In a previous article we looked at LVM. This short article describes how to grow an existing volume by adding an extra disk to the system. Specifically, we use a XenServer guest VM with CentOS installed.
The first disk of a XenServer guest VM is called xvda, the second disk (the one we added) is called xvdb. We start with the creation of a Physical Volume (PV) on the extra disk.
Then we extend the existing Volume Group (VG) called VolGroup00.
vgextend VolGroup00 /dev/xvdb
Then we extend the Logical Volume (LV) to the total size of the current and the extra disk, e.g. 12GB, or we extend the Logical Volume (LV) by the size of the extra disk, e.g. 4GB (pick one of these two methods).
lvextend -L12G /dev/VolGroup00/LogVol00lvextend -L+4G /dev/VolGroup00/LogVol00
Finally we resize the filesystem that uses this LV.