Score:0

Incremental backup qcow2 image with rsync

ua flag

I use rsync to backup the qcow2 disks of my virtual machines. However, I would like to be able to get an incremental backup so that I don't have to copy the entire disk every time. for now I use rsync -hav --progress / source / target, the execution time is always the same even if the second time the disk has already been copied and it should take much less

UPDATE

doing some additional research I discovered the existence of bitmaps:
https://wiki.qemu.org/Features/IncrementalBackup
https://qemu.readthedocs.io/en/latest/interop/bitmaps.html#overview
which should make it possible to perform an incremental backup of a qcow2 disk, however I don't know the correct procedure and the topic in general is not entirely clear to me. is there anyone who knows the subject better who can help me?

Score:1
ng flag

here is an utility that makes use of the bitmap features that you have mentioned, it supports incremental and differential backups and also saves the virtual machine configuration and related files. It also comes with an restore utility to recover the virtual machine and an utility to map the backups into an overlay image for single file recovery. It however expects that you manage your virtual machines using libvirt:

https://github.com/abbbi/virtnbdbackup

there is a solution for standalone qemu processes aswell, it connects directly to the qemu process using the qemu management protocol to allow for incremental backups using dirty bitmaps:

https://github.com/abbbi/qmpbackup

Note: ive authored both of these utilities.

bye,

  • michael
Score:0
ca flag

I know this is late, but can be useful for others.

rsync is an invaluable tools to reduce network transfers, but it does not reduce required disk bandwidth for changed files with default settings as it first copies the entire file, then it applies the required changes and finally it renames the temp file to the original name.

You can try with --inplace to avoid the intermediate copy, but be aware that rsync is not particularly efficient with very big files.

If it does not prove to be the right tool, you can try something as bdsync or blocksync.

Even better, if your filesystem support it (read: if you are using btrfs or zfs), you can send/recv it for true differential backups.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.