Rsync of LVM Snapshots copies whole file
paul+rsync at wurtel.net
Sat Aug 16 09:53:30 GMT 2008
On Fri 15 Aug 2008, Peter P GMX wrote:
> What happens:
> I discover that always the whole file is transfered. Even if the
> original virtual machine is idle (so only some log files should have
> been enhaned in the virtual disk images).
> I do the following:
> - take LVM snapshot
> - Rsync the desired VDI file (2GB are transferred), it takes 10min
> - destroy LVM snapshot
> - take new LVM snapshot with same parameters as before
> - Rsync the same file (2GB are transferred), it takes 10min
It may appear that the whole file is being transferred.
What does the --stats output show?
The whole of both the original and the copy need to be read through to
find what blocks have changed, and that can take a lot of time. It may
even be faster to use --whole-file to stop the searching of changed data
and simply copy the data (like you suspect is happening now). That would
save 2GB of reads. Rsync tries to optimize the network traffic; if
you're doing a local transfer (no network involved) rsync will
automatically do --whole-file. If your network is fast, --whole-file
might be the better option as well. As you give no example of how you're
invoking rsync, I'm left guessing as to your situation.
More information about the rsync