home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / linux / 8614 < prev    next >
Encoding:
Text File  |  1992-08-19  |  1.6 KB  |  44 lines

  1. Path: sparky!uunet!van-bc!rsoft!agate!ames!sun-barr!rutgers!igor.rutgers.edu!athos.rutgers.edu!hedrick
  2. From: hedrick@athos.rutgers.edu (Charles Hedrick)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: HELP! File system problem
  5. Message-ID: <Aug.19.03.06.08.1992.18829@athos.rutgers.edu>
  6. Date: 19 Aug 92 07:06:09 GMT
  7. References: <1992Aug19.050740.16584@cc.umontreal.ca>
  8. Organization: Rutgers Univ., New Brunswick, N.J.
  9. Lines: 33
  10.  
  11. duperval@ERE.UMontreal.CA (Duperval Laurent) writes:
  12.  
  13. >longer a valid directiry because . isn't first and .. isn't second.  That's
  14. >all fine and dandy but now, I can't remove it from my drive.  rmdir says that
  15. >the directory is not empty and rm says -rf says that device 0304 (or 0403,
  16. >whichever it is) contains an invalid directory and won't remove it.
  17.  
  18. >What do I do now?
  19.  
  20. You'd think fsck would handle this, but for some reason Linus hasn't
  21. felt safe in doing so.  What I've done in the past is to build a
  22. kernel that lets you unlink directories.  Running that kernel I then
  23. remove the bad directory, and then run fsck to recover the space and
  24. inodes.  Look for the routine minix_unlink in
  25. /usr/src/linux/fs/minix/namei.c.  Remove the code
  26.  
  27.     if (S_ISDIR(inode->i_mode)) 
  28.     goto end_unlink.
  29.  
  30. Once you're running that kernel, make yourself a utility "unlink":
  31.  
  32.   main (argc, argv)
  33.     int argc;
  34.     char **argv;
  35.  { if (argc > 0)
  36.     unlink(argv[1])
  37.  };
  38.  
  39. Use that to remove the bad directory.  Now run fsck.  (By the way,
  40. although I've done this a couple of times in the past, I haven't kept
  41. copies of my old changes, so I'm giving you this without having tested
  42. it.  That is, I know the method works, but there could be a typo in
  43. what I'm giving you.)
  44.