Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!munnari.oz.au!metro!natmlab.dap.csiro.au!dmssyd.syd.dms.CSIRO.AU!marka From: marka@dmssyd.syd.dms.CSIRO.AU (Mark Andrews) Newsgroups: comp.unix.wizards Subject: Re: How do I unlink directories created with ln -f? Message-ID: <7774@natmlab.dap.csiro.au> Date: 2 Jul 90 04:15:34 GMT References: <26899A74.24533@orion.oac.uci.edu> <1603@quando.quantum.de> <3575@auspex.auspex.com> Sender: news@natmlab.dap.csiro.au Organization: CSIRO Division of Mathematics and Statistics Lines: 30 In article <3575@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: |>Suppose it's a bug in unlink. |It is. SunOS, for some unknown reason, disallows (at the system call |level, not at the file system level!) *all* attempts to unlink |directories, even by the super-user. |>It seems really as if the only way would be a `clri' on the |>inode of "dir1" and "dir2", |They share the same inode; one "clri" is sufficient. |>followed by a `fsck', which will remove the directories. |...and shove everything that was in them into "lost+found", with cryptic |names. |Unless the directory in question was empty, I'd first make another |directory at the same level as the link you wanted to keep, move |everything (don't forget files, other than the obvious "." and "..", |with names beginning with "."!) into the new directory, then do the |unmount/clri/fsck. (Don't forget the unmount.) Fsck can actually pick this condition up (well it did it once). If you move all links to the directory to a new directory, umount and run fsck it should pick up the problem. "IS AN EXTRANEOUS HARD LINK TO DIRECTORY" from strings of fsck. Mark.