How to automount SMB share in OS X

I am running OS X Lion. I have the following line in my /etc/fstab:

//darren:q@acid/home /acid smbfs nodev,nosuid,auto

If I run mount -a, the share mounts correctly, but if I just reboot the computer, the drive does not mount.

The drive in question is an Ubuntu SMB share.

Can anyone advise?


Solution 1:

I ran across this today which is one way to do it.

In summary for Mountain Lion:

  1. Edit the file /etc/auto_master
  2. Within add /- auto_smb
  3. Create /etc/auto_smb
  4. Within add /Volumes/mount_point -fstype=smbfs,soft ://user:pass@smbserver/share

The author goes onto mention a second method using the vifs command, but I've never tried that one and it seems to do something of a pre-mount at bootup. You still have to touch the Volume for it to completely mount.

Lastly, the author states that "soft" should be used in step 4 above because failures to mount will cause the bootup to hang.

Solution 2:

You need to mount the drive once, then go to Settings Panel and Users & Groups. There you can add it. If you hide it, it will mount but don't open the finder screen upon logging in.

enter image description here