# Help!! Corrupt ext3 sperblock on root

## mattbates

Hi, 

I am desperately in need of some help to recover my root partition. Although I have not lost my home partition (luckily), I am currently without my web development files as they were sitting in the /var/www! 

I am running Gentoo 1.4 with the 2.6.3 kernel. I have been successfully running it for the last fortnight, with little to no problem, however I switched on this morning and I was presented with an ugly error message: 

---- 

ext3-fs: couldn't mount /dev/hda5 - unsupported optional features (2000200) 

---- 

I initially tried booting with a previous kernel (2.4.21) but the same error occurred again. Therefore I grabbed the Gentoo LiveCD and tried mounting it - again, the same problem. 

After carrying out some Google research, I came to the conclusion that the primary superblock may have corrupted. As a result, I have since found the locations of the backup superblocks and tried these with e2fsck (-b x) - this yields a new error, but one I cannot solve: 

---- 

ext3 recovery flag clear, but journal has data 

Recovery flag not set in backup superblock, so running journal anyway. 

fsck.ext3: unable to set superblock flags on /dev/hda5. 

---- 

To be honest, I have tried absolutely everything. Does anybody have any suggestions? 

I would appreciate any help anybody can offer.

----------

## MasterX

Boot with Live CD,

and then run fcsk.ext? -c /dev/hda5

where ? is 2 or 3 depending on whether you have ext2 or ext3.

The above command will check the partition for bad blocks and will try to repair the damage.

WARNING: Can not guarantee for the outcome. I run it on my system and it fixed the damage without destroying the data.

When it finds something corrupted it will ask you whether you want it to repair it. Be carefull, Especially if /dev/hda5 is your home directory.

----------

## mattbates

I've just tried it but I receive the following:

----

fsck.ext3: Filesystem revision too high while trying to open /dev/hda5

The filesystem is apparently too high for this version of e2fsck.

(Or the filesystem superblock is corrupt)

The superblock could not be read or does not describe a correct ext2 filesystem... 

----

Should I resign myself to the fact that this data may be unrecoverable?  I just cannot understand how it has occurred, particularly as I had cleanly shutdown the night before.

I would really appreciate any ideas or feedback.

Thanks in advance,

MB

----

----------

## MasterX

I found this

 *Quote:*   

> 
> 
> I'd start by looking at the partition table. 
> 
> Use fdisk -l [the letter ell, not the number one -- Heather] to list all the partitions that your Linux system can see. Make sure that the /dev/hda2 really is supposed to be a Linux native partition (that you haven't swap devices and the partition has moved to /dev/hdb2 --- and that it isn't a swap partition or whatever). 
> ...

 

and this

 *Quote:*   

> 
> 
> A filesystem can be corrupted so it can't be mounted, the result of damage to 
> 
> the filesystem's superblock. Any attempt to mount it will fail.
> ...

 

Hope these help you

----------

## mattbates

Thanks for your advice.

I used the advice from both snippets but unfortunately it does not yield anything new... the same errors are being returned and I am still without my root partition  :Sad: .

I did hope that I would be able to use one of the 'backup' superblocks but I have attempted and failed in using each one.  It reports:

----

ext3 recovery flag clear, but journal has data.

Recovery flag not set in backup superblock, so running journal anyway.

fsck.ext3: unable to set superblock flags on /dev/hda5.

----

I think I may need to download the new 2004 LiveCD and start again.. however any last-ditch thoughts from anyone would be *really* appreciated.

----------

## MasterX

I am assuming that you dual boot.

In this case, I will recommend you to go to Windows, install a program like Ext2FS Anywhere 3.0 (I found this on Google, I am sure there are many like this one) that can read ext(2,3) filesystems and hopefully you will be able to copy all your data from /dev/hda5 to a windows' partition. Then, use fdisk to delete the partition and recreate it and finally, copy everything back to it.

It should work, if it does not then I am afraid that you have to install Gentoo from scratch. That does not necessarily mean that you will loose all the data.

----------

## MasterX

Just a second!!!

/dev/hda5 is not the / filesystem but it is /var filesystem, right?

If I am right, then use LiveCd to boot, mount the / filesystem, edit /etc/fstab and remove the entry for /var.

Then you should boot into Linux.

Now, if you want to fix the filesystem you could try the following:

 *Quote:*   

> 
> 
> I just got my blog back after wrestling with a hosed ext3 partition, and winning. Long story short, I put some bad ram into Adrock which quickly caused a kernel panic. Upon removing the bad RAM and rebooting /var was toast, the journal was toast and it looked like the superblocks were a bit charred as well. I had to dig for a while to get this problem solved... so here's the info on the failure and the fix.
> 
>  /var was unmountable.
> ...

 

Even if the above does not help to recover the data, you still do not have to reinstall Gentoo, just format /dev/hda5 or try to do what I wrote in my previous post.

Good luck

----------

## mattbates

I've followed the latter advice you gave and it has worked a treat!  :Smile:   I can now access the drive and content so I have managed to backup my work to another partition.  On running fsck on the partition, it did find a huge number of problems - I think a reinstall may be in order however most important of all I have my data back  :Very Happy: .

Thank you so much for your help.  It is great being able to refer to the Gentoo community for help and support.

----------

## MasterX

 *mattbates wrote:*   

> 
> 
> Thank you so much for your help.  It is great being able to refer to the Gentoo community for help and support.

 

You are welcome. 

I am glad everything worked out for you.

----------

