4285ch01.fm Draft Document for Review May 4, 2007 11:35 am
18 Linux Performance and Tuning Guidelines
i-node of the file. The Linux kernel uses file object cache such as directory entry cache,
i-node cache to accelerate finding the corresponding i-node.
Now the Linux kernel knows i-node of the file then it tries to reach actual user data block. As
we described, i-node has the pointer to the data block. By referring to it, the kernel can get to
the data block. For large files, Ext2 implements direct/indirect reference to data block.
Figure 1-17 illustrates how it works.
Figure 1-17 Ext2 file system direct / indirect reference to data block
The file system structure and file access operations differ by file system. This makes different
characteristics of each file system.
1.3.4 Ext3
The current Enterprise Linux distributions support the extended 3 file system. This is an
updated version of the widely used extended 2 file system. Though the fundamental
structures are quite similar to Ext2 file system, the major difference is the support of
journaling capability. Highlights of this file system include:
򐂰Availability: Ext3 always writes data to the disks in a consistent way, so in case of an
unclean shutdown (unexpected power failure or system crash), the server does not have
to spend time checking the consistency of the data, thereby reducing system recovery
from hours to seconds.
򐂰Data integrity: By specifying the journaling mode data=journal on the mount command, all
data, both file data and metadata, is journaled.
򐂰Speed: By specifying the journaling mode data=writeback, you can decide on speed
versus integrity to meet the needs of your business requirements. This will be notable in
environments where there are heavy synchronous writes.
򐂰Flexibility: Upgrading from existing Ext2 file systems is simple and no reformatting is
necessary. By executing the tune2fs command and modifying the /etc/fstab file, you can
easily update an Ext2 to an Ext3 file system. Also note that Ext3 file systems can be
mounted as Ext2 with journaling disabled. Products from many third-party vendors have
ext2 disk inode
i_blocks[2]
i_blocks[12]
i_blocks[13]
i_blocks[14]
i_blocks[3]
i_blocks[4]
i_blocks[0]
i_blocks[1]
i_size
i_blocks
i_blocks[6]
i_blocks[7]
i_blocks[8]
i_blocks[9]
i_blocks[10]
i_blocks[11]
Data
block
Indirect
block
Indirect
block
Indirect
block
Indirect
block
i_blocks[5]
direct
indirect
double indirect
trebly indirect
Indirect
block
Indirect
block
Data
block
Indirect
block
Indirect
block
Data
block
Indirect
block
Indirect
block
Indirect
block
ext2 disk inode
i_blocks[2]
i_blocks[12]
i_blocks[13]
i_blocks[14]
i_blocks[3]
i_blocks[4]
i_blocks[0]
i_blocks[1]
i_size
i_blocks
i_blocks[6]
i_blocks[7]
i_blocks[8]
i_blocks[9]
i_blocks[10]
i_blocks[11]
Data
block
Indirect
block
Indirect
block
Indirect
block
Indirect
block
i_blocks[5]
direct
indirect
double indirect
trebly indirect
Indirect
block
Indirect
block
Data
block
Indirect
block
Indirect
block
Data
block
Indirect
block
Indirect
block
Indirect
block
Indirect
block
Data
block