How to access a disk with bad superblock Linux Ubuntu Debian Redhat CentOS ext3 ext4

Have you ever tried mounting a partition that you exists but you get this error?

mount: /mnt: can't read superblock on /dev/sda1.

The superblock in this example was bad because the physical disk had corruption and bad blocks/sectors.  However, the data was generally accessible and you can always try this trick below (with caution and no warranty).

This is specifically for filesystems that place superblocks in multiple locations, which makes the drive accessible.

Run the mkfs for your filesystem, in this case it was ext4 and pass the "-n" option. 

mkfs.ext3 -n /dev/sda1

*Do not forget the -n above or you will destroy the partition.

Then you'll see the prompt below, once again make sure you used -n

       -n     Causes  mke2fs  to not actually create a filesystem, but display
              what it would do if it were to create a filesystem.  This can be
              used  to  determine the location of the backup superblocks for a
              particular filesystem, so long as  the  mke2fs  parameters  that
              were  passed when the filesystem was originally created are used
              again.  (With the -n option added, of course!)
 

Hit y to proceed as long as you're sure that you used the -n flag.


mke2fs 1.44.1 (24-Mar-2018)
/dev/sda1 contains a ext4 file system
    last mounted on / on Wed Jun  8 11:40:24 2022
Proceed anyway? (y,N) y

Then you'll hopefully see a list of superblocks as below:


ext2fs_check_if_mount: Can't check if filesystem is mounted due to missing mtab file while determining whether /dev/sda1 is mounted.
Creating filesystem with 120038912 4k blocks and 30015488 inodes
Filesystem UUID: 91fcf16a-7f97-47cf-82b3-654d7dca6d70
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
    102400000



You can try any of those locations, if the disk is badly damaged you may need to try a few different superblocks.

Here is how you would mount with one of the superblocks above.

mount -o sb=4096000 /dev/sda1 /mnt
 

The -o sb= is where we plugin one of the superblocks we located earlier, and I used one of them from 4096000. 

Hopefully you can access and recover most of your data if this happens to you.


Tags:

disk, superblockhave, mounting, partition, mount, mnt, superblock, dev, sda, corruption, sectors, generally, accessible, caution, warranty, filesystems, superblocks, multiple, locations, mkfs, filesystem, ext, quot, ll, prompt, mke, fs, display, determine, parameters, originally, mar, contains, mounted, wed, jun, fs_check_if_mount, mtab, determining, creating, inodes, uuid, fcf, cf, dca, backups, stored, sb, plugin, located,

Latest Articles

  • How high can a Xeon CPU get?
  • bash fix PATH environment variable "command not found" solution
  • Ubuntu Linux Mint Debian Redhat Youtube Cannot Play HD or 4K videos, dropped frames or high CPU usage with Nvidia or AMD Driver
  • hostapd example configuration for high speed AC on 5GHz using WPA2
  • hostapd how to enable and use WPS to connect wireless devices like printers
  • Dell Server Workstation iDRAC Dead after Firmware Update Solution R720, R320, R730
  • Cloned VM/Server/Computer in Linux won't boot and goes to initramfs busybox Solution
  • How To Add Windows 7 8 10 11 to GRUB Boot List Dual Booting
  • How to configure OpenDKIM on Linux with Postfix and setup bind zonefile
  • Debian Ubuntu 10/11/12 Linux how to get tftpd-hpa server setup tutorial
  • efibootmgr: option requires an argument -- 'd' efibootmgr version 15 grub-install.real: error: efibootmgr failed to register the boot entry: Operation not permitted.
  • Apache Error Won't start SSL Cert Issue Solution Unable to configure verify locations for client authentication SSL Library Error: 151441510 error:0906D066:PEM routines:PEM_read_bio:bad end line SSL Library Error: 185090057 error:0B084009:x509 certif
  • Linux Debian Mint Ubuntu Bridge br0 gets random IP
  • redis requirements
  • How to kill a docker swarm
  • docker swarm silly issues
  • isc-dhcp-server dhcpd how to get longer lease
  • nvidia cannot resume from sleep Comm: nvidia-sleep.sh Tainted: Linux Ubuntu Mint Debian
  • zfs and LUKS how to recover in Linux
  • [error] (28)No space left on device: Cannot create SSLMutex Apache Solution Linux CentOS Ubuntu Debian Mint