I am new to using Apple as main OS. I am used to fstab in Linux to keep the mounts for nfs. When I use Go to
in Finder to mount nfs://serveripaddress/home/shared
I get a permissions error.
The below command works from Terminal though:
mount -t nfs -o resvport,nolocks,locallocks,intr,soft,wsize=32768,rsize=3276 \
serveripaddress:/home/shared /private/shared
How can I get this to be mounted each time I log in and vpn to the network where this share resides?
Best Answer
I have spent quite a bit of time figuring out automounts of NFS shares in OS X...
Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:
/etc/auto_master (see last line):
/etc/auto_nfs (this is all one line):
This will not work (anymore!) though it "should".
What's the solution?
It's so easy my jaw dropped when I figured it out. Basically, we trick OS X into thinking we're mounting * somewhere else. *
When you're talking about paths in just about any environment, the root folder is the highest path you can reach, whether it's
C:\
(windows) or/
(*nix)When you're at this path, attempting to reach the parent path, via
..
will keep you at the root path.For example:
/../../../../
is still just/
By now, a few of you have already figured it out.
TL;DR / Solution:
Change your
/etc/auto_nfs
config from (this is all one line):To (this is all one line):
And re-run the automounter:
..... there you go! Technically
/../Volumes
is still/Volumes
, but the automounter does not see things that way ;)This configuration persists the mount across restarts, and creates the mountpoint automatically.
I KNOW, RIGHT?