Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
Define "smart way"? –  Jim B Jun 4 '12 at 23:21
    
@JimB, like with SMB where the client can ask the server to perform a local copy using RPC. –  Zoredache Jun 4 '12 at 23:28
    
I am almost 95% certain that SSHFS is pretty dumb, but I don't know much about the NFS internals. –  Zoredache Jun 4 '12 at 23:29
    
@JimB yes, a good definition of "smart way" would be the one given Zoredache, above. –  Elton Carvalho Jun 5 '12 at 0:00
1  
There was a discussion on whether it is possible to copy remote files on nfs without round-trip on superuser.com. The conclusion was that it is not possible in general, but tools exists to support this. –  Dmitri Chubarov Jun 5 '12 at 6:59
show 2 more comments

1 Answer

up vote 4 down vote accepted

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

share|improve this answer
    
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 5 '12 at 0:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.