Shrink the new image with qemu-img resize -f qcow2 -shrink test.qcow2 3G.Convert the vmdk image to qcow2 with qemu-img convert test.vmdk -O qcow2 -o preallocation=falloc test.qcow2.Create a vmdk image with qemu-img create -f vmdk test.vmdk 5G.
The whole point of resizing that image was to free up disk space on the host. The size inside the VM is also reported as being 30GB. However, the file still consumes 151GB of space: $ du -h macOS-10.9.qcow2 151G macOS-10.9.qcow2Įven though qemu-img info shows: $ qemu-img info macOS-10.9.qcow2 image: macOS-10.9.qcow2 file format: qcow2 virtual size: 30 GiB (32212254720 bytes) disk size: 30 GiB cluster_size: 65536 Format specific information: compat: 1.1 compression type: zlib lazy refcounts: false refcount bits: 16 corrupt: false extended l2: false This resulted in macOS-10.9.qcow2 being 151GB big: $ du -h macOS-10.9.qcow2 151G macOS-10.9.qcow2Īfter reducing the filesystem size from within macOS to 25GB with DiskUtil, I shut down the VM and resized the image to 30GB with: qemu-img resize -f qcow2 -shrink macOS-10.9.qcow2 30G
The image was originally converted from a VMware image with: qemu-img convert macOS-10.9.vmdk -O qcow2 -o preallocation=falloc macOS-10.9.qcow2 I have a macOS 10.9 VM using a qcow2 image that was 151GB. This is a qemu-img issue with no VM running.