Skip to content

"Differential" Backups of QEMU VM disks?

I have multiple TBytes of QEMU VM disks / disk images (.img and .qcow2) and am currently using rsync to backup all files to HDDs.

As rsync basically replaces the old version of a disk image by writing the complete new version onto the HDDs, it is terribly slow. For example sometimes it has to write 500GB because I booted a VM.

Is there a recommended solution which allows to only write the changes, instead of the whole disk using rsync or something that nicely integrates into a rsync script?

3 points3 comments
Open on Reddit
About this post
Posted
Archived
Score
3 · 81% up
Kind
Text
ID
17cntps

Author

4
posts
6
comments
0
media
View profile

2 comments

I've been struggling with the same thing, and I've been thinking a bit about it again recently, since I'm planning on setting up a new NAS. In the past, for rsync I read a whole bunch of posts regarding in-place sync, and other options to efficiently sync a large file. When I finally got it working so that it did an in-place sync, it was actually slower than just copying the whole file.

In theory, I'd imagine you'd need some process that creates check-sums for "blocks" of the source file, and compares that against a checksum file at the destination. Then if a block matches the check-sum, don't copy, otherwise do. For an image file I would guess that it would function reasonably well, as I wouldn't expect you'd have any inserts or deletes like you would with a text file. It shouldn't shift and become misaligned so that at some part during the process none of the check-sums match anymore. I haven't really looked to see if there are any programs that do this.

Ideally however, you'd be able to only get the changes, so maybe one option is to use something like external snapshots, which from what I understand puts the changes in a separate file rather than internally in the same .qcow2. You'd only have to copy the external snapshot as the base image should remain the same.

The other possible option I've been thinking about is to run the VMs on a zfs zvol block device, and then using zfs snapshots and zfs send to only get the differences. I have no idea if that will actually work or not.

2 points

Kopia

Kopia uses file splitting based on rolling hash, which allows efficient handling of changes to very large files: any file that gets modified is efficiently snapshotted by only uploading the changed parts and not the entire file.

I am on it only for few months, but so far so good.... the draw to it is that it seems like the endgame backup utility. That it has everything and runs on everything.

Heres some useful deployment info.

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.