Nfs – Transfer between two NFS shares on the same machine

nfs

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 ?

Best Answer

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.