Virtualization

Understand qcow2, Raw Disks, and KVM Storage Pools

Create equal virtual-capacity qcow2 and raw volumes; Compare apparent size and allocated space; Convert in both directions and verify data hashes; Measure a bounded I/O comparison and explain its limits.

By InventiveHQ Team

Episode 15 of the InventiveHQ KVM virtualization series.

Lab verified July 2026 · Ubuntu 26.04 · libvirt 12.0.0 · QEMU 10.2.1

What this episode proves

  • Create equal virtual-capacity qcow2 and raw volumes
  • Compare apparent size and allocated space
  • Convert in both directions and verify data hashes
  • Measure a bounded I/O comparison and explain its limits

Validated workflow

1. Create equal virtual-capacity qcow2 and raw volumes

virsh pool-define-as format-lab dir --target /var/lib/libvirt/format-lab

2. Compare apparent size and allocated space

qemu-img create -f qcow2 format-test.qcow2 1G

3. Convert in both directions and verify data hashes

qemu-img convert -O raw format-test.qcow2 format-test.raw

4. Measure a bounded I/O comparison and explain its limits

qemu-img compare format-test.qcow2 format-test.raw

Finished state

A small format-lab pool remains; disposable benchmark volumes are removed. The public scripts contain no private keys, passwords, or tokens. Review names, addresses, paths, ownership, backups, quorum, and fencing for your own environment before running them.

Need help from an IT & cybersecurity partner?

InventiveHQ helps businesses secure, modernize, and run their technology. Let's talk about your goals.

Get in touch