Convert qcows2 snapshot plus backup file to standalone image file

I have a qmu qcow2 disk snapshot dev.img based on the dev.bak backup file. How can I combine both into standalone devplus.img , leaving dev.bak as it is?

+7
qemu
source share
1 answer

I got some help from the qemu mailing list: First, copy the source base file to a standalone image file:

 cp dev.bak devplus.img 

Then "rebase" the image file that was copied from the original file so that it uses the new file:

 qemu-img rebase -b devplus.img dev.img 

Then you can commit the changes to the dev file on the new database:

 qemu-img commit dev.img 

Now you can use devplus.img as a separate image file and get rid of dev.img if you want, leaving the original dev.bak intact and without damaging other images based on it.

+8
source share

All Articles