1

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?

penzoiders
  • 63
  • 2
  • 6
  • Tangentially, from a performance perspective I think CIFS performs many more network roundtrips per file than SSHFS or NFS does, depending on the client/server OS/version (I believe this is due to Windows legacy support). – user61849 Sep 30 '15 at 19:10

2 Answers2

3

No, it will not be better with sshfs. It can't be, as with locally mounted remote file systems, the local rsync process has to read the file to see what needs to be copied. For this, the whole file has to be transported via the network.

Sven
  • 97,248
  • 13
  • 177
  • 225
  • ok, but it seems that the whole file is copied over once it has been read for checking the differences over CIFS. will SSHFS be any better in letting rsync move just the changed blocks? or do I have to use some other kind of option in the rsync commandline? – penzoiders Apr 14 '15 at 09:45
2

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.

Gordon Davisson
  • 11,036
  • 3
  • 27
  • 33