0

Current system, OSX 10.9.5

I've followed the instructions in this MacWorld hint and by reading the Apple doc for Autofs and several other places but I can't get autofs to automagically mount a remote AFP share on my NAS box:

$ sudo ls -l /private/etc | grep auto
-rw-r--r--   1 root   wheel     149 28 Jun 09:35 auto_home
-rw-r--r--   1 root   wheel     256 24 Oct 13:39 auto_master
-rw-r--r--@  1 root   wheel      97 24 Oct 13:39 auto_nas
-rw-r--r--   1 root   wheel    1935 28 Jun 09:35 autofs.conf

/etc/auto_master

#
# Automounter master map
#
/-                                  auto_nas    -nosuid  # this one is mine
+auto_master                        # Use directory service
/net                                -hosts      -nobrowse,hidefromfinder,nosuid
/home                               auto_home   -nobrowse,hidefromfinder
/Network/Servers                    -fstab
/-                                  -static

/etc/auto_nas

/Users/USER/Shares/Public   -fstype=afp afp://USER:PASSWORD@nasbox.local/Public

The permissions on the Shares directory:

$ ls -al /Users/USER | grep Shares
drwxr-xr-x    3 USER  staff     102 24 Oct 13:31 Shares

I've put nasbox.local in /etc/hosts and can ping it fine. I update the automount (I've also rebooted, no dice).

$ sudo automount -vc
automount: /net updated
automount: /home updated
automount: no unmounts

and…

$ cd /Users/USER/Shares/Public
cd:cd:13: no such file or directory: /Users/USER/Shares/Public

but, if I use mount_afp it mounts the directory fine:

$ mkdir /Users/USER/Shares/Public
$ mount_afp afp://USER:PASSWORD@nasbox.local/Public /Users/USER/Shares/Public

$ ls -l /Users/USER/Shares/Public 
total 3718056
long list of file follows…

Would anyone know what part of the incantation I'm missing to get the magic to work? I've tried all the obvious stuff like making the Public directory prior to mount, and changing permissions to it and Shares, using direct maps, indirect maps, wildcards… I've still not got this to work :-/

Any help or insight will be much appreciated.

1
+150

Please create a folder Share in the User folder and change your auto_master to

/etc/auto_master

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

and

/etc/auto_nas

Shared_Folder -fstype=afp afp://User:Password@ip/Shared_Folder

enter sudo automount -vc in Terminal with the output:

$ sudo automount -vc
automount: /Users/User/Share updated
automount: /net updated
automount: /home updated
automount: no unmounts

Please regard the additional output: automount: /Users/User/Share updated

Both files need a trailing empty line or it won't work and you'll get the following error:
automount[pid]: map /etc/auto_master: line too long (max 4095 chars) or automount[pid]: map /etc/auto_nas: line too long (max 4095 chars)

(all tested and verified with a 10.9.5 client and 10.7.5 server)

  • Thanks, that worked. It was actually the trailing line that I was missing that seemed to make the difference, and I didn't get an error message without it, just silent failure. But now it works! Many thanks again. – Iain Oct 29 '14 at 22:41
  • Why did you delete your comment in apple.stackexchange.com/questions/158083/…? – softandsafe Nov 25 '14 at 20:19
  • 1
    @softandsafe because it was a totally wrong answer. i'm just working on a better one – klanomath Nov 25 '14 at 20:22

You must log in to answer this question.

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