>I have a directory entry that I have been unable to delete (as root).
>it looks like this after ls -l
>?-rwxrwxrwx 255 255 255 filename
>I've tried to rename it with mv. I've tried to chmod to 0777 then rm
>I've tried rm -fd to get it deleted. It is clearly garbage that should
>be removed. Any Ideas?
>Matt Kontoff
1.
First of all run fsck on the partition where the "filename" is located.
(for this purpose either boot from the root/boot installation floppies or mount
the partition read-only).
If you are lucky, the "filename" will be either corrected or removed.
or, 2.
When 1. does not help (and probably will not due to the Murphy law),
try to unlink the file first.
Under other *NIX systems there exists a system utility "unlink" suitable
for this purpose. Under Linux exists only a system call unlink(2) -- which
manual page refers to unlink(8) -- so you can prepare a dedicated program:
main()
{
unlink( "filename" ) ;
}
Compile/link and use it. If the "filename" disappears from the directory
listing, use the fsck again.
or, 3.
When 2. does not help, and the "filename" is on the ext2fs type of the
filesystem, use the debugfs(8).
The debugfs has options like "kill_file" or "clri" which should do the jobs.
Then run the fsck to ensure that your filesystem is clean (!).
Zenon