SHARE
Facebook X Pinterest WhatsApp

A Recovery Plan for a Superbad Superblock

The superblock is the part of an ext2 or ext3 filesystem that contains the metadata — information about filesystem type, size, status and so on. Without the superblock, you’re in trouble in terms of data loss. Linux therefore has multiple copies of the superblock in different locations. Thus, even if you get a “bad superblock” […]

Written By
thumbnail Juliet Kemp
Juliet Kemp
Nov 26, 2008
Datamation content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

Juliet Kemp

The superblock is the part of an ext2 or ext3 filesystem that contains the metadata — information about filesystem type, size, status and so on. Without the superblock, you’re in trouble in terms of data loss. Linux therefore has multiple copies of the superblock in different locations. Thus, even if you get a “bad superblock” error, you can still rescue your filesystem, as described here.

Note that before doing any of the below the filesystem must be unmounted!
If the problem filesystem is /, you must boot off a LiveCD or
rescue disk.

First, get the superblock information for the problem filesystem.

dumpe2fs /dev/hda2 | grep superblock

(^4dumpe5^ handles both ext2 and ext3 happily). The output will look a bit like this:

  Primary superblock at 0, Group descriptors at 1-3
  Backup superblock at 32768, Group descriptors at 32769-32771
  Backup superblock at 98304, Group descriptors at 98305-98307
  Backup superblock at 163840, Group descriptors at 163841-163843
[ etc ... ]

Superblocks have standard locations in a default system, but it’s always a
good idea to check the information anyway. So, you now have a list of backup
superblocks to use in place of your bad primary superblock.

The next step is to pass in a backup superblock as an option tofsck:

fsck -b 32768 /dev/hda2

fsck will probably ask you to confirm a few fixes. After
it’s run, try mounting the filesystem as usual (with mount). If this
still doesn’t work, try passing the backup superblock as an argument:

mount sb=32768 /dev/hda2 /mnt

And now you’ve sorted your disk out: Make sure you back it up!

This article was first published on ServerWatch.com.

  SEE ALL
ARTICLES
 

Recommended for you...

8 Best Network Monitoring Tools of 2024 (Free & Paid)
Liz Ticong
Apr 11, 2024
OpenVAS vs. Nessus: Top Vulnerability Scanners Compared
Leon Yen
Feb 23, 2024
What is SOX Compliance? Requirements & Rules
Mary Shacklett
Oct 4, 2023
The Top Intrusion Prevention Systems
Kashyap Vyas
Jun 14, 2023
Datamation Logo

Datamation is the leading industry resource for B2B data professionals and technology buyers. Datamation's focus is on providing insight into the latest trends and innovation in AI, data security, big data, and more, along with in-depth product recommendations and comparisons. More than 1.7M users gain insight and guidance from Datamation every year.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.