Skip to main content
ext4 vs XFS vs Btrfs: Choosing a Filesystem for a Server

ext4 vs XFS vs Btrfs: Choosing a Filesystem for a Server

KU
· Founder & Chief Editor
• 7 min read•Updated •

The default filesystem your distro picks is not always the right one for your workload. Here is what actually differs and when each one wins.

Key takeaways

  • Default to ext4 for general servers, since it is mature, low overhead and shrinks offline.
  • Choose XFS for large files and parallel throughput, but treat it as grow-only.
  • Choose Btrfs when you want built-in snapshots, data checksums and live shrinking, and avoid its RAID5/6 modes, which upstream still marks unstable.

Use ext4 for general-purpose servers, XFS for large files and high parallel throughput when the volume will only ever grow, and Btrfs when you want snapshots, data checksums and live shrinking built into the filesystem. Two constraints decide most cases before performance does: XFS is effectively grow-only, and only Btrfs has native snapshots.

Verified against

xfsprogs, e2fsprogs and btrfs-progs man pages (man7.org and btrfs.readthedocs.io), against the RHEL 9 file systems guide and the Btrfs feature status page. Checked October 2026.

The defaults were not arbitrary. Ubuntu and Debian install ext4. RHEL defaults to XFS, and its documentation no longer lists Btrfs at all (Red Hat deprecated it). Fedora Workstation and the desktop spins have defaulted to Btrfs since Fedora 33, while Fedora Server stays on XFS. openSUSE uses Btrfs for the root filesystem. None of those defaults is correct for every workload you put on top.

What actually differs

Attributeext4XFSBtrfs
Grow while mountedYes (resize2fs)Yes, must be mounted (xfs_growfs)Yes (btrfs filesystem resize)
ShrinkOffline onlyNot supported in RHEL; upstream can only trim the last allocation groupYes, while mounted
Large-file, parallel I/OGoodBest of the threeGood
Native snapshotsNo (use LVM)No (use LVM)Yes, subvolume snapshots
ChecksumsMetadataMetadataData and metadata, with scrub
RHEL-supported size50 TiB1024 TiBNot supported on RHEL

The two constraints that eliminate an option outright:

You might need to shrink this volume later: XFS is out. Red Hat's guide says "you can only increase the size of an XFS file system." The upstream xfs_growfs man page now documents a narrow exception (only "shrinking the last AG without removing it is implemented"), which is not something to plan capacity around.

You want snapshots without LVM underneath: ext4 and XFS are out. Neither has native snapshots; you put LVM below them (see resizing a filesystem live with LVM). Btrfs snapshots are part of the filesystem.

Where each one wins

ext4 is the safe, boring default: a typical application server, a database that does not need filesystem snapshots, home directories. Longest track record, lowest CPU overhead, the most tooling that assumes it exists. If nothing below pushes you elsewhere, ext4 wins precisely because it is unremarkable.

XFS wins for large files and high-parallelism I/O: media storage, data warehouses, big log and analytics volumes. It splits the filesystem into allocation groups that can be written concurrently, which is why it holds up on many-threaded sequential writes and why RHEL supports it to 1024 TiB against ext4's 50 TiB. The trade is permanent: provision conservatively, because shrinking means migrating data to a new filesystem.

