Critical File System Failure e2fsck -b Not Working

Asked by Paladine

I have a corrupted superblock on a drive with a month's worth of University work that I haven't backed up (I normally backup monthly). If I don't recover this data it is very likely I will fail my degree (which I currently stand to pass with the highest grade possible) and not be able to do my PhD so I can't emphasize enough how important it is to recover this data.

First of all I booted to an edgy LiveCD and did the following on the drive when it was not mounted:

e2fsck -c /dev/sda1

I got the following output:

ubuntu@ubuntu:~$ sudo e2fsck -c /dev/sda1
e2fsck 1.39 (29-May-2006)
/dev/sda1: recovering journal
/dev/sda1: Attempt to read block from filesystem resulted in short read while reading block 23890

JBD: Failed to read block at offset 22322
JBD: IO error -5 recovering block 22322 in log
/dev/sda1: Attempt to read block from filesystem resulted in short read while reading block 23891

JBD: Failed to read block at offset 22323
JBD: IO error -5 recovering block 22323 in log
/dev/sda1: Attempt to read block from filesystem resulted in short read while reading block 23892

JBD: Failed to read block at offset 22324
JBD: IO error -5 recovering block 22324 in log
e2fsck: Bad magic number in super-block while trying to re-open /dev/sda1
e2fsck: io manager magic bad!

So I did the following to find the backup blocks for the superblock so I could attempt to rebuild it:

ubuntu@ubuntu:~$ sudo mke2fs -n -S /dev/sda1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
29884416 inodes, 59759784 blocks
2987989 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=62914560
1824 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872

I then proceeded to run e2fsck -b with the following results:

ubuntu@ubuntu:~$ sudo e2fsck -b 32768 /dev/sda1
e2fsck 1.39 (29-May-2006)
e2fsck: Bad magic number in super-block while trying to open /dev/sda1

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

As you can see it failed, so I tried the next backup block as follows:

ubuntu@ubuntu:~$ sudo e2fsck -b 98304 /dev/sda1
e2fsck 1.39 (29-May-2006)
e2fsck: Bad magic number in super-block while trying to open /dev/sda1

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

So I am starting to panic. Do I need to pass anything to e2fsck to tell it I am checking an ext3 device? According to the man pages e2fsck is supposed to work fine with ext3 file systems, but I don't understand why it keeps reporting incorrect ext2 filesystem??

I really need to recover this data, please help if you can. Incidentally, my email server runs from the same system, so I won't be able to read any email responses to this post.

Thanks

Paladine

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Paladine
Solved:
Last query:
Last reply:
Revision history for this message
Paladine (paladine) said :
#1

OK I have had some progress with e2fsck -b now. After another reboot and reload of LiveCD it managed to rebuild the superblock from the backup blocks. I don't understand why it kept failing the first couple of times but at least it has worked now. I am currently running badblocks on a spare 250GB drive in preparation for dumping an image of the master drive onto it to work on. I will update with more info once dd has finished and I am able to run e2fsck in read/write mode.

Paladine

Revision history for this message
Best Paladine (paladine) said :
#2

OK once I fixed the superblock problem, I put in my spare drive, imaged the master over, fixed the superblock on the new image and e2fsck ran without a hitch. System is now fully recovered.

Paladine