Extending LVM Volumes and Filesystems
The objective is one line and the mistake is universal: growing the logical volume does not grow the filesystem on it. That is captured - a 300 MiB volume becomes 600 MiB while df still reports it full at 236 MiB - and then fixed two ways, including the single flag that does both.
File Systems Guide 40 of 67 Intermediate
- OSRHEL 10.0
- Kernel6.12.0-55.9.1.el10_0
- dnf4.20.0
- Flatpak1.16.0
- TimeAbout 13 min
lvextend -r resizes the filesystem as well, calling xfs_growfs or resize2fs as appropriate. It is the form to memorise: it works while mounted, it cannot be done in the wrong order, and it removes the need to remember which tool goes with which filesystem.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| RHCSA-A01 | 192.168.0.31 | RHEL 10.0 | Practice node (graded) - spare /dev/sda | 2 Core | 4 GB | 50 GB + 15 GB |
This guide includes
Use this because the mistake here is close to universal. This matters because growing the logical volume does not grow the filesystem sitting on it - df is unchanged until you grow the second thing too.
- starting from a filesystem that has genuinely run out
- growing the volume alone, and finding that nothing changed
- growing the filesystem afterwards
- using the one command that does both at once
- filling the group, and finding that ext4 needs a different tool from XFS
Before you start
- A volume group with free space -
guide 33builds one. - The session creates a volume, fills it, grows it and removes it.
-
A filesystem that has run out
-
Growing the volume alone changes nothing
-
Growing the filesystem
-
The one command that does both
-
Filling the group, and what happens then
-
ext4 uses a different tool