Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!pds3!bob From: bob@pds3 (Robert A. Earl) Newsgroups: comp.unix.wizards Subject: Re: Undeletable files. Message-ID: <1990Feb24.183157.15439@pds3> Date: 24 Feb 90 18:31:57 GMT References: <22347@pasteur.Berkeley.EDU> Reply-To: bob@pds3.UUCP (Robert A. Earl) Distribution: usa Organization: Project Design Systems, Inc. Lines: 41 In article <22347@pasteur.Berkeley.EDU> c91a1-rd@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