Project

General

Profile

Bug #33

Cannot delete file as root

Added by Daniel Curtis over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
01/16/2013
Due date:
% Done:

100%

Estimated time:
Spent time:

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.

#1

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.

#2

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

Also available in: Atom PDF