使用qemu-img创建虚拟磁盘文件
yum install -y qemu-img
qemu-img --help
Supported formats: vvfat vpc vmdk(vmware,virtualbox磁盘文件) vhdx vdi ssh sheepdog rbd raw host_cdrom host_floppy host_device file qed qcow2(kvm的虚拟磁盘格式) qcow parallels(Mac上的parallels) nbd iscsi gluster dmg tftp ftps ftp https http cloop bochs blkverify blkdebug
qemu-img create -f qcow2 -o preallocation=metadata /root/kvm.qcow2 80G
[root@7 ~]# ls -lh /root/kvm.qcow2
-rw-r--r--. 1 root root 81G Sep 29 11:30 /root/kvm.qcow2
[root@7 ~]# du -sh /root/kvm.qcow2
16M /root/kvm.qcow2
qemu-img resize /root/kvm.qcow2 300G