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.

3 Answers 3


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.

  • I will test that.
    – Coyote
    Mar 19, 2012 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, 2012 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:


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

  • 1
    Would you provide an example for a setup?
    – Coyote
    Mar 19, 2012 at 17:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .