What is File System Block And Super Block?
Block is a segment of data that contains data for the file, binary, dll, metadata, etc. Block is used to store information about files. Some blocks hold metadata about file system and called superblock.
The superblock is a segment of metadata that contains information about the file system on a block device. Superblock provides the following information about a file, binary, dll, metadata, etc.
- size of the file system
- block size of the file system
- empty or filled blocks of the file system
- size and allocation of inode tables
To access a file in a file system requires access to the superblock to get information about the file. The superblock is backed up into multiple areas of a disk.
List Super Block and Backups
We can list super block backups with
dumpe2fs command. Backup superblocks will list with the group descriptors.
$ sudo dumpe2fs /dev/sda1 | grep -i superblock
- The primary superblock is at 0
- Backup superblocks are separated to the different locations of the disk
List Details Of Blocks
We can use dumpe2fs tool to list all block information. But this will create a lot of output.
$ sudo dumpe2fs /dev/vda1
Last mounted onprovides the last path the given file system is mounted which is
/in this example.
Filesystem UIDis the unique identifier about the file system
Filesystem magic numberis the number which numbers the file system type
Filesystem featuresare the features provided by the filesystem
Default mount options
Filesystem stateshow the health of the file system which is clean in this example.
Errors behaviorwill specify what will be done if some error occurs during mount
Filesystem OS typeshows the file system OS which is
Linuxin this case.