Erviv
Posts: 18
Joined: Thu Jun 08, 2017 12:43 pm

GIO Mount command help

Tue Dec 04, 2018 2:34 am

I am trying to open my shared folder, which is on my hard drive attached to my router from the command line from my rpi. I want to do this so that I don't have to re-open the folder via File Manager every time we have a minor power failure, which causes the rpi to reboot.
Although I have had plenty of help on this forum, I can't get it to work properly via either the mount command or via the /etc/fstab file. It seems that my HDD/router doesn't cooperate as the mounted files although they appear to be mounted correctly won't open for reading. So I decided to try another approach.

The folder opens quite successfully from the desktop file manager. Looking at this I observed that file manager "mounts" it in - /run/user/1000/gvfs/smb-share:server=linksys19041,share=all%20folders/MUSIC - router

It has the following detail
mount | grep gvfs
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

I have tried the GIO command:
pi@raspberrypi-2:~ $ gio mount -m smb://192.168.1.1/all%20folders
Error mounting location: The specified location is not mounted

I believe I have some syntax errors but don't know what they are.
gio help mount doesn't give me much in terms of formatting the location.

any ideas?

Erviv
Posts: 18
Joined: Thu Jun 08, 2017 12:43 pm

Re: GIO Mount command help

Thu Dec 06, 2018 1:13 am

Sorted it out. The solution was in the syntax.

Not: pi@raspberrypi-2:~ $ gio mount -m smb://192.168.1.1/all%20folders

But pi@raspberrypi-2:~ $ gio mount “smb://192.168.1.1/all folders”. Also works with the server name in place of the IP address.

Erviv
Posts: 18
Joined: Thu Jun 08, 2017 12:43 pm

Re: GIO Mount command help

Fri Dec 07, 2018 3:36 am

While I solved the mounting problem, I have not figured out how to have this command run at boot and reboot. I have tried using a systemd file, but it appears commands can't be used with the execstart= statement. I guess this statement expects a unit file with the command inside it. Not sure yet how this works. There doesn't seem to be many examples of using systemd.

Return to “Networking and servers”