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.
News
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.
-
HashiCorp Cofounder Unveils Ghostty, a Linux Terminal App
Ghostty is a new Linux terminal app that's fast, feature-rich, and offers a platform-native GUI while remaining cross-platform.
-
Fedora Asahi Remix 41 Available for Apple Silicon
If you have an Apple Silicon Mac and you're hoping to install Fedora, you're in luck because the latest release supports the M1 and M2 chips.
-
Systemd Fixes Bug While Facing New Challenger in GNU Shepherd
The systemd developers have fixed a really nasty bug amid the release of the new GNU Shepherd init system.
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.