Repair a broken Ext4 Superblock in Ubuntu

Today I met an Input/output error when accessing /boot. It’s because the filesystem is corrupted.

We need find out the partition which we will deal with (using df -h or sudo fdisk -l. My /boot is /dev/sda1. Then following the steps:

Check the filesystem (you may skip this step):

$ sudo fsck.ext4 -v /dev/sda1

Find where the superblock backups are kept:

$ sudo mke2fs -n /dev/sda1
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912

Restore the superblock from the backup using the first backup:

$ sudo e2fsck -b 32768 /dev/sda1

Then things should be OK. If the corrupted directory is still inaccessible, then try the second, the third, …, superblock backup.

Leave a Reply

Time limit is exhausted. Please reload CAPTCHA.