1, with superuser privileges landing Linux, enter /lib/modules/2.6.32–504.el6.x86_64/kernel/fs directory ls command (different Linux distributions Fs directory you can find some different FS folder The way to find it). As shown below:
Here we are at the development of the advantages and disadvantages of the most common file system for a few details: ext, ext2, ext3, jsf,, xfs, ReiserFS
2, ext is the first designed specifically for the type of file system Linux, called the extended file system. In April 1992 it completed. It has achieved an important role in the development of Linux. But there are many flaws in the performance and compatibility. Now rarely used.
ext2 is scalable, high-performance file system to resolve deficiencies ext file system design. Also known as two extended file system. It was released in 1993, designed by Rey Card. ext2 Linux file system type is the most used format. And more prominent in terms of speed and CPU utilization is GNU / Linux system, standard file system, which is characterized by excellent performance access to documents, for small and medium sized files also show the advantages, mainly its cluster of fast profit Take good design layer. Ext2 can support up to 256 bytes long file name, file size and file its single system itself maximum capacity of the file system itself is the size of the cluster, in general common Intel x86-compatible processor system, a cluster of up to 4KB, then single file size limit of 2048GB, and the size limit of the file system is 6384GB. Although Linux can support a wide variety of file systems, but by the year 2000 almost all Linux distributions are used as the default file system ext2.
ext2 drawback: ext2 designer main consideration is the problem of file system performance. ext2 while writing the file contents and not also written to the file meta-data (and document information, such as: permissions, ownership, and create and access time). In other words, Linux to write the contents of the file, and then wait until the free meta- data when it is written to the file. After writing to a file so that if there is content, but before the meta-data written to the file system suddenly loses power, it could result in the file system will be in an inconsistent state. In a large number of file system operations that happens can cause very serious consequences. Moreover However, as a single partition core 2.4 can be used by only the largest 2048GB, although the file system size limit for 6384G but the file system capacity can actually be used up to only 2048GB.
ext3 is the open source community development of the log file system, the main developer is Stephen tweedie. ext3 is designed to be an upgraded version of ext2 and as easy as possible to migrate users from ext2fs to ext3fs. ext2 ext3 on the basis of adding metadata logging record, trying to keep the forward and backward compatibility. The file system is called the next version of ext2. That is, under the current ownership ext2 format plus logging. ext3 is a journaling file system. Superiority journaled file system is: Because the file system cache layer has involved in the operation, the file system must be removed when not in use, such as for the write-back data cache layer disk. Therefore, whenever the system is to be shut down, it must be all of its file system to be shut down after all to remove. If not unloaded before the file system to shut down (such as power outages), the next time will cause the file system after the reboot inconsistent information, it then must be re-engineering the file system will be inconsistent with the wrong place repair. However, this restructuring work is quite time-consuming, especially large capacity file systems, and can not absolutely guarantee that all of the information will not be lost. Therefore, it may cause problems in large servers.
ext3 drawback: its biggest drawback is that no modern file system has to improve file data processing speed and decompression of high-performance, pay attention to the hard disk quota problems additional use ext3 file system until this issue is resolved, do not recommend important use ext3 + disk quota (disk quota) on enterprise applications.
Ext3 Ext4 is the evolution version of the latter is the Linux operating system is the most common file system. Ext3 Ext4 done in many ways to improve, this change is much more than Ext3 to Ext2 make changes. The difference between Ext3 and Ext2 into restricted logging system, but Ext4 modifies the most important data structure of the file system, such as file data storage. Thus changing the design, enhanced performance, stability and features.
ext2 / ext3 and ext4 compare:
5.1 Large file system and large file size
Ext2 / Ext3:
File system size calculation method 2 ^ 32 * block_size, if block_size 4096, then the file system size cap is 16TB;
The maximum file size by three limitations:
The 1.ext2_inode i_size:
At first glance i_size only 32bits, so the maximum file size can not exceed 2 ^ 32, or actual, Ext2 / Ext3 uses a dirty method, borrowed and i_size adjacent i_dir_acl, it can be extended to be represented by 64bits file size, So this can not be the limit.
2. Indirect addressing space is three blocks:
Assuming that the block size is 4096, then three indirect blocks may represent 1024 * 1024 * 1024 * 4096 = 4T
3. The maximum file size can not exceed (2 ^ 32 -1) * 512 = 2T, that is, the file size can not exceed the number that can be represented sectors 32bits.
Therefore Ext2 / Ext3 file systems, the maximum file size is 2TB. As follows:
Ext2 / Ext3 Ext4
File system size 16TB 1EB
Maximum File Size 2TB 16TB
5.2 The maximum file number (see table below) subdirectory
Ext2 / Ext3 Ext4
The maximum number of subdirectories 3200065000
Ext2 / Ext3 file system to manage files using indirect data mapping logical addresses to physical block mapping indirect indirect map is divided into primary, secondary and tertiary indirect indirect file in front of a small portion of data using direct mapping. So for small files, this way is very simple and efficient management. But for large files, especially large files to delete and truncate operations, because for each mapping between block processing is deleted, so for very large files, it takes a very long time. Also large files require third order mapping, that is the logical block access files, you need to find access to four physical blocks.
Modern file systems have introduced the concept of “extents”, and this concept is entirely for the management of large files of data into one extent a set of contiguous physical blocks. Using only one set of logical extent manage a block of addresses to physical block mapping, without having to establish a mapping for each pair. Consider a 100MB file, ideally, we only need to record the mapping between an extent, but if you use indirect maps Ext2 / Ext3, you need to establish the mapping between 25,000 blocks.
Because extents in favor of contiguous disk allocation, so extents will reduce fragmentation and improve file system performance.
Over 5.4 block allocation
When Ext3 needs to write data to a file on disk, block allocator decide which free block to write data. But the Ext3 block allocator can only allocate a block of 4KB. This means that for 100MB size file, you need to call the 25000 block allocator. Inefficient, not only because of the 25000 block allocator calls, but also makes the block allocator can not optimize the allocation policy, because the block allocator 25000 can not be associated with these assignments.
Ext4 uses a multiblock allocator (mballoc), so a lot of block allocation possible. To avoid a number assigned to optimize the allocation strategy to improve the performance, multi-block allocator is particularly useful for delayed allocation and extents. This feature does not affect the disk layout.
Moreover, Ext4 block / inode allocator has other improvements, details see http://ols.fedoraproject.org/OLS/Reprints-2008/kumar-reprint.pdf
5.5 Delayed allocation
Delayed allocation is a performance-optimization techniques, several file systems are used in delayed allocation techniques, such as XFS, ZFS, btrfs and Resier 4. And Ext2 / Ext3 block allocation compared to a traditional file system, delayed allocation of blocks allocated to delay as much as possible.
The disadvantages of the traditional immediate allocation methods: for example, call for a write, the file system code data block storage location allocated immediately, even data is also stored in the cache write back situation some time before the disk. When a process continuing to write data into the file, then the next will be allocated each write physical block data, do not know the file is being sustained growth.
The delay distribution, when you call a write operation, if the data is only written to the cache, and does not allocate the block immediately, but wait until it actually writes to disk for distribution. This allows the opportunity to optimize the distributor block, the allocated block combination. Extents and delayed allocation needs with multi-block allocation with. Because in some scenes work, when a file is written to disk is allocated in accordance with extents, but this time the call is mballoc dispenser dispenser.
5.6 Fast fsck
fsck operation is very time consuming, especially fsck Step 1: Check the file system, all inode. Ext4, and in each group inode table stores an unused inode list, so fsck need to check these unused inodes. So the whole time fsck can improve 2-20 times (depending on the number of unused inode). It must be noted, is not created by fsck inode list instead of Ext4 created. You must first run fsck to create unused indes list, the next time fsck will then fast.
5.7 log checksumming
Log is the most commonly used part of the disk, thus making it easier to block this part of the hardware error occurs. Restore your system from the error logs may lead to greater error. Ext4 use check summing journal to ensure validity of the data. Also log checksumming have additional effects: it allows the two-stage submission ext3 file system into a one-phase commit, in some cases, an increase of 20% speed, reliability and speed at the same time and therefore improved.
5.8 Non-log mode
Log ensure the consistency of the file system, but also increases the load on the system. In some special cases, when data integrity is not important, it can run without Ext4 log. Ext4日志功能可以被 disable swap, which can slightly improve performance
5.9 Online Defragmentation
jsf provides byte-level file system log, the file system is designed for high-performance systems for transaction-oriented development. jsf (Journaled File System Technology for Linux) developers include AIX (IBM’s Unix) of jsf major developers. On AIX, jfs has withstood the test. It is reliable, fast and easy to use. In February 2000, ibm announced at an open source license, transplant linux version of the JSF file system. JSFs also a large number of users to install and use, enterprise-class file system. It has the scalability and robustness, compared with non-journaled file system, its advantage is its quick restart capability: Jfs within seconds or minutes can restore a file system to a consistent state. Although primarily jsf (from single processor systems to advanced multi-processor and clustered systems) high throughput and reliability requirements designed to meet the server, jsf also want high performance and reliability for the client configuration because at When the system crashes, jsf provides fast file system restart time, so it is a key technology Internet file server. Use database journaling techniques, jsf can in a few seconds or minutes to restore a file system to a consistent state. In non-journaled file systems, file recovery can take hours or days.
jsf drawback: Use jsf journaling file system, there will be some loss of performance, the ratio of system resources are also high. Because when it keeps a log, the system needs to write a lot of data.
ReiserFS’s first public appearance was in July 23, 1997, Hans Reiser on his balanced tree structure ReiserFS file system on the web. ReiserFS 3.6.x (as part of version 2.4 of Linux) are by Hans Reiser and his development team at Namesys jointly developed and designed. Hans and his team believe that the best filesystems are those that can help create a single shared environment, or namespace file system, applications can be more direct, effective and efficient interaction between them. To achieve this goal, the file system should meet user needs for performance and functionality. That way, users can continue to use the file system directly, without having to run the file system built on top of (eg type of database) special purpose layers. ReiserFS uses a specially optimized b * balanced tree (one per filesystem) to organize all file system data. This in itself offers a very good performance improvements, it is possible to reduce the artificial constraint file system design. For example, a catalog can now accommodate ext00,000 subdirectories. Another benefit of using b * tree is that ReiserFS, like most other next-generation file systems, dynamically allocates inodes as needed, without having to establish a fixed index festival when the file system is created. This helps the file system more flexible to adapt to a variety of storage needs they face, while providing additional space efficiency.
Reiserfs is seen as a more radical and modern file system. The traditional UNIX file system is based on disk space allocation blocks, for search and other directories and files using a simple linear search. The design at the time was right, but with the increase in disk capacity increases and the application requirements, the traditional file system on the storage efficiency, speed and functionality has been significantly behind. Reiserfs reiser4 in the next version also provides support for the transaction. In the [url] http://www.namesys.com/v4/v4.html [/ url] has introduced and a simple performance testing reiser4 of reiser4 of.
ReiserFS drawback: ReiserFS one of the most criticized drawback is that each upgrade version, will want to reformat the disk again. You can learn more about ReiserFS at [url] http://www.namesys.com/ [/ url] website.
is a very good xfs journaling file system, which is designed by SGI. xfs is known as the industry’s most advanced, most scalable file system technology. It is a full 64-bit, fast, robust journaling file system, for many years for SGI’s IRIX operating system. sgi decided to support the Linux community, the basic structure of a key technology licensing in Linux. It is released in open source form the xfs their own source code, and started porting. This progress very quickly, has entered the beta version stage. As a 64-bit file system, xfs can support a large number of files (9g × 1gb, even bigger 18g × 1gb), can provide significant performance in terms of large-scale data 2d and 3d. xfs file system has the ability to predict other weaknesses, xfs while providing enhanced performance, without prejudice to the reliability and fast disaster recovery. SGI’s xfs for linux and open source community has brought new features include: Scalability: xfs is designed to be upgraded in order to face most of the storage capacity and i / o storage requirements that can handle large files and contain huge a large number of files directory, twenty-first century to meet the rapidly growing demand disk. xfs has the ability to dynamically allocate space for the index file, the system is the ability to efficiently support the formation of a large number of files. In its support, users can use 1exabyte (1g × 1gb) large files, much larger than the current maximum file system. Excellent i / o performance: typical modern server using a large striped disk array to provide up to several gb / s of total bandwidth. xfs can satisfy I / O requests of size and concurrent I / O requests. xfs as root file system, and lilo support NFS server can also be used on no problem. Support Software disk arrays (RAID) and virtual cluster (LVM). SGI xfs latest 1.0.1 version (in: [url] http: // http: //oss.sgi.com/projects/xfs/ [/ url] You can download it).
xfs drawback: Because xfs more complex to implement some difficulty, we now have xfs Linux is mainly used in high-end enterprise applications.
9, other file systems Description:
Minix: Llnux support of the first file system, users have many restrictions and poor performance. Some are not time-stamped, the file name length l 4 characters. The biggest drawback is the largest minix file system can only use the 64M of hard disk partition, so now no one is using it.
Xia: version Minix file system corrected. In a certain extent, solve the limitations of the file name and file system size. But no new features, now rarely used.
Msdos: msdos is a file system on Dos, Windows, and some OS / 2 operating system, which is the name of a “8 + 3″ format, that eight-character file name plus 3-character extension .
umsdos: Linux extensions under msdos file system driver that supports long file name, owner, permitted privileges, connections, and device files. Allow an ordinary msdo s file system for Linux, but without creating a separate partition for it.
iso9660: CDROM file system standard, Universal Rock Ridge enhanced system that allows long file names.
Vfat: vfat is Windows9x and Windows NT / 2000 under a Dos file system, which adds support for long file names in the file system on the basis of Dos.
Nfs: Sun has introduced a network file system that allows multiple computers to share the same between the file system that is easy to access from all these computer files.
Hpfs: High Performance File System (HPFS) High Performance File System (HPFS) HPFS is Microsoft’s LAN Manager file system, but also IBM’s LAN Server and OS / 2 file system. HPFS can access a larger hard drive, providing more tissue properties and improved security features of the file system.
Smb: smb SMB protocol is based network operating system Windows for workgroups, Windows NT, and Lan Manager support.
Sysv: sysv file system is actually System V / Coherent on Linux file system.
Ncpfs: ncpfs is a Novell NetWare NCP protocol used by network operating system.
Proc: proc is Linux systems appear as a pseudo file system, which is used as an interface to connect the kernel data structures.
NTFS: Microsoft Windows NT family of operating system kernel support, a special for the network and disk quotas, file encryption and other security features designed to manage the disk format.