6

I have one machine that exports two directories, each on one physical hard drive.

When files are moved between these two shares, does the data transit on the network entirely? If so, is there a way to have the transfer behave more like a mv on the remote machine ?

alecail
  • 211

3 Answers3

9

NFS server-side copy is a proposed extension for NFSv4.2.
While initial support has made it into the Linux 3.11 kernel, you could be waiting a while for this.

84104
  • 13,181
  • 6
  • 49
  • 80
3

If you initiate the transfer on a client host, then yes, all data travels the wire. IF you initiate on the nfs server, whether you use the local directory paths or the mount points, it does not hit the wire. You can see this for yourself running tcpdump, in both cases. netstat may help you a little to see this, but tcpdump will show you the actual quantity of traffic.

The reason this is, is because mv does not known anything about NFS, it uses system calls on your local kernel, and the kernel doesn't know that mount points A and B are both exported from the same server. It treats the data the same.

The only way you can get the behavior you want is by issuing a shell command on the remote server to do the transfer there.

1

It depends on what system and what application you're doing the move from.

If you're doing it via the machine where these shares are at, it'll transfer locally through the OS. Example: ssh to server and using the MV command or opening a File Browser and transferring files from one File Browser to the next (so long as both File Browsers are opened to resources on same server).

The reason for this, if you're using two File Browsers on a remote session, is because whatever you do on your end, gets translated on the server end first. The server looks at the request and determines the shortest path to the destination and since it see's itself as the source and destination, the traffic never leaves the server (outside the updated tracking info you see for the file transfer).

If you're doing it through a complex remote session through a few computers, where you forcefully tunnel the traffic, then the transfer will happen over the network connection.

CIA
  • 1,634