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 Mandrakelinux.
The Second Extended File System (its abbreviated form is ext2 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 correcting 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.
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 sorts of events involve a very long examination of the file system'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 are 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 file system. And if problems occur, the verification is very rapid and the eventual repairs, very limited. The time spent in verifying a file system is thus proportional to its actual use and not related to its size.
So, ext3 offers journal 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.
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.
JFS is the journalized file system 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 similar to that of reiserfs.
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).
Table 9.1. File System Characteristics
Ext2 | Ext3 | ReiserFS | JFS | XFS | |
---|---|---|---|---|---|
Stability | Excellent | Good | Good | Medium | Good |
Tools to restore erased files | Yes (complex) | Yes (complex) | No | No | No |
Reboot time after crash | Long, even very long | Fast | Very fast | Very fast | Very fast |
Status of the data in case of a crash | Generally speaking, good, but high risk of partial or total data loss | Very good | Medium[a] | Very good | Very good |
ACL support | Yes | Yes | No | No | Yes |
[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 (e.g. the block size for ext2/ext3), and is likely to evolve depending on the kernel version and architecture. According to the file system 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. In kernel 2.6.X this block device limit could 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.
It is always very difficult to compare performance between file systems. 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[21]. On 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 also finishing with a very clean code base. Comparisons done a couple of months or weeks ago are already too old. Let us 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 large streaming files.
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 like 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, the four file systems 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 at normal speed.
[20] You may wonder how to achieve such capacities with hard drives that barely store 320-400GB. Using for instance one RAID card with 8 * 250GB drives in RAID-striping, you can achieve 2TB of storage. Combining the storage of several RAID cards using Linux software RAID, or using LVM (Logical Volume Manager) it should be possible to go even beyond (block size permitting) the 2TB limit.
[21] At the time of writing, reiserfs4 was not included in kernel 2.6.X