Metadata
Filesystem blocks are user for 2 purposes : To store User data and Metadata
- User data - stores actual data contained in files
- Metadata - stores file system structural information such as superblock, inodes, directories
Metadata describes the structure of the file system. Most common metadata structure are superblock, inode and directories.
Superblocks
Every FS has a superblock which contains info about filesystems such as :
- File system type
- Size
- Status
- Information about other metadata structures
- For filesystems with 1k blocksizes, a backup superblock can be found at block 8193
- For filesystems with 2k blocksizes, at block 16384
- For 4k blocksizes, at block 32768.
List backup superblocks:
# dumpe2fs /dev/hda3 | grep -i superblock
If Superblock is corrupted, restore with backup :
# e2fsck -f -b 8193 /dev/sda3
Inode
An inode is a data structure on a Linux Unix FS which stores stores basic information about a regular file, directory, or other file system objects.