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

  • Mysql vs MariaDB how to create a socket user tutorial
  • Ubuntu Linux Mint Desktop Dark Black Cannot See Solution
  • How to combine .txt ACLs without breaking things
  • How to ping all of Googlebot's IPs script
  • 'virtio0' uses a qcow2 feature which is not supported by this qemu version: QCOW version 3
  • Linux bash script to get the IP of a list of hostnames
  • How To Use Camera Webcam in Docker for OBS Studio etc...
  • Computer Server Won't Post Boot Or Enter BIOS Setup After Installing RAID SAS or GPU Card etc..
  • How To Test PHP Scripts from CLI with GET variables/query string
  • apt-cache how to see all available versions of a package in Debian Ubuntu Mint
  • Virtualbox VBox Guest-utils drag and drop files stops working with Windows VMs
  • How To Remove Ubuntu Netplan and Go Back to /etc/network/interfaces
  • How To Force Flash an AMD Instinct GPU To Another Model Using Debian Ubuntu Mint Linux
  • How To compile ollama from source to use unsupported AMD GPU with rocm in Ubuntu Debian
  • QEMU KVM Virtio GPU Windows Cannot Select 1080P
  • Linux Gnome Desktop Ubuntu Mint Debian Gets Slower After Weeks
  • Firefox How to Save Full Page As Screenshot/PDF
  • Nvidia Datacenter Driver Tesla Slow nvidia-smi response and high utilization with 0 usage
  • ffmpeg how to normalize / increase the volume of your audio
  • kdenlive audio blips pops cracks artifacts solution fix