Home>Article>Operation and Maintenance> What is the default file system currently used by Linux distributions?

What is the default file system currently used by Linux distributions?

青灯夜游
青灯夜游 Original
2021-02-03 15:24:22 6282browse

The file system currently used by Linux distributions by default is "ext4". EXT4 is the fourth generation extended file system, a log file system under the Linux system, and the successor version of the ext3 file system. Features of the Ext4 file system: larger file system and larger files, greater number of subdirectories, persistent preallocation, and more.

What is the default file system currently used by Linux distributions?

#The operating environment of this tutorial: Red Hat Enterprise Linux 6.1 system, Dell G3 computer.

There is an important concept in the LINUX system: everything is a file. Linux is a rewrite of UNIX. In the UNIX system, all resources are regarded as files, including hardware devices.

The file system of Linux is different because of different versions of Linux. It will be backward compatible, and a Linux distribution will not have only one file system.

Currently, Linux supports many file systems. The default file system used by most Linux distributions is generally ext4.

EXT4 is the fourth generation extended file system (English: Fourth extended file system, abbreviated as ext4) is a log file system under the Linux system and is the successor version of the ext3 file system.

Ext4 was implemented by the development team led by Theodore Tso, the maintainer of Ext3, and introduced into the Linux 2.6.19 kernel.

The reason for Ext4 is that developers added new advanced features to Ext3, but several important problems arose during the implementation process:

(1) Some new features violate backward compatibility Safety

(2) New features make Ext3 code more complex and difficult to maintain

(3) Newly added changes make Ext3, which was originally very reliable, unreliable.

For these reasons, starting in June 2006, developers decided to separate Ext4 from Ext3 for independent development. Development of Ext4 began at that time, but most Linux users and administrators paid little attention to it until the release of the 2.6.19 kernel in November 2006. Ext4 first appeared in the mainstream kernel, but it was still in the experimental stage, so many people ignored it.

On December 25, 2008, the official version of Linux Kernel 2.6.28 was released. With the release of this new kernel, the Ext4 file system has also ended its experimental period and become a stable version.

Features:

  • Larger file systems and larger files

    Ext3 file system can only support file systems up to 32TB and 2TB files. Depending on the specific architecture and system settings used, the actual capacity limit may be even lower than this number, which can only accommodate a 2TB file system and 16GB files. The file system capacity of Ext4 reaches 1EB, and the file capacity reaches 16TB, which is a very large number. This may not be important for typical desktops and servers, but for users of large disk arrays, it is very important.

  • More number of subdirectories

    Ext3 currently only supports 32,000 subdirectories, while Ext4 removes this limitation and theoretically supports an unlimited number of subdirectories.

  • More block and i-node numbers

    Ext3 file system uses 32-bit space to record the number of blocks and i-nodes, while Ext4 file system expands them to 64-bit.

  • Multiple block allocation

    When data is written to the Ext3 file system, the Ext3 data block allocator can only allocate one 4KB block at a time. A 100MB file requires 25,600 calls to the data block allocator, and Ext4's multi-block allocator "Multiblock Allocator (MBAlloc)" supports allocating multiple data blocks in one call.

  • Persistent Preallocation

    If an application needs to allocate disk space before it is actually used, most file systems do this by allocating disk space to unused disk space. Write 0 to the space to achieve allocation, such as P2P software. In order to ensure that there is enough space to store the downloaded file, an empty file with the same size as the downloaded file is often created in advance to avoid download failure due to lack of disk space in the next few hours or days. Ext4 implements persistent pre-allocation at the file system level and provides corresponding APIs, which is more efficient than the application software itself.

  • Delayed allocation

    The data block allocation strategy of Ext3 is to allocate as soon as possible, while the strategy of Ext4 is to delay allocation as much as possible until the file is written in the buffer. Data blocks are allocated and written to disk, thus optimizing block allocation across the entire file and significantly improving performance.

  • Extent structure

    The Ext3 file system uses indirect mapping addresses, which is extremely inefficient when operating large files. For example, for a 100MB file, a mapping table of 25,600 data blocks (taking the size of each data block as 4KB as an example) needs to be established in Ext3; while Ext4 introduces the concept of extents, and each extent is a set of consecutive Data blocks, the above files can be represented by extents as "the file data is stored in the next 25,600 data blocks", which improves access efficiency.

  • New i-node structure

    Ext4 supports larger i-nodes. The default i-node size of the previous Ext3 was 128 bytes. In order to accommodate more extended attributes in the i-node, the default i-node size of Ext4 is 256 bytes. In addition, Ext4 also supports fast expansion attributes and i-node retention.

  • Log verification function

    The log is the most commonly used structure of the file system. The log is also easily damaged, and recovering data from the damaged log will cause more data damage. Ext4 adds a verification function to log data. The log verification function can easily determine whether the log data is damaged. Moreover, Ext4 merges the two-stage logging mechanism of Ext3 into one stage, which improves performance while increasing security.

  • Support "no log" mode

    Logging will always take up some overhead. Ext4 allows turning off logging so that some users with special needs can improve performance.

  • Barrier is enabled by default

    The disk is equipped with an internal cache to re-adjust the order of write operations of batch data and optimize write performance, so the file system must log data The Commit record cannot be written until it is written to disk. If the Commit record is written first and the log may be damaged, data integrity will be affected. Barrier is enabled by default in the Ext4 file system. Only when all the data before the barrier is written to the disk can the data after the barrier be written.

  • Online defragmentation

    Although delayed allocation, multi-block allocation and extent functions can effectively reduce file fragmentation, fragmentation is still inevitable. Ext4 supports online defragmentation and will provide the e4defrag tool for defragmentation of individual files or the entire file system.

  • Support fast fsck

    Previous file system versions were slow to perform fsck because it had to check all i-nodes, while Ext4 gave each block group A list of unused i-nodes is added to the i-node table, so the Ext4 file system can skip them when doing consistency checks and only check which i-nodes are in use, thereby improving speed.

  • Support nanosecond timestamps

    The timestamps of the extended file system before Ext4 are in seconds, which can already cope with most settings, but As the speed and integration of processors (multi-core processors) continue to increase, and Linux begins to develop into other application areas, it will increase the unit of timestamps to nanoseconds.

    Ext4 adds two digits to the time range, thereby extending the time life by 500 years. The timestamp of Ext4 supports dates until April 25, 2514, while Ext3 only reaches January 18, 2038. .

To read more related articles, please visitPHP Chinese website! !

The above is the detailed content of What is the default file system currently used by Linux distributions?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn