Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Using the dd command, I was hoping that I would be able to copy over the first 446 bytes from Disk B (250GB) to Disk A (80GB), in order to make Disk A bootable just like Disk B. I issued the command:

dd if=/dev/sdb of=/dev/sda bs=446 count=1

But when I could not boot up from sda, I rebooted from sdb to see what was going on. To my horror, sda had a bad superblock.

Worse, I was unable to repair it via the backup superblocks. This is what I did. I first got the backup superblock addresses, like so:

[root@localhost liveuser]# mke2fs -n /dev/sda
mke2fs 1.41.14 (22-Dec-2010)
/dev/sda is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
4890624 inodes, 19537686 blocks
976884 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
597 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424

Then, I used e2fsck -b SUPERBLOCK /dev/sda, with each of the SUPERBLOCK values listed above, like so:

    [root@localhost liveuser]# e2fsck -b 32768 /dev/sda 
e2fsck 1.41.14 (22-Dec-2010)
e2fsck: Bad magic number in super-block while trying to open /dev/sda

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>

I tried every single value, but each gave the above message!

Is there anything that I could do NOW to salvage my precious disk? This is an 80G disk with 2 partitions. The /dev/sda1 partition is clean and is mountable; it is the /dev/sda2 partition that is failing to work with commands like mount, debugfs, dumpe2fs, etc.

Running mke2fs -n for the individual partitions gave me this (notice how the First Data Block and Maximum filesystem blocks both show 0 as their value):

[root@localhost liveuser]# mke2fs -n /dev/sda1
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
128016 inodes, 512000 blocks
25600 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67633152
63 block groups
8192 blocks per group, 8192 fragments per group
2032 inodes per group
Superblock backups stored on blocks: 
    8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409

[root@localhost liveuser]# mke2fs -n /dev/sda2
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
4857856 inodes, 19409408 blocks
970470 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
593 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424

I still don't know what was wrong in my dd command that corrupted my ext4 superblock. You cannot imagine how happy I will be if someone could help me recover my disk back... since, except fo this bad superblock, all the data is just sitting right there!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Per discussion on usenet the important partition turned out to be an LVM PV, and not a filesystem at all.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.