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

Challenge with mounting windows share

Sat Dec 01, 2018 4:10 pm

I can easily load the folders in my router attached hard drive via Debian stretch GUI file manager and the files are fully readable/usable. However when I try to mount the files from within/etc/fstab I get an error message when I try to use the files - cannot open files or directory.
The files and folders look as though they were mounted but as I say they are not readable.

The command I am using in fstab is
//192.168.1.1/all\040folders/Music\040-\040router /home/pi/MyNAS cifs guest,vers=1.0,uid=pi,gid=pi,file_mode=0777,dir_mode=0777 0 0
I have tried it with and without the uid and gid, with noperm option, nodfs option to no avail.
I also tried it with my router name instead of the IP address. Again the files appeared to mount but were unreadable.

The reason I want to use the command line to mount the folder is that I frequently have power interruptions and when my Pi reboots the link in the GUI file manager to my bookmarked folder in my NAS must be manually restarted. Automounting the folder will negate me having to manaully open the link. The link is needed for me to run my app remotely.
Last edited by Erviv on Sat Dec 01, 2018 9:04 pm, edited 2 times in total.

Andyroo
Posts: 795
Joined: Sat Jun 16, 2018 12:49 am

Re: Challenge with mounting windows share

Sat Dec 01, 2018 8:31 pm

Try

Code: Select all

ver=1.0


You need the equals sign.
Need Pi spray - these things are breeding in my house...

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

Re: Challenge with mounting windows share

Sat Dec 01, 2018 8:42 pm

Thanks Andyroo. Unfortunately the equal sign was there. I just missed it when I was copying my entry to this forum. Had the equal sign not been in the fstab file I would have gotten a parse error, which I experienced numerous times throughout this challenge. I will add it to the initial entry above. The problem still persists.
Note I also tried vers=2.0 and vers=3.0 but these didn’t work at all.
The problem is in the actual mounting. If I could see the logic that the GUI (desktop) File Manager uses to mount network folders perhaps that would give me some hints as to what I am missing in my fstab file.

Andyroo
Posts: 795
Joined: Sat Jun 16, 2018 12:49 am

Re: Challenge with mounting windows share

Sat Dec 01, 2018 9:52 pm

Can you do a copy and paste into code tabs here please as the ‘40’ looks a bit odd as well?
Need Pi spray - these things are breeding in my house...

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

Re: Challenge with mounting windows share

Sat Dec 01, 2018 10:43 pm

The \040 is the format to replace spaces in the folder-file path names. Without the \040 I get a parse error.
i have copied the specific line from my/etc/fstab file below:

