How to migrate to the Linux File System ext4

Source: Internet
Author: User
Article Title: How to migrate to the Linux 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 a large number of Linux? The latest version in the file system will be as important and popular as the previous version. As a Linux system administrator, you should know the advantages and disadvantages and basic steps of migrating to ext4. This article describes when ext4 should be used, how to use traditional file system maintenance tools in ext4, and how to make full use of the file system.

Ext4 Functions

Linux supports several different file systems. Some of these file systems are dedicated network file systems or file systems developed for other operating systems, but most of them are still used as Linux local file systems-you can (/) and system directory in this file system. Currently, this type of File System includes ext2, ext3, ReiserFS, XFS, and Journaled File System (JFS ). However, file systems are constantly being designed and developed, and new file systems will also be available soon.

The most important Linux file system currently under development is ext4, which is the fourth version of the original extended File System (ext or extfs) specially developed for Linux. Thanks to the previous version, ext4 will likely become an important standard file system for Linux in the near future (probably a standard file system ).

Ext4 and ext3 PairsRatio

The fourth version of the extended File System (ext or extfs) was generated because developers incorporated new advanced features in ext3. However, there are several problems in the implementation process:

Some new features violate backward compatibility.
The Ext3 code becomes more complex and difficult to maintain.
These changes make the originally very reliable ext3 unreliable.

For these reasons, since September June 2006, developers decided to separate ext4 from ext3 for independent development. The development of Ext4 started from that time, but most Linux users and administrators did not pay much attention to this issue. With the release of the 2.6.19 kernel in November 2006, ext4 was first introduced in the mainstream kernel, but it was still in the trial phase (now), so many people ignored it.

As it is still in the development stage, the function list of ext4 has been changing since the 2.6.24.4 kernel. The current and expected features of Ext4 include those developed from ext3, as shown in table 1.


Table 1. The current and future features of Ext4 surpass ext3


 

Function Advantages
Larger File System Ext3 can only accommodate 32 TiB file systems and 2 TiB files. Based on the specific architecture and system settings, the actual capacity limit may be lower than this number-maybe it can only accommodate 2 TiB file systems and 16 giibyte (GiB) files. In contrast, Ext4 has a file system capacity of 1024 pebibyte (PiB) or 1 exbibyte (EiB), while Ext4 has a file capacity of 16 TiB. This may not be important for general desktop computers and servers, but it is important for users of large disk arrays.
Extent Extent is a method to improve the efficiency of disk file descriptors. It can reduce the time required to delete large files.
Persistent pre-allocation If an application needs to allocate disk space before it is actually used, most file systems allocate space by writing 0 to unused disk space. Ext4 allows allocation in advance, without the need to perform the above operations, which can improve the performance of some databases and multimedia tools.
Delay allocation Ext4 can delay disk space allocation as much as possible, which can improve performance.
More subdirectories If a directory in ext3 can contain only 32,000 sub-directories and cannot meet your needs, do not worry, because ext4 removes this restriction.
Log checksum Ext4 adds the check and (checksum) functions to log data, which improves reliability and performance.
Online disk sorting Although ext3 is generally not affected by fragments, the number of files stored in it will produce some fragments. Ext4 supports online disk sorting, which can improve overall performance.
Restore deleted files Although this function has not yet been implemented, ext4 will support restoring and deleting files. This function is extremely useful when an object is accidentally deleted.
Faster File System check Ext4 adds a new data structure, allowingfsckSkipping unused parts of the disk during the check speeds up the file system check.
Nanosecond Timestamp Most file systems (including ext3) contain timestamp data precise to seconds, while ext4 improves accuracy to nanoseconds. Some materials also indicate that the date supported by the timestamp of ext4 is April 25, 2514, while that supported by ext3 is only January 18, 2038.

Because ext4 is still in the development stage, this menu will be changed. Some functions in the function list do not have backward compatibility with ext3 in actual use-that is, they may not be able to mount the ext4 file system using code of the ext3 file system type. However, ext4 retains the forward compatibility-you can mount the ext3 file system just as you mount the ext4 file system.

Use object of ext4

The most significant improvement of Ext4 is the size of the file and file system. Therefore, the users most likely to require ext4 are those whose disk space is several TB. However, the function list in table 1 shows other attractive improvements. For example, if your directory contains a large number of subdirectories or requires that the timestamp accuracy be less than one second, you may want to try to use ext4.

Because ext4 is currently in the experimental stage, you must re-compile the kernel to use it. Otherwise, it will be troublesome to use ext4. In fact, the test phase of ext4 means that it is necessary to use ext4 only when you want to contribute to the development of ext4, or are eager for some of its features. If you want to obtain reliable large disk support before the stable release of ext4, you can consider using XFS or JFS.

Of course, ext4 cannot be in the test phase forever. It will soon become a stable file system. At that time, ext4 will become the best choice for all users like ext3, but several issues need to be noted. First, ext4 still has some unique bugs. Therefore, pay more attention to the first release of the ext4 stable version. Second, using ext4 may cause some earlier tools to be unable to access the disk. This involves the emergency recovery tool, so do not update it before confirming that the tool you are using supports ext4. On the other hand, you should be able to smoothly migrate from ext3 to ext4. If you need to save the existing data, this will achieve easy transfer.

[1] [2] [3] Next page

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.