With the large use of virtualization technology, the use of virtualization thinking and start more, such as the direct expansion of disk space, I recommend the way to re-add a disk, in line with the normal use of physical machines.
Another way to increase disk space is to directly extend the space of an existing disk, as this is the case with this article.
1. View the virtual machine configuration file
XM List
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/83/1F/wKioL1dralSwfP5bAAAvie507nU295.png "title=" 00.png "alt=" Wkiol1dralswfp5baaavie507nu295.png "/>
2. DD2 virtual machine with/data/dd2.img
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/83/1F/wKiom1dramODXjTNAAByUI_vGdc174.png-wh_500x0-wm_3 -wmp_4-s_3742684356.png "title=" 00.png "alt=" Wkiom1dramodxjtnaabyui_vgdc174.png-wh_50 "/>
3. Direct expansion of existing virtual disk space
View virtual machine disk File size now
Ll-h
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/83/1F/wKioL1dranLCwKlSAABuxvm_2zs325.png-wh_500x0-wm_3 -wmp_4-s_1903541546.png "title=" 00.png "alt=" Wkiol1dranlcwklsaabuxvm_2zs325.png-wh_50 "/>
Direct expansion of virtual machine disk files
DD if=/dev/sdb1 bs=1024m count=4 >>/data/dd2.img
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/83/1F/wKiom1draoTyb-5RAACcx_eoVSE559.png-wh_500x0-wm_3 -wmp_4-s_2443392138.png "title=" 00.png "alt=" Wkiom1draotyb-5raaccx_eovse559.png-wh_50 "/>
has been extended to 10G, the following is a virtual machine configuration
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/83/1F/wKioL1drapWCEnyaAABFD_l4zwY301.png-wh_500x0-wm_3 -wmp_4-s_1414598108.png "title=" 00.png "alt=" Wkiol1drapwcenyaaabfd_l4zwy301.png-wh_50 "/>
4. Start and enter the virtual machine and partition
Virt-manager &
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/83/1F/wKiom1draqqgIla4AAAV-npVIVo031.png "title=" 00.png "alt=" Wkiom1draqqgila4aaav-npvivo031.png "/>
(1) Enter the virtual machine console
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/83/1F/wKioL1drar3CDwrbAACRQwqpjZE765.png-wh_500x0-wm_3 -wmp_4-s_614196951.png "title=" 00.png "alt=" Wkiol1drar3cdwrbaacrqwqpjze765.png-wh_50 "/>
(2) View disk partitions
View to disk space is not changed, the size of the disk has been extended to 10G. Add the expanded space directly, you can create another partition, and use it directly. The newly created partition is incorporated directly into the LVM logical volume now.
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/83/1F/wKioL1dras6x4NFwAAAWji06vz8309.png-wh_500x0-wm_3 -wmp_4-s_4176472835.png "title=" 00.png "alt=" Wkiol1dras6x4nfwaaawji06vz8309.png-wh_50 "/>
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/83/1F/wKiom1drat7ifzMxAAAhv1zGP1E559.png-wh_500x0-wm_3 -wmp_4-s_2297440378.png "title=" 00.png "alt=" Wkiom1drat7ifzmxaaahv1zgp1e559.png-wh_50 "/>
(3) Partitioning
Create a new primary partition/dev/xvda3 with the newly added unused disk space behind the disk and identify the disk as an LVM partition
Fdisk/dev/xvda
N
P
3
T
3
8e
W
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/83/1F/wKiom1dravHToMcHAAJMA8fVm_Y358.png-wh_500x0-wm_3 -wmp_4-s_3039004377.png "title=" 00.png "alt=" Wkiom1dravhtomchaajma8fvm_y358.png-wh_50 "/>
5. Merging new partitions into LVM logical volumes
(1) Create a physical volume
Pvcreate/dev/xvda3
PVs
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/83/1F/wKioL1drawLi0k1oAAAcfWibPPo713.png "title=" 00.png "alt=" Wkiol1drawli0k1oaaacfwibppo713.png "/>
(2) Creating a logical Volume group
VGs
Vgextend Volgroup/dev/xvda3
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/83/1F/wKioL1draxezZ-MDAAATePV0pn0750.png "title=" 00.png "alt=" Wkiol1draxezz-mdaaatepv0pn0750.png "/>
(3) Extending an existing logical volume
Lvs
Lvextend-l +100%free/dev/volgroup/lv_root
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/83/1F/wKiom1drayfQj2cuAAAWiLlokBI944.png-wh_500x0-wm_3 -wmp_4-s_2073496604.png "title=" 00.png "alt=" Wkiom1drayfqj2cuaaawillokbi944.png-wh_50 "/>
(4) Resize extended logical partition
Resize2fs/dev/volgroup/lv_root
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/83/1F/wKiom1drazeQapv-AAAvB-yPUGI452.png-wh_500x0-wm_3 -wmp_4-s_2881492986.png "title=" 00.png "alt=" Wkiom1drazeqapv-aaavb-ypugi452.png-wh_50 "/>
To the time, add disk space, expand complete.
This article is from the "Calf---xmlgrg" blog, please be sure to keep this source http://xmlgrg.blog.51cto.com/10467412/1792132
5, Xen virtual machine extended disk space again a method