Justin Garrison
March 1, 2017

Which Linux File System Should You Use?

Posted on March 1, 2017  •  8 minutes  • 1586 words

When formatting partitions on a Linux PC, you’ll see a wide variety of file system options. These options don’t need to be overwhelming. If you’re not sure which Linux file system to use, there’s a simple answer.

The Quick Answer: Use Ext4 if You’re Not Sure

We’ll get into the weeds and run down the difference between the various file systems in a moment, but if you aren’t sure: Use Ext4.

Ext4 is the default file system on most Linux distributions for a reason. It’s an improved version of the older Ext3 file system. It’s not the most cutting-edge file system, but that’s good: It means Ext4 is rock-solid and stable.

In the future, Linux distributions will gradually shift towards BtrFS. BtrFS is still cutting edge and seeing a lot of development, so you’ll want to avoid it on production systems. The risk of data corruption or other problems isn’t worth the potential improvement in speed.

Note, though, that this “use Ext4” advice only applies to Linux system partitions and other on-disk partitions only Linux will access. If you’re formatting an external drive you want to share with other operating systems, you shouldn’t use Ext4 because Windows, macOS, and other devices can’t read Ext4 file systems. You’ll want to use exFAT or FAT32  when formatting an external drive on Linux.

If you’re setting up partitions on your main Linux boot drive, you’ll also want to create a swap partition of at least a few GBs in size  when setting up those partitions. This partition is used for “swap space”. It’s similar to the paging file on Windows. Linux swaps out memory to the swap space when its RAM is full. This partition must be formatted as “swap” instead of with a particular file system.

Linux file system partitions Screenshot

What Is Journaling?

One thing you’ll notice when choosing between file systems is that some of them are marked as a “journaling” file system and some aren’t. This is important.

Journaling is designed to prevent data corruption from crashes and sudden power loss. Let’s say your system is partway through writing a file to the disk and it suddenly loses power. Without a journal, your computer would have no idea if the file was completely written to disk. The file would remain there on disk, corrupt.

With a journal, your computer would note that it was going to write a certain file to disk in the journal, write that file to disk, and then remove that job from the journal. If the power went out partway through writing the file, Linux would check the file system’s journal when it boots up and resume any partially completed jobs. This prevents data loss and file corruption.

Journaling file system flow diagram

Journaling does slow disk write performance down a tiny bit, but it’s well-worth it on a desktop or laptop. It’s not as much overhead as you might think. The full file isn’t written to the journal. Instead, only the file metadata, inode, or disk location is recorded in the journal before it’s written to disk.

Every modern file system supports journaling, and you’ll want to use a file system that supports journaling when setting up a desktop or laptop.

File systems that don’t offer journaling are available for use on high-performance servers and other such systems where the administrator wants to squeeze out extra performance. They’re also ideal for removable flash drives, where you don’t want the higher overhead and additional writes of journaling.

What’s the Difference Between All Those Linux File Systems?

Ext2, Ext3, and Ext4 illustration

While Microsoft develops Windows and Apple controls macOS, Linux is an open-source project developed by the community. Anyone (or any company) with the skill and time can create a new Linux file system. That’s one reason why there are so many options. Here are the differences:

BtrFS illustration

ZFS linux illustration

There are other Linux file systems too, including file systems designed specifically for flash storage  in embedded devices and on SD cards. But these are the options you’ll most frequently see when using Linux.

Follow me

Here's where I hang out in social media