Is it better to use rsync over SSHFS or over CIFS as remote repository, having no option for rsyncd

cifslarge-datarsyncsshfs

I have a NAS that is only capable of CIFS, AFS, SSH (no rsyncd capabilities, no NFS).

I have to backup very large files (vm images) and I usually set a rsync server on the backup device then I do a rsync --inplace to transfer only the block level delta of the big files. This works fine with rsyncd.

With CIFS it seems that it has to read all the destination file and the local file before copying it ALL over (the whole thing, not just the delta).. is it any better with SSHFS?

Any other way to move just the block delta without a rsyncd?

Best Answer

sshfs won't help with this; what you need to do is add the -W option to tell rsync to just transfer whole files, without trying to figure out where the specific differences are. You might also need to remove --inplace (not sure about that).

rsync is really designed for remote operations where there's an rsync instance (or daemon) on each computer, each with a fast link to its disk, but with a slow link between the rsync instances. In your case, the slow link is between the "remote" rsync and its disk, so a different set of optimization choices are needed. Specifically, rsync generally defaults to reading the entire source and destination files so it can figure out just which sections need to be transferred over the "slow" middle link; in your case, slows it down more than just blindly transferring the entire file would.

Also, make sure you have the -t option (or -a, which implies -t), and are not using -c. -c would make it read the entire file to see if it had changed at all; without that, it'll just look at the file size and modification time, which -t (and -a) preserve.