Re: e2fsck not fixing root partition

Theodore Ts'o (tytso@mit.edu)
Fri, 5 Apr 1996 14:17:25 -0500


From: "William M. Perkins" <bill@grnwood.grnwood.richmond.us.net>
Date: Thu, 4 Apr 1996 23:59:37 -0500 (EST)

I am having a problem with e2fsck not fixing a problem I have with
my root partition /dev/sda2 (ncr53c810). My system crashed while
I was trying to start DOOM up. and upon rebooting I was instructed
to run fsck manually. But, no matter how many times I run e2fsck
on sda2, I get the following:

> e2fsck 1.01, 30-Oct-95 for EXT2 FS 0.5a, 95/03/19
> Pass 1: Checking inodes, blocks, and sizes
> Pass 2: Checking directory structure
> Directory inode 50891, block 0, offset 0: directory corrupted
> Salvage? yes
....

If this sort of problem is not fixable by 1.01, try using 1.02. That
has some fixes which help improve the ability of e2fsck to deal with
these situations. 1.02 is still not perfect in this regard though; I
know this, I just haven't had time to fix it.

If you can't fix it by going to 1.02, run "debugfs /dev/sda2", and then
type the command "clri 50891", followed by "quit". This forcibly zeros
out that inode, thus removing it from the e2fsck hierarchy. Do this
with /dev/sda2 *unmounted*, and then immediately run "e2fsck -f
/dev/sda2" to fix the gaping hole which you've just blasted through the
filesystem. :-)

When you do this to a directory, you're completely destroying it. (A
very brute-force way of dealing with the fact that it was corrupted.)
Hence, it will leave a lot of files in /lost+found which you'll have to
manually sort through. However, it will solve the filesystem corruption
problem.

- Ted