Choosing The Best Linux Filesystem For Your PC

If you’re a Linux user, you’ve likely been asked at some point if you want Ext3, Ext4, XFS, ReiserFS, Btrfs, or one of many other filesystem acronyms. This choice confuses new and old users alike, and like all software, the options change as technology improves. Many people probably don’t care what filesystem they use as long as it’s stable and reasonably fast, but how do you know which one that is? This guide will attempt to cover the basic differences between the most common options, and provide the pros and cons of each choice.

Ext2

Ext2 is Linux’s “old standby” filesystem. It was the default for most of the major early Linux distributions. While it has been mostly supplanted by versions 3 and 4, ext2 is still popular on USB and other solid-state devices. This is because it does not have a journaling function, so it generally makes fewer reads and writes to the drive, effectively extending the life of the device.

Recommended Use: USB/Solid State Drives, or any cause where you need high stability with minimal reads/writes.

Ext3

The most notable difference between ext2 and ext3 was the introduction of journaling. In short, journaling filesystems are meant to recover more gracefully in the event of a system crash. Whenever you find yourself in doubt about which filesystem to use for Linux, ext3 is nearly always a good bet. It’s extremely mature, extremely well supported, and contains all the features you’re likely to need for a desktop OS.

Recommended Use: If you have no specific reason for another filesystem, ext3 is an excellent default.

Ext4

The most recent in the ext filesystem line, ext4 includes many major improvements over ext3 like larger filesystem support, faster checking, nanosecond timestamps, and verification of the journal through checksums. It’s backward and forward compatible with versions 2 and 3, so you can mount a ext2 or ext3 filesystem as ext4, and the other way around. You may however lose some of the benefits of the newer versions when mounting as the older. Many of the modern Linux distributions now offer ext4 during the install, and some are using it as the default.

Recommended Use: Ext4 should be stable enough for desktop and server needs. If your distribution offers it as an install choice, it should be a good choice for nearly any usage needs.

ReiserFS (Reiser3)

Before ext3, ReiserFS was the only journaling filesystem for Linux. It’s also notable for allowing live resizing of the filesystem. In some cases where many small files are involved, Reiserfs can outperform ext3 by a considerable margin. Reiser3 has problems, however when it comes to handling things like multicore PCs, as the design only allows for some operations to run one at a time.

Recommended Use: Interacting with small files on a single core system.

Reiser4

Reiser4 is intended to solve some of the problems with the Reiser3 implementation. Performance has improved, particularly with small files, and it includes support for plugins to handle things like compression and encryption. Reiser4 has a somewhat uncertain future. It has not yet been accepted into the main line Linux kernel, the lead designer is in prison, and the company developing it is not currently in business. Reiser4, if completed and fully polished, could be a fast and useful filesystem, but until it gains a foothold in the mainline kernel it may not be a good choice for long term use.

Recommended Use: Filesystem testing and development

XFS

XFS is packed full of cool features like guaranteed rate I/O, online resizing, built-in quota enforcement, and it can theoretically support filesystems up to 8 exabytes in size. It’s been used on Linux since about 2001, and is available as an install option on many popular Linux distributions. With variable block sizes, you can tune your system like a sliding scale to tweak for space efficiency or read performance.

Recommended Use: If you really like to tweak your system to meet your needs, XFS is a great way to go.

Btrfs

Btrfs is still in development, and may not yet be ready for production server use. That said, it has been included to some extent in the Linux kernel and is available as an install option in some distributions. Some of the interesting features include transparent compression, snapshots, cloning, and in-place conversion (with rollback) from ext3 and 4. According to the lead developer, Btrfs aims to “let Linux scale for the storage that will be available.” Btrfs, once completed and matured, will likely be a strong contender in the Linux filesystem world on both desktops and servers.

Recommended Use: Eventually, Btrfs should make for an excellent filesystem for servers and other high-bandwidth high-storage devices.

