Qemu: Merge snapshot and backing file into standalone disk

Praveen Kumar
Nov 29, 2018 · 2 min read
# qemu-img info --backing-chain test1-master-0 
image: test1-master-0
file format: qcow2
virtual size: 16G (17179869184 bytes)
disk size: 4.6G
cluster_size: 65536
backing file: /var/lib/libvirt/images/test1-base
backing file format: qcow2
Format specific information:
compat: 0.10
refcount bits: 16
image: /var/lib/libvirt/images/test1-base ***
file format: qcow2
virtual size: 16G (17179869184 bytes)
disk size: 1.6G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
# cp test1-base new-master
# qemu-img rebase -b new-master test1-master-0
# qemu-img commit test1-master-0
Image committed.
# qemu-img info new-master
image: new-master
file format: qcow2
virtual size: 16G (17179869184 bytes)
disk size: 6.1G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
Praveen Kumar

Written by

Runner, Cyclist, Open-source lover, MiniShift Developer !!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade