4

I would like to automatically mount a certain SMB share whenever I log into my account on Snow Leopard. Way back in the Old Days on Mac Classic, all I had to do was Get Info on the drive in question and choose Mount at Startup, but Snow Leopard appears to lack an equivalent option. While I've found some hacks that claim to mount the drive at system boot, (1) they don't work, and (2) they don't do what I want: I want it automatically mounted when I log in and unmounted when I log out, not mounted at system boot.

Is there any built-in way to do this? Or should I go the AppleScript route? If the latter route, does that imply that there is no way to automate this across a network situation?

3 Answers 3

5

Could you just add the following command to your startup items?

mount -t smbfs //user@server/sharename share

Specifically, I'd put it in an Applescript like this:

do shell script "mount -t smbfs //user@server/sharename share"

Then I'd save the file as an application and add it to my login items.

3
  • Oh, and you might have to escape the forward slashes; I can't remember, and I can't test it since I don't have my Mac in front of me at the moment!
    – jrc03c
    Commented Jul 19, 2010 at 16:02
  • I have two possible concerns with that: it won't unmount when I log out, unless I'm missing something; and it'll fail if it's already mounted due to not logging out. Is there an easy way to prevent those two issues? Commented Jul 19, 2010 at 16:49
  • Again, I don't have my Mac in front of me, so I can't confirm this; but I would think that logging out forces network shares to unmount automatically. Or perhaps they'll only stay mounted by your username (in other words, if another user logs in after you, they can't access the share). Can you confirm this?
    – jrc03c
    Commented Jul 19, 2010 at 17:42
1

finder -> go -> connect to server: enter the smb URL when asked, save credentials to keychain

finder -> preferences: check "connected servers" under "show these items on the desktop"

Open system preferences -> accounts -> login items: drag the icon into the login items

0

Mount the volume you want. Then, just drag the volume into Login Items inside System Preferences / Users & Groups / (your account). Make sure the credentials you need to connect are stored in your keychain.

You should see it appear as another Login Item, of type "Folder". That's it.

You must log in to answer this question.

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