2

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

2
  • Where in Finder are you looking /Volumes or the top level in Finder? ie if you show the fullpath in Finder what is at the top of the window?
    – mmmmmm
    Feb 26, 2013 at 21:55
  • @Mark I need them appear at the top level in Finder (the actual machine), so that other users find them comfortably. I know OS X has a way of telling folders from drives, so just creating a folder in /Volumes does not work out of the box, but I don't know what that is.
    – CatalinM
    Mar 4, 2013 at 10:39

3 Answers 3

1

There is a boring, technical explanation (which I cannot find right now) for this behavior . I worked around it by adding /Volumes to the Favorites section in the Finder's sidebar

enter image description here

9
  • Can you not mount NFS volumes through Finder's "Connect to Server" feature? I don't have an NFS share to attempt with.
    – bispymusic
    Mar 2, 2013 at 21:24
  • Unfortunately, this does not solve the problem, as I need the drives to be available when I click on the machine (under Devices).
    – CatalinM
    Mar 4, 2013 at 10:35
  • @bispymusic Yes I can, but it doesn't give me any mounting options, so I loose on performance visibly. Also, to have them automount on startup I have to add them to Login Items.
    – CatalinM
    Mar 4, 2013 at 10:37
  • @CatalinM Instead of mounting them as Login Items you can auto mount them at system boot time via the fstab file. Read the man page for fstab for more info. Mar 4, 2013 at 17:09
  • 1
    @CatalinM the /etc/fstab file does not exist by default. You have to create it. See this Apple document for more info, specifically page 9 where it describes fstab and how autofs interacts with fstab. And please up-vote my answer if you found it useful Mar 6, 2013 at 19:03
3

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?

5
  • I will try it this weekend!
    – CatalinM
    Jan 30, 2014 at 22:00
  • Did you solve the issue of the shares not being visible in Finder? Dec 29, 2015 at 19:36
  • 2
    while useful, this does not answer the question of how to make autofs mounted folders show up in the finder...
    – rjmoggach
    Jan 13, 2016 at 20:30
  • I was really hopeful this would still work in macOS 12 (Monterey), but unfortunately it does not. When I run auto mount -cv, I get: automount: /System/Volumes/Data/../Volumes/Files: Operation not permitted ☹️ May 3, 2023 at 17:08
  • Aye, @JollyRoger, the trick shown here is technically a clever workaround that worked because Apple was not following the strict guidelines for /etc/fstabwhich _explicitly forbid using /../ (or even spaces...) there. However, Apple does allows us to mount NFS shares under /Volumes these days, so I guess that all these tricks are not necessary any longer... Nov 25, 2023 at 10:18
0

You can mount a volume in terminal, it will be automatically visible in finder

mount -v -w -o vers=4,noowners,rw,nolocks,locallocks -t nfs IP_ADDRESS:/ /PATH/TO/SHARED_FOLDER

unmount with

umount -f /PATH/TO/SHARED_FOLDER
1
  • 1
    8 years later this is not a problem anymore, but IIRC the idea behind the question was to have all this done automagically... and once (not throwing it into bashrc or something).
    – CatalinM
    Nov 11, 2021 at 14:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .