====== 36 qcow2 シンプロ 圧縮 ====== ===== 普通に作成するとシンプロで作成される ===== #qemu-img create -f qcow2 aa.qcow2 10G # qemu-img info aa.qcow2 image: aa.qcow2 file format: qcow2 virtual size: 10 GiB (10737418240 bytes) disk size: 196 KiB cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false ===== フルプロ ===== # qemu-img create -o preallocation=full -f qcow2 aa.qcow2 10G # qemu-img info aa.qcow2 image: aa.qcow2 file format: qcow2 virtual size: 10 GiB (10737418240 bytes) disk size: 10 GiB cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false ==== preallocationオプション ==== | preallocation=full | フルプロビジョニング| | preallocation=off | シンプロビジョニング| | preallocation=metadata | ディスク領域だけ先に確保、中身はシンプロ \\ (※dfでみるとfull qemu-img infoで見るとシンプロ)| ===== 圧縮する場合 ===== コンバートして圧縮する。 # ls -alh -rw------- 1 root root 51G Feb 4 00:10 AAA.qcow2 qemu-img convert -c -f qcow2 -O qcow2 AAA.qcow2 AAA.qcow2-c # ls -alh -rw-r--r-- 1 root root 1.5G Feb 4 00:18 AAA.qcow2-c {{tag>qcow2}}