Skip to content

ext4 vs XFS vs Btrfs vs ZFS: Choosing a Linux Filesystem in 2026

ext4, XFS, Btrfs and ZFS compared for real servers: distro defaults, resizing limits, checksums, snapshots, RAID and the workloads where each one wins or hurts.

●By 12 min read

For most installs the filesystem is chosen for you: Debian and Ubuntu default to ext4, RHEL and its rebuilds to XFS, Fedora Workstation and openSUSE to Btrfs. That default is usually fine. It stops being fine when you need to shrink a volume, detect silent corruption, snapshot a database before an upgrade, or run storage across several disks without a separate RAID layer.

This guide compares the four filesystems that matter on Linux in 2026 on the things that bite in production: what you can change after mkfs, what each one does when a disk lies, and which workloads each handles badly. The short version is at the end.

At a Glance

ext4XFSBtrfsZFS (OpenZFS)
Default onDebian, UbuntuRHEL, Rocky, Alma, Fedora ServerFedora Workstation, openSUSENone (Ubuntu offers it)
In mainline kernelYesYesYesNo, out-of-tree module (CDDL)
Grow onlineYesYesYesYes (add vdevs or larger disks)
ShrinkOffline onlyNoYes, onlineNo (can remove some vdevs)
Data checksumsNo (metadata only)No (metadata only)YesYes
SnapshotsVia LVMVia LVMNative, subvolumesNative, datasets
Transparent compressionNoNozstd, lzo, zliblz4, zstd, gzip
Built-in RAIDNo (mdadm/LVM)No (mdadm/LVM)RAID1/10 solid; RAID5/6 not advisedMirror, RAIDZ1/2/3
Repair toole2fsckxfs_repairbtrfs check (last resort)None needed: scrub + redundancy

RHEL has no Btrfs β€” Red Hat deprecated it in RHEL 7 and removed it in RHEL 8. Fedora keeps it as the Workstation default, but on RHEL-family servers the supported choices are XFS and ext4.

Size limits rarely matter now β€” ext4 caps a single file at 16 TiB with 4K blocks. XFS, Btrfs and ZFS limits are far beyond any single server. Pick on features, not maximums.

ext4 and XFS: The Conservative Choices

Both are mature journaling filesystems with decades of production use, excellent tooling, and predictable performance. Neither checksums your data, so a disk that returns the wrong bytes without an error goes unnoticed. That is what the RAID, backup and monitoring layers underneath are for.

# What am I running?

$ findmnt -no FSTYPE,SOURCE /

xfs /dev/mapper/rhel-root

$ lsblk -f

# Create

$ sudo mkfs.ext4 -L data /dev/vg0/data

$ sudo mkfs.xfs -L data /dev/vg0/data

# Grow the LV and the filesystem in one step (works for ext4 and XFS)

$ sudo lvextend -r -L +50G /dev/vg0/data

# Or grow each by hand

$ sudo resize2fs /dev/vg0/data # ext4: takes the device

$ sudo xfs_growfs /srv/data # XFS: takes the mount point

# ext4 reserves 5% for root by default; on a big data volume that is a lot

$ sudo tune2fs -m 1 /dev/vg0/data

# XFS used by Docker/containerd overlay2 must have ftype=1 (the default for years)

$ xfs_info /var/lib/docker | grep ftype

naming =version 2 bsize=4096 ascii-ci=0, ftype=1

XFS cannot shrink β€” this is the single biggest practical difference. If you might need to give space back to another LV, use ext4, or size XFS volumes small and grow them as needed. The only way to shrink XFS is to back up, recreate and restore.

ext4 shrinks, but offline β€” unmount, run e2fsck -f, then resize2fs to the new size before reducing the LV. lvreduce -r does all three, and still needs the filesystem unmounted.

Inodes β€” ext4 fixes the inode count at mkfs time, so a volume full of tiny files can run out of inodes with space free. Check with df -i. XFS allocates inodes dynamically.

Where XFS wins β€” large files, many parallel writers, and big volumes: media storage, backup targets, and database data directories on RHEL. It also supports reflinks, so cp --reflink=always makes instant copy-on-write copies.

Where ext4 wins β€” small volumes, root filesystems, VMs that might be resized in either direction, and anywhere the simplest well-understood option is the right one.

