The ext filesystem – a four-generation retrospective
Journaling
Over time, more filesystems have been added to the Linux kernel, and ReiserFS, JFS, and XFS were superior to ext2 in at least one way: Thanks to journaling, an fsck
was much faster than in ext2. With ever-increasing volumes, filesystem checking contributes significantly to the time the operating system is occupied. In 1998, Tweedie published a design study with initial implementation approaches for ext2 with a journaling function [9].
During the discussion on write performance problems with large files [10], the developer reported on the kernel mailing list that he was working on this extension of the filesystem [11]. The management of many files in a directory was tricky for ext2. The developers addressed this with the introduction of H-tree, a special form of the B-tree.
With the introduction of journaling, the H-tree for large directories, and the ability to enlarge ext FS online, ext3 was born. Since version 2.4.15 (November 2001), it has been available as a Linux kernel extension [12]. The highlight here is that a conversion of ext2 to its successor was (and still is) possible without the inconvenience of shifting data around.
The filesystem developers kept their word. More than that, a way back was even possible. Simply run the fsck.ext2
command against an ext3 partition, and you could mount it again as a normal ext2 FS in the directory tree. For a more elegant approach, you have the tune2fs
tool (Listing 1).
Listing 1
From ext2 to ext3 and Back
# mkfs.ext2 /dev/sdb1 mke2fs 1.42.7 (21-Jan-2013) Filesystem label = OS Type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) [...] Writing inode tables: done Writing superblocks and filesystem accounting information: done # mount /dev/sdb1 /tmp/mnt/ # grep mnt /proc/mounts /dev/sdb1 /tmp/mnt ext2 rw,relatime 0 0 # umount /tmp/mnt/ # tune2fs -j /dev/sdb1 tune2fs 1.42.7 (21-Jan-2013) Creating journal inode: done # mount /dev/sdb1 /tmp/mnt/ # grep mnt /proc/mounts /dev/sdb1 /tmp/mnt ext3 rw,relatime,data=ordered 0 0 # umount /tmp/mnt/ # tune2fs -O ^has_journal,^dir_index /dev/sdb1 tune2fs 1.42.7 (21-Jan-2013) # mount /dev/sdb1 /tmp/mnt/ # grep mnt /proc/mounts /dev/sdb1 /tmp/mnt ext2 rw,relatime 0 0
Going Back
Converting an ext3 partition back to ext2 appears useful when performance is more important than filesystem integrity. A journal requires more writes to the disk than in ext2, and unfortunately, it cannot be switched off separately. As Listing 1 shows, the conversion is fairly painless and not a one-way street.
History, however, has repeated itself: As size and performance requirements of the managed media grew, ext3 began to reach its limits, so ext4 was created from a kind of patched ext3 [13]. First characterized as experimental, the filesystem has been tagged as production since kernel version 2.6.28 (October 2008).
Continuity
Continuity was also evident on the developer front. Ts'o, already involved in the grandfather of ext4 and the maintainer of ext3, also took the youngest representative of the ext FS family under his wing. Most importantly: you can convert an existing ext3 without data loss or migration.
Unfortunately, some new features of ext4 require a change in the on-disk format. If you do without them, again the conversion is not a one-way operation, and again the tune2fs
tool provides valuable service.
The light version of the tool allows the user to mount an ext3 partition with the ext4 driver (Figure 3).
The relationships within the ext FS family are transitive – the compatibility of ext2 with ext3 and ext3 with ext4 results in some compatibility between ext2 and ext4. Table 2 shows which kernel driver can handle which filesystem, without requiring the user to manipulate the data on the disk.
Table 2
Driver Compatibility
Filesystem | ext2 | ext3 | ext4 |
---|---|---|---|
ext2 |
Yes |
Yes |
Yes |
ext3 |
No |
Yes |
Yes |
ext4 (with ext3 on-disk format) |
No |
Yes |
Yes |
ext4 |
No |
No |
Yes |
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
Gnome OS Adopting systemd-sysupdate
Gnome OS is about to undergo a major under-the-hood change that promises enhanced security.
-
Endless OS 6 has Arrived
After more than a year since the last update, the latest release of Endless OS is now available for general usage.
-
Fedora Asahi 40 Remix Available for Macs with Apple Silicon
If you've been anticipating KDE's Plasma 6 for your Apple Silicon-powered Mac, then you're in luck.
-
Red Hat Adds New Deployment Option for Enterprise Linux Platforms
Red Hat has re-imagined enterprise Linux for an AI future with Image Mode.
-
OSJH and LPI Release 2024 Open Source Pros Job Survey Results
See what open source professionals look for in a new role.
-
Proton 9.0-1 Released to Improve Gaming with Steam
The latest release of Proton 9 adds several improvements and fixes an issue that has been problematic for Linux users.
-
So Long Neofetch and Thanks for the Info
Today is a day that every Linux user who enjoys bragging about their system(s) will mourn, as Neofetch has come to an end.
-
Ubuntu 24.04 Comes with a “Flaw"
If you're thinking you might want to upgrade from your current Ubuntu release to the latest, there's something you might want to consider before doing so.
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.