Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I would like to mount an SMB network share from the command line (terminal); how would I go about that?

I am using Mac OS X 10.6.4.

share|improve this question
add comment

2 Answers

up vote 9 down vote accepted

You could easily achieve this using mount_smbfs (which is, actually, a wrapper for mount -t smbfs) :

mount_smbfs //user@SERVER/folder ./mntpoint

Optionally, add the workgroup :

mount_smbfs -W workgroup //user@SERVER/folder ./mntpoint

You could, of course, change the ./mntpoint (for something like /Volumes/smb).

After doing this, simply go to ./mntpoint to browse your data.

To unmount, using the following command :

umount ./mntpoint

share|improve this answer
1  
I get : `mount_smbfs: mount error: path: Input/output error', while it mounts find via Finder->Connect to Server? –  Ian Vaughan Mar 2 '12 at 16:53
add comment

You should take a look at mount’s help:

man mount

Upon closer inspection you’ll see that the filesystem’s type is:

mount -t smbfs //username:password@MACHINENAME/SHARENAME /SomeLocalFolderOfChoice

Password (and theoretically username) are optional.

The result of the above command will be no output (if all went ok), but a cd /SomeLocalFolderOfChoice, should produce the remote results. Please note that SomeLocalFolderofChoice must exist.

You can also use mount_smbfs to replace the mount -t smbfs.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.