auto mount automount SMB samba windows shares at boot reboot on OS X 10.7 Mountain Lion
What you need to do is:
sudo su -
Create the file:
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.