Installation guide

Chapter 7.
43
The Ext4 File System
The ext4 file system is a scalable extension of the ext3 file system, which was the default file system
of Red Hat Enterprise Linux 5. Ext4 is now the default file system of Red Hat Enterprise Linux 6, and
can support files and file systems of up to 16 terabytes in size. It also supports an unlimited number of
sub-directories (the ext3 file system only supports up to 32,000).
Main Features
Ext4 uses extents (as opposed to the traditional block mapping scheme used by ext2 and ext3),
which improves performance when using large files and reduces metadata overhead for large
files. In addition, ext4 also labels unallocated block groups and inode table sections accordingly,
which allows them to be skipped during a file system check. This makes for quicker file system
checks, which becomes more beneficial as the file system grows in size.
Allocation Features
The ext4 file system features the following allocation schemes:
Persistent pre-allocation
Delayed allocation
Multi-block allocation
Stripe-aware allocation
Because of delayed allocation and other performance optimizations, ext4's behavior of writing files
to disk is different from ext3. In ext4, a program's writes to the file system are not guaranteed to be
on-disk unless the program issues an fsync() call afterwards.
By default, ext3 automatically forces newly created files to disk almost immediately even without
fsync(). This behavior hid bugs in programs that did not use fsync() to to ensure that written
data was on-disk. The ext4 file system, on the other hand, often waits several seconds to write out
changes to disk, allowing it to combine and reorder writes for better disk performance than ext3
Warning
Unlike ext3, the ext4 file system does not force data to disk on transaction commit. As such,
it takes longer for buffered writes to be flushed to disk. As with any file system, use data
integrity calls such as fsync() to ensure that data is written to permanent storage.
Other Ext4 Features
The Ext4 file system also supports the following:
Extended attributes (xattr), which allows the system to associate several additional name/
value pairs per file.
Quota journaling, which avoids the need for lengthy quota consistency checks after a crash.
Note
The only supported journaling mode in ext4 is data=ordered (default).