File systems compared
ext4, XFS, Btrfs, ZFS, exFAT and friends: what they are good at and which one to pick.
The short answer
- Not sure? Use ext4. It is Ubuntu’s default, robust and every tool knows it.
- Big files, databases, lots of parallel writes? XFS is a great choice.
- Snapshots, checksums, compression built in? Look at ZFS (or Btrfs).
- USB stick to share with Windows/macOS? exFAT.
Comparison
| ext4 | XFS | Btrfs | ZFS | |
|---|---|---|---|---|
| Ubuntu default | yes | no | no | optional |
| Maturity | very high | very high | good | very high |
| Grow online | yes | yes | yes | yes |
| Shrink | offline only | no | yes | no (pool) |
| Snapshots | via LVM | via LVM | built in | built in |
| Checksums against silent corruption | metadata | metadata | data + metadata | data + metadata |
| Compression | no | no | yes | yes |
| Built-in RAID / pooling | no (use mdadm/LVM) | no | yes (avoid RAID5/6) | yes |
| RAM needs | low | low | low | higher (cache) |
| Best for | general use, boot, small/medium volumes | large volumes and files, databases, VMs | desktops, snapshots before updates | file 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 system | Where |
|---|---|
| vfat / FAT32 | The EFI boot partition (/boot/efi). Max 4 GB per file. |
| exFAT | USB sticks and SD cards, works on every OS |
| NTFS | Windows disks; Ubuntu reads and writes them (ntfs3 driver) |
| swap | Not a real file system: overflow for RAM. Ubuntu uses a /swap.img file by default. |
| tmpfs | Lives 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