Method One
The mirror provided by Stacklet is too small, only 10G, so it has to be manually added.
Add 40G to the mirror
The code is as follows |
Copy Code |
DD If=/dev/zero of=imcat.centos.img bs=1g conv=notrunc count=1 seek=40 1+0 Records in 1+0 Records out 1073741824 bytes (1.1 GB) copied, 51.9901, 20.7 MB/s |
Scan for mirrored files:
The code is as follows |
Copy Code |
Losetup-d/dev/loop0 Losetup/dev/loop0 imcat.centos.img E2fsck-f/dev/loop0 Resize2fs/dev/loop0 E2fsck-f/dev/loop0 Losetup-d/dev/loop0 |
Method Two
To turn off the virtual machine:
The code is as follows |
Copy Code |
#/USR/SBIN/XM Shutdown VM01 |
Append 4GB space to the virtual machine image file (. img):
The code is as follows |
Copy Code |
# dd If=/dev/zero bs=1024k count=4096 >>/vm/vm01.img |
Scan for mirrored files:
The code is as follows |
Copy Code |
#/sbin/e2fsck-f/vm/vm01.img |
This time just increased the size of the mirrored file (hard disk), this image file is not a normal file, which contains a mount/umount loop file system, so you need to adjust the file system size, otherwise enter the virtual machine DF will find the size of the hard drive:
The code is as follows |
Copy Code |
#/sbin/resize2fs/vm/vm01.img |
To restart the Xen virtual machine:
The code is as follows |
Copy Code |
#/USR/SBIN/XM Create Vm01 |
To view the size of your hard disk after entering the virtual machine:
code is as follows |
copy code |
#/usr/sbin /XM console vm01 # df-h |