Skip to content

Instantly share code, notes, and snippets.

@natritmeyer
Created September 19, 2013 09:40
Show Gist options
  • Star 59 You must be signed in to star a gist
  • Fork 17 You must be signed in to fork a gist
  • Save natritmeyer/6621231 to your computer and use it in GitHub Desktop.
Save natritmeyer/6621231 to your computer and use it in GitHub Desktop.
How to mount and unmount a SMB share on Mac OS X (using mount_smbfs)
#Mounting the share is a 2 stage process:
# 1. Create a directory that will be the mount point
# 2. Mount the share to that directory
#Create the mount point:
mkdir share_name
#Mount the share:
mount_smbfs //username:password@server.name/share_name share_name/
#Unmount the share:
umount share_name
@bilogic
Copy link

bilogic commented Jun 22, 2023

Can update the gist for Monterey which requires adding WORKGROUP?

mount_smbfs //'WORKGROUP;username':password@remote-host/shared local-mount-point/

@arisolt
Copy link

arisolt commented Jun 22, 2023

mount_smbfs: mount error: /Users/machenchi/shareDev: No such file or directory
But I have made a dir with mkdir /Users/machenchi/shareDev

@vaxilicaihouxian @mwmcode I had the same issue. I fixed it by putting the last argument (i.e the mounting point) in quotes. So, the original command becomes:

mount_smbfs //username:password@server.name/share_name "share_name/"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment