Linux supports a number of different file systems. A file system–internal data structure that assures all the data on disk is properly organized and accessible. Almost every file system has its own structure of metadata, which is partly why the file systems show different performance characteristics. Inodes contain various information about a file, including size, number of links, date and time of creation, modification, and access, and pointers to the disk blocks where the file contents are actually stored.
Journal : In the context of a file system, a journal is an on-disk structure containing a kind of log in which the file system stores what it is about to change in the file system’s metadata. Journaling greatly reduces the recovery time of a Linux system because it obsoletes the lengthy search process that checks the entire file system at system start-up. Instead, only the journal is replayed.
Major File Systems in Linux :
It is very important to bear in mind that there may be no file system that best suits all kinds of applications. Each file system has its particular strengths and weaknesses, which must be taken into account.
Ext2 File System :
The origins of Ext2 go back to the early days of Linux history. Its predecessor, the Extended File System, was implemented in April 1992 and integrated in Linux 0.96c. The Extended File System underwent a number of modifications and, as Ext2, became the most popular Linux file system for years. With the creation of journaling file systems and their astonishingly short recovery times, Ext2 became less important.
Advantages :
1. Solidity : After a system outage occurs when the file system could not be cleanly unmounted, e2fsck starts to analyze the file system data. Metadata is brought into a consistent state and pending files or data blocks are written to a designated directory (called lost+found). In contrast to journaling file systems, e2fsck analyzes the entire file system and not just the recently modified bits of metadata. This takes significantly longer than checking the log data of a journaling file system.
2. Easy Upgradability : The code for Ext2 is the strong foundation on which Ext3 could become a highly-acclaimed next-generation file system. Its reliability and solidity were elegantly combined with the advantages of a journaling file system.
Ext3 File System :
Ext3 was designed by Stephen Tweedie. Unlike all other “next-generation” file systems, Ext3 does not follow a completely new design principle. It is based on Ext2. These two file systems are very closely related to each other. An Ext3 file system can be easily built on top of an Ext2 file system. The most important difference between Ext2 and Ext3 is that Ext3 supports journaling. A transition to Ext3 is a matter of minutes. Downgrading from Ext3 to Ext2 is as easy as the upgrade. Just perform a clean unmount of the Ext3 file system and remount it as an Ext2 file system.
Converting from Ext2 to Ext3 involves two separate steps:
1. Creating the Journal Log in as root and run tune2fs -j. This creates an Ext3 journal with the default parameters.
2. Specifying the File System Type in /etc/fstab To ensure that the Ext3 file system is recognized as such, edit the file /etc/fstab, changing the file system type specified for the corresponding partition from ext2 to ext3. The change takes effect after the next reboot.
3. Using ext3 for the Root Directory To boot a root file system set up as an ext3 partition, include the modules ext3 and jbd in the initrd. To do so, edit the file /etc/sysconfig/kernel to include the two modules under INITRD_MODULES then execute the command mk_initrd.
JFS :
JFS, the Journaling File System was developed by IBM. JFS is tailored to suit the needs of high throughput server environments where performance is the ultimate goal. Being a full 64-bit file system, JFS supports both large files and partitions, which is another reason for its use in server environments. JFS follows a “metadataonly” approach like ReiserFS. Instead of an extensive check, only metadata changes generated by recent file system activity are checked, which saves a great amount of time in recovery.
JFS holds two different directory organizations. For small directories, it allows the directory’s content to be stored directly into its inode. For larger directories, it uses B+ trees, which greatly facilitate directory management. For Ext2, you must define the inode density in advance (the space occupied by management information), which restricts the maximum number of files or directories of your file system. JFS spares these considerations — it dynamically allocates inode space and frees it when it is no longer needed.