35

I want to have a mapped drive in Mac OS X which points to my NAS - however I've found that I have to do it after every single reboot.

I'm a Mac noob, so would like to just have the drive mapped at all times like Windows does, but instead each time I reboot and forget to map the drive, I accidentally open iTunes and find no music as it's all stored on my NAS!

Is there a simple way of doing this? Have I missed something really silly?

5 Answers 5

38

Mount a Windows Share in OS X and Have it Reconnect at Login (via www.howtogeek.com)

Mounting the Windows Share

When you are in Finder you can click Go and Connect to Server or you can type Command + K to get to the same menu.

In Server Address you will need to put the location of you Windows share with this format smb://server/share where server is the name or IP address of your Windows machine and share is going to be the folder or drive you want to mount.

alt text

If your Windows share requires authentication it will ask you for that info here.

Now if you have Connected Servers showing on your desktop, it will show up on your desktop an in Finder.

Making the Share Mount at Login

To keep the share showing up when you have to log out seems pretty difficult. The internet is littered with ways to write scripts to allow you to do this. But OS X makes it pretty simple if you are just needing to add the share to your machine.

You will need to be in System Preferences for this, which you can get to by clicking on the Apple Menu and then going to System Preferences.

alt text

Then you will go to Accounts.

alt text

Once in Accounts, you will need go to the Login Items tab. Then you will just drag the share from your desktop or Finder window into the Login Items list.

alt text

If your share requires authentication, it may be possible to add the username and password into your keychain with the check box in the authentication window. Some shares will not work with the keychain though.

This is pretty nice if you are working a lot between OS X and Windows, and need to move files between the two.


To solve the issue of a Finder window showing the network drive each time you log in, you can check the Hide box in the Login Items list.

4
  • 4
    This is the route I've gone... and it works. The downside, which I've not yet been able to resolve, is that it will open a Finder window for that share every time you log on. I have a few shares configured this way for our Windows Home Server (Music, Videos, Photos, etc)... and every time I log in, I get multiple Finder windows - one for each share. The Hide checkbox appears to affect Applications opened at login, but doesn't seem to change whether or not the Finder window is opened for a mapped volume. Aug 10, 2010 at 21:47
  • 1
    This is nice but not 100% working for me. My boss bought a MacBook Pro for the first time and needs to have company shared folders mounted. We found as useful to put them to the Finder's favorite pane. But when laptop is out of the company network, Finder will clear unaccessible favorites and they are no more mounted even if they are in Login items. /// Probably another problem is that Login items are called upon the first login and not after each login, i.e. after machine wakeup.
    – dmnc
    Jul 4, 2014 at 6:41
  • 1
    In more modern versions of OSX, I think the "Accounts" button is called "Users and Groups". Same icon though. Oct 7, 2014 at 8:57
  • Amazingly, such a simple trick is still working with macOS Big Sur (11.7.9) in 2023. I'm actually mounting NFS shares and this is the easiest way of getting them to be mounted on reboot. Pretty amazing! As @StackExchangeWhatTheHeck said, "Accounts" is now "Users and Groups", but it's the same thing. Well done! Note that Finder will still show a window for each share, though, but it will discreetly be in the background. Nov 27, 2023 at 9:20
7

What kind of NAS are you using?

If it has an IP#, supports AFP and user authentication... maybe try this AppleScript as a start ( Create this with Script Editor ). Replace username,password and IP with your info:

try
    mount volume "afp://username:password@ip_address/sharename"

end try

Save the script as an application

 File -> Save As -> File Format -> Application

Then go to

Sys Prefs -> Accounts -> Login Items

and add that application to your login items.

2
  • I use a terastation live NAS which I believe supports AFP, I will try your solution when I get home, thanks.
    – falter
    Apr 15, 2010 at 10:34
  • 1
    This answer is much less annoying that the accepted one (finder popping up) and it also scales.
    – row1
    Jul 11, 2012 at 14:07
