Description: XenServer installed in the virtual machine, the partition is using the LVM disk partition
requirements: now need to expand the virtual machine root partition/
First, use Xencenter to increase the disk capacity of the virtual machine, as shown in the following figure
Increase Current disk to 50GB
Note: Must be in the virtual organization machine state
Second, look at the hard disk capacity
Df-h #可以看到此时根分区还是12G, no change.
Fdisk-l #已经可以看到整个磁盘容量变为53 6GB.
Third, create a new disk partition
Fdisk/dev/xvda #对磁盘/dev/xvda to operate
8e #输入 8e, using LVM type on behalf of partitions
W #保存以上操作, otherwise you cannot create a new partition
After restarting the system, do the following
Iv. Add the newly created partition/dev/xvda4 to the root partition/same LVM
MKFS.EXT3/DEV/XVDA4 #格式化分区, you need to wait a while.
PVCREATE/DEV/XVDA4 #创建一个新的LVM分区
Pvdisplay #查看已经存在的pv (physical volume)
Vgdisplay #查看当前已经存在的vg (Logical Volume Group)
Lvdisplay #查看已经存在的lv (Logical volume)
Vgextend volgroup00/dev/xvda4 #把/dev/xvda4 Join the same VG AS/directory (Logical Volume Group)
Lvextend-l +30.01gb-n/dev/volgroup00/logvol00 #扩容lv (logical volume) LogVol00
E2fsck-f/dev/volgroup00/logvol00 #检查
Resize2fs/dev/volgroup00/logvol00 #生效
Df-h #查看挂载状态, display/partition has been enlarged
at this point, the xenserver virtual machine expands the LVM disk partition complete.