virsh list
Id Name State
----------------------------------------------------
10 qemu_test running
qemu_test映射的qcow文件为test.qcow2
qemu-img info test.qcow2
image: /home/test.qcow2
file format: qcow2
virtual size: 3.0G (3221225472 bytes)
disk size: 912M
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
# shutdown
virsh shutdown qemu_test
Domain qemu_test is being shutdown
扩容:
qemu-img resize test.qcow2 +5G
Image resized.
查看
qemu-img info test.qcow2
进入虚机:
创建磁盘分区
fdisk /dev/vda
根据CentOS的提示创建新的分区
格式化
这一步很重要
mkfs -t ext4 /dev/vda3
mount
mount /dev/vda3 /home
绝大部分转载于:https://blog.csdn.net/han0373/article/details/107861814