ReiserFS vs ext4 vs XFS vs ZFS vs Btrfs – Linux filesystems compared

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 to move to EXT3
  • Not Journaled
  • POSIX access control

Recommended Use: USB/Solid State Drives, or any cause where you need high stability with minimal reads/writes. EXT2 file system is the predecessor to the EXT3 file system. EXT2 is not journaled, and hence is not recommended any longer (customers should move to EXT3).

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.

  • Most popular Linux file system, limited scalability in size and number of files
  • Journaled
  • POSIX extended access control

EXT3 file system is a journaled file system that has the greatest use in Linux today. It is the “Linux” File system. It is quite robust and quick, although it does not scale well to large volumes nor a great number of files. Recently a scalability feature was added called htrees, which significantly improved EXT3′s scalability. However it is still not as scalable as some of the other file systems listed even with htrees. It scales similar to NTFS with htrees. Without htrees, EXT3 does not handle more than about 5,000 files in a directory.

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.

  • Best performance and scalability when number of files is great and/or files are small
  • Journaled
  • POSIX extended access controls

The Reiser File System is the default file system in SUSE Linux distributions. Reiser FS was designed to remove the scalability and performance limitations that exist in EXT2 and EXT3 file systems. It scales and performs extremely well on Linux, outscaling EXT3 with htrees. In addition, Reiser was designed to very efficiently use disk space. As a result, it is the best file system on Linux where there are a great number of small files in the file system. As collaboration (email) and many web serving applications have lots of small files, Reiser is best suited for these types of workloads.

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.

  • Best for extremely large file systems, large files, and lots of files
  • Journaled (an asymmetric parallel cluster file system version is also available)
  • POSIX extended access controls

The XFS file system is Open Source and included in major Linux distributions. It originated from SGI (Irix) and was designed specifically for large files and large volume scalability. Video and multi-media files are best handled by this file system. Scaling to petabyte volumes, it also handles great deals of data. It is one of the few filesystems on Linux which supports Data Migration (SGI contributed the Hierarchical Storage Management interfaces into the Linux Kernel a number of years ago). SGI also offers a closed source cluster parallel version of XFS called cXFS which like cVxFS is an asymmetrical model. It has the unique feature, however, that it’s slave nodes can run on Unix, Linux and Windows, making it a cross platform file system. Its master node must run on SGI hardware.

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.

ZFS

ZFS is a combined file system and logical volume manager designed by Sun Microsystems. The features of ZFS include data integrity (protection against bit rot, etc.), support for high storage capacities, integration of the concepts of filesystem and volume management, snapshots and copy-on-write clones, continuous integrity checking and automatic repair, RAID-Z and native NFSv4 ACLs. ZFS is implemented as open-source software, licensed under the Common Development and Distribution License (CDDL).

Recommended Use: ZFS is the best choice for FreeBSD and Solaris users.

Comments

  1. Where is btrfs?

  2. Nice article need more raid information too.

    Thnks
    STR

  3. Just what I needed! Perfect in length and detail.

    Thank you.

  4. foolbaby says:

    great article
    thanks..

  5. Update for cXFS: as of mid-late 2011, the master node need not be on SGI hardware. At the moment, support is still a little tempermental, but by the time you read this you can expect it to be a common practice.

    Nice comparison.

  6. Nice article, would appreciate some benchmarks though.

  7. Editorial: Opening paragraph repeated in XFS section. Search for “If you’re a Linux user…”

  8. short and precise
    you wanna keep up this ;)
    thx

    have fun !

  9. beside from the fact that Reiser is in jail it’s no longer the default filesystem for any Suse System. They have switched to ext3. Reiser4 does not even make part of the current kernel.

    IMHO Reiser should no more be used. My current choice is ext3/ext4 for linux. XFS for large files, at btrfs I ‘ll look again in about 2 years

    Greets
    Marc

  10. @marc

    Why shouldn’t Reiser be used? 3.x is long since stable and is in the linux kernel being maintained. Hans was not a murderer back then and I’m not 100% sure he is now, I wasn’t there.

    With small file read /writes reiser surpasses ext3 and ext4 by a wide margin. It shaves an hour off of compiling IPCop or more specifically my adaptation of it to run on Cobalt x86 hardware dubbed Raqcop. It also is the best thing in the world for /var. The only real attraction to ext3 and ext4 is that you can start with an old ext2 system and work your way up to ext4 and even btrfs. The latter will be worth using. Other than compatibility with a filesystem from 1998, there is no compelling reason to use any of the ext filesystems. This is not an issue of principal but rather what works right out of the kernel.

    Anytime I make even my / partition with ext3 or 4 the performance is noticeably sluggish even on opening apps the first time. Compiling as I mentioned is far far faster with reiser, small files is what it does best.

    For server use I use reiser for everything except storage. Since I store many large multimedia files, XFS is my current favorite and is improved as of just prior to the 3 kernel.

    One very important thing that is NOT mentioned here is that every filesystem has a maximum performance speed at which it can read and write, no hard drive, processor power and the like can make it exceed it’s maximum speed.

  11. James says:

    The use of reiserfs on multi-core systems is no longer a problem since kernel 2.6.33 because the big kernel lock was removed from most filesystems.

  12. Thank you, simple and precise, just what I needed, a cleaner understanding of the variations of these file systems, well accepted and responded to.

    Well written.
    :yes:

  13. The main reason someone would probably choose ZFS is for setting up an iSCSI SAN, as that file system has features specific to that setting that are not found in other filesystems. I could repeat them all, but it is just as easy to lookup on wikipedia.

  14. Been using BTRFS for 6 months now and I have to say, much like every other product Oracle has ever sold and/or designed, it’s terrible. Bad performance, not reliable, and overall poor design. Performance degrades very very quickly if you do a lot of read/write to a system, especially when you delete afterward. Since starting with linux over 10 years ago, it’s the first filesystem you need to regularly defrag, but you have to defrag on a one by one directory basis. It’s in no way shape or form suitable for usage at this point.

  15. You kind of forgot JFS which is still partially actively developed, stable and has a combination of benefits that exist in both EXT4 and XFS.

  16. Neikius says:

    You are missing one very interesting file system: JFS

    It is like ext – good for everything (mixed workloads), but better. The downside would be its a bit uncommon, hence no really good recovery tools. Don’t see why not more people use it.

  17. cesar daniel lopez says:

    ext3 limits on 32000 files per directory… but. it’s obsolete, ext4 works fine.. tested 500000 files directory.
    now testing zfs on linux… it is fast on multi i/o

  18. XFS, it is. Thanks for the simple outline!

Leave a Reply