These old hard drives...
Superblock and codepage error when mounting.
You might find yourself in a situation, when you cannot mount a hard drive, seeing an error like the following:
mount: /mnt/test: wrong fs type, bad option, bad superblock on /dev/sda1, missing codepage or helper program, or other error.
A possible approach for ext4 filesystems would be the following:
- Let's assume the device partition is called
/dev/sda1. - In order to get any superblock backup block numbers, run:
$ sudo mke2fs -n /dev/mapper/sda1
- Then, run the following command using a
<block_number>of the superblock backup block numbers from the output above:
$ sudo e2fsck -b <block_number> /dev/mapper/sda1
I have done this a few times with old drives with corrupt superblocks, and it worked quite well.
Note:
- Take a look at
dmesg, sometimes it contains valuable information. -
For example:
- I tried to mount a sdcard with the following command:
bash $ sudo mount -o uid=$(id -u),gid=$(id -g),noatime /dev/sda1 /mnt/test/- and received the error above
dmesgrevealed:
EXT4-fs (sda1): Unrecognized mount option "uid=1000" or missing value- and I modified the command to:
bash $ sudo mount -o noatime /dev/sda1 /mnt/test/