Nepedia
Back to Discover
Advanced Reader
💻

ext4

technology Maturity 11-13 war conflict Next article →

This article covers sensitive topics: war_conflict. Parents can manage visibility in Parental Controls.

ext4, or the fourth extended filesystem, is a journaling file system designed for Linux. A file system is the method a computer uses to organize, store, and retrieve data on a storage device. ext4 serves as a vital tool for managing how information is written to disks. It is widely used because it offers high performance and reliability. It is currently the default file system for many popular Linux distributions, such as Ubuntu and Debian.

Simplified Structure of the Linux Kernel
Simplified Structure of the Linux Kernel

The system works through several advanced mechanisms to manage data efficiently. One key method is the use of extents. In older systems like ext2 and ext3, the computer used block mapping to track every single piece of a file. An extent replaces this by mapping a range of contiguous, or connected, physical blocks. A single extent can map up to 128 MiB of space using a standard 4 KiB block size. This reduces fragmentation and allows the computer to read large files much faster.

Simplified Structure of the Linux Kernel
Simplified Structure of the Linux Kernel

Another important process is called delayed allocation, also known as allocate-on-flush. In many file systems, the computer assigns a specific spot on the disk as soon as data is sent to be written. ext4 instead waits until the data is actually flushed to the disk before choosing its location. This allows the multiblock allocator to see a larger amount of data at once. By waiting, the system can group data into larger, contiguous chunks. This reduces fragmentation and improves overall performance.

Simplified Structure of the Linux Kernel
Simplified Structure of the Linux Kernel

To ensure data stays safe, ext4 uses a technique called journaling. A journal is a special file on the disk that records changes before they are permanently applied. ext4 uses journal checksums to improve the reliability of this process. This feature was inspired by research from the University of Wisconsin regarding the IRON file system. By using checksums, the system can also avoid waiting for certain disk operations, which slightly improves speed. Furthermore, metadata checksumming was added in 2012 to help protect the structural information of the file system.

Simplified Structure of the Linux Kernel
Simplified Structure of the Linux Kernel

The history of ext4 began with the need to improve upon the older ext3 system. Between 2003 and 2006, many of its features were originally developed for the Lustre file system. While some developers wanted to simply add extensions to ext3, others preferred to create a separate version for better stability. On June 28, 2006, Theodore Ts'o, the maintainer of ext3, announced the official development plan for ext4. A preliminary version appeared in Linux kernel 2.6.19. The stable version was finally merged into the Linux 2.6.28 source code and released on December 25, 2008.

Simplified Structure of the Linux Kernel
Simplified Structure of the Linux Kernel

Ext4 offers massive scale and precision compared to its predecessors. It can theoretically support volumes as large as 64 ZiB. A single file can reach a size of 16 TiB using standard 4 KiB blocks. The system also provides much higher timestamp accuracy. While older systems measured time in one-second increments, ext4 uses nanoseconds. It also expands the date range to prevent the "year 2038 problem." This allows the system to track time correctly until the year 2446.

Simplified Structure of the Linux Kernel
Simplified Structure of the Linux Kernel

Many major organizations have adopted this technology for their infrastructure. In 2010, Google announced it would upgrade its storage systems from ext2 to ext4. That same year, Google also chose ext4 for the Android 2.3 operating system. Despite its success, the development of ext4 has faced interesting debates. Theodore Ts'o noted in 2008 that while ext4 is an improvement, it is based on older technology. He suggested that other systems, like Btrfs, might offer different advantages in scalability and management. However, many contributors from companies like IBM and Huawei have continued to improve ext4 with features like transparent encryption and project quotas.

Simplified Structure of the Linux Kernel
Simplified Structure of the Linux Kernel
613 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (1)
File:Simplified Structure of the Linux Kernel.svg
Simplified Structure of the Linux Kernel.svg
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.