4

After working with a few large files over sshfs, one question started dwelling in my mind.

Suppose I have a sshfs (or NFS for that matter) mount on ~/remodetir and I want to do something like

cp ~/remotedir/foo ~/remotedir/some/weird/path/bar

Does sshfs (or NFS) handle it in a smart way or do they transfer the file back-and-forth just because the cp command is running in my local CPU?

1 Answers1

4

sshfs makes local mv calls for mv.

I assume this is similar for cp.

Not sure if this is the case if the remote sshd restricted to internal-sftp.

edit:

File flows through local machine for cp as well (confirmed with network traffic).

$ sshfs -V
SSHFS version 2.4
FUSE library version: 2.8.6
fusermount version: 2.8.6
using FUSE kernel interface version 7.12

84104
  • 12,905
  • 6
  • 45
  • 76
  • So the local call for `mv` really means data transferred from the server to the client and back? Because, AFAIK, `mv` only messes with file handlers, or hardlinks, if you prefer, so the size of the file moved by `mv` doesn't matter so much, as long as filesystem borders are not crossed. – Elton Carvalho Jun 05 '12 at 00:02