10.7: Mount AFP volume with root bug

Jan 09, '12 07:30:00AM

Contributed by: applebit

I'm sick of waiting for Apple to come up with a fix to trying to mount a volume in 10.7 while logged in as root so I came up with my own solution.

cat >/tmp/mountVolume.sh <<-"EOF"
osascript -e 'mount volume "afp://username:password@server/path/"'
EOF
chmod 755 /tmp/mountVolume.sh
su -l guest /tmp/mountVolume.sh
rm -f /tmp/mountVolume.sh
When run as root this will use the guest account to mount the volume -- it's a work around and only recommended for those whom understand the root account.

[crarko adds: I haven't tested this one.]

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20120106082818768