Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a large amout of data (several GB) on a remote drive, that is transparently mounted via nfs. I'd like to copy these files into a subdirectory of where they are already residing, so everything stays on the same physical disk. For that reason, I would like to prevent an unnecessary round trip over the network.

It seems that cp files* subdir does the naive thing and reads all the data into memory and then writes it back. Is that true? Is there a special command that does the actual copying entirely on the server the disk is physically connected to?

share|improve this question
    
Do you mean copy (as in cp), or move (as in mv)? If you move the files, I don't see why there should be any round-tripping. –  Kusalananda Sep 20 '11 at 13:49
    
I mean a proper copy (cp). –  jdm Sep 20 '11 at 14:42

1 Answer 1

up vote 3 down vote accepted

It seems that cp files* subdir does the naive thing and reads all the data into memory and then writes it back. Is that true?

Yes.

Is there a special command that does the actual copying entirely on the server the disk is physically connected to?

No, unless you can login to the remote machine with ssh and do the copying there.

EDIT There is some work going on to add "server-side copy" to the NFS protocol version 4.2 (current is 4.1). See e.g. http://www.usenix.org/events/fast11/posters_files/Lentini.pdf . Note that then using this feature would require a) NFS clients and servers supporting it b) a new syscall for the client OS (maybe reflink or copyfile()?) c) support for using the new syscall in the usual utilities (cp, rsync, etc.). My guess it will be at least several years before anything this sees the light of day.

share|improve this answer
    
Too bad. I think AFS supports this, and this looks like someone implemented a patch to NFS to include it: lsub.org/who/nemo/nfscp.html –  jdm Sep 20 '11 at 14:43
    
@jdm: There is some work in this area, see my edit. Maybe in the future.. –  janneb Sep 20 '11 at 15:09

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.