This is the original disk layout before the disk extension
To include this new space into existing LVM, create a new partition on the new disk space using a tool called cfdisk. Please refer to this post on how to use cfdisk to create a new partition.
The first step is to become root. If you prefer using sudo, please append sudo on each of these commands.
Once we can see that the partition is available, create a new physical volume (PV) using the new partition.
# pvcreate /dev/sda3
We should see the message as per below
Then, check what is the name of our volume group (VG)
# vgs
Extend our VG by including the new PV
# vgextend centos /dev/sda3
Check what is our logical volume (LV) path
# lvdisplay | grep Path
Extend our LV to use the whole free space available on the VG
# lvextend -l +100%FREE /dev/centos/root
Check that our LV's size is now expanded
# lvs
Determine what is our filesystem type, at the same time we can see that our filesystem is not aware of the new size
# df -Th /
Grow xfs filesystem to suit the new partition size
# xfs_growfs /
We can see that the filesystem is now grown to the full size as per our LV
# df -Th /
No comments:
Post a Comment