millerdev
millerdev

Reputation: 10331

Finding the path of a mounted network share on Mac OS X

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.

Upvotes: 7

Views: 33230

Answers (2)

John N
John N

Reputation: 139

Try /Volumes/PUBLIC

(Or whatever Get Info tells you after looking at the file with Finder)

That's what worked for me.

Upvotes: 13

prodigitalson
prodigitalson

Reputation: 60413

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...

Upvotes: 1

Related Questions