Guide
    Backup Content Hub

    RAW vs QCOW2 Disk Images in KVM: Which One Should You Choose?

    In KVM and OpenStack environments, virtual machines keep their operating systems and data in disk images. The two common formats are RAW and QCOW2, and they behave differently.

    Updated · Mr.PlanB

    Sections
    1
    Action Points
    0
    Guidance Blocks
    7

    Overview

    A RAW image is a plain binary disk file that looks much like a physical drive. There is no metadata layer on top, so its performance is close to the physical storage underneath. RAW images attach directly to virtual machines and convert easily into other formats, which makes them handy as an intermediate format during a migration. They are easy to extend and they cooperate with most tooling. What RAW does not do is snapshots or encryption. Version control tools can imitate snapshots, but somebody has to manage that.

    QCOW2, short for QEMU Copy-On-Write version 2, adds features on top of the basic disk. Copy-on-write means the file grows only as data is written, so it uses storage efficiently. QCOW2 also supports internal snapshots, zlib compression and AES encryption with 128-bit keys. That combination suits cloud and other fast changing environments, where flexibility and storage use come first.

    The qemu-img command-line tool converts between the two. Converting QCOW2 to RAW, or RAW to QCOW2, is a matter of naming the source and target formats.

    So RAW is the pick for performance and simplicity, and QCOW2 for environments that want snapshots, compression and encryption. Which one fits depends on the workload, the performance you need and how much management you want to take on.

    FAQs

    1. Which of the two formats performs better under load?

    RAW is usually a little faster, because there is so little structure in the way.

    2. Does QCOW2 save storage space compared with RAW?

    Yes. It grows as data is written and it supports compression.

    3. Can RAW and QCOW2 images be converted into each other?

    Yes. The qemu-img tool converts between the two formats.

    Related guides

    More from the backup hub on the same topics.

    Topic hub
    All OpenStack guides
    Every article on this topic in one list.
    Compare
    VM Platform Ledger
    15 virtualization platforms scored on capability, buyer risk and lock-in.
    Free tool
    Backup Advisor
    Describe your systems in one sentence and get a 20 second video plan.

    Need help with backup and recovery?

    Use the form below to get in touch about backup strategy, recovery planning, and data protection projects.