EMZETT.
Login

Linux file systems: ext4, Btrfs, XFS and ZFS

In short: A file system organises how data is stored on a drive. On Linux ext4 is the common default, Btrfs and ZFS offer snapshots and checksums, XFS is strong with large files.

In more detail: The choice affects safety, speed and functions such as undoing changes.

In detail

File systemStrengthNote
ext4robust, fast, supported everywheredefault on Debian, Ubuntu
Btrfssnapshots, compression, checksums, subvolumesdefault on Fedora, openSUSE
XFSvery large files and serversdefault on RHEL
ZFSchecksums, RAID, snapshots, replicationlicence question, much RAM, servers/NAS
F2FSfor flash storagephones, SD cards
exFAT, NTFSexchange with WindowsNTFS via the ntfs3 driver
  • Journaling: protects against broken structures at power loss.
  • Copy-on-write: Btrfs/ZFS never write over old data, so snapshots are cheap.
  • Checksums: detect silent data errors (“bit rot”).
  • Commands: df -h (space), lsblk -f (file systems), mkfs.ext4 /dev/sdX1, fsck, mount.
  • Mount configuration: /etc/fstab.
  • Snapshots with Btrfs: btrfs subvolume snapshot / /snap/before-update. Tools: Snapper, Timeshift.
  • RAID: does not replace a backup.

See also: Partitions, LVM and encryption (LUKS), Linux file system hierarchy (FHS)