Skip to content

hard disks

Gather harddisk related stuff here, but first here is a working way to fix can't read superblock failures.

troubleshooting

Can't read superblock

This page gives working fixes for this error. It usually occurs when trying to mount the disk.

https://www.linuxbabe.com/desktop-linux/fix-cant-read-superblock-error

I am enthusiastic about that page because i managed to get it working for both the btrfs as well as the ext4 fix.

Here is a short description for as this page may be removed in the future.

ext4

sudo parted -l  # find out the partition name, here /dev/sdb1
sudo mke2fs -n /dev/sbd1

That second command might ask for permission multiple times, but the -n makes sure there is not ext4 filesystem written just the info about where the superblock was backed up to. So you get something like :

mke2fs 1.45.5 (07-Jan-2020)
/dev/sdb1 contains a ext4 file system labelled 'Stretch'
    last mounted on /media/linuxbabe/b43e4eea-9796-4ac6-9c48-2bcaa46353732 on Thu Jan 28 02:43:43 2021
Proceed anyway? (y,N) y
Creating filesystem with 7864320 4k blocks and 1966080 inodes
Filesystem UUID: fcae3dc8-ee11-412c-97f0-27106601314e
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000

So the superblock was saved at 32768, 98304, etc, so just pick the first to restore it :

sudo e2fsck -b 32768 /dev/sbd1

Now this could really be a long sit because it might ask you a 100 times to agree with a fix. I ended up just holding down the 'y' key but if so you can better do that directly with -y

sudo e2fsck -y -b 32768 /dev/sbd1

Note that a lot of fix attempts are made, but you have to risk it because it doe not mount otherwise.

After this i could mount again !!

btrfs

Analogous to ext4 :

sudo parted -l
sudo apt install btrfs-progs
sudo btrfs rescue super-recover -v /dev/sbd1
sudo dmesg

If it complains about this

BTRFS: error (device sdb1) in btrfs_run_delayed_refs:2227: errno=-5 IO failure
BTRFS: error (device sdb1) in btrfs_replay_log:2287: errno=-5 IO failure (Failed to recover log tree)

Then issue this command

sudo btrfs rescue zero-log /dev/sdb1

Again... this fixed my problem and it mounted !!