What Is a Journaling File System?

Featured Image Journaling File Systems

Every operating system uses its own file system to store data. Windows uses NTFS, macOS uses APFS, and most Linux distributions use Ext4. While these file systems are fundamentally different from each other, one feature that exists in all of these file systems is journaling.

Let’s learn more about journaling file systems and how they affect everyday computing.

What Is Journaling?

Imagine every file on a computer as a unique library catalog of journals, periodicals, or documents. Each new issue added to a catalog would change its information slightly. Instead of searching across the library for an entry, you only have to check the relevant catalog.

Journaling in computing file systems works very similarly. Its purpose is to keep track of changes not yet committed to the file system. Even after any crashes or unexpected shutdowns, you can still access the latest file version with a lower likelihood of it becoming corrupted.

Journaling File Systems What It Looks Like

The term “journal” comes from the analogy of a diary. Any changes you record in a diary entry are stored date- and time-wise. In a similar way, journaling allows all the updates to a file to be stored in a contiguous portion of the disk.

These updates do not have to be located physically in proximity to each other: in fact, the journal file entries are scattered all over the disk. But instead of accessing them randomly, they are available in a diary-like sequence which is thousands of times faster.

Journaling File Systems Schematic

Journaling saves much time in file storage retrieval because of contiguous memory allocations.

Definitions

Depending on the operating system, there are different kinds of journaling entries which we will discuss below. Before we do that, we need to be clear about a few numerical terms.

Tebibytes (TiB): we all know how much a gigabyte is. A tebibyte (TiB) is equal to 1024 (= 210) gigabytes. TiB is one of the default units to express large values in file storage. Also, 1 TiB = 1.09951 terabytes (TB).

Pebibyte (PiB): a pebibyte (PiB) is equal to 1024 TiB or around a million gigabytes – a very large value indeed.

Clusters: data clusters are the smallest unit of disk space which can be used to store a file. It can range from 512 bytes for a single sector to 64 KB for 128 sectors.

1. NTFS

New Technology File System (NTFS) is Microsoft’s default journaling system for Windows and Windows Server. It uses log files and checkpoint information to restore the stable values of a file system after a restart.

NTFS supports large data volumes: for a 4 KB cluster size, it can accommodate 16 TiB of data. For a 64 KB cluster size (maximum), it means 256 TiB of data with 256 TiB as maximum file size.

Nowadays, NTFS fixes any corruption in files online through what is known as “self-healing NTFS.” Windows 10 users might remember a downtime experience due to Chkdsk, which used to plague older Windows versions. In the latest self-healing NTFS update, the problem has been solved online, and no downtime occurs.

Also read: FAT32 vs. exFAT vs. NTFS: What’s the Difference?

2. Ext

Extended File System (ext) has been Linux’s journaling system since the very beginning. It was inspired by the Unix File System (UFS) and has undergone three other iterations since its arrival in the early ’90s.

  • ext2: originally used in Debian and Red Hat Linux, ext2 is still used in flash media such as SD cards and USB drives. It can accommodate 2 to 32 TiB of data with a maximum cluster size of 8 KB.
  • ext3: as the third extended file system, ext3 has been used with Linux, BSD, and ReactOS. The size limits are similar to ext2.
  • ext4: the latest version of the extended file system, it is used by Google file storage, BSD, PowerPC, and most current Linux distributions. The size limits are equal to 1024 PiB or around a million TiB. The biggest cluster size is 64 KB.

ext4 uses checksums in the journal to improve reliability, as it can safely avoid a disk I/O wait during journaling and slightly improve the performance of the disk.

3. APFS

The Apple File System (APFS) is used with macOS High Sierra, iOS 10.3 and later, and a few other systems. It supports up to 8000 PiB (263 bytes), which is approximately eight times greater than ext4.

Journaling File Systems Apfs

The core capabilities of APFS are many: they include creating “snapshots,” which is like a photocopy of the system at a particular point. Like NTFS, it uses checksums to ensure data integrity and protects from system crashes using an approach called “copy on writer.” APFS uses full disk encryption.

Conclusion

Journaling in file systems is a basic insurance against system crashes and unexpected shutdowns. By writing changes to a journal quickly, we can ensure that all changes to files are recorded and not lost during power shutdowns or computer crashes.

There are many journaled file systems apart from the ones discussed here. Oracle, VMware, BSD, Cisco, Solaris, and many others have their own proprietary journal units.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sayak Boral Avatar

Read next

When Sony shipped the first Walkman in 1979, chairman Akio Morita insisted on a second headphone jack and a “hotline” talk button, convinced it would be rude for one person to listen to music alone — and within a few years buyers had ignored the sociable features so completely that Sony quietly dropped them
Russia still custom-builds the Soyuz return seats for ISS crew members using plaster casts taken weeks before launch, because astronauts grow as much as five centimetres taller during a long-duration stay and a seat moulded to their Earth-shaped spine would no longer fit the body that comes home
The “CrackBerry” nickname stuck for a reason — and the variable-reward psychology that hooked early-2000s executives on their BlackBerrys is the exact same machinery now running every push notification on every smartphone in your pocket
In 1843, Ada Lovelace described a brass-and-punched-card engine that could act on symbols as well as numbers, even composing music if harmony could be reduced to rules, inside seven translator’s notes three times longer than the paper itself
ARPANET sent its first message on 29 October 1969 from a lab at UCLA to a machine at Stanford, and the message was supposed to read ‘LOGIN’ — but the system crashed after the L and the O, meaning the first word ever transmitted over the network that became the internet was, by accident, ‘LO’.
In 1995, Microsoft shipped a cartoon-house interface called Bob, led by Melinda French, who married Bill Gates while it was in development — it demanded twice the memory of a typical home PC, sold roughly 30,000 copies, and was dead within a year, leaving behind the font Comic Sans and the animated assistant that became Clippy.
The Greenland shark grows about one centimetre a year, does not reach sexual maturity until around age 150, and a specimen carbon-dated by Danish researchers in 2016 was estimated to be at least 272 years old, meaning it was already swimming the North Atlantic when Mozart was composing symphonies.
When Apple shipped iOS 12 in June 2018, a small feature called Screen Time slipped onto every iPhone with a counter nobody had quite prepared for — a tally of pickups — and within a day Tim Cook was telling CNN the number of times he picked up his own phone was simply too many