1

Background:

I am accessing a remote directory like this:

smb://serv.erNa.me/storage/directory/

Accessing it, is not an issue. Through the file manager I copy paste the path, press Enter, insert user and password and, eventually, I can see the content of the directory. That is fine, if I want to browse its content.

But, if I need to access this directory through the shell (suppose to Open a Terminal Here, from the file manager) to launch some scripts, I fall into an overcomplicated series of subdirectories and my path looks like this:

/run/user/1000/gvfs/smb-share:server=serv.erNa.me,share=storage/directory

which is kind of impossible to manage, if I have to perform some operations over filenames and paths (which is exactly what I need to to).

A few experiments I performed:

  1. I noticed that if I have a virtualbox installed, that has a shared directory pointing to the directory of interest:

    smb://serv.erNa.me/storage/directory/
    

    in the virtualised Ubuntu, the mount point is nice and clean:

    /media/storage/directory
    

    and I can simply run the scripts and everything goes fine. But I need to run the scripts without the need of a virtualbox since it makes everything slow.

  2. I also tried:

    mkdir /media/short/
    mount -t cifs -o rw,guest,vers=1.0,noperm,sec=none smb://serv.erNa.me/storage/directory/ /media/short/
    

    but that gives an error:

    mounting cifs URL not implemented yet. Attempt to mount smb://serv.erNa.me/storage/directory/
    

The question:

Why is that? How can virtualbox use a very clean and readable mounting point while, if I want to access the same directory from my system I need to go through the horrible path shown above?

Is there a way I can set something more user-friendly?

  • @Fabby: no I haven't but now that I did it returns an error message: mount.cifs: bad UNC (///serv.erNa.me/storage/directory/). – gabrielet May 9 at 15:25
  • I also tried mount -t cifs -o rw,guest,vers=1.0,noperm,sec=none smb://serv.erNa.me/storage/directory/ /media/short/ but it gives another error like: mounting cifs URL not implemented yet. Attempt to mount smb://serv.erNa.me/storage/directory/ – gabrielet May 9 at 15:26
  • My apologies: no further bright ideas... All my comments deleted. See my edits. You can delete all the above comments now. – Fabby May 9 at 17:20
  • Don't include smb: in the remote path you pass to mount. Try mount -t cifs -o rw,guest,vers=1.0,noperm,sec=none //serv.erNa.me/storage/directory/ /media/short/. You can read about this with man mount and man mount.cifs. – roaima May 9 at 19:08
  • @roaima and fabby thanks to both of you. I'll post the actual answer but mount cifs is the way to go! – gabrielet May 10 at 6:36
0

I found this answer: https://askubuntu.com/questions/101029/how-do-i-mount-a-cifs-share

which exactly achieve what I needed, I simply didn't know about mount.cifs.

In the end, this is what I did:

$ sudo apt install cifs-utils
$ mkdir /media/short/
$ sudo mount -t cifs -o username=yourUserName //serv.er.name/storage/ /media/short/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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