OS X: How to avoid having to re-connect to network share after NAS was turned off?
Solution 1:
You will be able to get re-connect working with Autofs.
Apple has published a technical white paper on Autofs
http://images.apple.com/business/docs/Autofs.pdf
There is a comprehensive blog article by Rajeev Karamchedu
http://rajeev.name/2007/11/22/autofs-goodness-in-apples-leopard-105-part-i/
Also there is a third party application named AutomountMaker that enables this using GUI
http://jm.marino.free.fr/index.php?switch=sw_&title=AutomountMaker
(personally haven't used this software though)
Here is my setup using indirect mapping
(I personally use smb
but afp
should just work)
-
edit master map file to add your custom map
# sudo vi /etc/auto_master
+add line
/Network/NAS nas_map
-
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 -fstype=afp afp://USER:PASS@NAS_NAME/SHARE_NAME
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 NASalternatively you can use following line to use smb instead of afp
SHARE_NAME -fstype=smbfs ://USER:PASS@NAS_NAME/SHARE_NAME -
Set the permission on your map file
# sudo chmod 600 /etc/nas_map
-
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.