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
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.
-
Kodi 21.0 Open-Source Entertainment Hub Released
After a year of development, the award-winning Kodi cross-platform, media center software is now available with many new additions and improvements.
-
Linux Usage Increases in Two Key Areas
If market share is your thing, you'll be happy to know that Linux is on the rise in two areas that, if they keep climbing, could have serious meaning for Linux's future.
-
Vulnerability Discovered in xz Libraries
An urgent alert for Fedora 40 has been posted and users should pay attention.
-
Canonical Bumps LTS Support to 12 years
If you're worried that your Ubuntu LTS release won't be supported long enough to last, Canonical has a surprise for you in the form of 12 years of security coverage.
-
Fedora 40 Beta Released Soon
With the official release of Fedora 40 coming in April, it's almost time to download the beta and see what's new.
-
New Pentesting Distribution to Compete with Kali Linux
SnoopGod is now available for your testing needs
-
Juno Computers Launches Another Linux Laptop
If you're looking for a powerhouse laptop that runs Ubuntu, the Juno Computers Neptune 17 v6 should be on your radar.