Author Topic: Unable to automount NAS shares (SOLVED)  (Read 512 times)

Offline Jay S

  • Newly Subscribed
  • *
  • Posts: 20
  • Karma: 3
  • LInux Newbie
    • View Profile
    • Peterberger Adventures
  • Peppermint version(s): Peppermint 10
Unable to automount NAS shares (SOLVED)
« on: April 08, 2020, 10:15:29 pm »
Hello All,
I've gone through all the CIFS mount issues via the search and have tried multiple iterations of the /etc/fstab commands but I'm not able to get my NAS shares to automount. They mount fine with 'sudo mount -a' and appear on the desktop. I am able to access and manipulate all the directories and files as user 'jay'. However, I am then unable to unmount the shares from the desktop and they do not return after rebooting.

Here are the lines in the fstab file I'm using:

# NAS shares mounting on boot
//192.168.1.203/homes   /media/jay/homes   cifs   uid=1000,gid=1000,credentials=/home/jay/.nascredentials,file_mode=0770,dir_mode=0770  0 0
//192.168.1.203/video   /media/jay/video   cifs   uid=1000,gid=1000,credentials=/home/jay/.nascredentials,file_mode=0770,dir_mode=0770  0 0
//192.168.1.203/photo   /media/jay/photo   cifs   uid=1000,gid=1000,credentials=/home/jay/.nascredentials,file_mode=0770,dir_mode=0770  0 0
//192.168.1.203/Images   /media/jay/Images   cifs  uid=1000,gid=1000,credentials=/home/jay/.nascredentials,file_mode=0770,dir_mode=0770  0 0

My credentials file is root:root, the uid and gid values are correct. I've tried a number of other options that are noted in MAN and some that are used by others showing videos of the process. I was really hoping to automount these shares to make everything smoother as I keep working on transitioning from Win to Linux.  Any suggestions?

Thanks,
Jay

Note: when trying to mount as user 'jay' from the file menu, I get an error stating 'operation permitted for root only' so this is obviously a permissions error. All mount point permissions are set 0775 jay:jay.  Help!!!
« Last Edit: April 09, 2020, 07:26:13 pm by Jay S »
Fast enough to get there, slow enough to see...

Offline murraymint

  • Trusted User
  • Veteran
  • *****
  • Posts: 2202
  • Karma: 459
  • soft boiled with a yolk of gold
    • View Profile
  • Peppermint version(s): 7, 8, 9
Re: Unable to automount NAS shares
« Reply #1 on: April 09, 2020, 07:58:03 am »
They mount fine with 'sudo mount -a'

...

when trying to mount as user 'jay' from the file menu, I get an error stating 'operation permitted for root only'

That's normal for fstab mounts and doesn't indicate any errors. The network might be coming up slightly later than the mount is attempted. One of my PCs is affected and I either run 'sudo mount -a' manually or automate it into the launcher for 'Files'.

Offline Jay S

  • Newly Subscribed
  • *
  • Posts: 20
  • Karma: 3
  • LInux Newbie
    • View Profile
    • Peterberger Adventures
  • Peppermint version(s): Peppermint 10
Re: Unable to automount NAS shares
« Reply #2 on: April 09, 2020, 07:09:28 pm »
They mount fine with 'sudo mount -a'

...

when trying to mount as user 'jay' from the file menu, I get an error stating 'operation permitted for root only'

That's normal for fstab mounts and doesn't indicate any errors. The network might be coming up slightly later than the mount is attempted. One of my PCs is affected and I either run 'sudo mount -a' manually or automate it into the launcher for 'Files'.

Thanks murraymint. It makes sense to me that the fstab runs before the network drives are visible to the computer. However, I still don't understand why I get the 'only root' can do this error when trying to mount after opening the desktop file manager. All of the mount points have user 'jay' set as the owner and user. I must be missing a setting or privilege somewhere allowing user to mount drive????  For now I'll try messing with the launcher to see if I can get this to work as most of my access to these shares won't be via the command line.

Jay
Fast enough to get there, slow enough to see...

Offline Jay S

  • Newly Subscribed
  • *
  • Posts: 20
  • Karma: 3
  • LInux Newbie
    • View Profile
    • Peterberger Adventures
  • Peppermint version(s): Peppermint 10
Re: Unable to automount NAS shares (SOLVED)
« Reply #3 on: April 09, 2020, 07:33:07 pm »
So I finally made enough incremental changes to make it work. I then returned variables to their previous state until I found the combination that works with the least number of steps...so far!

#1 required change - my .nascredentials file needs Jay:jay as owner:user, not root:root.

#2 required change - add 'user' as an option in the fstab file for each share to mount like this (bold for effect)
# NAS shares mounting on boot
//192.168.1.203/homes   /media/jay/homes   cifs   user,uid=1000,gid=1000,credentials=/home/jay/.nascredentials,file_mode=0770,dir_mode=0770  0 0

It still won't mount the shares on boot but, now that I can mount and unmount from the file manager, I'm thinking about the mount point. Using /media/..... makes the mount visible on the desktop. I'm not sure if I need it to clutter the desktop if I'm accessing it through Nemo. But that's for another thought exercise.  Thanks again for the help and motivation.

Jay

4/10/2020 Update:
The fstab line is down to a shorter version that works well now. I haven't been able to eliminate any more options and still get it to work.

//192.168.1.203/homes   /media/jay/homes   cifs   user,credentials=/home/jay/.nascredentials  0 0
« Last Edit: April 10, 2020, 08:56:48 pm by Jay S »
Fast enough to get there, slow enough to see...