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

  • You cannot snapshot a block device. It is a fixed array of blocks. You could copy it to another block device of the same size. You could copy it to a file. You could restore from the file to the block device, or run from the file at reduced performance and loss of that fi;e's point in history.
    – Skaperen
    Mar 20 '13 at 17:42

Two options, stop or pause the VM and:

  1. dd the image into a raw file, if you use the raw format
  2. use qemu-img convert to copy the disk image into any format file

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.