4

I do have a NAS as well, and having switched to Mac about 2 years ago, I found this to be one of the main disadvantages of Mac. Windows is much better for handling network drives. Even on Linux things work out much better than on Mac.

There is a way to automatically map a drive at logon (you can add it to the 'applications' to launch at logon, see for example the explanation here), but that isn't working very well for me (see e.g. the sleep issue below). Other solutions are based on automator scripts, but it is all very clumpsy.

The problems as I experience them:

  • indeed an application, like iTunes or MS Word, doesn't bring up (mount) the network share automatically when it is not mounted.
  • also, when my mac awakes from sleep, sometimes the network mapping is lost (a dialog tells me "server connection interrupted"); sometimes it keeps on working. I then have to wait for about 10 seconds before I can mount the share again.
  • additionally, when using fast user switching the network share is mounted two times because of user permission issues. As a result, shortcuts to the share sometimes become unusable.

Another solution would be to cache all information from the share locally, like you can do on Windows Vista and higher very easily using Windows Sync (or Windows Offline files as it is also called). This gives the added benefit of a backup copy and ability to work offline. However, no such thing is available on Mac (see here).

So, this isn't an answer to your question, but I have done the following as a (bad) workaround:

  • I have put a shortcut to the network share on my desktop. I click it whenever I need to work with files on my NAS.
  • I copied my music files to my local hard drive, on both our macs. A very unsatisfactory solution though since these libraries then go out of sync. (The problem is worsened by iTunes not being able to watch a folder for changes). I am still on the lookout for a good media player for Mac. Amarok was promising, but I don't like their version 2 interface.
  • What concerns photos (which are also on my NAS), I've ditched iPhoto and am using Picasa now, which is able to watch a folder for changes. This way, I have only one photo library.

If there is a better solution, I am very curious for it too...

3
  • 1
    I think itunes can watch folders now - lifehacker.com/5356619/… I'll let you know how the solution above goes!
    – falter
    Apr 15, 2010 at 10:36
  • Ah, didn't know about that one, thanks for the tip. Still, it is not really 'wachting a folder': you have to put new files in that specific 'Automatically add to iTunes' folder, and if you remove a folder from your music folder, iTunes will not detect it. Because of this, the mechanism isn't suitable to share a music folder on a NAS with several computers (which potentially have different music players or operating systems) Apr 15, 2010 at 11:11
  • I'd say that modern NAS will include some sort of file syncing ability, using whatever protocol they prefer (either proprietary or possibly even just SMB or NFS), thus allowing you to keep the music libraries in sync between the Mac(s) and the NAS. Nov 27, 2023 at 9:23
3

You may want to look at macmounter, an open source, python project that automatically mounts drives, and keeps them mounted: https://github.com/roubles/macmounter

2
  • 1
    Thanks, this worked really well for me! Got sshfs and cifs/smbfs mounted happily.
    – Xavier Ho
    Jul 16, 2015 at 4:52
  • This is fantastic. Such a well written and designed program that works beautifully even today. Thank you!
    – trisweb
    Jan 15, 2022 at 17:05
1

Nowadays there are some applications on the MacOS Appstore that allow you to control exactly this.

One is called "Drive Mounty": Free for 1 share. USD 3 to go Pro for unlimited shares.

Another is called "AutoMounter": Costs USD 10.

Another is called "Drive Mounter" they have a free and a paid version not sure what are their differences.

There are some others, so have a look and let the community know which one you found best. For now I am testing Drive Mounty Pro.

2
  • If you can, please share your experiences, namely, comparing those paid solutions with the free ones shown on the other answers. Thanks! Nov 27, 2023 at 9:24
  • Is this "Drive Mounty"? mounty.app — because that one is free. Hmm. Perhaps it's a different thing altogether? Nov 27, 2023 at 9:28

You must log in to answer this question.

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