[Turn] Linux Ext3 EXT4 Difference

Source: Internet
Author: User

Linux Kernel officially supports the new file system EXT4 since 2.6.28. EXT4 is an improved version of EXT3 that modifies some of the important data structures in EXT3, not just as Ext3 to EXT2, but adds a log function. The EXT4 offers better performance and reliability, as well as a richer range of features:

1. Compatible with EXT3. By executing several commands, you can migrate from Ext3 online to EXT4 without reformatting the disk or reinstalling the system. The original EXT3 data structure is still retained, EXT4 action on new data, of course, the entire file system has thus obtained the EXT4 supported by the larger capacity.

2. Larger file systems and larger files. EXT4 supports 1EB (1,048,576TB, 1EB=1024PB, 1PB=1024TB) file systems and 16TB files, respectively, compared to the maximum 16TB file system and maximum 2TB files currently supported by EXT3.

3. An unlimited number of subdirectories. EXT3 currently supports only 32,000 subdirectories, and EXT4 supports an unlimited number of subdirectories.

4. Extents. EXT3 uses indirect block mapping, which is extremely inefficient when working with large files. For example, a 100MB size file, in Ext3 to create 25,600 blocks (each data block size is 4KB) mapping table. The EXT4 introduces the popular extents concept in modern file systems, each extent a contiguous set of data blocks, which is expressed as "the file data is stored in the next 25,600 blocks", which improves a lot of efficiency.

5. Multi-block allocation. When writing data to the Ext3 file system, the EXT3 data block allocator can only allocate a 4KB block at a time, write a 100MB file will call 25,600 data block allocator, and Ext4 's multi-block allocator "Multiblock Allocator" (Mballo c) supports one call to allocate multiple blocks of data.

6. Deferred distribution. EXT3 's block allocation strategy is allocated as quickly as possible, while the EXT4 and other modern file operating system policies are to delay allocations as much as they can, until the file is written in the cache before the data block is allocated and written to disk, which optimizes the data block allocation for the entire file, which, together with the first two features, significantly improves performance.

7. Fast fsck. The first step in executing fsck is slow, because it checks all the inode, and now EXT4 adds a list of unused inode to each group's inode table, and the fsck EXT4 file system will be able to skip them in the future to check only the inode that is in use.

8. Log check. Logs are the most common part and are prone to disk hardware failure, and recovering data from corrupted logs can result in more data corruption. EXT4 's log check function makes it easy to tell if the log data is corrupted, and it merges the EXT3 two-stage logging mechanism into one phase, increasing security while improving performance.

9. "No Log" (no journaling) mode. The log has some overhead, and EXT4 allows logging to be turned off so that some users with special needs can improve performance.

10. Online defragmentation. Although delayed allocations, multiple allocations, and extents can effectively reduce file system fragmentation, fragmentation is unavoidable. EXT4 supports online defragmentation and will provide e4defrag tools to defragment individual files or the entire file system.

The inode-related characteristics. The EXT4 supports larger inode sizes, compared to the default inode size of Ext3 of 128 bytes, EXT4 in order to accommodate more extended attributes (such as nanosecond timestamp or inode version) in the Inode, the default inode size is 256 bytes. EXT4 also supports fast extended properties (fast extended attributes) and Inode retention (inodes reservation).

12. Persistent pre-allocation (persistent preallocation). To ensure that the downloaded file has enough space to store, it is often pre-created an empty file with the same size as the downloaded file, so that the download fails due to insufficient disk space in the next few hours or days. The EXT4 implements durable pre-allocation at the filesystem level and provides the appropriate API (Posix_fallocate () in libc), which is more efficient than the application software itself.

13. Barrier is enabled by default. The disk is equipped with an internal cache to re-adjust the write order of the bulk data, optimizing write performance, so the file system must write the commit record after the log data is written to disk, and if the commit record is written earlier and the log is potentially corrupted, data integrity is affected. EXT4 By default, barrier is enabled, and data after barrier can be written only if the data before barrier is written to disk. (This attribute can be disabled by the "mount-o barrier=0" command.) )

[Turn] Linux Ext3 EXT4 Difference

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.