17 comments

  1. You didn't mention JFS, which has the lowest processor requirements of all the available linux file systems. I use it on refurbished computers that I donate to local families that cannot afford a new computer.

    • Reading this, I decided I might choose JFS for an old laptop I have lying about. But since I wanted to be certain, I did a little digging around. BIG PROBLEM: JFS gets fragmented, so it needs to be defragmented regularily. BUT the defragmentation utility has not been ported to linux! Only way seems to involve backup, reformat and restore of the entire disk. If you have an SSD-device or similar, fragmentation should not be a problem, but for a harddisk, this is a no-no.
      As a contrast, all the EXT filesystems manage fragmentation automatically. Seems the old box will get ext4 after all.

  2. It is possible (easy) to deactivate journaling from Ext 4 if so desired.

    Ext4 and BTRfs are both usable with TRIM on SSD's, and it is easy to activate.

    Still early days for BTRfs, but Ext4 without journaling + TRIM enabled seems to be the most viable setup for SSD right now (don't forget to allign).

    Watch out for NILFS

  3. On the same token, JFS is an excellent choice for embedded systems and a great filesystem for “enterprise class” (whatever marketroids mean by that) servers. I wouldn't use it for high TPS database servers, but for rock solid SAN based fileservers…? Absolutely.

  4. To say that ext4 is fully compatible with ext2 and ext3 is false.

    Internal directory structures and file allocation are completely different. You cannot mount a ext4 filesystem with neither the ext2 nor ext3 drivers, and if you mount an ext3 filesystem with the ext4 driver and write *anything* on it, you have converted that filesystem to ext4 irreversibly. You would be able to mount the filesystem as ext3 and recover the *old* ext3 data but the files and directories created with the ext4 driver will be unreadable.

  5. I use it on desktop computers. Works really well for squeezing maximum performance out of sub-gigahertz processors.

  6. Great info, I was kind of confused before I read this.
    I have always choosen ext3 as my filesystems.

  7. ext3 is tried-and-true for most desktop systems, likewise ext2 for netbooks with SSD (flash) storage. However, ext4 has some issues with filesystem integrity, especially when running a filesystem check (e2fsck). I have encountered, on two different systems running two different Linux distributions, the same incorrect result where running e2fsck twice on a filesystem yields errors on the same inodes both times, even when instructed to fix the errors automatically.

    Also, the Linux kernel in most (all?) distros is configured to use a particular I/O scheduler (the Completely Fair Queueing, or CFQ) by default, as it works very well with ext2 and ext3. However, if you're going to use XFS, Reiser-something, or JFS, you should consider adding “elevator=noop” to your kernel command line in GRUB or LILO. XFS and JFS do some of their own I/O scheduling, and CFQ gets in their way.

  8. Likewise, FAT is a supported filesystem, but I chose not to include NTFS or FAT because they are not native to this type of OS and do not support many of the features a modern Linux system expects for its root.

    • Uh, he didn’t say anything about NTFS. **NILFS** isn’t lacking any Linux features. Sheesh.

      Also, “so you can mount a ext2 or ext3 filesystem as ext4, and the other way around” is mistaken — you can only mount an ext4 fs as ext3 if you haven’t created any extents; “You may however lose some of the benefits of the newer versions when mounting as the older” is nonsensical drivel.

  9. I reinstalled my Linux system with 2 SSD drives, a 40gb SSD for / and swap, and a 90gb SSD for /home. I formatted the / partition with ext4 using these mount options: noatime,discard,data=ordered
    From what I read, these are the optimal mount options for the ext4 filesystem. the ‘discard’ option enables Trim. It is disabled by default.
    For the /home partition, I used the jfs filesystem. I have never used it before, but it seems to be fast and should work well handling large files. I plan to use this partition for virtual machines and storing Linux distro ISO files.
    I don’t have any testing data to share, but I don’t notice much speed difference comparing ext4 with these mount options to ext2. It is faster than ext4 without the mount options though. From what I’ve read, ext2 and ext3 do not support Trim, but ext4 and jfs do.

Comments are closed.

Sponsored Stories