views:

367

answers:

1

I'd like to find out where a network share is mounted when the mount command fails like this:

$ mkdir ~/share
$ mount_afp afp://server/share ~/share
mount_afp: the volume is already mounted

This looked promising...

$ mount
... snip ...
afp_000000004oMw0q76003DF78u-1.2d000006 on /Volumes/share-1 (afpfs, nodev, nosuid, mounted by username)
afp_000000004oMw0q76003DF78u-2.2d000007 on /Volumes/share-2 (afpfs, nodev, nosuid, mounted by username)

It seems like there should be a way to map those long afp_000... numbers to URIs... Is there any way to determine where a volume is mounted given its afp:// URI?

I'm actually executing these commands with Python's subprocess module, so if there's a module or library that can do it that would be acceptable as well.

+1  A: 

Do you mean where it mounted on the remote server or where its mounted locally? If youre talking on the local system the mountpoint should be in /Network/Servers unless otherwise specified by fstab, autofs or an arg to mount. You could scan /Network/Servers for the share name...

prodigitalson
I want to know where it is mounted locally. I forgot about /Network/Servers. That might work.
Daniel
It doesn't look like /Network/Servers will work. If I do `ls /Network/Servers/server/path/to/share` I get `ls: share: File exists` instead of a real listing.
Daniel
Actually in 10.5 it looks like it mounts in /Volumes (at least using cmd+k) like a normal volume - maybe they got rid of the /Network/Servers thing (i was relaying expeience from Tiger) or maybe thats only for mounts configured from the Directory services.
prodigitalson