qcow2镜像文件瘦身 配置
qcow2镜像文件瘦身 配置使用dd命令将客户机未使用的磁盘空间用0填满
$dd if=/dev/zero of=~/junk
dd: writing to `/home/***/junk’: No space left on device
而后
$rm junk
关闭客户机
qemu-img check debian.qcow2
No errors were found on the image.
74133/81920 = 90.49% allocated, 0.00% fragmented, 0.00% compressed clusters
Image end offset: 4859428864
# qemu-img convert -c-O qcow2 debian.qcow2 debian.qcow2.qcow2
# qemu-img check debian.qcow2.qcow2
No errors were found on the image.
74133/81920 = 90.49% allocated, 35.09% fragmented, 34.67% compressed clusters
Image end offset: 3747151872
页:
[1]