Btrfs: Snapshots and Checksums in the Kernel

Btrfs is copy-on-write: it never overwrites live data in place, which is what makes snapshots instant and cheap. It checksums data and metadata, compresses transparently, and can span several disks. It is also the filesystem with the most sharp edges, so learn its tools before you trust it with anything important.

# Subvolumes are separate trees you can snapshot independently

$ sudo btrfs subvolume list /

ID 256 gen 4512 top level 5 path root

ID 257 gen 4510 top level 5 path home

# Read-only snapshot before an upgrade (instant, shares blocks with the original)

$ sudo mkdir -p /.snapshots

$ sudo btrfs subvolume snapshot -r / /.snapshots/root-$(date +%F)

# "df" lies on Btrfs; this shows real allocation

$ sudo btrfs filesystem usage /

# Transparent compression: set in /etc/fstab, applies to newly written data

UUID=... / btrfs subvol=root,compress=zstd:1,noatime 0 0

# Verify every checksum, and check per-device error counters

$ sudo btrfs scrub start -B /

$ sudo btrfs device stats /

# Resize online, in either direction

$ sudo btrfs filesystem resize -20G /srv

Avoid RAID5 and RAID6 β€” the Btrfs documentation still warns about the parity write hole. RAID1, RAID1C3 and RAID10 are the profiles to use for multi-disk setups.

VM images and databases fragment β€” copy-on-write turns random in-place writes into scattered new blocks. For those directories, set chattr +C on an empty directory before creating files in it. That disables CoW for those files, and it also disables their checksums.

A snapshot is not a backup β€” it lives on the same disks. Use btrfs send and btrfs receive to copy snapshots to another machine, incrementally with -p.

Do not reach for btrfs check --repair β€” on a damaged filesystem, try mounting with -o ro,rescue=all and copying data off first. The repair mode can make things worse and is meant for use on developer advice.

Quotas cost performance β€” enabling qgroups makes snapshot deletion and balance noticeably slower on large filesystems. Turn them on only if you need per-subvolume limits.

sponsored

ZFS: Volume Manager and Filesystem in One

ZFS replaces mdadm, LVM and the filesystem with a single stack: disks form vdevs, vdevs form a pool, and the pool holds datasets with their own properties. It has the strongest integrity story of the four and the best snapshot and replication tools. Its licence keeps it out of the mainline kernel, which shapes how you install and upgrade it.

# Ubuntu ships the module prebuilt

$ sudo apt install zfsutils-linux

# Debian: zfs-dkms + zfsutils-linux from contrib (builds against each kernel)

# RHEL/Rocky/Alma/Fedora: the OpenZFS zfs-release repo, DKMS or kABI-tracking kmod

# Mirror of two disks; always use /dev/disk/by-id, never /dev/sdX

$ sudo zpool create -o ashift=12 tank mirror \

/dev/disk/by-id/ata-WDC_WD80EFZZ_A /dev/disk/by-id/ata-WDC_WD80EFZZ_B

$ sudo zfs create -o compression=lz4 -o atime=off tank/data

$ sudo zfs create -o recordsize=16K tank/mysql # match InnoDB page size

# Snapshot, list, roll back, replicate

$ sudo zfs snapshot tank/data@before-upgrade

$ zfs list -t snapshot

$ sudo zfs rollback tank/data@before-upgrade

$ sudo zfs send tank/data@before-upgrade | ssh backup sudo zfs receive pool2/data

$ sudo zpool scrub tank

$ zpool status -x

all pools are healthy

ashift is forever β€” it sets the sector size for each vdev and cannot be changed later. Use ashift=12 for modern 4K-sector disks and SSDs; a wrong value means rebuilding the pool.

Kernel upgrades are the main risk β€” on Fedora and other fast-moving kernels, a new kernel can land before OpenZFS supports it, and a DKMS build failure can leave you without your pool after reboot. Ubuntu LTS and RHEL with kABI-tracking kmods avoid most of this.

The ARC uses RAM by design β€” ZFS caches aggressively and gives memory back under pressure, but on hosts that also run memory-hungry services, cap it with the zfs_arc_max module parameter.

