Article Title: analyzes the Linux Extension File System ext4. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Ext4 is the next generation of log file system. It is backward compatible with the previous generation of File System ext3. Although ext4 is not yet a standard file system, it will become the next generation of Linux? The default file system of the release. Learn about ext4 and why it will become your favorite new file system.
Every release of the Linux kernel is accompanied by some surprises. 2.6.28 of July is no exception. This release is the first stable ext4 File System (it also contains other outstanding features, such as the Btrfs being developed ). This next-generation extended file system provides improved scalability, reliability, and many new features. The scalability of ext4 is so large that the maximum disk space used by the file system will reach 1 million TB.
A Brief History of extended file systems
The first file system supported by Linux is the Minix file system. This file system has serious performance problems, so another file system for Linux has emerged, that is, the extended file system. 1st extended file systems (ext1) were designed by Remy Card and introduced to Linux in April 1992. The ext1 file system is the first file system to be switched using a Virtual File System (VFS. Virtual File System switching is implemented in the 0.96c kernel. The maximum supported file system is 2 GB.
2nd extended file systems (ext2) were also implemented by Remy Card and introduced to Linux in January 1993. It draws on the advanced ideas of the File System (such as Berkeley Fast File System [FFS. Ext2 supports a maximum file system of 2 TB, but the 2.6 kernel increases the maximum capacity supported by this file system to 32 TB.
The 3rd extension File System (ext3) is a major improvement for Linux file systems, although it is inferior to some competitors in terms of performance. The ext3 file system introduces the log concept to improve the reliability of the file system when the system suddenly stops. Although some file systems have better performance (such as the XFS and IBM? Journaled File System [JFS]), but ext3 supports local (in-place) upgrades from systems using ext2. Ext3 was implemented by Stephen Tweedie and introduced in November 2001.
Today, we already have 4th extended file systems (ext4 ). Ext4 has been significantly improved in terms of performance, scalability, and reliability. Most importantly, ext4 supports 1 EB file systems. Ext4 is implemented by a development team led by Theodore Tso (ext3 maintainer) and introduced to the 2.6.19 kernel. Currently, it has been very stable in the 2.6.28 kernel (until December 2008 ).
Ext4 draws on many useful concepts from competitors. For example, you have implemented the partition (extent) in JFS to manage blocks. Another feature (latency allocation) related to block management has been implemented in ZFS of XFS and Sun Microsystems.
In the ext4 file system, you can find various improvements and innovations. These improvements include new features (new features), scalability (breaking the limits of the current file system), and reliability (responding to faults). Of course, they also include performance improvements.
Function
Ext4 introduces a large number of new features, but the most important thing is its backward and forward compatibility with ext3, as well as improvements in timestamp. These improvements are based on improving the performance of future Linux systems.
Backward and forward compatibility
Because ext3 is one of the most popular file systems on Linux, it should be able to easily migrate to ext4. To this end, ext4 is designed to have backward and forward compatibility with extent (see figure 1 ). Ext4 is forward compatible with ext3, so that the ext3 file system can be mounted as an ext4 file system. To fully utilize the advantages of ext4, you must migrate the file system to convert and use the new ext4 format. You can also mount ext4 to ext3 (backward compatible), provided that the ext4 file system does not have a partition (we will discuss it in the performance section ).
Figure 1. backward and forward compatibility of ext4
In addition to compatibility, You can gradually migrate the ext3 File System to ext4. This means that the old files that have not been moved can be retained in the ext3 format, but the new files (or the old files that have been copied) will adopt the new ext4 data structure. In this way, you can migrate the ext3 File System to the ext4 file system online.
Increase timestamp resolution and extend range
Surprisingly, the timestamps of extended file systems before ext4 are in seconds. This has been able to cope with most of the settings, but as the processor speed and Integration (multi-core processor) continue to increase, and Linux began to develop to other application fields (such as high performance computing ), the timestamp Based on seconds is insufficient. When designing a timestamp for ext4, considering future development, it increases the unit of the timestamp to a nanosecond. Ext4 adds two bits to the time range to extend the time span by 500.
Scalability
One important aspect of the future development of file systems is scalability, that is, the ability to scale as needed. Ext4 provides powerful scalability in multiple ways. Its scalability surpasses ext3 and opens up a new field in metadata management of file systems.
Break through the limits of file systems
An obvious difference between ext4 is that it supports larger file systems, files, and subdirectories. Ext4 supports a maximum file system of 1 EB (1000 PB ). Although the file system is already huge according to today's standards, the storage space consumption will continue to grow. Therefore, ext4 must take future development into account. Ext4 Supports files up to 16 TB (Suppose it consists of 4 kb blocks), which is eight times the size of ext3.
Finally, ext4 also expands the sub-directory capacity from 32 KB to infinity. This is an extreme situation. We also need to consider the hierarchical structure of the file system because its maximum storage capacity is 1 EB. In addition, the Directory Index is also optimized to be similar to the hash B tree structure, so although there are more restrictions, ext4 supports faster search.
Section
Ext3 space allocation is one of its main drawbacks. Ext3 uses free space bit ing to allocate files. This method is not very fast and is not scalable. The ext3 format is very efficient for small files, but the opposite is true for large files. Ext4 uses the block instead of ext3 mechanism, which improves space allocation and supports a more efficient storage structure. A block is a way to represent a group of adjacent blocks. The use of the section reduces metadata because the Section maintains information about the storage location of a group of adjacent blocks (thus reducing the overall metadata storage), rather than the information about the storage location of a block.
The section of ext4 uses a layered method to efficiently represent small files, and uses a section tree to efficiently represent large files. For example, a single ext4 inode has enough space to reference four segments (each segment represents a group of adjacent segments ). For large files (including fragment files), an inode can reference an index node, and each index node can reference a leaf node (reference multiple segments ). This continuous segment tree provides rich representation for large files (especially scattered files. These nodes also contain autonomous check mechanisms to prevent threats from file system corruption.
[1] [2] Next page