LINFO

The Third Extended Filesystem



Ext3 (the third extended filesystem) is the most commonly used filesystem on Linux. It is basically an extension of ext2 to which a journaling capability has been added.

A filesystem is a way of organizing data on a computer system. On Linux and other Unix-like operating systems, the most obvious part of the main filesystem is the hierarchy of directories that starts with the root directory (designated by a forward slash), which contains a series of subdirectories, each of which, in turn, may contain further subdirectories, etc.

Ext2 is the most basic and the most portable of the native Linux filesystems. A native Linux filesystem is one that was developed specifically for Linux, or a foreign filesystem (i..e., one that was first developed for some other operating system) that was rewritten so that it would have functions and performance on Linux comparable or superior to those of original Linux filesystems. Ext2 is the most portable of the native Linux operating systems because it is easiest to transfer data to and from other filesystems.

Ext2 was developed as an improved version of the extended file system, commonly referred to as ext, Linux's first native filesystem, and was incorporated into the kernel (i.e., core of the operating system) from January 1993. It remained the standard filesystem on Linux for a number of years, and it is still in widespread use.

A journaling filesystem is a filesystem that maintains a special file called a journal that is used to repair any inconsistencies in the filesystem that occur as the result of an unclean shutdown of a computer and thus always maintains an internal consistency. Such shutdowns are usually due to an interruption of the power supply or to a software crash that cannot be resolved without rebooting.

During rebooting from an unclean shutdown with an ext2 filesystem, it is necessary for the e2fsck program to run a consistency check and repair any inconsistencies before the filesystem can be mounted (i.e., logically attached to the system) and the booting can be completed. The wait can be very long, possibly several hours in the case of filesystems with hundreds of gigabytes. Ext3, in contrast, usually does not require any checking of the filesystem during rebooting after an improper shutdown because of its guaranteed internal consistency.

Ext3 can also do a substantially better job of protecting data integrity than can ext2 in the event of an unclean system shutdown. In fact, it offers a choice of how carefully to protect data: (1) ensuring that data is consistent with the state of the filesystem (which eliminates corrupted data from appearing in files that were rewritten after an unclean shutdown) or (2) keeping the filesystem consistent but allowing for damage to data (which can result in slightly increased speed in some situations). The former is the default.

In addition, ext3 is often faster than ext2, despite the fact that it writes some data more than once. This is because its journaling optimizes hard disk drive (HDD) head motion. There is also a choice of three journaling modes that provide trade-offs between optimizing speed and maximizing data integrity.

Further contributing to ext3's high degree of reliability is the extremely high degree of reliability of the underlying ext2 technology. An additional feature is the ability for ext2 partitions (i.e., logically independent sections of HDDs) to be easily converted to ext3 and vice-versa and without any need for backing up of data and repartitioning. Moreover, because ext3 has the same HDD formating as ext2, it can, if needed, likewise utilize the extensively tested and highly reliable e2fsck program to check filesystem consistency and repair any errors.

Ext3 was originally written by Dr Stephen C. Tweedie for the 2.2 kernel. It was added to the kernel beginning with version 2.4.15, which was released in November 2001, and it has remained the default filesystem on Red Hat and some other distributions despite the development of other native Linux journaling filesystems (the most popular of which is reiserfs). The lack of a journaling filesystem had often been cited as a major factor holding back the widespread use of Linux at the enterprise level.





Created January 22, 2007.
Copyright © 2007 The Linux Information Project. All Rights Reserved.