Filesystems on Linux: When Should You Not Use Ext4?
Linux & macOS Terminal
Summary
- Ext4 is essentially the default Linux filesystem, offering simplicity and compatibility, making it a solid choice for most users.
- Btrfs supports snapshots and is self-repairing, while XFS excels with large file storage due to its parallel read and write operations.
- exFAT is best used for removable drives that you’ll use with other computers.
As with many things, a typical Linux install offers a choice of filesystems, though the Ext4 filesystem is typically the default for most distros. What are the advantages of those other filesystems, and when should you choose them instead?
Why the Ext4 Filesystem Is So Common on Linux
Ext4 is the most recent iteration of the filesystem, but it’s far from the first, as the number in the name implies. The earliest versions of Linux used the filesystem from Minix, another Unix-like operating system, before beginning work on a more capable replacement.
The original Ext filesystem was released in 1992, with the improved Ext2 following quickly in 1993. Compared to the original Ext filesystem, Ext2 offered improved performance, and was the default for most Linux installs at least until the introduction of Ext3 in 1999.
Ext3 was an important step forward as it added support for journaling, which helps prevent data loss during sudden crashes. This adds a slight performance overhead, but the tradeoffs are such that nearly every modern filesystem uses journaling.
Ext4 was released in 2008, so which it’s the relative new kid on the block, it’s still been around for quite a while. This version of the filesystem is backward compatible with the two prior versions (the original extfs driver was removed as of Linux kernel version 6.9), but also adds performance and features. For example, there is no limit in the Ext4 filesystem on the number of subdirectories, while Ext3 was limited to 32,000.
Due to its compatibility, simplicity, and relatively lightweight nature, Ext4 has been the default filesystem on most Linux distributions for quite some time now. It’s far from the only option, but if you’re not sure which filesystem is right for you, Ext4 is likely your best bet.
Btrfs: A Filesystem With Extra Features
While Ext4 has added plenty of features, one it doesn’t currently support is any kind of snapshot or checksum functionality. This allows a filesystem to automatically repair itself, capturing and restoring data as necessary to recover from crashes or to prevent data corruption.
Btrfs is far from the only filesystem with this type of functionality, but it is currently the second most popular option on Linux, at least when it comes to finding it preinstalled. Depending on the distribution, Btrfs may be relatively tightly integrated, like in the case of the OpenSuSE linux distributions, which use Btrfs for snapshots.
This does add some performance overhead, as does the Copy-on-write (CoW) support in Btrfs. Using this approach, the changes to a file are written to a new location rather than directly over the old file, helping prevent data loss. Using this alongside its checksum and snapshot features, Btrfs is self-healing, compared to older-style filesystems, but again, this does come with an overhead.
For pure performance, Ext4 will be faster than Btrfs in most cases. That said, the differences will often be negligible if you’re talking about the typical workload of a home PC.
XFS: Best For Large File Storage
Both Ext4 and Btrfs are equally at home on your personal PC or running on a server, though as we’ve looked at, there are performance differences between the two. While both of these filesystems work well for certain types of server workloads, if you’re dealing with large files, you may want to consider the XFS filesystem.
XFS has multiple advantages for dealing with large files, including the ability to store files up to 500TB in size, compared to 16TB for Ext4. While Btrfs has a limit in the exabytes (and it isn’t alone), XFS also performs read and write operations in parallel, which can have major performance benefits in server situations.
If this sounds like it could be useful for your Ubuntu-powered Plex server, you might be right. XFS is also a great option for running on a NAS if you’re frequently backing up large video files for video editing, for example.
While you could argue that it’s slightly overkill, there are plenty of reports all over the internet of happy NAS users running XFS, so you wouldn’t be alone.
What About Other Filesystems on Linux?
If you spend any time researching filesystems available on Linux, you’ll end up stumbling upon ZFS. Similar to XFS, servers are the main target for ZFS. Similar to Btrfs, the maximum file size supported is 16EB (that’s exabytes), which currently isn’t even possible on Linux. It also uses LZ4, a faster compression algorithm than Btrfs, which uses zlib.
The main downside of ZFS is that you won’t find it as a preinstalled option on many distributions. It’s not difficult to install, as our guide to installing ZFS on Ubuntu shows, but it’s a further step that not everyone may want to take once they already have a system up and running.
While we won’t touch on every filesystem available on Linux, exFAT briefly deserves a mention. This is a version of the Windows FAT filesystem meant for flash drives, and is likely your best bet for removable drives if you want to use them with other operating systems.