CertGrid CertGrid
Hands-on Lab·Linux Foundation Certified System Administrator

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

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.

Every resize on this page was followed by `md5sum -c` against a 200 MiB file written before any of them. It passed four times, including after the shrink.
Server NameIP AddressOSRolesCPURAMHDD
LFCS-A01192.168.0.70Ubuntu 26.04 LTSPrimary host - most guides run only here2 Core4 GB50 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.

Before you start

  1. Data worth not losing

  2. Growing the volume, and nothing else

  3. Growing the filesystem, while it is mounted

  4. Running out of room, and adding a disk

  5. Both at once, and across both disks

  6. Shrinking, in the order that does not destroy anything

  7. The asymmetry that decides which filesystem to use

Official sources