Expand Disk in CentOS

Enlarge Disk Size in Hypervisor

Create Partition from Free Space

Run the below commands in order:

fdisk -l Find which disk to work on – probably sda for system


fdisk /dev/sda Enter fdisk utility
p Print partition table
n Create new partition
p Choose Primary Partition
3 Partition number
Enter x2 To choose all available free space
t To change partition ID
3 To select newly created partition
8e To choose a Linux LVM partition type
w Write changes
partprobe Reloads the partition changes

Make Space available to Volume Group

fdisk -l Confirm new partition exists
pvcreate /dev/sda3 Convert new partition to physical volume
vgdisplay Show volume groups to get VG Name – eg VolGroup00 or centos

vgextend centos /dev/sda3 Extend the Volume Group to include new partition

Extend Logical Volume into Space

lvdisplay Show logical volumes – eg LogVol00 or root

vgdisplay centos | grep "Free"

Confirm free space in Volume Group centos – if answer is ‘<16.00 GiB’ try 15.99

lvextend -L+#G /dev/centos/root

Where # is the number of Free space in GB available as per the previous command

lvextend -l +100%FREE /dev/centos/root

Expand into all available free space

xfs_growfs /dev/centos/root

Extend the filesystem into the free space

df -h / Confirm filesystem has additional space now