First you would check to see if the Volume group had any free space using either vgs or vgdisplay
vgs VG PV LV SN Attr VSize VFree centos 1 2 0 wz--n- <79.47g 0 #the VFree column is zero, no space vgdisplay --- Volume group --- VG Name centos <SNIP> VG Size <79.47 GiB PE Size 32.00 MiB Total PE 2543 Alloc PE / Size 2543 / <79.47 GiB Free PE / Size 0 / 0 #The Free PE is Zero, no space left VG UUID y79R98-0yM7-nAZZ-m00t-mhrp-0MgR-vkcbsi
Lets check the physical volumes incase we missed some space
pvs PV VG Fmt Attr PSize PFree /dev/sda2 centos lvm2 a-- <79.47g 0 #PFree is also zero --- Physical volume --- PV Name /dev/sda2 VG Name centos PV Size <79.50 GiB / not usable 30.00 MiB Allocatable yes (but full) PE Size 32.00 MiB Total PE 2543 Free PE 0 #Free PE is zero here Allocated PE 2543 PV UUID LVA29B-NcbK-Teg6-AMnU-iJWQ-Nyhw-e9Apl8
So we need a new/bigger disk. If you find some Free PE, you can skip straight to Step 6
fdisk /dev/sdb #repeat this first step for all new disks required (/dev/sdc)
fdisk -l #check
pvcreate /dev/sdb1 #/dev/sdc1 /dev/sdd1 # add as applicable pvs #check the creation
vgextend centos /dev/sdb1 vgs #we can recheck the VFree value now VG PV LV SN Attr VSize VFree centos 1 2 0 wz--n- <79.47g 50.00g #the VFree column is zero, no space
(best method)
vgdisplay |grep Free Free PE / Size 1562 / 50.00 GiB
We have 1562 extends now to use
(best method)
lvextend -l +562 /dev/centos/root #add 562 of them to a logical volume called root #The remaining 1000 (32gb) are saved for later
(lazy method)
lvextend -L +50GB /dev/centos/root #add 50GB of to a logical volume called root #You may have to fiddle with the numbers to get the right space added
(extra lazy method
lvextend -l +100%FREE /dev/centos/root #assign ALL space to the root
resize2fs /dev/centos/root #this can be done without unmounting
lvdisplay |grep Size Alloc PE / Size 3543 / <110.72 GiB df -h /dev/mapper/centos-root xfs 127G 20G 109G 15% /
All good