I have recently been using my girlfriends Macbook with Mac OSX Lion (10.7.3) for sorting files on my Synology DS-1511+ NAS. The way OSX handles Volumes/Shares frustrates me, and having to reconnect every time the Macbook leaves standby is even more annoying.

So I started looking for ways to utilize the Mac OSX automount (autofs) tools. With a bit of looking around on the net and a few modifications, this is what I came up with:

First, I created /etc/auto_smb:

Script Content:

So far, so good: Now I have a script that handles the doing, but I have to tell the automounter where to apply this script, so I append a directive to /etc/auto_master, create the designated mountpoint and reload the automounter:

At this point, the automounter is registered for /Volumes/storage/, but since I haven’t actually ACCESSED any of the shares yet, there are no subfolders under /Volumes/storage (automounter creates those after initial access).

Since I want a TRUE automount, I use a little script that can be added to the users startup routine.
This script just reads all available shares from the NAS, and cd’s to each of the corresponding automount subdirectories to create the initial stubs.

Script Content:

Finally, something working :) But wait, shares mounted this way dont show up on the desktop as Volumes. Fair enough. I just linked the automounter base_dir to my desktop to have easy access:

Tadaaa! A working Mac OSX 10.7.3 automounter, easy to use and comfortable. I hope you find this as useful as I do :)

~~ sebastian