What is Superblock?

A superblock refers to the segment of the hard drive that contains a metadata. It describes and contains the details of the file system on a block device.

In simple words, it is the collection of metadata that tells about the properties of file systems.

Understanding Superblock

What is Superblock

Most of the computer hard drives contain a superblock that holds the information about the file system.

Ideally, on a disk or in the partition of the disk drive, the first data block holds the metadata, or data about data, of the partition itself. This is where the superblock got its name from.

However, that was back in time, but today, superblocks are not dependent on the traditional data block concept.

Instead, it is now more of a data structure that contains the vital information and details of each of the file systems mounted on the hard disk drive.

If the term is quite new to you and you are used to Microsoft Windows systems, be informed that the equivalent to the superblock on the Windows file system is the File Allocation Table, or FAT.

This contains the information about which particular block of the disk holds which records related to the topmost directory.

On a Unix-like operating system, however, the superblock is virtually located in the memory always, as opposed to the older operating systems such as Microsoft Disk Operating System (MS-DOS).


One of the primary objectives of the superblocks, apart from holding the information about the file system, is to alert the users, especially the Linux users, with a superblock error message when they try to mount a hard disk drive inappropriately.

In addition to that, it also ensures that every request to access any file within the filesystem is made through the superblock. This means that if you cannot access the superblock, you will not be able to mount a filesystem on your disk.

Read Also:  What is Virtual Hard Disk (VHD)? (Explained)

This, in technical terms, also means that it will not allow you to attach logically to the main filesystem or access the files.

Also, if you want to mount a filesystem with a tarnished or otherwise damaged superblock, you are likely to fail and will usually receive an error message stating ‘Cannot read superblock.’

Need for Multiple Copies

The importance of the superblocks may be overlooked by the average user, but it is quite immense.

It is due to its importance that the chances of any potential damage that can be caused to it and the effects of it need to be considered. These damages could be any of the following or others that may erase critical data:

To minimize the chances of permanent data loss, multiple backup copies of these superblocks are created at block offsets or at intervals on the file system itself and stored at the beginning of each individual block group, or at the start of the disk slice. It is also duplicated in every cylinder group.

As already mentioned, for Unix and Linux, a copy of the superblock of every mounted filesystem is also maintained in the memory.

The main reason to store the several redundant copies of superblock in multiple locations on the disk and even in the main memory of the system is that it is considered to be an extremely critical metadata structure for a given file system.

For instance, if, at any point in time, the superblock of a partition, /var for instance, is damaged or becomes corrupt, the operating system will not be able to mount the specific file system.

Typically, in such situations, you will need to run File System Check. This will help you to choose an alternate superblock automatically from the backup copies and try to recover the file system.

Ideally, all of the backup copies of the superblock cannot get damaged altogether because they are stored in several block groups spread across the disk and the file system, with the first one stored at the first block offset from the beginning of the partition.

This feature plays a very crucial role in specific situations where there is a need for manual recovery.

It is especially very important to create redundant multiple copies of the superblock if you are using a multi-platter disk drive.

In such cases, the offsets are so calculated, created, and stored that there is a copy of them available on every platter of the hard disk drive.

This will ensure that, even in the event of the first platter failing or being lost, there is a substitute superblock available always that can be easily retrieved to restore the filesystem.

Read Also:  What is GUID Partition Table (GPT)? Uses, Pros, Cons & More

However, at this point, it is to be remembered that, apart from the principal blocks in the primary cylinder group, it is the leading blocks that are typically formed by the offsets that are used to store data.

The Summary Block

There is also a block containing the summary information that is also stored within the superblock, but this particular block is not replicated.

Instead, it is congregated with the principal superblock, which is typically located in the cylinder group 0.

The summary block normally records modifications and changes that occur as and when the filesystem is used. It typically lists the following:

Contents of a Superblock

The superblock is a segment of metadata that contains all the characteristics and information about the file system.

Typically, it contains the following information:

How to Recover Superblock?

If you find a superblock of your file system to be damaged by using File System Check (fsck), you can recover it quite easily because there are redundant copies of it stored in the file systems, fortunately.

You may use the fsck -o b command to replace the damaged superblock with one of these copies.

Using File System Check (fsck)

The steps to follow for the entire process are as follows:

The File System Check will use the alternate superblock specified by you in order to restore the primary damaged superblock.

You can use any of the substitute block numbers displayed in the output of the newfs -N command that are used to make copies of superblocks while creating the file system. However, you can always use 32 as a substitute block.

In Ubuntu

Alternatively, if you are using Ubuntu, you can follow these steps as mentioned below in order to restore a damaged Ext4 superblock.

Assuming that at this stage the system won’t boot, probably the easiest way to go ahead with this process is to download and burn Parted Magic.

Read Also:  What is Seek Time? Example, Formula & More

When you boot from there, you will have access to a lot of useful tools and you can follow these steps:

At this point, you can change ext4 to ext2 or ext3, depending on the filesystem.

Now, you will need to check what the superblock backups are and where they are kept by using the command sudo mke2fs -n /dev/xxx.

Finally, choose a backup from the list displayed and restore the damaged superblock, making sure that the x’s are replaced by the name of your partition and the block number with the first superblock backup in the command sudo e2fsck -b block_number /dev/xxx.

Complete the process by rebooting your system, which should fix the damaged superblock. If it does not, repeat the above steps, but this time use a different backup superblock to restore.

Fixed disk (fdisk)

In addition to the above steps, there is also a relatively outdated method of restoring a damaged superblock, which is by using the fdisk command.

However, this process will not support GPT disks because, as said at the beginning, this process is pretty outdated.

You will need to use GParted or some other similar tool for that matter.


Now that you have reached so far and are reading this line, you must have gained a fair amount of knowledge about the superblocks sited in the hard disk drive of your computer.

You know its value, benefits, and how exactly you can recover or restore a damaged superblock in the drive with a few easy steps and commands.