Linux Backup and Disk Imaging Cheat Sheet/Convert a virtual disk image

Convert between raw, qcow2, and other image formats.

Section: Images and Clones

Convert a virtual disk image

bash
bash
qemu-img convert -O qcow2 disk.raw disk.qcow2
Explanation

Convert between raw, qcow2, and other image formats.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Images and Clones
Inspect a virtual disk image
Show image format, virtual size, and backing file info.
OpenIn sheetbashsame section
Create a raw disk image
Image a disk device to a raw file.
OpenIn sheetbashsame section
Compress a raw disk image
Compress large raw images for storage or transfer.
OpenIn sheetbashsame section
Compress an image with xz
Use stronger compression for cold storage backups.
OpenIn sheetbashsame section
Compare two images byte-for-byte
Quick equality check for cloned images of the same size.
OpenIn sheetbashsame section
Write a raw image back to disk
Restore a disk image onto a target device.
OpenIn sheetbashsame section