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