What's new

USB Application - Network Place (Samba) Share: mounting from command line?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Chuckles67

Regular Contributor
Asus router RT-AC66U_B1 (Merlin 380.69)
Hard disk connected by USB to the router, with settings below

Using a Mac Mini with Mac OS X, I can connect successfully using Finder to "Connect to Server" and "smb://<ip address of my router>", and entering username and password. However the connected share disconnects after some time (perhaps when Mac Mini goes to sleep?) which means opening Finder and manually connecting.. instead I'd like to automate this connection using a script.

I'm a bit confused trying to figure out the syntax of the mount command, found here
mount -t smbfs //username:userpass@myserver/PUBLIC /smb/public
I've tried replacing the "myserver/PUBLIC" with "<ip address of my router>/HDD/Media" but this returns an error
mount_smbfs: mount error: /Volumes/Media (at HDD): No such file or directory
Has anyone figured the mount command terminology?

upload_2018-1-29_21-49-25.png

upload_2018-1-29_21-58-39.png
 
I don't know the answer to your question as it is an OS X question and nothing really to do with the router. But I would suggest that you turn on "Simpler share naming" just so that you don't have spaces in the share name ("Media (at HDD)" becomes "Media"). Sometimes having embedded spaces can be awkward from the command line.
 
Thanks - good point. Following that advice, here is how I did this from the command line
1. check you can see the Media folder using this:
smbutil view -g //guest@<routerIPaddress>
2. make a directory
mkdir /Volumes/Media
3. mount the smb share:
mount -t smbfs //<username>:<pwd>@<routerIPaddress>/Media /Volumes/Media
=> now you have mounted the Media folder from the USB drive at /Volumes/Media
4. if you need to unmount the share
umount /Volumes/Media
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top