lkml.org 
[lkml]   [1997]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [offtopic] undeletable file on corrupted ext2 partion
From
Date
Hi,

Stephen Beynon <stephen@askone.demon.co.uk> writes:

> I have a ext2 partion that corrupted due to a hardware fault (since
> rectified :) - but I am left with a file that has been corrupted so that
> it looks like a symbolic link.
>
> rm returns
> rm: /bin/red: Operation not permitted
>
> when I try to rm the file as root - should this be possible ?

Yes. This is a problem that often hits people who get disk corruption
--- the difficulty is that ext2fs provides a mechanism to prevent
*any* modifications to the file, even by root. If that property is
set on the file accidentally by disk corruption, then e2fsck won't
reset the permission because it's a perfectly valid state for the file
to be in.

Do a "man chattr" and "man lsattr" to find out about ext2fs file
attributes. From the chattr(1) man page:

A file with the `i' attribute cannot be modified: it can-
not be deleted or renamed, no link can be created to this
file and no data can be written to the file. Only the
superuser can set or clear this attribute.

Try doing a "chattr -i /bin/red" and see if you can delete the file
now.

Cheers,
Stephen.


\
 
 \ /
  Last update: 2005-03-22 13:39    [W:2.077 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site