Btrfs wins when snapshots, checksums and copy-on-write clones are worth more than raw headroom. Snapshot before a risky upgrade (openSUSE's snapper does this automatically), catch silent corruption with btrfs scrub, and ship incremental backups with btrfs send and receive. The Btrfs status page marks resize, snapshots, send/receive, scrub and RAID1/RAID10 as OK, and RAID5/6 as "unstable". The cost is CPU for checksumming and copy-on-write, plus fragmentation on heavy random writes into large files such as database and VM images.

The commands, side by side

Check what you actually run before assuming the distro default:

Terminal
df -T /data
Filesystem                  Type  Size  Used Avail Use% Mounted on
/dev/mapper/vg_data-lv_data ext4   89G   50G   35G  57% /data
findmnt -no FSTYPE /
xfs

Growing, after extending the underlying LV or partition:

Terminal
sudo resize2fs /dev/vg_data/lv_data          # ext4, online
sudo xfs_growfs /data                        # XFS, takes the mount point
sudo btrfs filesystem resize max /data       # Btrfs, online

Shrinking, where it is possible:

Terminal
# ext4: offline only, check first, then shrink the fs before the LV
sudo umount /data
sudo e2fsck -f /dev/vg_data/lv_data
sudo resize2fs /dev/vg_data/lv_data 60G
sudo lvreduce -L 60G /dev/vg_data/lv_data

# Btrfs: online
sudo btrfs filesystem resize -20g /data

Btrfs snapshots and the database escape hatch:

Terminal
sudo btrfs subvolume snapshot -r /data /data/.snap-$(date +%F)
sudo mkdir /data/pgdata && sudo chattr +C /data/pgdata   # no CoW for new files here
sudo btrfs scrub start -B /data

chattr +C only applies to files created after the flag is set, so set it on an empty directory before the database writes its first file. It also turns off checksums for those files, which is the price of avoiding CoW fragmentation.

Errors you will hit, and the fix

Error textFilesystemFix
On-line shrinking not supportedext4 (resize2fs)Unmount, run e2fsck -f, then shrink; the man page allows shrinking unmounted filesystems only
Please run 'e2fsck -f /dev/...' first.ext4Run the check it names, then repeat the resize
is not a mounted XFS filesystemXFS (xfs_growfs)Mount it and pass the mount point; XFS must be mounted to grow
data size ... too small, old size is ...XFSYou asked for a shrink; back up, recreate smaller, restore
No space left on device with free space in dfBtrfsMetadata chunks are full; check btrfs filesystem usage, then btrfs balance start -dusage=50 /data

For a full disk on any of the three, the general triage is in diagnosing disk full on Linux.

Where this breaks

Benchmarks between the three swing with workload, kernel version and mount options, so we do not quote numbers and you should not trust anyone who quotes one without the fio job file. This guide also assumes local block storage. On cloud volumes you grow the disk, rarely shrink it, and rely on provider snapshots, which removes most of the reason to pick Btrfs and most of the risk of picking XFS. Multi-disk parity RAID is out of scope: Btrfs RAID5/6 is unstable upstream, and ZFS or mdadm under ext4 or XFS are the usual answers.

Questions people ask

Can you shrink an XFS filesystem?

Not in any practical sense. Red Hat's documentation states XFS can only grow. Upstream xfs_growfs has gained a narrow ability to trim free space from the last allocation group, but it cannot remove allocation groups, so real shrinking still means backing up with xfsdump or rsync, recreating a smaller filesystem with mkfs.xfs, and restoring. Choose ext4 or Btrfs if a volume may need to shrink.

Is Btrfs stable enough for production servers?

For single-disk, RAID1 and RAID10 setups, yes: the Btrfs status page lists snapshots, send/receive, scrub, resize and RAID1/10 as OK, and openSUSE and Fedora Workstation ship it as the root default. RAID5/6 is still marked unstable, so avoid parity modes. Red Hat does not support Btrfs on RHEL, so on RHEL-family servers pick XFS or ext4 instead.

Which is faster, ext4 or XFS?

It depends on the workload. XFS usually leads on large files and many parallel writers, because allocation groups allow concurrent allocation, and it scales to larger volumes. ext4 is often as fast or faster for small-file, single-threaded and metadata-heavy work, with lower CPU overhead. Benchmark your own workload with fio on your kernel before switching from your distro's default.

The call we'd make

Default to ext4 unless a specific requirement pulls you off it: XFS for large-file, high-throughput volumes you are confident will never shrink, Btrfs when native snapshots and data checksums are worth the CPU and you stay away from RAID5/6. Run df -T before assuming anything; the box in front of you may already run something other than what you would have chosen.

Sources

Explore topics:Linux
React
Share this post
Cite this article
Plain text

Kiril Urbonas (2026). ext4 vs XFS vs Btrfs: Choosing a Filesystem for a Server. DevOpsNess. Updated 2026-10-31. https://www.devopsness.com/blog/ext4-vs-xfs-vs-btrfs-choosing-a-filesystem

Markdown

[ext4 vs XFS vs Btrfs: Choosing a Filesystem for a Server](https://www.devopsness.com/blog/ext4-vs-xfs-vs-btrfs-choosing-a-filesystem) (Kiril Urbonas, DevOpsNess, updated 2026-10-31)

KU

Kiril Urbonas

Founder & Chief Editor

608 articles
View all articles by Kiril Urbonas

You might have missed

Evergreen posts worth revisiting.