Removing a bad directory - (nf)

jab at uokvax.UUCP jab at uokvax.UUCP
Mon May 21 11:57:00 AEST 1984


#R:sri-arpa:-63500:uokvax:6200027:37777777600:1329
uokvax!jab    May 20 20:57:00 1984

/***** uokvax:net.unix-wizar / sri-arpa!ARPA /  7:13 pm  May 15, 1984 */
The standard way to remove a bad directory is:

1. Take the system down to single-user mode (killing all user processes if
   System III/V).
2. Attempt to recover files from the bad directory by LSing it and moving the
   files elsewhere. If corruption is severe this may not be possible. Also,
   there may not be anything to move.
3. Determine the inode of the directory. If the directory was restored by
   fsck then the name (less any "#") is the inode number. A "ls -li" on
   the parent directory will list the inode number at the start of the
   line.
4. Determine the device name of the file system.
5. As root give the command "clri <FSdevice> <inode number>". This zaps the
   inode into oblivion.
6. Run "sync".
7. Run "fsck" on the file system.

This works on Version 7, System III/V, and BSD*.

Bob Toxen
Silicon Graphics
ucbvax!olympus!bob
/* ---------- */
Something that may be obvious to some but not to others is that between
steps two and three, you MUST unmount the filesystem you're planning to
modify if there is any chance at all of the inode in question being incore.

The reason for this is that if it's in the inode table that the kernel keeps,
the "sync" in step 6 could very well undo what step 5 helps.

	Jeff Bowles
	Lisle, IL



More information about the Comp.unix.wizards mailing list