Automounting AFP and SMB volumes on Mac OS X
:: Wednesday, September 20th, 2006 @ 1:21:43 am
:: Tags: Computers
Of all the things to spend a couple hours figuring out…
All I wanted to do was to have certain shares mount upon login. Who knew that it would be so complicated in Mac OS X?
Here are a few methods I investigated:
1. Create alias of shared volume and drag into Login Items
I harrassed Victor A. for a long time, and he suggested this one. Unfortunately, it doesn’t work.
2. NetInfo entry
I tried following some directions I found online, but I had no luck mounting my AFP share. A dynamically mounted share sounds ideal because I would really much rather have the share mount itself only when accessed… but the point was moot because I couldn’t get anything to work.
3. Shell scripts
I created shell scripts like this:
#!/bin/tcsh -f # mount afp volume mkdir /Volumes/sharename mount -t afp afp://username:password@192.168.x.xx/sharename /Volumes/sharename # mount smb volume mkdir /Volumes/sharename2 mount_smbfs //myserver/sharename2 /Volumes/sharename2 # mount 2nd smb volume mkdir /Volumes/sharename3 mount_smbfs //myserver/sharename3 /Volumes/sharename3
I then used LoginWindow Manager to get the shell script to run upon login and logout, and the following is what happened:
- The AFP volume mounted, and the first SMB volume mounted. The second SMB volume did not mount.
- I got the dreaded “mount_afp: the mount flags are 0000 the altflags are 0020“ message upon mounting the AFP volume. Yippee.
- All volumes were mounted with root:unknown ownership, which was also the ownership of every file and folder within.
- The AFP volume was read-only even to my user account, despite the bizarre root:unknown ownership. SMB volumes were unreadable without sudo.
Lame, and not useful.
4. fstab
I am an fstab moron, and couldn ‘t find any examples of configuring it to mount AFP/SMB. I’m not sure if it’s even possible.
5. Jean-Michel Marino’s AutomountMaker program (it works!!)
This just worked, and I wish I had tried it first instead of trying to be fancy. I created scripts with AutomountMaker and dumped them into my Login Items list in the Accounts system prefs.
So there you go. Anyone have fancier ways of doing this? :)
that’s weird. i have my iTunes library on an AFP server and it just mounts when i access the library. it’s like it’s a local copy.
not sure why you’re having trouble. computers suck.
Kenny - iTunes may be smart enough to know where its library is, but apps like Retrospect aren’t. Or, at least, I haven’t been able to get it to work! So the same problem applies — i still have to mount the volume before Retrospect starts up…
I am trying to use AutomountMaker in 10.4.11 and it’s not working. I created a script and dropped the script in the Login Items in System Prefs but the AFPs do not mount when users log in. Has anyone else had this issue with AMP?