Growing a filesystem without losing it
This is the most dangerous sequence in the Storage domain, and the whole of it is one rule about order. This guide grows a volume, watches the filesystem stay the same size, then grows the filesystem too - and checksums the data after every single step to prove nothing was lost.
Storage Guide 34 of 38 Advanced
- OSUbuntu 26.04 LTS
- LVM2.03.31 (Ubuntu) / 2.03.36 (AlmaLinux)
- nftables1.1.6 (Ubuntu) / 1.1.5 (AlmaLinux)
- TimeAbout 20 min
lvextend -r and lvreduce -r call the right resize tool for the filesystem and are the safe way to do this on both families. ext4 can grow online and shrink offline; xfs can grow online and cannot shrink at all.
- 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 |
This guide includes
Use this for the most dangerous sequence in the Storage domain. This matters because the volume and the filesystem are two separate resizes - and doing them in the wrong order is how the data goes.
- checksumming data worth not losing, before anything else
- growing the volume, then the filesystem, while it stays mounted
- running out of room, and adding a disk to the group
- doing both at once, across two disks
- shrinking in the order that destroys nothing, and meeting the command that does not exist
Before you start
- guide 34 - the stack this page resizes.
-
Data worth not losing
-
Growing the volume, and nothing else
-
Growing the filesystem, while it is mounted
-
Running out of room, and adding a disk
-
Both at once, and across both disks
-
Shrinking, in the order that does not destroy anything
-
The asymmetry that decides which filesystem to use