ubuntu, updated

File systems compared

ext4, XFS, Btrfs, ZFS, exFAT and friends: what they are good at and which one to pick.

The short answer

Comparison

ext4XFSBtrfsZFS
Ubuntu defaultyesnonooptional
Maturityvery highvery highgoodvery high
Grow onlineyesyesyesyes
Shrinkoffline onlynoyesno (pool)
Snapshotsvia LVMvia LVMbuilt inbuilt in
Checksums against silent corruptionmetadatametadatadata + metadatadata + metadata
Compressionnonoyesyes
Built-in RAID / poolingno (use mdadm/LVM)noyes (avoid RAID5/6)yes
RAM needslowlowlowhigher (cache)
Best forgeneral use, boot, small/medium volumeslarge volumes and files, databases, VMsdesktops, snapshots before updatesfile servers, NAS, data integrity

In a few words

ext4: The safe all-rounder. Fast fsck, can be shrunk while unmounted. Limits (16 TB files, 1 EB volume) don’t matter in practice.

XFS: Built for big storage and parallel I/O, the default on RHEL. Grows online but can never shrink, so don’t give it all the space up front if you might need it back.

Btrfs: Copy-on-write with snapshots, compression (compress=zstd) and subvolumes. Solid for single disks and mirrors. Its RAID5/6 mode is still not recommended.

ZFS: File system and volume manager in one. Excellent integrity and snapshots, very popular for storage servers. Ubuntu supports it (sudo apt install zfsutils-linux). Plan pools carefully, they are hard to change later.

The others you’ll meet

File systemWhere
vfat / FAT32The EFI boot partition (/boot/efi). Max 4 GB per file.
exFATUSB sticks and SD cards, works on every OS
NTFSWindows disks; Ubuntu reads and writes them (ntfs3 driver)
swapNot a real file system: overflow for RAM. Ubuntu uses a /swap.img file by default.
tmpfsLives in RAM, gone on reboot (/run, /dev/shm)
NFS / CIFS (SMB)Network shares mounted like a local folder

Check what you have

df -hT          # file system type of every mount
lsblk -f        # type of every partition and volume
§ home
~/knubertus/home/
1,1 Top