OS X: How to avoid having to re-connect to network share after NAS was turned off?

Posted on


I use Mac OS 10.6 to connect to a NAS drive using the afp protocol (Finder -> Go -> Connect To Server). I have set up the NAS to automatically power off during the day, and power on in the evening. Now what happens is this: each time the NAS powers off, the network share disappears. After the NAS has turned on again, I have to manually re-connect to the network share.

My girlfriend uses Windows 7 to connect to the same share. For her, when the NAS is off, the network drive is still visible in “My Computer”, albeit with a “not connected” marker. When the NAS is on, she simply opens the network drive and Windows notices that it is available again.

Is there a way to make Mac OS behave in a comparable way to Windows here? I want Mac OS to automatically reconnect to the drive when it is available again (or at least when I try to access it).

I know I can turn the connection into a login item, but I rarely re-login. I want this to work automatically, while already being logged in.


You will be able to get re-connect working with Autofs.

Apple has published a technical white paper on Autofs

There is a comprehensive blog article by Rajeev Karamchedu

Also there is a third party application named AutomountMaker that enables this using GUI
(personally haven’t used this software though)

Here is my setup using indirect mapping

(I personally use smb but afp should just work)

  1. edit master map file to add your custom map

    # sudo vi /etc/auto_master

    +add line

    /Network/NAS nas_map
  2. create /etc/nas_map add a following line

    # sudo vi /etc/nas_map

    +add line (note that you can add more than one line here)


    SHARE_NAME – directory name you want use to map /Network/NAS/SHARE_NAME
    USER:PASS – username and password (use ‘guest’ for anonymous login)
    NAS_NAME – name of your nas or the ip address
    SHARE_NAME – name of your share set by your NAS

    alternatively you can use following line to use smb instead of afp

  3. Set the permission on your map file

    # sudo chmod 600 /etc/nas_map
  4. Reload automount

    # sudo automount -vc

You now have access to your NAS via /Network/NAS/SHARE_NAME directory. When your server goes offline, you should be able to auto-connect to your NAS when it comes back online.

Leave a Reply

Your email address will not be published. Required fields are marked *