home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.hp
- Path: sparky!uunet!haven.umd.edu!purdue!yuma!csn!iem!larry
- From: larry@iem.com (Larry Fenske)
- Subject: Re: A directory that CANNOT be removed.
- Message-ID: <C184J3.EDv@iem.com>
- Date: Thu, 21 Jan 1993 21:47:25 GMT
- References: <8476@tivoli.UUCP>
- Organization: IEM, Inc.
- X-Newsreader: Tin 1.1 PL4
- Lines: 35
-
- stuart@TIVOLI.COM (Stuart Jarriel) writes:
- : Has anyone else been able (HPUX 8.07) to create a directory that
- : cannot be removed? ls with all of it's options fails to show any
- : files in it, a program using scandir() thinks it's empty, yet
- : rm -f or rmdir tells me that it cannot be deleted, it's not empty.
- :
- : We are creating the directory programattically (havent isolated it
- : yet), and can find NO WAY to delete it.
- :
- : stuart
-
- I have seen this before. It happens when a directory has an extra hard
- link. This isn't supposed to happen. If you do "ll -d" on that
- directory, does it show 3 links? If so, then somewhere on the system,
- there is (if fsck passes) another directory name that is the same
- directory. Do "ll -ia" on the directory. This will tell you the inode
- numbers of the directory and what it thinks is its parent. Then, you
- can do something like "find / -inum [inodenum] -print" (where [inodenum]
- is the inode number of "." from above) to discover where the two links
- are. Now, do "ll -id" on both parent directories to see which one does
- NOT match the inode number of ".." in the bad directory. Do an
- "unlink" on the bad directory where the inode number of ".." doesn't
- match the inode number of its parent. Then you should be able to
- "rmdir" the other one.
-
- The only times I've seen this happen is from a dumb/smart "rm"
- re-implementation that moves the "rm"'d file to a save directory. It is
- dumb in the sense that it will link a directory to the save directory,
- then tries to unlink it from the original place.
-
-
- ----
- Larry Fenske
- larry@iem.com
- IEM, Inc.
-