We have some LV disk on xen server.there are a number of linux systems in the LV disk.And now it is less space among LV. We need to extend the space immediately.


Main steps:

1.Shutdown the virtual system,Imagine the VM name is CentosA

xm shutdown CentosA

2.Check if VG have enough left space.

#vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "xen_disk" using metadata type lvm2
#vgdisplay xen_disk
 Alloc PE / Size       529408 / 2.02 TB
  Free  PE / Size       411435 / 1.57 TB

It free 1.57TB .

3.Extend LV disk

#lvextend -L +300GB /dev/xen_disk/CentosA

4.Confirm LV disk stype.

#blkid
/dev/xen_disk/xxx  UUID=XXXX       SEC_TYPE="ext2" TYPE="ext3"
/dev/xen_disk/xxx  UUID=XXXX       TYPE="xfs"

5.If it is ext2 or ext3

e2fsck -f /dev/xen_disk/CentosA
resize2fs /dev/xen_disk/CentosA

6.if it is xfs formate

#xfs_check  /dev/xen_disk/CentosA
#mount /dev/xen_disk/CentosA   /mnt
#xfs_growfs  /mnt

7.start VM and verify

#xm create -c /xenconfig/CentosA
#df -h