Bug #33
closed
Cannot delete file as root
Added by Daniel Curtis almost 13 years ago.
Updated over 12 years ago.
Description
A problem exists in Linux after a file recovery (e2fsck) leaving some of the recovered files with corrupt file attributes (lsattr). This causes any file modification or deletion to fail, even as root.
- Status changed from New to Closed
- % Done changed from 0 to 100
In order to remove the two file attributes needed for file deletion by root use the chattr command with the -a and the -i flags on the file to change the *A*ppend and *I*mmutable file attributes.
chattr -i -a /path/to/some/file
When the command finishes delete or modify the files normally.
Some attributes include:
- A - don't update atime
- S - synchronous updates
- D - synchronous directory updates
- a - append only
- c - compressed
- d - no dump
- i - immutable
- j - data journaling
- s - secure deletion
- T - top of directory hierarchy
- t - no tail-merging
- u - undeletable
- I - use hashed b-trees for directory lookups
Also available in: Atom
PDF