Bacon, Alcohol, Tobacco, Firearms, Explosives

Things I love

auto mount automount SMB samba windows shares at boot reboot on OS X 10.7 Mountain Lion

Pardon the keyword-laden title. I’m going to reproduce the contents of this wonderful page with a dash of this page against deletion.

What you need to do is:

Become root:

sudo su -

Create the file:

touch /etc/auto_smb

Close non-root access to the file:

chmod 600 /etc/auto_smb

Using your favorite editor, add this line to /etc/auto_smb; obviously replacing [user], [password], [machine] and [share] with the right bits:

/Volumes/[share] -fstype=smbfs,rw ://[user]:[password]@[machine]/[share]

Using your favorite editor, add this line to /etc/auto_master:

/- auto_smb -nosuid

Reboot (or automount -vc) and it should mount the share at reboot.

This was for a build server that is never logged in to, thus the need for boot time instead of login time mounting.

ETA: you also need to add a line to the crontab of the user that needs the share to be mounted; I did something like @reboot /bin/bash -l -c ‘cd /Volumes/Share’ and it works for me.

About these ads

Written by Ry Jones

10 September 2012 at 17:10

Posted in Apple

One Response

Subscribe to comments with RSS.

  1. haha, your titles are such google bait, and I love it.

    Lefty

    11 September 2012 at 18:28


Comments are closed.

Follow

Get every new post delivered to your Inbox.

Join 42 other followers

%d bloggers like this: