Superblocks Inode Bitmaps and Block Bitmaps

To mount a file system, you need a file system superblock. Typically, this is the first block on a file system and contains generic information about the file system. You can make it visible using the stats command from a debugfs environment. Listing 5-3 shows you what it looks like for an Ext3 file system.

Listing 5-3. Example ofan Ext3 Superblock [email protected]:~# debugfs /dev/system/root debugfs 1.40.8 (lB-Mar-2008) debugfs: stats Filesystem volume name: Last mounted on: Filesystem UUID: Filesystem magic number Filesystem revision #: Filesystem features:

<not available>

d40645e2-412e-485e-9225-8e7f87b9f568 OxEF53 1 (dynamic)

has_journal ext_attr resize_inode dir_index*

filetype needs_recovery sparse_super large_file

Filesystem flags: Default mount options: Filesystem state: Errors behavior: Filesystem OS type: Inode count: Block count: Reserved block count: Free blocks: Free inodes: First block: Block size: Fragment size: Reserved GDT blocks: Blocks per group: Fragments per group:

signed_directory_hash (none) clean Continue Linux 6553600 26214400 1310720 23856347 6478467 0

4096

4096

1017

32768

32768

Without superblock, you cannot mount the file system; therefore, most file systems keep backup superblocks at different locations in the file system. In that case, if the real file system gets broken, you can mount using the backup superblock and still access the file system anyway.

Apart from the superblocks, the file system contains an inode bitmap and a block bitmap. By using these bitmaps, the file system driver can determine easily if a given block or inode is available. When creating a file, the inode and blocks used by the file are marked as in use, and when deleting a file, they are marked as available and thus can be overwritten by new files.

After the inode and block bitmaps sits the inode table. This contains the administrative information of all files on your file system. Since it normally is big (an inode is at least 128 bytes), there is no backup of the inode table.

Was this article helpful?

0 0

Post a comment