In virtualized and cloud environments, expanding virtual disk storage is a routine sysadmin task. Red Hat Enterprise Linux 9 (RHEL 9) makes online disk expansion seamless without requiring system reboots or service downtime.
This guide covers how to rescan block devices, extend partition boundaries with growpart, grow LVM Physical Volumes (PV), and expand Logical Volumes (LV) alongside the filesystem (XFS / ext4).
1. Verifying Available Free Disk Space
First, inspect the disk layout and partition boundaries using parted or lsblk:
parted /dev/vda u s p free
You should see unallocated free space at the end of the disk after expanding the virtual disk in your hypervisor (VMware, Proxmox, or KVM).
If the OS has not recognized the new disk capacity yet, trigger an online SCSI rescan:
echo 1 > /sys/class/block/vda/device/rescan
2. Growing the Partition (growpart)
Use growpart to expand partition 2 (or your primary OS partition) to occupy all contiguous free space:
growpart /dev/vda 2
Verify partition size update:
lsblk /dev/vda
3. Resizing LVM Physical Volume (PV)
Inform LVM of the increased partition capacity:
pvresize /dev/vda2
Check updated Physical Volume free space:
pvs
vgs
4. Extending Logical Volume (LV) and Filesystem
To extend the root Logical Volume (/dev/mapper/rhel-root) using 100% of remaining free space and automatically expand the underlying XFS or ext4 filesystem in one command:
lvextend -l +100%FREE -r /dev/mapper/rhel-root
The -r flag invokes xfs_growfs (for XFS) or resize2fs (for ext4) automatically.
5. Verification
Confirm the new filesystem size with df:
df -h /
Online disk expansion is now complete — zero downtime required!
Leave a Comment / Ask a Question
Have thoughts or questions on this article? Drop a message below and Faiez will receive an instant notification.