How to kill a dir?

rnichols at interaccess.com rnichols at interaccess.com
Mon Jan 5 22:23:51 UTC 2004


On Mon, 5 Jan 2004, "jdow" <jdow at earthlink.net> wrote:
>Subject: Re: How to kill a dir?
>
>From: "Felipe Alfaro Solana" <felipe_alfaro at linuxmail.org>
>
>> On Mon, 2004-01-05 at 19:09, WipeOut wrote:
>> > I have a dir that I can't seem to delete and is giving strange errors..
>> >
>> > [root at dev02 i386]# ls
>> > ls: ??*?: Invalid or incomplete multibyte or wide character
>> > test
>> > [root at dev02 i386]# rm -rf test
>> > rm: cannot remove directory `test': Directory not empty
>> > [root at dev02 i386]# cd test
>> > [root at dev02 test]# ls
>> > ls: : No such file or directory
>> >
>> > Anyone got any super commands for getting rid of a directory that just
>> > will not go?
>>
>> If everything else fails, I recommend using "fsck" to checl the
>> filesystem integrity.
>
>That is a good suggestion.
>
>I've seen the two effects he mentions before. The "test" effect was
>created by an application that figured out how to force a hard link
>of a subdirectory back to its parent a couple parents up the chain.
>It was ugly. However, I do not believe this is necessarily his effect.

Improperly linked directories can indeed have that effect.  If fsck
can't fix the problem, the only reasonable solution is to run 'debugfs'
on the unmounted filesystem and use the "clri" command to zero out the
offending directory's inode.  Then an fsck should clean things up.
Any remaining files and subdirectories that had been in `test' will
end up in lost+found, and a simple 'rm' should work from there.

-- 
Bob Nichols         rnichols at interaccess.com





More information about the fedora-list mailing list