I'm trying to automount a Windows SMB share on Mac OS X.
The first thing I tried was to put entries only in /etc/fstab
:
$ dgrant$ cat /etc/fstab
//darrengrant@d-grant/share /pc/share smbfs nodev,nosuid
This works fine using mount -a
.
But I want my drives to be mounted whenever the machine is turned on. But the drives aren't getting mounted when I restart my computer. I check the Console and I see the following:
3/24/11 2:09:32 PM com.apple.launchd[1] *** launchd[1] has started up. ***
3/24/11 2:09:48 PM com.apple.autofsd[50] automount: Mount for //darrengrant@d-grant/share has no path for the directory to mount
I can reproduce this error message on the commandline by a simple use of sudo automount
. I think launchd
calls automountd
, that mounts everything in /etc/fstab
. The file /etc/auto_master
contains a reference or two to fstab, so that seems reasonable.
I found the 'no path for the directory to mount' error in the actual source for automountd
, and it seems the cause is a missing colon in the fstab
line between the machine name and mount directory name. I made the error disappear by adding the colon to fstab
like this:
//darrengrant@mypc:/share /pc/share smbfs nodev,nosuid
But after a reboot, automount
doesn't work with an entirely different set of errors:
$ sudo automount -v
automount: /net updated
automount: /home updated
[ pauses here for a couple of seconds ]
automount: /pc/share updated
automount: no unmounts # looks good so far ...
$ mount
....
map -static on /pc/share (autofs, automounted, nobrowse) # OK, a little different..
$ ls /pc/share
ls: share: Host is down # fail.
This doesn't really make much sense.. why does fstab not need the colon but automount does? And what is the 'Host is down' part all about? Some confusion between network and local drives perhaps?