Hands-on Lab·Linux Foundation Certified System Administrator
ext4, xfs, and choosing between them
Both distributions offer both filesystems and each family defaults to a different one, so a task may name either. This guide formats two partitions on the same device, measures what each filesystem consumed before anything was written, and covers the one asymmetry that decides real designs: xfs cannot be shrunk.
Storage Guide 31 of 38 Intermediate
- PlatformsUbuntu 26.04 LTS + AlmaLinux 10.2
- LVM2.03.31 (Ubuntu) / 2.03.36 (AlmaLinux)
- nftables1.1.6 (Ubuntu) / 1.1.5 (AlmaLinux)
- TimeAbout 16 min
xfs is the default on RHEL and ext4 on Debian and Ubuntu. Both families can create both - xfsprogs and e2fsprogs - though not always installed by default.
- Firewallufw 0.36.2 enabled but reporting inactive / firewalld active
- Network confignetplan + systemd-networkd / NetworkManager 1.56.0
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| LFCS-A01 | 192.168.0.70 | Ubuntu 26.04 LTS | Primary host - most guides run only here | 2 Core | 4 GB | 50 GB |
| LFCS-C01 | 192.168.0.72 | AlmaLinux 10.2 | The other distribution - dnf, firewalld and NetworkManager | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when a task says to make a filesystem and does not say which. This matters because xfs cannot be shrunk at all - an asymmetry that should decide the choice long before performance does.
- putting both filesystems on one device
- measuring what each cost before a single file existed
- writing a file on each, and asking each filesystem about itself
- meeting the asymmetry that decides designs
- repeating the overhead measurement on the family that defaults to ext4
Before you start
- guide 31 - the partitions being formatted.
-
One device, two filesystems
-
What each one cost before a file existed
-
The differences you can see
-
And the asymmetry that decides designs
-
Both filesystems on Ubuntu, and the overhead again