Bug #33
Cannot delete file as root
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.
Updated by Daniel Curtis over 11 years ago
- 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.
Updated by Daniel Curtis over 11 years ago
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