how do I backup my qemu kvm img files that are block files?

Doug Symes asked:

I inherited a pair/cluster of Ubuntu 10.04 servers running DRBD and QEMU/KVM and I want to backup the img files but they appear to be block files on the DRBD fs and I’m not sure how I can back them up. I tried to use the qemu snapshot command; it replies: qemu-img: “Could not create snapshot ‘rhea_snapshot’: -95 (Operation not supported)” the img files are in /dev/mapper folder.

Here is an example:

brw-rw—- 1 root disk 251, 12 2013-03-20 10:55 vg00-server1.img

My answer:


The typical way this is done is to use DRBD on LVM logical volumes, which can then be backed up using LVM snapshots. This guarantees you a backup of a specific point in time, though it is going to require more than a bit of rearchitecting the mess you’ve inherited.

In the meantime, you can just copy the image files, with the caveat that they will be completely internally inconsistent and quite possibly useless unless you shut down the VM that uses it during the copy.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.