| Summary Creating Partitions File Systems Mounting File System Files /etc/fstab |
Major FileSystem in Linux
ext2
The ext2 filesystem is the default filesystem for Linux. It supports partitions of up to 4 Terabytes in size (1 Terabyte is 1024 Gigabytes), while a single file can be up to 2 Gigabytes. However many kernels only support block devices up to 2TB, so the practical limit is 2TB. Filenames can be up to 255 characters long. In the case of a power outage or a similar situation in which the system is switched off without a proper shutdown, the disks can be left in an "unclean" state, where some data is only partly written or where data has been written without the directory entry being updated. In that situation, Linux performs a filesystem check. The ext2 filesystem has a tried and tested filesystem checker, e2fsck. In order to ensure that everything is well, the system also runs this program once every so many boot-ups, even when correctly shut down. The ext2 filesystem also offers the possibility of undeleting files which were deleted by mistake. This is unrelated to the "Move to Trash" method of deletion which is common with many graphical environments like KDE. In the latter case, the files are not really deleted but moved to a special folder, from which they are deleted after a set limit is reached. However with ext2, even when a file is actually deleted, it is possible to restore it unless it has been overwritten. The ext2 filesystem also allows "secure deletion", which ensures that a confidential file cannot be undeleted. Special attributes allow files to be marked as unmodifiable, or append-only.
ext3
Ext3 is the descendant of ext2, as its name implies. In fact, it is essentially ext2 with added support for journaling. Ext3 has a significant advantage over the other options described below:
- It is backwards compatible. Ext2 partitions can be converted to ext3 and vice-versa without reformatting the partition.
- An Ext3 partition can be mounted by an older kernel with no ext3 support - it is just seen as a normal ext2 partition.
- Ext3 partitions, like ext2, allow files to be undeleted.
ReiserFS, developed by Hans Reiser and other developers, is quite stable and is very fast, depending on a balanced tree structure instead of the traditional blocks. It was the first journaling filesystem available for Linux, and people who have been using it for a long time seem very satisfied with its reliability and performance.
ReiserFS has been available as a kernel patch for 2.2.x SUSE kernels since SUSE LINUX version 6.4. ReiserFS was designed by Hans Reiser and the Namesys development team. ReiserFS has proven to be a powerful alternative to the old Ext2. Its key assets are better disk space utilization, better disk access performance, and faster crash recovery. However, there is a minor drawback: ReiserFS pays great care to metadata but not to the data itself. Future generations of ReiserFS will include data journaling (both metadata and actual data are written to the journal) as well as ordered writes.ReiserFS's strengths, in more detail, are:
- Better Disk Space Utilization
In ReiserFS, all data is organized in a structure called B*-balanced tree. The tree structure contributes to better disk space utilization as small files can be stored directly in the B* tree leaf nodes instead of being stored elsewhere and just maintaining a pointer to the actual disk location. In addition to that, storage is not allocated in chunks of 1 or 4 kB, but in portions of the exact size needed. Another benefit lies in the dynamic allocation of inodes. This keeps the file system more flexible than traditional file systems, like Ext2, where the inode density must be specified at file system creation time.
- Better Disk Access Performance
For small files, you will often find that both file data and “stat_data” (inode) information are stored next to each other. They can be read with a single disk I/O operation, meaning that only one access to disk is required to retrieve all the information needed.
- Fast Crash Recovery
Using a journal to keep track of recent metadata changes makes a file system check a matter of seconds, even for huge file systems.
SGI (Silicon Graphics) developed XFS for its own IRIX servers, and later made it open-source. XFS is a 64-bit filesystem, so its size "limitations" are measured in millions of Terabytes - no problems there for the foreseeable future (not that the 4 terabyte limit of ext2 is going to weigh heavy on the mind of most home users). XFS was designed with big filesystems and high performance in mind (think computer graphics animation). The data is arranged in B+ trees (somewhat similar to ReiserFS).
Another interesting feature is that it allows the storage of arbitrary data to each file. This allows it to store advanced security attributes (ACLs), or possibly other useful information such as icons, etc.
JFSOne of the most recent additions to Linux's journaling filesystem is IBM's JFS - a filesystem developed for its high-end servers.
SwapThe Linux swap partition is something you generally create once and then forget about. This is an amount of disk space in which Linux temporarily writes data from RAM to free up memory for other processes. The swap partition is different from all others in that it is not used to store files in, so it won't be dealt with in any further detail here.