Undeletable files.

Robert A. Earl bob at pds3
Sun Feb 25 05:31:57 AEST 1990


In article <22347 at pasteur.Berkeley.EDU> c91a1-rd at amazon.Berkeley.EDU.UUCP (Raja (Reader)) writes:
>I tried to remove an old, unwanted directory in the root system.
>There werea couple of subdirectories in that directory, and no matter what 
>commands I used, I just could not remove it. rm -R, rmdir, etc.  I then ran 
>icheck and then fsck, and still no errors were reported.  Then, on 
>doing an ls -ilR, I noted that the directories were circularly linked!
>One of the subdirectories had the same inode number as it's parent.
>I then ran clri, and tried to first remove that inode number only, and
>then that inode nbr and the other sub-directory inode.  Both times I failed.

If you have root permissions on your system, you should be able to use the
'unlink' command to solve this one.  (Note:  I have just created and solved the
problem you described on my SCO XENIX 386 2.3.2 system, SVR2 + BSD stuff)

Here is what I would do:
(assume /tmp/junk is the dir to be deleted, /tmp/junk/oops is the recursion)
login as root.
cd /tmp/junk
ls -lia
(which produces:
total 8
 4302 drwxr-xr-x   3 bob      pds           48 Feb 24 13:29 .
   19 drwxrwxrwx   3 bin      bin         1616 Feb 24 13:29 ..
 4302 drwxr-xr-x   3 bob      pds           48 Feb 24 13:29 oops
)
unlink oops
ls -lia
(which now gives:
total 6
 4302 drwxr-xr-x   2 bob      pds           48 Feb 24 13:30 .
   19 drwxrwxrwx   3 bin      bin         1616 Feb 24 13:30 ..
)
cd
rmdir /tmp/junk


Hope this helps!
-- 
==============
Robert A. Earl
uunet!pds3!bob



More information about the Comp.unix.wizards mailing list