Accessing NFS Shares

TechBoyJK

Lifer
Oct 17, 2002
16,699
60
91
Is there a way to access NFS shares directly so that you don't have to mount them first?

For instance, say I have an NFS share setup on server 'files01' and I'm sharing a folder called /files

Can I reference the file directly on the nfs server from a remote server? Goal here would be to move the local file 'image.jpg' to the NFS share on another server.

Example

#mv /somefiles/image.jpg //files01/files/image.jpg
 

mv2devnull

Golden Member
Apr 13, 2010
1,526
160
106
No. You either have a filesystem mounted, or you don't.

You could configure the automounter to automagically mount the files:/files to some local mount-point, whenever you try to access that local mount-point.

Alternatively, forget the NFS and copy files with some other protocol, for example 'rsync'.
 

Scarpozzi

Lifer
Jun 13, 2000
26,391
1,780
126
If you already have 1 server configured with an NFS share and all you want to do is copy files TO the NFS server, make it RW in /etc/export to the server you're copying from.

That will allow you to use the server with /somefiles/image.jpg as an NFS client.

You'll just need to create a mount for the remote server
#mkdir /files01share
#mount -t nfs files01:/files
then you can
#mv /somefiles/image.jpg /files01share
 

Red Squirrel

No Lifer
May 24, 2003
70,085
13,535
126
www.anyf.ca
Since it's strictly for moving files, I would just use rsync or scp and then you can do it directly.

Something like:

rsync file.jpg user@server.loc:/path/to/remote/location/

Of course the permissions for user need to match correctly, but same would go for NFS.