Thursday, April 25, 2013

Accessing a Network Share in OSX

It is not obvious how to access network drives in OSX. Thankfully knowing a little Linux goes a long way. My main need for this was to create a way to access a shared Git repository on a network share.
cd /Volumes
mkdir netshare
mount -t smbfs //username@server/netshare netshare
This can be condensed to just one line.
mkdir /Volumes/netshare && mount -t smbfs //username@server/netshare /Volumes/netshare
If the network share requires authentication, a password prompt will appear.

In good fashion it is good to know how to undo what you did; here is the unmout command.
umount netshare
rm -r /Volumes/netshare