1. Comparing a Few File Systems

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 file system is not obvious. We will take a quick look at a few current file systems, all of which are available with Mandriva Linux.

1.1. Different Usable File Systems

1.1.1. Ext2

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

ext2 respects the usual standards for UNIX®-type file systems. Since its inception, it was destined to evolve while still offering great robustness and good performance.

[Note]Note

Caution: It needs to be unmounted to be resized.

1.1.2. Ext3

As 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” file systems like ext2 is their low tolerance to abrupt system breakdowns (power failure or crashing software). Generally speaking, once the system is restarted, these types of events involve a very long examination of the file system's structure and attempts to correct errors, which sometimes results 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 are doing is storing the actions (such as the saving of a file) before really performing them. 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 file system. And if problems occur, the verification is very rapid and the eventual repairs, very limited. Therefore the time spent in verifying a file system is proportional to its actual use and not related to its size.

So ext3 offers journaling file system technology while keeping ext2's structure, ensuring excellent compatibility. This makes it very easy to switch from ext2 to ext3 and back again.

[Note]Note

As with ext2, it needs to be unmounted to be resized.

1.1.3. ReiserFS

Unlike ext3, reiserfs was written from scratch. It is a journalized file system like ext3, but its internal structure is radically different because it uses binary-tree concepts inspired by database software and also has a variable block size, making it optimal for use with several (thousands or hundreds of thousands of) small files. It also performs well with big files, making it suitable for various uses.

[Note]Note

It can be resized “on the fly”, without unmounting the file system.

1.1.4. JFS

JFS is the journalized file system designed and used by IBM. Proprietary and closed at first, IBM decided to open it to access to the free software movement. Its internal structure is similar to that of reiserfs.

[Warning]Warning

It can not be resized on GNU/Linux.

1.1.5. XFS

XFS is the journalized file system designed by SGI and also used with the 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, such as support for real-time bandwidth, extents, and clustered file systems (but not in the free version).

[Warning]Warning

With GNU/Linux it can be resized for a bigger size only. You can't reduce it. Resizing can only be made with a mounted filesystem.

1.2. Differences Between File Systems

Table 4.1. File System Characteristics

 Ext2Ext3ReiserFSJFSXFS
StabilityExcellentVery GoodGoodMediumGood
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 goodMedium[a]Very goodVery good
ACL supportYesYesNoNoYes

[a] It is possible to improve results on crash recovery by journaling the data and not just the metadata, adding the option data=journal to /etc/fstab.

The maximum size of a file depends on many parameters (i.e. the block size for ext2/ext3), and is likely to evolve depending on the kernel version and architecture.

In kernel 2.6.X the block device limit can be extended using a kernel compiled with Large Block Device support enabled (CONFIG_LBD=y). For more information, consult Adding Support for Arbitrary File Sizes to the Single UNIX Specification, Large File Support in Linux, and Large Block Devices. With this and a file system which supports it you can reach up to many TB without special file-system tricks as is done by JFS for the file-system size.

1.3. And Performance Wise?

It is always very difficult to compare performance between file systems. All tests have their limitations and the results must be interpreted with caution, comparisons done a couple of months or weeks ago are already too old. Let's not forget that today's hardware (specially concerning hard drive capacities and hard disk controller performance) has greatly leveraged the differences between the different file systems.

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 file system such as ext3 is preferred. reiserfs, perhaps because of its genesis, is more suited to a database server. JFS is preferred in cases were file system throughput is the main issue. XFS is interesting if you need any of its advanced features. For “normal” use, these four file systems give approximately the same results and all of them have different options to tune the file system for a particular use. Please refer to the file system's documentation for more information.