Resizing volumes in RHEL
- Ensure disk is already expanded from hypervisor
- Check the list of disks attached
lsblk
- Check if the disk expansion was recognised by RHEL
fdisk /dev/sda
Press p
to check properties
Press q
to quit fdisk
- 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
- Reprobe the disks
modprobe -s
- Resize the PV
pvresize /dev/sda
- Verify the disk is re-sized
vgdisplay
- Verify the lv
lvdisplay
and confirm the LV that we want to expand
- Extend LV
lvextend -l +100%FREE /dev/rhel_bastion/root
- Verify the LV size was extended
lvdisplay
- 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