Resize LVM Volume

on Aug. 10, 2022, 8:09 p.m.

First, add the new disk to a physical volume. This assumes the new disk is /dev/sdb
pvcreate /dev/sdb
Next, we do this to get the volume group need the logical volume is a part of
vgdisplay
lvdisplay
Next, we extend the volume group
vgextend ubuntu-vg /dev/sdb
Next, we need to extend the logical volume
lvextend -l+100%FREE /dev/ubuntu-vg/ubuntu-lv
Finally, we resize the partition
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
To check to see if the space is there, we run the df command
df -h