HOWTO: Repair a broken Ext4 Superblock in Ubuntu
31mar10This has happened to me a few times, and it’s not a nice problem to find yourself in. You computer won’t boot, all your filesystem checks tell you you’ve a bad superblock, but you cant seem to find how to fix it. Well, here goes
This guide is for ext4 , though I’ll explain how other filesystems can be cured along the way. The easiest way to carry all this out, seeing as your computer probably won’t boot at this stage, is to download and burn a copy of Parted Magic. Boot from that, and you’ll access to a number of useful tools.
First, figure out what partition we’re dealing with.
1sudo
fdisk
-l
The above will list all the partitions on all the drives in your computer. To recover a lost partition, your going to need Testdisk. Testdisk is included in Parted Magic, and there’s a great guide on their site. For this though, we just need the partition number, such as /dev/sda3 or /dev/hdb1.
Now, make sure your superblock is the problem, by starting a filesystem check, replacing xxx with your partition name. Here, you can change ext4 to ext3, or ext2 to suit the filesystem.
1sudo
fsck
.ext4 -
v
/dev/xxx
If your superblock is corrupt, the output will look like this
Source: HOWTO: Repair a broken Ext4 Superblock in Ubuntu | Linux Expresso