Before we answer the question posed by this article, a bit of background will be required. Ext4 is only the latest, albeit not particularly new, iteration of the venerable Linux Extended file system (Extfs).
What is Ext4?
Ext4 started as a set of extensions to, yes, you guessed it–Ext3. Ext3 was itself an evolution of Ext2, which was the offspring of Extfs, the original Linux-specific file system. Extfs was created by Rémy Card and others to overcome the limitations of the MINIX file system employed by Linus Torvalds in the first Linux kernel. MINIX (1987), written by Andrew S. Tanenbaum, is a Unix-like operating system. The man wrote it for the benefit of higher education, so that UNIX could be taught without paying a considerable sum for the real deal. As mentioned, the MINIX file system has limitations, hence Extfs was “extending” it.
Ext4 was added to the Linux kernel in 2006 (Ext4dev) and the repositories in 2008. It’s what’s known as a journaling file system (as of Ext3), i.e. a list of impending and implemented changes is maintained. It’s a bit different than your diary in that its most recent entries describe what will happen, rather than what has. A combination day planner/journal if you will. Journaling (which is optional) makes it possible to quickly repair file system errors without using a utility (e2fsck) to traverse the entire data structure in search of wackiness.
Ext4 is a standard root/tree file system, with a boot sector, partition table, and like the Unix File System, uses inodes (index nodes) to describe files and objects. It offers transparent encryption, uses checksums on the metadata (journal and other), supports TRIM, and implements delayed allocation.
Delayed allocation means that Ext4 caches data until it can determine the quickest and most efficient way to write it. This is a boon to performance, but introduces the possibility that data might not be written in the case of power failure. Journaling mitigates the danger of data loss in this scenario.
Beyond that, Ext4 uses 48-bit addressing that allows up to an exbibyte (EiB) of data. 12-bit “extents” which describe large chunks of contiguous space augment Ext3’s 32-bit direct and indirect block addressing. The maximum single file size in Ext4 is 1 tebibyte (TiB), and the maximum number of files is 4 billion.
Note: When it comes to Tebibytes versus Terabytes et al, numbers whose names share the same first two letters (“ex”, “gi”, “pe”, etc.) are roughly equivalent in size. E.g., a gigabyte (10^9) is 1,000,000,000 bytes while 1 gibibyte (2^30) is 1,073,741,824 bytes. Remember them as “BI”nary and b”A”se 10.
In short, the main advantages and disadvantages of Ext4 are…
The Upside
- A long successful track record
- Very good performance
- Handles up to an 1 exbibyte (EiB) of data (1 million tebibytes)
- Journaling operations make error recovery quick
- Backwards compatible with Ext3
The Downside
- Lacks newer techniques such as copy on write
- No integrated volume manager as with Btrfs and OpenZFS
- Not native Windows support. (Third-party drivers are available. Free and from Paragon software)
When to use Ext4
As Ext4 is fast, tried, and true, not to mention the default file system for Linux, it’s perfectly fine for end-user fans of Tux. For NAS, servers, or any situation where fault tolerance and data integrity are more important than speed, Btrfs or OpenZFS could be better choices.