Plan vdev layout up front β€” you grow a pool by adding vdevs or replacing every disk in a vdev with a larger one. OpenZFS 2.3 added RAIDZ expansion by a single disk, but the existing data keeps its old parity ratio until it is rewritten.

recordsize per dataset β€” the default 128K suits large files. Databases do better with recordsize matched to their page size, such as 16K for InnoDB or 8K for PostgreSQL, as a starting point to benchmark.

Matching Filesystem to Workload

WorkloadGood choiceWhyWatch out for
Root filesystem, general serverext4 or XFS (distro default)Supported, tested by your vendor, simple recoveryXFS root cannot shrink
Desktop / laptop rootBtrfsSnapshots before updates, compression on SSDsKeep VM images in a nodatacow directory
PostgreSQL / MySQLXFS or ext4; ZFS if tunedPredictable latency for in-place writesBtrfs CoW fragmentation; ZFS recordsize
Container hostsext4 or XFSoverlay2 is tested most on theseXFS needs ftype=1
NAS, backup target, archivesZFSChecksums, scrub, snapshots, send/receiveOut-of-tree module, RAM for ARC
Many small filesXFS or BtrfsDynamic inode allocationext4 inode exhaustion
VM disk imagesXFS or ext4 (or ZFS zvols)Large files with random writesBtrfs without chattr +C

Measure before and after β€” filesystem benchmarks on the internet rarely match your I/O pattern. Run fio with a profile that mirrors your workload, and watch iostat -x 1 in production. Our disk usage analyzer helps find where space actually goes.

Mount options matter too β€” noatime avoids a metadata write on every read, and is safe for almost every server workload. relatime is the kernel default and a reasonable middle ground.

Separate data from root β€” putting /var/lib/docker, database directories or user data on their own volume lets you pick a filesystem per job and stops one full disk from taking down the OS. It also makes the mount options in our server hardening guide easy to apply.

The Short Version

Default to your distro β€” ext4 on Debian and Ubuntu, XFS on RHEL. Both are the most tested combination for that distro, and that matters more than any feature table.

Choose ext4 if β€” you might need to shrink, the volume is small, or you want the simplest recovery path.

Choose XFS if β€” you run RHEL-family servers, large files, or heavily parallel I/O, and you are sure the volume will only grow.

Choose Btrfs if β€” you want snapshots and checksums without an out-of-tree module, especially on desktops and single-disk or mirrored systems. Avoid its parity RAID.

Choose ZFS if β€” data integrity across many disks is the priority and you are willing to manage the kernel module, on Ubuntu LTS or a RHEL-family system with kmod packages.

Frequently Asked Questions

Is XFS or ext4 better for a Linux server?

Both are reliable. XFS handles large files and parallel writes better and is the RHEL default; ext4 can be shrunk offline while XFS cannot be shrunk at all. If you are on RHEL, Rocky or Alma, use XFS. On Debian or Ubuntu, ext4 is the default and a safe choice. Pick XFS on Debian for large data volumes that will only grow.

Is Btrfs stable enough for production in 2026?

Single-disk and RAID1 or RAID10 Btrfs is stable and is the default on Fedora Workstation and openSUSE. RAID5 and RAID6 still carry a documented write-hole warning and should not hold data you care about. Red Hat does not support Btrfs on RHEL at all, so on RHEL-family servers it is not an option.

Why is ZFS not included in the Linux kernel?

OpenZFS is licensed under the CDDL, which is widely considered incompatible with the kernel's GPLv2, so it is distributed as a separate module. Ubuntu ships it prebuilt; other distros use DKMS or kABI-tracking kmod packages, which means a kernel update can briefly outpace ZFS support.

Can I shrink an XFS filesystem?

No. XFS can only grow, with xfs_growfs on the mount point. To make an XFS volume smaller you must back up the data, recreate the filesystem at the new size, and restore. If you expect to shrink volumes later, use ext4 or Btrfs instead.

Which Linux filesystem protects against silent data corruption?

Btrfs and ZFS checksum both data and metadata, so a scrub detects bad blocks, and with a mirror or RAIDZ they repair them from the good copy. ext4 and XFS checksum only metadata; they rely on the disk, RAID layer and backups to catch corrupted file contents.

sponsored

Related Tools

See also