All documentation

Expanding a Logical Volume After Increasing an Existing Disk (RHEL / LVM)

Published April 22, 2025 Guide

Use Case

This guide walks through expanding a logical volume (e.g., /var/log) after increasing the size of an existing virtual disk (e.g., /dev/sda) in a Linux VM using LVM. The disk and partition names may vary, so the guide includes steps to dynamically identify and rescan the correct device.


High-Level Steps

  1. Identify the disk and partition
  2. Rescan to detect the new disk size
  3. Grow the partition
  4. Resize the physical volume (PV)
  5. Extend the logical volume (LV)
  6. Resize the filesystem

Step 1: Identify the Disk and Partition

View all disk layouts

lsblk

Identify the Physical Volume used by LVM

pvs

Look for something like:

/dev/sda3  vg_dcl_os  lvm2 a--  <410G  0

Confirm it's the Last Partition

fdisk -l /dev/sda

Ensure /dev/sda3 is the last partition on the disk.


Step 2: Rescan the Disk (Detect Size Change)

After increasing the disk size in vSphere/VCF:

Install if not available:

yum install sg3_utils -y

Run rescan:

rescan-scsi-bus.sh --forcerescan

Or use manual method:

echo 1 > /sys/class/block/sda/device/rescan

Verify disk size is updated:

lsblk

Step 3: Grow the Partition

Install growpart if needed:

yum install cloud-utils-growpart -y

Run growpart on the correct partition:

growpart /dev/sda 3

Verify the change:

lsblk

Step 4: Resize the Physical Volume

pvresize /dev/sda3

Check available space:

pvs

Step 5: Extend the Logical Volume

Use all free space:

lvextend -l +100%FREE /dev/vg_dcl_os/var_log

Or extend by a specific size:

lvextend -L +10G /dev/vg_dcl_os/var_log

Step 6: Resize the Filesystem

Check filesystem type:

df -T /var/log
  • For ext4: resize2fs /dev/vg_dcl_os/var_log
  • For xfs: xfs_growfs /var/log

Step 7: Validate

df -hT /var/log

You should now see the expanded capacity.


Notes

  • This only works if the partition you are growing is the last one on the disk.
  • Always take backups or VM snapshots before making changes.
  • This guide assumes /var/log is on LVM. Adjust accordingly for other mount points.