LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This 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


Reply
  Search this Thread
Old 09-14-2011, 09:47 AM   #1
slacky
Member
 
Registered: Feb 2004
Location: USA
Distribution: Debian
Posts: 174

Rep: Reputation: 16
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.

Thanks,
slacky
 
Old 09-14-2011, 10:48 AM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,019

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
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.
 
Old 09-15-2011, 09:54 AM   #3
ottavio
Member
 
Registered: Nov 2007
Posts: 312

Rep: Reputation: 46
Quote:
Originally Posted by slacky View Post
What exactly is the difference between qcow2 and raw disk formats?
From the qemu.doc file:
http://qemu.weilnetz.de/qemu-doc.htm...005finvocation

Quote:
3.6.4 qemu-img Invocation

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.
 
Old 09-16-2011, 01:27 PM   #4
slacky
Member
 
Registered: Feb 2004
Location: USA
Distribution: Debian
Posts: 174

Original Poster
Rep: Reputation: 16
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.

slacky
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting Xen RAW image to KVM qcow2 makes Win2k8 guest BSOD Savaan Linux - Virtualization and Cloud 9 12-31-2011 11:59 AM
kvm-qemu-img: qcow2 disk image format changes to raw format in RHEL-KVM 5.6 rajivdp Linux - Virtualization and Cloud 2 09-19-2011 11:23 AM
How to resize the qcow2 image in the KVM? rajivdp Linux - Virtualization and Cloud 1 03-23-2011 05:36 PM
How to resize the qcow2 image in the KVM? rajivdp Linux - Virtualization and Cloud 2 03-23-2011 12:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 03:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration