Chapter 9. The Linux filesystem

Table of Contents
9.1. Comparison of a Few File Systems
9.1.1. Different Usable File Systems
9.1.2. Differences Between those File Systems
9.1.3. And Performance Wise?
9.2. Everything is a File
9.2.1. The Different File Types
9.2.2. Inodes
9.3. Links
9.4. "Anonymous" Pipes and Named Pipes
9.5. "Special" Files: Character Mode and Block Mode Files
9.6. Symbolic Links, Limitation of "Hard" Links
9.7. File Attributes

Naturally, your GNU/Linux system is contained on your hard disk within a file system. Here we present different aspects related to file systems, as well as the possibilities they offer.

9.1. Comparison of a Few File Systems

During the installation, you can choose different file systems for your partitions. This means you can format your partitions according to different algorithms.

Unless you are a specialist, choosing a file system is not obvious. We propose a rapid presentation of three of the most current file systems, which are all available under Mandrake Linux.

9.1.1. Different Usable File Systems

9.1.1.1. Ext2FS

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). The "new" file system corrected certain problems and limitations.

Ext2FS respects the usual standards for Unix-type file systems. Since its conception, it was destined to evolve, while still offering a great robustness and good performances.

9.1.1.2. Ext3

Like its name suggests, the Third Extended File System is Ext2FS' successor. It is compatible with the latter but it is enhanced by a very interesting feature: journaling.

One of the major flaws of "traditional" file systems like Ext2FS is their low tolerance to abrupt system breakdowns (power failure or crashing software). Generally speaking, such events involve a very long exam of the file system's structure, attempts to correct errors, sometimes resulting in an extended corruption. Hence, a partial or total lost of saved data.

Journaling answers this problem. To simplify, let's say that the object is to save actions (such as the saving of a file) before really doing it. We could compare its functioning to the one of a boat captain whom notes in his log book daily events. The result: an always coherent file system. And if problems occur, the verification is very rapid and the eventual repairs, very limited.

Hence, Ext3FS offers the journal file system technology, while keeping Ext2FS' structure - ensuring an excellent compatibility.

9.1.1.3. ReiserFS

Unlike to Ext3FS, ReiserFS is created from scratch. It is journalized like Ext3FS, but its internal structure is radically different. Specifically, it uses binary-tree concepts inspired by database software.

9.1.1.4. JFS

JFS is the journalized file system designed and used by IBM. Proprietary and closed at first, IBM recently decided to open the access to free software movement. Its internal structure is near to ReiserFS' one.

9.1.2. Differences Between those File Systems

Table 9-1. File System Characteristics

 Ext2FSExt3FSReiserFSJFS
File System Maximal Size4Tb ("Tb" stands for terabyte[a])4Tb16Tb32Pb
Block Size1Kb to 4Kb1Kb to 4Kb4Kb (up to 64Kb)512 Bytes to 4Kb
File Maximal Size2Gb2Gb4Gb512Tb to 4Pb
StabilityExcellentGoodGoodMedium
Tools to recuperate erased filesYes (complex)Yes (complex)NoNo
Reboot time after crashLong, even very longFastVery fastVery fast
Sum of the data in case of a crashGenerally speaking, good, but high risk of partial or total data lossN/AVery good. Complete data loss is very rareVery good
Notes:
a. One terabyte = 1,024 gigabytes

9.1.3. And Performance Wise?

It is always very delicate to compare performances. Every tests have their limitations and the results must be interpreted with caution. Nowadays, Ext2FS is very mature but its development is scarce; on the other hand, journal file systems like Ext3FS and ReiserFS evolve very rapidly. Tests 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. However JFS is currently the one showing best performances.

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 Ext2FS. For a server, a journalized file system Ext3FS is preferred. ReiserFS, perhaps because of its genesis, is more suited to a database server. JFS is itself preferred in cases were file system throughput is the main issue.

For a "normal" use, the four file systems give approximately the same results. ReiserFS allows to access small files rapidly, but it is fairly slow to manipulate large files (many megabytes). In most cases, the advantages brought by ReiserFS' journaling capabilities render its inconvenients to be of minimal importance.


Tux on Star from MandrakeSoft Linux is a registered trademark of Linus Torvalds. All other trademarks and copyrights are the property of their respective owners.
Unless otherwise stated, all the content of these pages and all images are Copyright MandrakeSoft S.A. and MandrakeSoft Inc. 2001.
http://www.mandrakelinux.com/