With the extensive use of virtualization technology, there are more and more ideas about using virtualization, such as directly expanding the disk space. In this case, I recommend the method of adding a new disk, which is consistent with the normal use of physical machines. Way.
There is another way to increase disk space, which is to directly expand the space of the existing disk. This method is used in this article.
xm list
(1) Enter the virtual machine Machine console
(2) Check the disk partition
It is found that the disk space has not changed and the disk space has not changed. The size has been expanded to 10G. If you directly add the expanded space, you can create another partition and use it directly. Merge the newly created partition directly into the current LVM logical volume.
(3) Partition
Add the new disk Add the unused disk space to create a new primary partition /dev/xvda3, and identify the disk as the lvm partition
fdisk /dev/xvda
n
p
##3t
3
8e
w
5. Merge the new partition into the LVM logical volume
pvcreate /dev/xvda3
pvs
##(2) Create a logical volume group
vgs
vgextend VolGroup /dev/xvda3
##(3) Extend the existing logical volume
lvs
##lvextend -l 100%FREE /dev/VolGroup/lv_root
(4) resize extended logical partition
resize2fs /dev/VolGroup/lv_root
At this time, add disk space and the expansion is completed.
The above is the detailed content of How to expand disk space of xen virtual machine. For more information, please follow other related articles on the PHP Chinese website!