//192.168.1.1/all\040folders/Music\040-\040router /home/pi/MyNAS cifs guest,vers=1.0,uid=pi,gid=pi,file_mode=0777,dir_mode=0777 0 0
Note I have also used the router name and get the same results (ie. the folder/files appear to mount but are not useable.

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: Challenge with mounting windows share

Sat Dec 01, 2018 10:55 pm

I will point out again that doing this sort of thing in fstab is all wrong, for about a dozen reasons.

Despite the fact that there are a lot of tuts out there on the InterWebs recommending it.

The right way to do it is to figure out the right "mount" command, with all the needed options supplied on the "mount" command line, then arrange for that mount to be auto-executed on boot - usually via the "/etc/rc.local" file.

P.S. I wouldn't be surprised to find that the underlying problem here is not "waiting for network" in your startup. It usually is.

There's an option somewhere in systemd/raspi-config/wherever to tell it to "wait for network".
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

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

Re: Challenge with mounting windows share

Sat Dec 01, 2018 11:17 pm

I have already selected wait for network in raspi-config. That resolved the folder not automounting, however it did not make the files usable. I have tried in the past to use the manual command mount, but still had the same issue with the mounted folder not working, although by appearances the structure was the same. I posted about this problem last year, but wasn’t able to resolve the problem.
I know the folder on the hard drive connected to my router works, as I can use it successfully when I open it via the desktop file manager on my rpi. It’s strange I can’t replicate the process via commands.

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

Re: Challenge with mounting windows share

Sun Dec 02, 2018 1:27 am

n67: I followed up on your suggestion to trying running the mount from the command line. The result was unfortunately the same.
Here is my mount command:

sudo mount -t cifs -o guest,nounix,vers=1.0,file_mode=0777,dir_mode=0777,uid=1000,gid=1000 //192.168.1.1/"all folders"/"Music - router" /home/pi/MyNAS

No error message appears, but when I go to use them they can't be read.

Andyroo
Posts: 795
Joined: Sat Jun 16, 2018 12:49 am

Re: Challenge with mounting windows share

Sun Dec 02, 2018 2:05 am

On my router I have to put a device name at the front of the path. So if I was going to ‘Pictures’ I would have to mount it as //192.168.1.254/usb1/Pictures
Need Pi spray - these things are breeding in my house...

User avatar
thagrol
Posts: 1080
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Challenge with mounting windows share

Sun Dec 02, 2018 2:09 pm

n67 wrote:
Sat Dec 01, 2018 10:55 pm
I will point out again that doing this sort of thing in fstab is all wrong, for about a dozen reasons.
No. No it isn't.
Despite the fact that there are a lot of tuts out there on the InterWebs recommending it.

The right way to do it is to figure out the right "mount" command, with all the needed options supplied on the "mount" command line, then arrange for that mount to be auto-executed on boot - usually via the "/etc/rc.local" file.
Again, no. Despite it being present in raspbian rc.local has been deprecated (i.e. removed) from debian and other linux distros. Use a systemd service/mount instead (hit google for details).

@Erviv:From your original post it sounds like the mount is succeeding but permissions are wrong.

Some stuff to try:
  • Compare the output of

    Code: Select all

    mount|grep MyNAS
    With the share mounted via fstab and via file manager. Change your fstab entry so the options match.
  • Likewise compare file ownership and permissions of an affected file and/or directory.
Note to self: don't feed the trolls
If you believe "L'enfer, c'est les autres" (Hell is other people) have you considered that it may be of your own making?

n67
Posts: 938
Joined: Mon Oct 30, 2017 4:55 pm

Re: Challenge with mounting windows share

Sun Dec 02, 2018 3:55 pm

I will point out again that doing this sort of thing in fstab is all wrong, for about a dozen reasons.
No. No it isn't.
Yes. Yes, it is.
"L'enfer, c'est les autres"

G fytc hsqr rum umpbq rm qyw rm rfc kmbq md rfgq dmpsk:

Epmu Sn!

J lnacjrw njbruh-carppnanm vxm rb mnuncrwp vh yxbcb!

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

Re: Challenge with mounting windows share

Sun Dec 02, 2018 4:07 pm

@thagrol, thanks for some tips. I agree it mgiht be a permissions issue, as when I run ls /home/pi/MyNAS i get a complete listing of the folders, and drilling down all files within subfolders also appear to be mounted. Filesize and names match my shared folder.
When I click on folder properties in file manager for the shared folder no permissions tab appears. When I click on foldrer properties s for the MyNAS i get
Owner-pi, group - pi, view content - anyone, change content - anyone, access content - anyone. This after I added noperm to my options list in the mont command.

My output from mount grep | MyNAS is odd to me, it is though it is mounted many time over(?). Here it is

$ mount|grep MyNAS
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,cache=strict,username=admin,domain=WORKGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.1,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,sec=none,cache=strict,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.1,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,sec=none,cache=strict,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.1,file_mode=0777,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,sec=none,cache=strict,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.1,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,sec=none,cache=strict,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.1.1,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,sec=none,cache=strict,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.1.1,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,noperm,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)

I don't get any output from, (not even an error message: mount|grep //linksys19041/"all folders"/"MUSIC - router"
Neither do I get an output if I change the shared name to its op address of 192.168.1.1
Since File Manager uses likely a different process to mount the shared folder, is there another command or syntax I should be using?

I rebooted the machine thinking something was amiss with my umount command, as after running the umount command I was stilll getting a result againts the grep command. I rebooted my rpi. Ran the mount commnad and now the result of the grep is more logical:

mount|grep MyNAS
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,sec=none,cache=strict,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.1.1,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,noperm,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)

It still says there is a file permissions issue.

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

Re: Challenge with mounting windows share

Sun Dec 02, 2018 4:19 pm

I looked closer at the file properties of the to files. The total files size is identical (down to the last byte), however the line size on disk is slightly larger for the MyNAS file. I am thinking that as long as the file size is the same, how it gets allocated on the disk is not significant.

User avatar
thagrol
Posts: 1080
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Challenge with mounting windows share

Sun Dec 02, 2018 4:49 pm

Erviv wrote:
Sun Dec 02, 2018 4:07 pm
@thagrol, thanks for some tips. I agree it mgiht be a permissions issue, as when I run ls /home/pi/MyNAS i get a complete listing of the folders, and drilling down all files within subfolders also appear to be mounted. Filesize and names match my shared folder.
When I click on folder properties in file manager for the shared folder no permissions tab appears. When I click on foldrer properties s for the MyNAS i get
Owner-pi, group - pi, view content - anyone, change content - anyone, access content - anyone. This after I added noperm to my options list in the mont command.
Sorry, I don't use the gui file manager so don't know how to interpret that.
My output from mount grep | MyNAS is odd to me, it is though it is mounted many time over(?). Here it is

