1. How can I make my MacBook Pro automatically mount a network share when it wakes up?
  2. How can I make sure that when it is mounted it is mapped to the same path (/Volumes...)


I have a MacBook Pro running the latest OS X, and I also have a NAS in the house. From Finder I connected the NAS to my MacBook, and it shows up in the shared drives on the Finder bar together with all the other links (like Desktop, All my files...etc.). I also have a password saved in my keychain, so I do not have to type it in.


This network share is not mounted automatically, i.e. I have to click on the link in Finder to get it mounted (on /Volumes/...), otherwise other programs do not see it. When my MacBook sleeps it will be automatically dismounted though but not mounted again when I wake the computer up. Even worse, after manual mounting with a click in Finder, the path at /Volumes will be a different one, so some programs lose the path.


A prime example is Adobe Lightroom (LR): I keep lots of photos on the NAS share, and LR add these photos to its database found on the MacBook's local drive. But it does not copy the files over from the network share just links to each of them and generates a (much smaller size) thumbnails. Now when the MacBook wakes up, and I go to LR, the drive does not exist, it is not mounted. I have to go to finder, click and mount it, then back to LR where now I can see it. But sometimes the mounting associates the share with a new path, so the old share show lost links in the database, and I have to re-add the photos to LR, under the new path, just to lose it again next time when the Mac sleeps.

This must be an issue for others too, anybody figured it out?


The answer somewhat depends on how the drive is being mounted in the first place.

For example, my AirPort Extreme has a USB drive attached. The Drive Name is 'CrashPlanExtreme' and the AirPort Extreme is (un-creatively) called "Airport-Extreme.local." so I can mount the drive using this command:

open afp://Airport-Extreme.local./CrashPlanExtreme

However, I think I had better success with this:

open -g -a Finder "afp://Airport-Extreme.local./CrashPlanExtreme"

It would be helpful if you mount the drive manually, then go to Terminal.app and enter this command:

mount | egrep '^/'

then add the output to your question.

Once we determine the correct Terminal command to mount the drive, the rest is simply a matter of writing a script that runs when you log in (easily accomplished using launchd) and when the computer wakes from sleep (easily accomplished using the free and excellent sleepwatcher.)


If the Network-Attached Storage (NAS) supports Server Message Block (SMB), you can use autofs to map a folder to the network drive. This will provide a reliable mount point that automatically mounts and unmounts as needed.

I put together a script to help set this up at https://github.com/grahammiln/setup-autofs.

  • You can find an explanation on what this script is doing by reading this answer as well. – Marco M. von Hagen Jul 7 '15 at 16:02

You must log in to answer this question.

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