Subject: Re: FSCK fails after a crash
To: Vincent <10.50@free.fr>
From: Eric Haszlakiewicz <erh@jodi.nimenees.com>
List: current-users
Date: 09/15/2005 15:18:49
On Thu, Sep 15, 2005 at 07:55:15PM +0200, Vincent wrote:
> Hello,
> I surely missed something, but I have no clue why.
> 
> I had to switch off (in a quite unexpected and rude way) my laptop (i386 
> - 3.99.8). When I switched it on again, the automatic fsck checks failed.
> 
> fsck -p fails because it complains about no lost+found directory, and 
> fsck_ffs reports an inode out of range and quits at pass2 (checking 
> pathnames). When I did a fsck on the other partitions, it seemed that 
> every directory had to be reconnected.
> 
> Anyhow, I couldn't get any clean file system and I had to mount them 
> stale, which is how I send this mail. The system does not seem to run 
> into inconsistencies, I can execute X and Mozilla, but it is quite 
> unsettling to know that fsck does not work. I suspect I missed something 
> like a file system update, but when or where?

A) If you have no important data on there, wipe it clean and start over.
B) More likely, you have stuff you want to keep:
	1) STOP using the machine NOW and make an immediate backup.  Your
	   filesystem is corrupted and there's a good chance it'll crash again.
		a) the easiest way is probably with g4u, but you could also try
		   booting in single user mode, leaving the fs mounted r/o, and
		   copying the data you need (or all of it) to another machine.

	2a) Now wipe it clean and restore what you need.
	 or
	2b) the inode out of range sounds like a corrupted directory entry.
	   The output probably doesn't mention anything about what directory
	   it's working on at the time, so finding that entry might be a bit
	   difficult.  Your best bet might be to build fsck_ffs with -g, run
	   it in gdb with a breakpoint on errx(), then poke around and see if
	   you can figure out what directory it's failing on.

	   Once you figure out the inode of the directory it's failing on
	    you can manually fix it with fsdb.

eric