11

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?

2
  • 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. Commented Sep 20, 2011 at 13:49
  • I mean a proper copy (cp).
    – jdm
    Commented Sep 20, 2011 at 14:42

1 Answer 1

14

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.

2
  • 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
    Commented Sep 20, 2011 at 14:43
  • 1
    @jdm: There is some work in this area, see my edit. Maybe in the future..
    – janneb
    Commented Sep 20, 2011 at 15:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .