Mount NFS share in /Volumes as a drive Ok, this might be a stupid question to ask, but trying to mount a NFS share (from a Linux machine, if it's worth anything) in a folder that resides in /Volumes never makes the share appear in Finder (not in Volumes anyway).

The folder was made by simply sudo mkdir /Volumes/folder_name and the mount was made using autofs like this:

/Volumes/folder_name    auto_nfs      -nolock,locallocks,rdirplus


I should mention the folder is accessible though the terminal, but it just doesn't show in Finder.

On the other hand, if I modify /etc/auto_master to this:

/Volumes  auto_nfs      -nolock,locallocks,rdirplus


the folder appears, but I loose all my other drives (except the system one and Network)

At the moment, I'm mounting to a regular folder on the system drive which I've symlinked to a folder in /Volumes. Oddly, that works fine, but it does appear as a symlink and it bothers me (and possibly other users).
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):

#
# Automounter master map
#
+auto_master        # Use directory service
/net            -hosts      -nobrowse,hidefromfinder,nosuid
/home           auto_home   -nobrowse,hidefromfinder
/Network/Servers    -fstab
/-          -static
/-          auto_nfs    -nobrowse,nosuid


/etc/auto_nfs (this is all one line):   

/Volumes/my_mount    -fstype=nfs,noowners,nolockd,noresvport,hard,bg,intr,rw,tcp,nfc nfs://192.168.1.1:/exports/my_share


This will not work (anymore!) though it "should".

$ sudo automount -cv
...
automount: /Volumes/my_mount: mountpoint unavailable


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):

/Volumes/my_mount    -fstype=nfs,noowners,nolockd,noresvport,hard,bg,intr,rw,tcp,nfc nfs://192.168.1.1:/exports/my_share


To (this is all one line):

/../Volumes/my_mount    -fstype=nfs,noowners,nolockd,noresvport,hard,bg,intr,rw,tcp,nfc nfs://192.168.1.1:/exports/my_share


And re-run the automounter:

$ sudo automount -cv
...
automount: /Volumes/my_mount: mounted


..... 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?