Superblocks – describing filesystem metadata
If you’ve ever created a filesystem by running mkfs
on a block device, chances are you must have seen the term superblock in the output. Superblock is one of the more familiar structures to the casual Linux user. You might have noticed that the structures used in VFS bear a close resemblance to each other. Dentry and file objects store in-memory representations of directories and open files, respectively. Both structures do not have an on-disk image and only exist in memory. On a similar note, the superblock structure has a lot in common with inodes. Inodes store metadata about files, whereas superblocks store metadata about filesystems.
Consider the example of a library catalog system that keeps track of the books, including their titles, authors, and locations on the shelves. If the catalog system is lost or damaged, it can be difficult to find and retrieve specific books in the library. Similarly, if the superblock structure...