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 system | Strength | Note |
|---|---|---|
| ext4 | robust, fast, supported everywhere | default on Debian, Ubuntu |
| Btrfs | snapshots, compression, checksums, subvolumes | default on Fedora, openSUSE |
| XFS | very large files and servers | default on RHEL |
| ZFS | checksums, RAID, snapshots, replication | licence question, much RAM, servers/NAS |
| F2FS | for flash storage | phones, SD cards |
| exFAT, NTFS | exchange with Windows | NTFS 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)