Fixing a corrupt EXT4 superblock on Linux
Your EXT4 filesystem won't mount because the superblock got corrupted. Here's how to fix it with backup superblocks — from quick to deep recovery.
You try to mount an EXT4 drive and get an error like EXT4-fs error (device sda1): ext4_find_entry: bad entry or wrong fs type, bad superblock. The filesystem won't mount. What's actually happening here is the primary superblock — the filesystem's master table of contents — got corrupted. Maybe a power loss, a bad cable, or you yanked the drive without unmounting.
The superblock sits at the start of the partition. If its bytes get scrambled, the kernel can't read where files live. But EXT4 stores backup superblocks at fixed offsets across the partition. You just need to tell the system to use one of those instead.
Here's the fix, from dead simple to full recovery. Try each step until your drive mounts. No need to do all of them.
Step 1 — 30 seconds: Check the backup superblock list
First, see what backup superblock positions exist on your partition. Replace /dev/sda1 with your device name. You can find it with lsblk or fdisk -l.
sudo dumpe2fs /dev/sda1 | grep -i "backup superblock"
If the primary superblock is readable enough to run this, you'll see a list of block numbers like 32768, 98304, 163840, 229376. Write down the first one — usually 32768 for 4k block sizes.
If dumpe2fs fails with Can't read superblock, skip to Step 2 or 3.
Step 2 — 5 minutes: Mount using a backup superblock
Mount the filesystem with -o sb=BLOCK_NUMBER. Using 32768 as example:
sudo mount -t ext4 -o sb=32768 /dev/sda1 /mnt
If it mounts, you're in read-only mode. The kernel now uses that backup superblock. Don't write anything yet. Run a filesystem check to copy the backup superblock back to the primary location.
sudo fsck.ext4 -f /dev/sda1
Fsck will detect the mismatch and ask to restore the primary superblock. Say yes. After that, unmount and try a normal mount:
sudo umount /mnt
sudo mount /dev/sda1 /mnt
If the normal mount works, you're done. If not, move to Step 3.
Why this works: Fsck sees the primary superblock is corrupt but the backup is good. It copies the backup over the primary. The kernel then loads the fixed primary superblock on next mount.
Step 3 — 15+ minutes: Force a backup superblock write with e2fsck
If Step 2 didn't work or dumpe2fs couldn't read the drive at all, use mke2fs -n to guess backup superblock positions based on block size. First, confirm your block size — default is 4096 for most EXT4 drives.
sudo mke2fs -n /dev/sda1 2>&1 | grep -i superblock
You'll see output like Superblock backups stored on blocks: 32768, 98304, 163840, 229376. Pick the first number. Then run e2fsck with the -b flag to use that backup superblock:
sudo e2fsck -b 32768 -y /dev/sda1
The -y flag auto-answers yes to all repair prompts. Do not use -y if you're unsure — it will write changes. If you want to review each repair, omit -y and answer manually.
E2fsck will rebuild the primary superblock from the backup. After it finishes, try mounting normally:
sudo mount /dev/sda1 /mnt
If it mounts, run a full fsck to catch any other corruption:
sudo umount /mnt
sudo fsck.ext4 -f /dev/sda1
What if none of these work?
If all backup superblocks are also corrupt (rare but happens with severe physical damage), you have options:
- Testdisk — can rebuild a lost superblock by scanning the whole partition and guessing parameters. Install with
sudo apt install testdiskorsudo dnf install testdisk. Runsudo testdisk /dev/sda1and choose the Analyse option. It's interactive and guides you. - Data recovery first — if the drive is physically failing (clicking sounds, reallocated sectors), don't write to it at all. Use
ddrescueto clone the drive to a healthy one, then run recovery on the clone. Install withsudo apt install gddrescue. Syntax:sudo ddrescue /dev/sda1 /path/to/clone.img /path/to/mapfile.log. - Last resort — create a new filesystem with
mkfs.ext4and use photorec or extundelete to recover files. Be awaremkfs.ext4overwrites superblocks, so run a recovery tool before formatting.
Real-world triggers
This happens most often when you:
- Force-unplug a USB drive that's still mounted.
- Lose power during a large file write (system crash, UPS failure).
- Use an unstable SATA cable — the superblock gets silently corrupted during write.
I've fixed dozens of these on external drives and internal SSD partitions. The 30-second mount trick works about 70% of the time. E2fsck with -b catches most of the rest.
Pro tip: If you manage servers, run
tune2fs -l /dev/sdXafter a fresh mkfs and note the backup superblock positions. Store them with the server documentation. Saves you from guessing when the drive goes bad at 3 AM.
Was this solution helpful?