Exploring the ext3 Filesystem - page 5
Introduction to the ext3 Filesystem
Aside from its compatibility with ext2 filesystem utilities and the ease with which you can convert ext2 filesystems to ext3, the ext3 filesystem also offers several different types of journaling. A classic issue in journaling filesystems is whether they only log changes to filesystem metadata or log changes to all filesystem data, including changes to files themselves. The ext3 filesystem supports three different journaling modes, which you can activate in the /etc/fstab entry for an ext3 filesystem. These journaling modes are the following:
journal - logs all filesystem data and metadata changes. The slowest of the three ext3 journaling modes, this journaling mode minimizes the chance of losing the changes you have made to any file in an ext3 filesystem.
ordered - only logs changes to filesystem metadata, but flushes file data updates to disk before making changes to associated filesystem metadata. This is the default ext3 journaling mode.
writeback - only logs changes to filesystem metadata but relies on the standard filesystem write process to write file data changes to disk. This is the fastest ext3 journaling mode.
The differences between these journaling modes are both subtle and profound. Using the "journal" mode requires that an ext3 filesystem write every change to a filesystem twice - once to the journal, and then again to the filesystem itself. This can reduce the overall performance of your filesystem, but is the mode most beloved by users, because it minimizes the chances of losing changes to your files since both metatdata and data updates are recorded in the ext3 journal and can be replayed when a system reboots.
Using the "ordered" mode, only filesystem metadata changes are logged, which reduces redundancy between writing to the filesystem and to the journal and is therefore faster. Though the changes to file data are not logged, they must be done before associated filesystem metadata changes are made by the ext3 journaling daemon, which can slightly reduce the performance of your system. However, using this journaling mode guarantees that files in the filesystem will never be out of sync with any related changes to filesystem metadata.
Using the "writeback" mode is faster than the other two ext3 journaling modes because it only logs changes to filesystem metadata and does not wait for associated changes to file data to be written before updating things like file size and directory information. Because updates to file data are done asynchronously to journaled changes to filesystem metadata, files in the filesystem may exhibit metadata inconsistencies such as owning data blocks to which updated data was not yet written when the system went down. This isn't fatal, but can be disappointing to users.
Specifying the journaling mode used by an ext3 filesystem is done in the /etc/fstab entry for that filesystem. The "ordered" journaling mode is the default journaling mode by ext3 filesystems, but you can specify a different journaling mode by updating the filesystem options portion of an /etc/fstab entry. For example, an /etc/fstab entry that specifies the "writeback" journaling mode would look like the following:
/dev/hda5 /opt ext3 data=writeback 1 0
Solid state disks (SSDs) made a splash in consumer technology, and now the technology has its eyes on the enterprise storage market. Download this eBook to see what SSDs can do for your infrastructure and review the pros and cons of this potentially game-changing storage technology.
- 1Linux Top 3: GNOME 3.12 and New Betas for Ubuntu 14.04 and OpenMandriva Lx 2014.0
- 2Linux Top 3: Linus Lashes out, Linux 3.14 Gets PIE and Ubuntu One is Done.
- 3Linux Top 3: Ubuntu 14.04, Debian Gives Squeeze More Life and Red Hat Goes Atomic
- 4Linux Top 3: CoreOS, Oracle Enterprise Linux 7 and Ubuntu 14.10
- 5Linux Top 3: Debian Gives Up on Upstart, Ubuntu and Linux Kernel Updates