home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / hp / 15187 < prev    next >
Encoding:
Text File  |  1993-01-21  |  1.9 KB  |  47 lines

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