Comparison of a Few Filesystems

During installation, you can choose different file systems for your partitions, so they will be formatted using different algorithms.

Unless you are a specialist, choosing a filesystem is not obvious. We'll quickly take a look at a few current file systems, all of which are all available under Mandrake Linux.

Different Usable Filesystems

Ext2

The Second Extended Filesystem (its abbreviated form is Ext2 or simply ext2) has been GNU/Linux's default filesystem for many years. It replaced the Extended File System (that's where the “Second” comes from). The “new” filesystem corrected certain problems and limitations of its predecessor.

Ext2 respects the usual standards for Unix-type filesystems. Since its inception, it was destined to evolve while still offering great robustness and good performance.

Ext3

Like its name suggests, the Third Extended File System is Ext2's successor. It is compatible with the latter but enhanced by incorporating journaling.

One of the major flaws of “traditional” filesystems like Ext2 is their low tolerance to abrupt system breakdowns (power failure or crashing software). Generally speaking, once the system is restarted, these sorts of events involve a very long examination of the filesystem's structure and attempts to correct errors, which sometimes result in an extended corruption. This corruption could cause partial or total loss of saved data.

Journaling answers this problem. To simplify, let's say that what we're doing is storing the actions (such as the saving of a file) before really doing it. We could compare this functionality to that of a boat captain who uses a log book to note daily events. The result: an always coherent filesystem. And if problems occur, the verification is very rapid and the eventual repairs, very limited. The time spent in verifying a filesystem is thus proportional to its actual use and not related to its size.

So, Ext3 offers journal filesystem technology while keeping Ext2's structure, ensuring excellent compatibility. This makes it very easy to switch from Ext2 to Ext3 and back again.

ReiserFS

Unlike Ext3, ReiserFS was written from scratch. It is a journalized filesystem like Ext3, but its internal structure is radically different because it uses binary-tree concepts inspired by database software.

JFS

JFS is the journalized filesystem designed and used by IBM. Proprietary and closed at first, IBM decided to open it to access by the free software movement. Its internal structure is close to that of ReiserFS'.

XFS

XFS is the journalized filesystem designed by SGI and used in ins IRIX operating system. Proprietary and closed at first, SGI decided to open it to access by the free software movement. Its internal structure has lots of different features, like support for real-time bandwidth, extents, and clustered filesystems (but not in the free version).

Differences Between the Filesystems

Table 9.1. Filesystem Characteristics

 Ext2Ext3ReiserFSJFSXFS
StabilityExcellentGoodGoodMediumGood
Tools to restore erased filesYes (complex)Yes (complex)NoNoNo
Reboot time after crashLong, even very longFastVery fastVery fastVery fast
Status of the data in case of a crashGenerally speaking, good, but high risk of partial or total data lossVery goodVery good. Complete data loss is very rareVery goodVery good
ACL supportYesYesNoNoYes

The maximum size of a file depends on a lot of parameters (e.g. the block size for ext2/ext3), and is likely to evolve depending on the kernel version and architecture. According to the filesystem limits, the current maximum size is currently near or greater than 2 TeraBytes (TB, 1 TB=1024 GB) and for JFS can go up to 4 PetaBytes (PB, 1 Pb=1024 TB). Unfortunately, these values are also limited to maximum block device size, which in the current 2.4.X kernel is limited (for X86 arch only) to 2TB[20] even in RAID mode. For more information, consult Adding Support for Arbitrary File Sizes to the Single UNIX Specification.

And Performance Wise?

It is always very difficult to compare performance between filesystems. All tests have their limitations and the results must be interpreted with caution. Nowadays, Ext2 is very mature but its development is slow; Ext3 and ReiserFS are quite mature at this point. New features for ReiserFS are included in ReiserFS4, that is being tested on 2.6. In the other hand XFS has a lot of features, and as time passes more of the advanced features work better on linux. JFS took a different approach here, and they are integrating on linux feature by feature. This makes the process slower, but they are finishing also with a very clean code base. Comparisons done a couple of months or weeks ago are already too old. Let's not forget that today's material (specially concerning hard drive capacities) has greatly leveraged the differences between them. XFS has the advantage that just now it is the better performer with small files (less than 4KB).

Each system offers advantages and disadvantages. In fact, it all depends on how you use your machine. A simple desktop machine will be happy with Ext2. For a server, a journalized filesystem like Ext3 is preferred. ReiserFS, perhaps because of its genesis, is more suited to a database server. JFS is preferred in cases were filesystem throughput is the main issue. XFS is interesting if you need any of its advanced features.

For “normal” use, the four filesystems give approximately the same results. ReiserFS allows you to access small files rapidly, but it is fairly slow in manipulating large files (many megabytes). In most cases, the advantages brought by ReiserFS' journaling capabilities outweigh its drawbacks. Notice that by default ReiserFS is mounted with the notail option. That means that there is no optimization for small files and that big files run a normal speed.



[20] You may wonder how to achieve such capacities with hard drives that barely store 180GB. Using three RAID cards each hosting 8*128Gb drives, you can get 3TB.