Friday, October 13, 2006

Automounting samba drives in Mac OS X

Almost impossible to find out how to do this! Finally with a mash up of a few articles, I found out how to automount samba drives. Yeeeah haa. Means i can mount //calculus/data and //nestor/data with different names (to stop confusing front row :-))

Samba automount

(NetInfo app --> found in ya utilities folder under applications)

The important bit is the path the mount is created under -- '/Network/calculus' will mount it with the name 'calculus' (if I had /Network/joebloggs, the drive would be called 'joeblogs'), ja?. This is doing a 'static' mount, which means it's mounted all the time (dynamic mounts unsuprisingly get turned on/off depending if they are in use). The drive is then in the finder under 'Network' --> drop an alias wherever ya want and bob's your uncle :-)

Not sure what will happen when someone else logs onto this box... do they still get mounted? And using my username/pass? hmm will have to try it out and see.

Edit: Found a post on macosxhints that may be even easier -- using an applescript and automator. Not sure if it will handle 'remounting' when an automount fails (as the netInfo way above only runs at boot - I haven't found a way of 'remounting' the netInfo mounts if it fails at boot). But one bonus is it's user specific, so doesn't set up those mounts for everyone.
http://www.macosxhints.com/article.php?story=20070202190047133

Edit: I've done a followup on another method here: http://rachmobile.blogspot.com/2007/10/more-automounting-samba-drives-in-os-x.html

5 comments:

davef8 said...

will this or the macosxhints options work if my nas is at home and I want to access it each day after I get back from work without re-connecting?

rach said...

Not sure what you're after... do you shut your Mac down? If so, it automatically mounts on boot.

I've actually moved to another way of doing it - where I've written an applescript to mount drives, and I use MarcoPolo to run the script whenever it decides i'm at 'home'. Not 100% perfect, but more flexible :) I'll have to write a post about how to hook all the bits up!

davef8 said...

yeah that's totally what I'm after. I never shutdown my mac so the automount on boot doesn't really work. I wake my mac from sleep when I get home and would like some way for it to detect my share and automatically connect to it. In a perfect world it would work just like auto connecting to my wifi :) looking forward to your post!

rach said...

Finally got around to posting the alternative method I'm using now here: http://rachmobile.blogspot.com/2007/10/more-automounting-samba-drives-in-os-x.html

davef8 said...

i ended up springing for an airport extreme. it automatically shows the drive whenever I'm home, not configuration or apple scripting needed :) I even got it to work with pesky vista.