In Proxmox, VM data is stored using virtual hard disks. These disks are stored as files in the datastore, unlike physical drives. The two popular formats for virtual hard disks are raw and qcow2.
Both the qcow2 and raw disk formats have advantages and disadvantages. If you require additional features, go for qcow2. However, if you prioritize I/O performance, opt for a raw disk format. When selecting a raw disk format, ensure that you use a Proxmox storage type that allows snapshots.
Our macOS Templates comes standard with qcow2 to give it’s benefits.
raw Disk Image
Raw images offer a “raw” characteristic that results in performance comparable to physical drives, making them highly efficient. Moreover, this feature allows for direct attachment to VMs. Another advantage of raw images is their straightforward conversion to various image types.
Raw signifies being in its original and unformatted form, such as a disk. In Linux, a raw image is a type of unadulterated binary image. In a file system that allows sparse files, a raw image only occupies the real storage capacity of the disk data.
qcow2 Disk Image
qcow2, also known as QEMU Copy on Write 2, is a virtual image format that is compatible with the QEMU emulator. It is a popular choice in virtual environments, similar to raw image, and currently offers nearly identical performance.
Benefits over raw Disk Image
- The qcow2 image requires less storage space because it does not support holes in the file system. In contrast, the raw image is typically larger in size. The qcow2 file only expands when the virtual machine utilizes the disk space, resulting in a more efficient storage solution.
- With COW and copy-on-write, the qcow2 image reflects only the modifications made to the underlying disk.
- Snapshots are supported by qcow2 images, and it is possible to have multiple snapshots in one image.
- Within the qcow2 file format, zlib compression can be applied independently to each cluster, providing enhanced compression capabilities.
- The support for AES encryption in qcow2 allows for encryption using a 128-bit key.
Converting a Disk Image Format
Should you already have a Virtual Machine running on Proxmox with one or the other format and want to switch for the benefits over the other, you can convert using the QEMU-img conversion tool, which comes bundled in Proxmox.
Converting qcow2 to raw
qemu-img convert -p -f qcow2 -O raw /<folder>/<disk-image>.qcow2 /<folder>/<disk-image>.raw
- -p displaying the progress of the conversion
- -f format of the source disk image
- -O format of the target disk image
- <folder> /var/lib/vz/images/
- /mnt/pve/<storage>/images (if not using default storage)
- <disk-image>.raw/qcow2 (largest one)
Converting raw to qcow2
qemu-img convert -p -f raw -O qcow2 /<folder>/<disk-image>.raw /<folder>/<disk-image>.qcow2
- -p displaying the progress of the conversion
- -f format of the source disk image
- -O format of the target disk image
- <folder> /var/lib/vz/images/
- /mnt/pve/<storage>/images/ (if not using default storage)
- <disk-image>.raw/qcow2 (largest one)