Create & modify Qemu and Raw disk images:


To create images:

This example creates a qcow2 image with a maximum size of 8GB:
qemu-img create -f qcow2 disk1.qcow2 8G

This example creates a RAW image with a maximum size of 8GB:
qemu-img create -f raw disk1.img 8G

To view Image properties:

This example displays attributes of a qcow2 image:
qemu-img info disk1.qcow2

This example displays attributes of a RAW image:
qemu-img info disk1.img

To increase virtual disk size:

This example increases the size of a qcow2 image:
qemu-img resize disk1.qcow2 16G

This example increases the size of a RAW image
qemu-img resize -f raw disk1.img 16G


Source | Date: June 5th 2021




Back

© 2019 to 2025 Branden Gilfoil & © up to 2025 for respective owners.