Recover original superblock on corrupted filesystem?

bloch at verdurin.com bloch at verdurin.com
Tue Oct 25 22:05:21 UTC 2005


On Tue, 25 Oct 2005, Stephen C. Tweedie wrote:

> Hi,
> 
> On Fri, 2005-10-21 at 15:51 +0100, bloch at verdurin.com wrote:
> 
> > It appears the original superblock is corrupted too, as it has an inode
> > count of 0.  When I start fsck with -b 32760, it uses the alternate
> > superblock and proceeds.  However, it restarts from the beginning a
> > couple of times and after the second restart it doesn't use the
> > alternate superblock, stopping instead as it can't find the original
> > one.
> 
> Do you have a log of the fsck output, and which e2fsprogs version is
> this?  Sounds like it may be an e2fsck bug if we don't honour the backup
> superblock flag on subsequent passes.
> 

I do have a log, yes.  It's rather large...

It's version 1.38

> > Is there a way around this, such as using one of the alternate
> > superblocks to replace the broken one
> 
> Yes, "dd" of the appropriate block should work... but do this with
> extreme care, as getting it slightly wrong will cause major havoc.
> 
> "debugfs" may be a better bet.  
> 
> 	# debugfs -w -b$BLOCKSIZE -s$SUPERBLOCK /dev/$DEV
> 
> will tell debugfs to read the specified superblock.  If you dirty the
> superblock (eg. with the "dirty" command) then quit, it will write back
> the backup superblock to the home location too.
> 

In the end I managed to get the filesystem to mount (after a six-hour
fsck), backed up the data and have since wiped that partition.

Thanks for the tip, though.  I'll see if I can compress and/or edit the
log to a sensible size.

Adam




More information about the Ext3-users mailing list