23 Apr, 2024 3:35 AM
09 Jan, 2025 5:29 PM

Resizing volumes in RHEL

  1. Ensure disk is already expanded from hypervisor
  2. Check the list of disks attached lsblk
  3. Check if the disk expansion was recognised by RHEL
    fdisk /dev/sda
    Press p to check properties
    Press q to quit fdisk
  4. Delete the partition for the disk
    fdisk /dev/sda
    Press d and select the partition number (e.g 3)
    Press n to re-create partition
    Press t to select type. 8e is for local LVM filesystem
    Press w to write the changes
  5. Reprobe the disks modprobe -s
  6. Resize the PV pvresize /dev/sda
  7. Verify the disk is re-sized vgdisplay
  8. Verify the lv lvdisplay and confirm the LV that we want to expand
  9. Extend LV lvextend -l +100%FREE /dev/rhel_bastion/root
  10. Verify the LV size was extended lvdisplay
  11. Extend the filesystem to recognise the new disk size.
    For xfs filesystem: xfs_growfs /dev/rhel_bastion/root
    For other filesystem: resize2fs /dev/rhel_bastion/root

Updated Steps

  1. Check list of disks attached lsblk
  2. Recreate root partition
    fdisk /dev/sda
    Press p to check properties
    Press d2 to delete partition 2
    Press n2EnterDefault Valuen to create new partition
    Press w to save the configuration
  3. Run partprobe -s to sync the partition configuration
  4. Verify the volume group vgdisplay
  5. Expand the root partition
    lvextend -l +100%FREE /dev/mapper/rhel-root
  6. Expand the file system
    xfs_growfs /dev/mapper/rhel-root
Reference