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.
Best Answer
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
butafp
should just work)edit master map file to add your custom map
+add line
create /etc/nas_map add a following line
+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
SHARE_NAME -fstype=smbfs ://USER:PASS@NAS_NAME/SHARE_NAME
Set the permission on your map file
Reload automount
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.