$ mount|grep MyNAS
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,cache=strict,username=admin,domain=WORKGROUP,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.1,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,sec=none,cache=strict,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.1,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,sec=none,cache=strict,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.1,file_mode=0777,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,sec=none,cache=strict,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.1,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,sec=none,cache=strict,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.1.1,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,sec=none,cache=strict,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.1.1,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,noperm,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
Looks odd but not sure why.
I don't get any output from, (not even an error message: mount|grep //linksys19041/"all folders"/"MUSIC - router"
Neither do I get an output if I change the shared name to its op address of 192.168.1.1
That's what I'd expect. Mount generally doesn't give any output unless there is an error to report.
Since File Manager uses likely a different process to mount the shared folder, is there another command or syntax I should be using?
It does, and I think that's where the problem lies. In the difference.
I rebooted the machine thinking something was amiss with my umount command, as after running the umount command I was stilll getting a result againts the grep command. I rebooted my rpi. Ran the mount commnad and now the result of the grep is more logical:

mount|grep MyNAS
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,sec=none,cache=strict,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.1.1,file_mode=0777,dir_mode=0777,soft,nounix,serverino,mapposix,noperm,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)

It still says there is a file permissions issue.
OK, try this (appologies if I'm assuming less knowledge than you have).
  1. Edit your fstab and comment out the entry for your NAS (insert a # at the start of the line)
  2. Reboot
  3. Mount the share via the GUI file manager
  4. Open a terminal window
  5. Run

    Code: Select all

    mount | grep MyNAS > ~/filenamager_mount.txt
  6. Run

    Code: Select all

    ls -l /home/pi/MyNAS > ~/filemanager_ls.txt
  7. Edit your fstab and re-enable the entry for your NAS (remove the #)
  8. Reboot. Your NAS should be mounted from fstab during boot. If not run

    Code: Select all

    sudo mount -a
    in a terminal window.
  9. Open a terminal window
  10. Run

    Code: Select all

    mount | grep MyNAS > ~/manual_mount.txt
  11. Run

    Code: Select all

    ls -l /home/pi/MyNAS > ~/manual_ls.txt
  12. Compare ~/filenamager_mount.tx and ~/filemanager_ls.txt
  13. Compare ~/filemanager_ls.tx and ~/manual_ls.tx
The above should show us what the difference between the two cases is. You can use the diff command to do the comparison if you wish.
Note to self: don't feed the trolls
If you believe "L'enfer, c'est les autres" (Hell is other people) have you considered that it may be of your own making?

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

Re: Challenge with mounting windows share

Sun Dec 02, 2018 5:21 pm

Thanks. Ok, I will give this a try this afternoon. Keep in mind that when I open the connection directly to the share via File Manager (via network connections) that MyNAS stays empty.

User avatar
thagrol
Posts: 1080
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Challenge with mounting windows share

Sun Dec 02, 2018 6:17 pm

Now I'm confused. I though you said it worked when mounted via file manager?

Try accessing //192.168.1.1/all folders/Music - router on your file manager before doing steps 5 and 6.

Edit:
Silly me. Of course that directory will be empty. The file manager will mount it somewhere else. Change the ls in the file manager step to match where it actually mounted the share.
Note to self: don't feed the trolls
If you believe "L'enfer, c'est les autres" (Hell is other people) have you considered that it may be of your own making?

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

Re: Challenge with mounting windows share

Sun Dec 02, 2018 7:27 pm

<t>@thagrol: What works is opening and accessing the network hard drive which is connected to my router via the GUI program File Manager. from the desktop of my rpi. To do so I simply open file manager, and clck on my bookmark, but can alsojust enter the address go to location smb://linksys19041/all folders/MUSIC - router. Note this is not opening anything to the MyNAS directory which I created to receive the manual mount or fstab mount.<br/>
When I open the SMB:.... in File Manager the files are fully usable. There are no permissions shown when I open folder properties. <br/>
When I run mount | grep MyNAS > ~/filenamager_mount.txt. I get no results. I assume this is because nothing is mounted in the directory MyNAS.

Running ls -l /home/pi/MyNAS > ~/filemanager_ls.txt yields no results.<br/>

When I revise the /etc/fstab to enable the cifs line and run mount -a, and then run mount | grep MyNAS > ~/manual_mount.txt I get nothing<br/>

Finally running ls -l /home/pi/MyNAS > ~/manual_ls.txt results in no ouput.<br/>

Runing ls -l /home/pi/MyNAS yields a list of my folders, one line example:<br/>
ls -l /home/pi/MyNAS<br/>
total 21504<br/>
drwxrwxr-x 1 pi pi 0 Mar 18 2018 3 Doors Down

I can' think of a ls command that provides a similar output for the GUI FILE Manager 'mounted' share,. as it doesn't like any of the paths i tried.</t>
For some of the above commands I believe the ~ is to bring the path to the root directory, should I use an explicit path name instead?

User avatar
thagrol
Posts: 1080
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Challenge with mounting windows share

Sun Dec 02, 2018 9:40 pm

You won't see any direct output from the commands I suggested as all output (except errors) is redirected into a file.

So, have you looked at the contents of any of ~/filenamager_mount.txt, ~/filemanager_ls.txt, ~/manual_mount.txt, and ~/manual_ls.txt?

You may find nothing in in ~/filenamager_mount.txt if so try this instead:

Code: Select all

mount|grep linksys
or just

Code: Select all

mount
and look for something relevant in the output.

I included ouput re-direction to a file so you'd have a more permanent record of what's going on rather than just having it printed to the terminal window. You need this as you're rebooting between tests.

Assuming your file manager does mount the share rather than using some other technique, the output from "mount" should tell you where it has been mounted. Probably somewhere under /media

Though as I said, I don't use the desktop or its file manager so can't help directly with its behaviour.

What I'm trying to get from you is details of the mounted shared and what options were used to mount it both via your file manager and via your fstab.

From your ls excert, permissions look like they should work, at least for the pi user. You were attempting to acess the share as pi? But, they're not the permissions I'd expect from your fstab entry. I'd expect rwxrwxrwx not rwxrwxr-x

Alternatively, comment out your fstab entry and experiment with mount options via a terminal window. Remember to umount between mount attempts. Once you have it working convert the successful mount command to an fstab entry.

If doing this, I'd start with:

Code: Select all

sudo mount -t cifs -o rw,guest,user=pi,vers=1.0,uid=pi,gid=pi //192.168.1.1/all\040folders/Music\040-\040router /home/pi/MyNAS
The main diference between that and your fstab is that I've added "user=pi" and "rw"; and removed both "file_mode" and "dir_mode"

You could cut it back further to

Code: Select all

sudo mount -t cifs -o rw,guest,vers=1.0//192.168.1.1/all\040folders/Music\040-\040router /home/pi/MyNAS
but that would likely result in everything on the share appearing to be owned by root with limited permissions for everyone else.
Note to self: don't feed the trolls
If you believe "L'enfer, c'est les autres" (Hell is other people) have you considered that it may be of your own making?

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

Re: Challenge with mounting windows share

Mon Dec 03, 2018 3:30 am

Thanks for the feedback. I have tried mount from terminal. The command I used is in the 8th post of this thread. However it didn't work any better than the fstab approach.
I will give your ideas a shot tomorrow.

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

Re: Challenge with mounting windows share

Mon Dec 03, 2018 5:40 pm

The mount seems to be located at the following: /run/user/1000/gvfs/smb-share:server=linksys19041,share=all%20folders

If I run mount grep against that location I get nothing, but if I run mount grep against gvfs I get the following:
mount | grep gvfs
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

Note I found this location by observing an option in File Manager that says open folder to terminal. My shared folder opens as:
/run/user/1000/gvfs/smb-share:server=linksys19041,share=all%20folders/MUSIC - router $. When this is done, the files work.

Trying the sudo mount
sudo mount -t cifs -o rw,uid=1000,gid=1000,vers=1.0 //192.168.1.1/"all folders"/"Music - router" /home/pi/MyNASPassword for root@//192.168.1.1/all folders/Music - router: **********
pi@raspberrypi-2:~ $ mount | grep MyNAS
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,cache=strict,username=root,domain=WORKGROUP,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.1.1,soft,unix,posixpaths,serverino,mapposix,acl,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
No luck
and trying to cpoy the gvfsd-fuse mount options I get
$ sudo mount -t cifs -o rw,nosuid,nodev,uid=1000,gid=1000,vers=1.0 //192.168.1.1/"all folders"/"Music - router" /home/pi/MyNAS
Password for root@//192.168.1.1/all folders/Music - router: **********
pi@raspberrypi-2:~ $ mount | grep MyNAS
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,nosuid,nodev,relatime,vers=1.0,cache=strict,username=root,domain=WORKGROUP,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.1.1,soft,unix,posixpaths,serverino,mapposix,acl,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)

No success with this either. Could it be something to do with domain as there is nothing in the gvfs mount that shows domain.
What I guess I need is a way to open the link via the gvfs. I will have to do some further research.

comparing the two outputs:
//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,nosuid,nodev,relatime,vers=1.0,cache=strict,username=root,domain=WORKGROUP,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.1.1,soft,unix,posixpaths,serverino,mapposix,acl,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)
pi@raspberrypi-2:~ $ mount | grep gvfs
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

User avatar
thagrol
Posts: 1080
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Challenge with mounting windows share

Mon Dec 03, 2018 6:27 pm

OK.

The file manager appears to be going via gvfsd-fuse rather than directly to cifs/samba. I'm afraid I know nothing about this except the wikipedia entry: https://en.wikipedia.org/wiki/GVfs

I suspect that the problem with both your manual mount and fstab entry is revealed by this: "username=root". This is probably the default taken from the username of the user performing the mount. "root" in the case of both fstab and sudo.

Your NAS proably doesn't like that and is restricting permissions for that user. That samba/cifs user on the NAS, I mean. "root" is often disallowed or treated as a special case.

As per the mount command I suggested in my last post, try including "user=pi" in your mount options. This will override the default username to one that isn't "special". Assuming a sane smb.conf on your NAS, you can probably use amost anything in place of "pi", it doesn't have to match an existing user on either the NAS or the pi.
Note to self: don't feed the trolls
If you believe "L'enfer, c'est les autres" (Hell is other people) have you considered that it may be of your own making?

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

Re: Challenge with mounting windows share

Mon Dec 03, 2018 8:07 pm

Well perhaps my router/NAS is not normal. I tried the suggestion of adding user=pi and did not get a different result

sudo mount -t cifs -o rw,guest,user=pi,uid=1000,gid=1000,vers=1.0 //192.168.1.1/"all folders"/"Music - router" /home/pi/MyNAS
pi@raspberrypi-2:~ $ mount | grep MyNAS//192.168.1.1/all folders/Music - router on /home/pi/MyNAS type cifs (rw,relatime,vers=1.0,cache=strict,username=pi,domain=WORKGROUP,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.1.1,soft,unix,posixpaths,serverino,mapposix,acl,rsize=61440,wsize=65536,echo_interval=60,actimeo=1)

I took a stab at using the gio command, but the web information isn't sufficient to figure it out

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

GIO locations seems to be in the format smb://server/resource/file.txt
the format of the command seems to be gio mount option location, per the GIO help mount (manual from rpi terminal)

User avatar
thagrol
Posts: 1080
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Challenge with mounting windows share

Mon Dec 03, 2018 9:34 pm

Well I'm stumped.

The only other things I can suggests are:
  • See if your router/NAS has any accessablke log files that might shed some light on what's going on.
  • Check any relavent settings on your router/NAS. I doubt this is the problem but just to be sure.
  • Arrange for your shortcut to run when the desktop is started. This isn't ideal and won't mount your shaer exactly where you want it but might provide a work around. I can't help with how as it's a long time since I've needed to auto start anything with the desktop and all my Pi are headless.
  • Try asking in the support/forums for the router. Or, if you haven't, searching google.
As I don't have the same router as you, I don't think there is much more I can do to help resolve things for you. Sorry.
Note to self: don't feed the trolls
If you believe "L'enfer, c'est les autres" (Hell is other people) have you considered that it may be of your own making?

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

Re: Challenge with mounting windows share

Mon Dec 03, 2018 9:56 pm

@thagrol: Thanks for your help. I have googled all that I can think of. I have not found anywhere commands to launch from the desktop. I still have some hope about figuring out Gio commands, although info on Gio commands seems rare.

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

Re: Challenge with mounting windows share

Wed Dec 05, 2018 8:13 pm

I had success with the Gio command. I used in terminal
gio mount “smb://linksys19041/all folders/Music - router”
I originally had Gio mount -m ..., but this didn’t work. Removing the -m worked.
This opened the shared folder “all folders” in /run/user/1000/gvfs/smb-share:server=linksys19041,share=all%20folders. I don’t understand why it didn’t mount down to the specified sub folder, but the sub folder and all other sub folders under “all folders” are there. Better still, this works.

My remaining ponderance is what would be the best way to have this run on each reboot either systemd or local.host, any recommendations?

Return to “Raspbian”