Understanding UNIX / Linux filesystem Superblock

This is second part of “Understanding UNIX/Linux file system”, part I is here. Let us take an example of 20 GB hard disk. The entire disk space subdivided into multiple file system blocks. And blocks used for what?

Unix / Linux filesystem blocks

The blocks used for two different purpose:

  1. Most blocks stores user data aka files (user data).
  2. Some blocks in every file system store the file system’s metadata. So what the hell is a metadata?

In simple words Metadata describes the structure of the file system. Most common metadata structure are superblock, inode and directories. Following paragraphs describes each of them.


Each file system is different and they have type like ext2, ext3 etc. Further each file system has size like 5 GB, 10 GB and status such as mount status. In short each file system has a superblock, which contains information about file system such as:

  • File system type
  • Size
  • Status
  • Information about other metadata structures

If this information lost, you are in trouble (data loss) so Linux maintains multiple redundant copies of the superblock in every file system. This is very important in many emergency situation, for example you can use backup copies to restore damaged primary super block. Following command displays primary and backup superblock location on /dev/sda3:
# dumpe2fs /dev/hda3 | grep -i superblock

Primary superblock at 0, Group descriptors at 1-1
Backup superblock at 32768, Group descriptors at 32769-32769
Backup superblock at 98304, Group descriptors at 98305-98305
Backup superblock at 163840, Group descriptors at 163841-163841
Backup superblock at 229376, Group descriptors at 229377-229377
Backup superblock at 294912, Group descriptors at 294913-294913

Continue reading rest of the Understanding Linux file system series (this is part II):

  • Part I – Understanding Linux superblock
  • Part II – Understanding Linux superblock
  • Part III – An example of Surviving a Linux Filesystem Failures
  • Part IV – Understanding filesystem Inodes
  • Part V – Understanding filesystem directories
  • Part VI – Understanding UNIX/Linux symbolic (soft) and hard links
  • Part VII – Why isn’t it possible to create hard links across file system boundaries?

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 16 comments so far... add one
CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
16 comments… add one
  • Anonymous May 31, 2006 @ 17:13

    # dumpe2fs /dev/hda3grep -i superblock
    above command is not running here |(pipe) is missing, anyway

    I am getting different output as you mentioned
    [root@sachan /root]# dumpe2fs /dev/hda1 | grep -i superblock
    dumpe2fs 1.19, 13-Jul-2000 for EXT2 FS 0.5b, 95/08/09
    [root@sachan /root]#

  • 🐧 nixcraft May 31, 2006 @ 21:59

    Opps pipe was missing, thanks for heads up.

    Hmm it should give the output.

  • Kristian May 5, 2007 @ 16:33

    It should be mentioned that dumpe2fs only is for the ext2/ext3 file systems.

  • bipul Aug 1, 2007 @ 8:14

    Hello Unix Team
    how are you

  • Swapnil Aug 31, 2007 @ 6:05

    Hi Vivek,

    I have a doubt as how many redundant backups of superblock are created in the file system ? Is it made on every block group or only on initial few block groups ?
    In the filesystem that I created of size 128 MB with 16 block groups, when I run the dumpe2fs command on it, it gives the info on superblocks (These are not the exact wordings of the output ) :
    primary superblock is present on block group 0,
    back up superblock is present on block group 1, 3, 5, 7, 9.

    Similarly for a file system with 256 MB size and 31 block groups, primary superblock is present on block group 0 and backups are present on block groups 1,3,5,7, and 9.

    So my doubt is how does the file system how many backups of the superblock to be created ?
    And the same doubt for block group descriptors as well. Block group descriptors are not present in each block group but only in the block groups where superblock is present.

    Hoping for an earliest response.


  • Sunil Apr 18, 2008 @ 6:40

    Hey this command id not working on my system…

    [sunilv@lnx202-28 ~]$ dump2fs /u/sunilv | grep -i superblock
    dump2fs: Command not found.

    • rakesh Sep 13, 2011 @ 7:52

      dude.. commands is dump2efs

      u used dump2fs

  • 🐧 nixCraft Apr 18, 2008 @ 10:46

    Use full path /sbin/dumpe2fs, you are logged in as regular user and /sbin and /usr/sbin not in PATH settings.

  • c Nov 24, 2008 @ 6:10

    To Swapnil,

    You have sparse_super mode so super block and backups are saved in groups 0,1,3^n,5^n,7^n (e.g. 0,1,3,5,7,9,25,27,…). If you take a look at mke2fs code, you’ll see these places where super blocks are saved.

    p.s. this is a very late comment but just wanted to comment..

  • Govindasamy C Jan 28, 2009 @ 5:25

    Its working fine for me
    sunil i think you did not give space after the command dumpe2fs

  • try Dope Jan 24, 2011 @ 4:46

    so… what the hell is Superblock, and can you please please be careful using the word/term …. “OBJECT” . You just cant use it at your whim.

  • sox May 24, 2011 @ 1:37

    what is meant by offset information in a filesystem?

  • saikumar Jul 14, 2011 @ 3:59

    is it possible to install linux in personal lappies? core2duo processor( dell laptop)…
    is it possible even vmware workstation is installed in laptops….

  • lanh May 17, 2012 @ 8:06

    Good content; I like how you explain this topic very simply, as linux is typically hard to grasp.

  • Aravind Oct 3, 2012 @ 7:00

    Very fine . . . . . . .u

  • tony Sep 24, 2014 @ 10:01

    Thanks, it is very well explained.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum