Chapter 1. Understanding the Linux operating system 17
Draft Document for Review May 4, 2007 11:35 am 4285ch01.fm
1.3.3 Ext2
The extended 2 file system is the predecessor of the extended 3 file system. A fast, simple file
system, it features no journaling capabilities, unlike most other current file systems.
Figure 1-16 shows the Ext2 file system data structure. The file system starts with boot sector
and followed by block groups. Splitting entire file system into several small block groups
contributes performance gain because i-node table and data blocks which hold user data can
resides closer on disk platter, then seek time can be reduced. A block group consist of:
Super block: Information on the file system is stored here. The exact copy of a
super block is placed in the top of every block group.
Block group descriptor: Information on the block group is stored.
Data block bitmaps: Used for free data block management.
i-node bitmaps: Used for free i-node management.
i-node tables: inode tables are stored here. Every file has a corresponding i-node
table which holds meta-data of the file such as file mode, uid, gid,
atime, ctime, mtime, dtime and pointer to the data block.
Data blocks: Where actual user data is stored.
Figure 1-16 Ext2 file system data structure
To find data blocks which consist of a file, the kernel searches the i-node of the file first. When
a request to open /var/log/messages comes from a process, the kernel parses the file path
and searches a directory entry of / (root directory) which has the information about files and
directories under itself (root directory). Then the kernel can find the i-node of /var next and
takes a look at the directory entry of /var, and it also has the information of files and
directories under itself as well. The kernel gets down to the file in same manner until it finds

Ext2

boot sector
boot sector
BLOCK
GROUP 0
BLOCK
GROUP 0
BLOCK
GROUP 1
BLOCK
GROUP 1
BLOCK
GROUP 2
BLOCK
GROUP 2
:
:
:
:
BLOCK
GROUP N
BLOCK
GROUP N
super block
super block
block group
descriptors
block group
descriptors
data-block
bitmaps
data-block
bitmaps
inode
bitmaps
inode
bitmaps
inode-table
inode-table
Data-blocks
Data-blocks