Help auto mounting drives with autofs

Discussion in 'Mac Basics and Help' started by schpongo, Mar 10, 2015.

  1. schpongo macrumors member

    Feb 21, 2011
    I have a Nas and to make the experience using it more seamless I wanted a way to auto mount my shares after waking my laptop.
    First I thought of using some kind of utility which allowed me to run a script on wake up, but then I found out that there is a built in utility for auto mounting drives called autofs.

    So I looked at some tutorials and tried my luck but my results are inconsistent.
    Sometimes the shares show up mounted sometimes not.

    Here ist my auto_master file:

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

    In the same directory I put the auto_afp file:

    HomeServer -fstype=afp,rw afp://Anonymous:1234@
    Time-Machine -fstype=afp,rw afp://Anonymous:1234@$
    Wg -fstype=smb smb://Anonymous:1234@

    Could someone enlighten me on what I did wrong?
  2. satcomer macrumors 603


    Feb 19, 2008
    The Finger Lakes Region
    Why use a script?

    What Ido with ALL older NAS devices is as follows:

    1. Make a new folder and name it "Connected Shares" and then leave the new folder in your usr Documents folder. Then drag that folder to your right side of the Dock.

    2. Mount the external using the "Connect to Server" function.

    3. Once the drive is mounted on your desktop right click the mounted share and make an alias to the share. Then drag that alias to the new folder you made in your Documents folder.

    Do this for every share you ever want to connect and save the connection password in Keychain. So whenever you want to connect to the share just click on the new folder in the dock and select that share and it will auto-connect to the share.
  3. schpongo thread starter macrumors member

    Feb 21, 2011
    Thanks that works much better, and it even saves money as the drives in the nas don't always have to spin up when I wake my laptop and the shares are auto mounted.

Share This Page