KVM disk formats - difference between qcow2 and raw
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
KVM disk formats - difference between qcow2 and raw
Hello,
I am planning on virtualizing Debian Squeeze guests on a Debian Squeeze host. What exactly is the difference between qcow2 and raw disk formats? virt-install seems to generate raw files by default, although I am passing --nonspare. The only major difference I can tell is supposedly I need qcow2 if I want to take snapshots.
Raw is much like a dd copy of a hard drive. It is bit by bit.
Qcow2 has some features that may or may not be useful. It can expand and have other tools applied to the size both before and after creation. It can have encryption I believe also. There might be some other features too like the snapshots.
I tend to use qcow in almost all cases. It is the native format for that VM.
I do use raw also. When I dd a drive it ends up as raw and I leave it. Raw is also pre-sized and doesn't tax resources when the qcow is trying to allocate more area. It has caused me issues so if I need the system to work in more real time I use raw. Some OS's just seem to work better on raw. You can per-allocate the size on the qcow too.
Might be easier to convert raw to other images but there are a lot of image converters out there. Use qcow for the the big OS's and consider raw for things like qnx maybe and other os's that may not be a normal virtualized OS.
qcow2
QEMU image format, the most versatile format. Use it to have smaller images (useful if your filesystem does not supports holes, for example on Windows), optional AES encryption, zlib based compression and support of multiple VM snapshots.
Supported options:
backing_file
File name of a base image (see create subcommand)
backing_fmt
Image format of the base image
encryption
If this option is set to on, the image is encrypted.
Encryption uses the AES format which is very secure (128 bit keys). Use a long password (16 characters) to get maximum protection.
cluster_size
Changes the qcow2 cluster size (must be between 512 and 2M). Smaller cluster sizes can improve the image file size whereas larger cluster sizes generally provide better performance.
preallocation
Preallocation mode (allowed values: off, metadata). An image with preallocated metadata is initially larger but can improve performance when the image needs to grow.
Thanks for your help. So far I cannot get virt-install to generate anything but raw images, and I also cannot seem to mount the raw file under the host OS, so I need to play around some more.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.