When I do the below then the qcow2 file is less than 200KB.
# qemu-img create -f qcow2 /var/lib/libvirt/images/urb-dat0.qcow2 10G
# du -hsc /var/lib/libvirt/images/urb-dat0.qcow2
196K /var/lib/libvirt/images/urb-dat0.qcow2
If I attach it to a KVM guest and fdisk -l
Disk /dev/vdb: 0 MB, 197120 bytes, 385 sectors
Question
How to make a 10GB qcow2 file that is not thin provisioned?
You can use the
preallocation
option.Reference: https://linux.die.net/man/1/qemu-img
An existing thin-provisioned qcow2 file can be converted to a fully allocated one like this:
(This is not an answer to the question but might still be of interest.)