Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Which file system is used by default in linux distributions?

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces which file system is used by default in the current linux distribution, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.

Currently, the default file system used by linux distributions is "ext4". EXT4 is the fourth generation extended file system, the journal file system under the Linux system, and the successor version of the ext3 file system. Features of the Ext4 file system: larger file systems and larger files, more subdirectories, persistent pre-allocation, and so on.

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

The file system of inux varies depending on the version of Linux, it is backward compatible, and a Linux distribution will not have only one file system.

At present, there are many file systems supported by Linux, and the default file system used by most Linux distributions is ext4.

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

Ext4 was implemented by a development team led by Theodore Tso, the maintainer of Ext3, and introduced into the Linux2.6.19 kernel.

The reason for Ext4 is that developers have added new advanced features to Ext3, but several important problems arise in the process of implementation:

(1) some new features violate backward compatibility

(2) the new features make Ext3 code more complex and difficult to maintain.

(3) the newly added changes make the original very reliable Ext3 unreliable.

For these reasons, from June 2006, developers decided to separate Ext4 from Ext3 for independent development. The development of Ext4 has been under way since then, but most Linux users and administrators didn't pay much 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 ended its experimental period and became a stable version.

Features:

Larger file systems and larger files

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

More number of subdirectories

Ext3 currently supports only 32000 subdirectories, while Ext4 removes this restriction and theoretically supports an unlimited number of subdirectories.

More blocks and I-nodes

The Ext3 file system uses 32-bit space to record the number of blocks and I-nodes, while the Ext4 file system extends them to 64 bits.

Multi-block allocation

When data is written to the Ext3 file system, Ext3's block allocator can only allocate one block of 4KB at a time. If you write a 100MB file, it will call the block allocator 25600 times, while Ext4's multi-block allocator "Multiblock Allocator (MBAlloc)" supports allocating multiple blocks in one call.

Persistent pre-allocation

If an application needs to allocate disk space before it is actually used, most file systems do so by writing zeros to unused disk space, such as P2P software. In order to ensure that there is enough space for the downloaded file, an empty file of the same size as the downloaded file is often created in advance to prevent the download from failing due to insufficient disk space in the next few hours or days. Ext4 implements persistent pre-allocation and provides corresponding API at the file system level, which is more efficient than the application software itself.

Delayed allocation

The block allocation strategy of Ext3 is to allocate as soon as possible, while the strategy of Ext4 is to delay the allocation as much as possible until the file is written in the buffer, so that the block allocation of the whole file can be optimized and the performance can be significantly improved.

Area structure

The Ext3 file system uses indirect mapping addresses, which is extremely inefficient when manipulating large files. For example, a 100MB-sized file should establish a mapping table of 25600 data blocks in Ext3 (taking each block size as 4KB as an example); while Ext4 introduces the concept of extent, each extent is a group of continuous data blocks, the above file can be expressed as "the file data is saved in the next 25600 data blocks", improving the access efficiency.

New I-node structure

Ext4 supports larger I-nodes. The default I-node size of the previous Ext3 is 128 bytes, and the default I-node size of Ext4 is 256bytes in order to accommodate more extended attributes in the I-node. In addition, Ext4 supports rapid extension of attributes and I-node retention.

Log check function

Logs are the most commonly used structure of file systems, and logs can be easily corrupted, and recovering data from corrupted logs can lead to more data corruption. Ext4 adds a check function to the log data, and the log check function can easily judge whether the log data is damaged. And Ext4 combines the two-phase logging mechanism of Ext3 into one phase, which improves performance while increasing security.

Supports "no log" mode

Logs always take up some overhead. Ext4 allows logging to be turned off so that some users with special needs can improve performance.

Barrier is enabled by default

There is an internal cache on the disk to rearrange the write order of bulk data and optimize write performance, so the file system must write Commit records after the log data has been written to disk. If the Commit record is written first, and the log is likely to be corrupted, then data integrity will be affected. The Ext4 file system enables Barrier by default, and only when all the data before Barrier is written to disk can the data after Barrier be written.

Online defragmentation

Although delayed allocation, multi-block allocation, and extent features can effectively reduce file fragmentation, fragmentation is inevitable. Ext4 supports online defragmentation and will provide e4defrag tools to defragment individual files or entire file systems.

Support for fast fsck

Previous file system versions were slow to perform fsck because it checked all I-nodes, and Ext4 added a list of unused I-nodes to the table of unused I-nodes in each block group, so the Ext4 file system can skip them for consistency checking and only check which I-nodes are in use, thus improving speed.

Support nanosecond timestamp

Prior to Ext4, the timestamp of the extended file system was in seconds, which was able to cope with most settings, but as the processor speed and integration (multi-core processors) increased, and Linux began to develop into other applications, it increased the unit of timestamp to nanosecond.

Ext4 has added two bits to the time range, thus extending the time life by 500 years. Ext4's timestamp supports the date to April 25, 2514, while Ext3 only reaches January 18, 2038.

Thank you for reading this article carefully. I hope the article "which file system is used by default in the current linux distribution" shared by the editor is helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report