Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to automatically mount remote AFP shared drives.

The ideal solution would be to auto mount the remote drives even before the session was opened.

Edit: I currently use login items, but as stated above auto mounting before the session or even without the session starting would be ideal.

Examples would be very appreciated.

share|improve this question
up vote 2 down vote accepted

I have a shell script that I run via a launchd plist every few minutes to automount an NAS drive. I use it from home to mount my NAS as it contains our shared iTunes Media folder.

You can look at the script Code on Pastebin.

I you have questions about the code I'll be happy to discuss. It has a lots of error checking etc. Using a shell script and a launchd plist has the benefit if the the mount becomes unmounted for any reason.

share|improve this answer
I will test that. – Coyote Mar 19 '12 at 22:44
FYI, in function mount_disk the syntax for an AFP mount is mount_afp afp://ip-address/volume-name $vol – afragen Mar 19 '12 at 23:13

You can put aliases to the remote volumes in your Login Items folder.

A nice explanation of this feature is available from Apple on the web and the built-in help:

share|improve this answer

You can write a shell script that gets exectued with an AppleScript script.

share|improve this answer
Would you provide an example for a setup? – Coyote Mar 19 '12 at 17:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.