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
Make sure you:
sudo chmod 644 /etc/auto_nfs
Otherwise the automounter will not be able to read the config and fail with a ... parse_entry: getmapent for map failed...
error in /var/log/messages
This will not work (anymore!) though it "should".
$ sudo automount -cv
...
automount: /Volumes/my_mount: mountpoint unavailable
Note that, if you manually create the mount point using mkdir
, it will mount.
But, upon restart, OS X removes the mount point, and automounting will fail.
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.
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
For pre-Catalina: 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
For Catalina and up: To (this is all one line)
/System/Volumes/Data/../Data/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.
Feel free to send me large checks and/or high five the screen. [email protected]
The auto-mount path you used is entered wrong. Based on the error, I would suggest you make the line look like:
For NFS
/System/Volumes/Data/./Volumes/Videos -fstype=nfs,noresvport,soft,bg,rw nfs://192.168.0.100:/volume1/Videos
For AFP
/System/Volumes/Data/./Volumes/Shared -fstype=afp,rw afp://192.168.0.100:/Shared
Now, my Videos are mounted to /Volumes/Videos. The NFS share on my Synology is on volume 1, and and the share is called Videos. For AFP and SMB, the share name is all you need, and the volume is ignored.
Assuming you have that part right, and I suspect you do since your error is in regards to the mount point, the mount point should look like mine do. put the full path in, then after data add the /./ path reference. if you want to you /../ you can, but there would be more typing: Here is my AFP share with /../
/System/Volumes/Data/Volumes/../Volumes/Shared -fstype=afp,rw afp://192.168.0.100:/Shared
The Idea is that your relative path reference should occur under the Data path to trick the parser into allowing the path. But also because the Data volume is where your writable data is actually at.
Some key points, make sure you also use the IP address of your NAS, and that your NAS get assigned a reserved IP address, or you will have mount issue at boot up.
How to auto mount drive on desktop
You can't. An automount drive is an extension of the filesystem. The best you can do is create a symbolic link on your desktop that points to the mount point.
To do this, from the Terminal:
ln -s /Volumes/Shared ~/Desktop/Shared
Then in my Desktop, I see a Link that looks similar to the share.

This is not the same thing though. You cannot eject this drive. If you want to mount the drive automatically in a way that behaves exactly like the drives you mount manually, then you don't want to use autmout. Instead you should use a script to mount the drive, and run that script at login. For that method, look at this: Automatically Connect to a Network Drive. on Mac OS X Startupp and Login. This method is uses the scripting engine on your Mac to automated he. mounting.
autofs and automount are technologies that integrate into your drive to mount remote shares into any folder when the folder is accessed and to make it appear as part of the local file-system. I do not think this is what you want. I think you want to use the mounting script to make use of the system's drive mounter instead.