[lug] Filesystem attributes (lsattr/chattr): how to deal with files with "I" attrbitute?

Davide Del Vento davide.del.vento at gmail.com
Fri Jan 23 14:55:48 MST 2009


Well, I do not know why it does not work, this is what happens (after
I was given ownership of the evil file/directory, which I moved in
/ptmp/ddvento/tmp/ and renamed "Nameless_file"). Please note that this
is GPFS under AIX, not ext? under Linux.

ddvento at be1105en /ptmp/ddvento/tmp $ ls -il
total 128
10857295 drwxr-xr-x 2 ddvento ncar 131072 2009-01-23 14:49 Nameless_file
ddvento at be1105en /ptmp/ddvento/tmp $ ls -il Nameless_file/
total 128
10857295 drwxr-xr-x 2 ddvento ncar 131072 2009-01-23 14:49
ddvento at be1105en /ptmp/ddvento/tmp $ ls -il Nameless_file/*
total 128
10857295 drwxr-xr-x 2 ddvento ncar 131072 2009-01-23 14:49
ddvento at be1105en /ptmp/ddvento/tmp $ ls -il Nameless_file/*/*
total 128
10857295 drwxr-xr-x 2 ddvento ncar 131072 2009-01-23 14:49
ddvento at be1105en /ptmp/ddvento/tmp $ find . -inum 10857295 -exec rm -i {} \;
rm: cannot remove directory ./Nameless_file
find: bad status-- ./Nameless_file/
ddvento at be1105en /ptmp/ddvento/tmp $ cd Nameless_file/
ddvento at be1105en /ptmp/ddvento/tmp/Nameless_file $ find . -inum
10857295 -exec rm -i {} \;
rm: cannot remove '.' or '..'
find: bad status-- ./


On Fri, Jan 23, 2009 at 01:47, Nate Duehr <nate at natetech.com> wrote:
> Delete by inode number.  Piece of cake.  What made it so difficult?
>
> --
> Nate Duehr
> Sent from my iPhone
>
> On Jan 22, 2009, at 12:31, Davide Del Vento <davide.del.vento at gmail.com>
> wrote:
>
>> Speaking of weird unremovable files, on our system (AIX, but I think
>> the same might happen in linux) an user created a (nameless)
>> directory, containing a (nameless) hard link to itself. Besides the
>> difficulties to specify the nameless entry, we cannot remove it,
>> because it's not empty, neither with "rm -r" because it's an infinite
>> loop.
>> Bye
>> ;Dav
>>
>> On Thu, Jan 22, 2009 at 11:26, Michael J. Hammel
>> <mjhammel at graphics-muse.org> wrote:
>>>
>>> A guy at work has a file on a linux box that has an attribute (from
>>> lsattr) of "I" (uppercase i).  Lowercase i is immutable.  Uppercase I
>>> means, quoting the chattr man page:
>>>
>>> The  'I'  attribute  is used by the htree code to indicate that a
>>> directory is being indexed using hashed trees.  It may not be set or
>>> reset using chattr(1), although it can be displayed by lsattr(1).
>>>
>>> What the heck does that mean?  From his perspective it means the file
>>> cannot be removed, not even by root.  So how do you get rid of it?  The
>>> directory is empty.  Will a reboot clear that attribute so the directory
>>> can be removed?
>>>
>>> --
>>> Michael J. Hammel                                    Principal Software
>>> Engineer
>>> mjhammel at graphics-muse.org
>>> http://graphics-muse.org
>>>
>>> ------------------------------------------------------------------------------
>>> When trouble arises and things look bad, there is always one individual
>>> who perceives a solution and is willing to take command. Very often, that
>>> individual is crazy. -- Unknown.
>>>
>>> _______________________________________________
>>> Web Page:  http://lug.boulder.co.us
>>> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
>>> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug
>>>
>> _______________________________________________
>> Web Page:  http://lug.boulder.co.us
>> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
>> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug
>
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug
>



More information about the LUG mailing list