1753925 Members
8495 Online
108810 Solutions
New Discussion юеВ

Cycles in lost+found

 
Eric Swalens
New Member

Cycles in lost+found

After fscking one of our Apollo workstation (running HPUX B.10.20 with HFS) I found a cycle in lost+found. It also contains two non-empty directories (according to rm -r) but when I execute "ls -ali" in these directories I don't see anything but . and ..

Is there a way to clean this?
6 REPLIES 6
LucianoCarvalho
Respected Contributor

Re: Cycles in lost+found

hi,

Run "rm -rf".

regards
Frank Slootweg
Honored Contributor

Re: Cycles in lost+found

I think that the "cycle" you mention is caused by the fact that the names are probably starting with a "#" character and "#" is the comment character, so anything you type after it (and the "#" itself) is ignored.

This problem can be worked-around by putting a backslash ("\") in fron of every "#", i.e. for example:

cd \#123456
ls
rm \#234567
....
cd ..
rmdir \#123456

Please let us know whether or not this was indeed your problem and whether or not it is now solved.
Eric Swalens
New Member

Re: Cycles in lost+found

I protected the # using double quotes, same result with \.

Here is the lost+found content (lost+found has inode number 3)

- lost+found contains 3 directories who's inode numbers are 116749, 223236 and 223238.

- when I "ls -ali \#116749" or 223236, I see . and .. but "rm -rf \#116749" fails with error "Directory not empy".

- 223238 contains three directories: the first one has inode 116749, the second one 223238 (the cycle) and the last one 223241.

- 223241 contains one directory: the one that has inode 116749.

I re-run fsck but it does not find any inconsistencies...
Frank Slootweg
Honored Contributor

Re: Cycles in lost+found

If the directories are really corrupt, you can often fix things with unlink(1M) ("man 1m unlink), clri(1M) (only for HFS filesystems) and a subsequent fsck(1M).

When using these tools, make sure that you undersand *exactly* what the problem and the fix is. If not, leave things as they are, especially since fsck does not complain at the moment and the directories probably only take very little space.
Eric Swalens
New Member

Re: Cycles in lost+found

I was not aware that unlink() was implemented in a tool. I'll backup the partition and give it a try.

Thanks for your help.
Decio Miname
Frequent Advisor

Re: Cycles in lost+found

Have you tried cd into it, then find . -exec rm \{}; ?