Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 878
millerdev Avatar asked Jan 29 '10 04:01

millerdev


People also ask

How do I find the path of a network drive on a Mac?

Under the Go menu, open the Connect to Server utility. Enter the path to the folder (example: smb://Hostname/Sharename). A new icon displays on your desktop and in your Finder sidebar. That is your network drive.

How do I access network shares on a Mac?

In the Finder on your Mac, choose Go > Connect to Server. Type the network address for the computer or server in the Server Address field. For information about the correct format for network addresses, see Network address formats and protocols. Click Connect.

Can you map a network drive on a Mac?

In Finder, either hit Command+K to bring up “Connect to Server” or click Go > Connect to Server. Enter the path of the network drive you're trying to map (e.g. smb://192.168.1.300/shared/Files) and click Connect. Enter your login details and password then click OK to mount the network drive.

How do I find UNC path on Mac?

Also, if you connect to the local domain, you can configure UNC paths to work in Mac OS X. You can connect to the domain by going to System Preferences>Users & Groups>Login Options and click the Join button next to Network Account Server. Type in the name of the domain and press enter.


2 Answers

Try /Volumes/PUBLIC

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

That's what worked for me.

like image 103
John N Avatar answered Sep 20 '22 04:09

John N


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

like image 35
prodigitalson Avatar answered Sep 22 '22 04:09

prodigitalson