Unable to mount CIFS share on boot with fstab in LinuxMint 19 [SOLVED]

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
ladon
Level 1
Level 1
Posts: 11
Joined: Fri Nov 16, 2012 7:06 pm
Location: UK
Contact:

Unable to mount CIFS share on boot with fstab in LinuxMint 19 [SOLVED]

Post by ladon » Wed Jul 04, 2018 1:35 am

Hi All,

I installed Linux Mint 19 x64 Cinnamon (no update from a previous version).
I entered the following line in my fstab:

//<NasIP>/<share> /media/pictures cifs credentials=/home/<user>/.credentials,rw,uid=1000,gid=1000,nounix,vers=1.0,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0

This line works perfectly fine on my very old Lubuntu Netbook Remix system.
In Linux Mint 19 it doesn't map the shares on boot.
When I select the share in my file manager I receive the following error:
"Unable to mount. Operation permitted for root only"

I tried this with a normal user as well as with an admin user.
If I enter "sudo mount -a", it maps all the shares correctly.

Maybe worth mentioning that "mount -a" returns only the message that only root can execute it.
However, this message is the same on my Lubuntu system. So I don't think that's connected with it.
The share itself resides on a very old QNAP NAS box (TS-109).

The file permissions for fstab are set to "read" to everyone.
Even when I add "write" to everyone, it doesn't change the behaviour.

Any thoughts about this are very much appreciated.
Many thanks in advance.

Kind Regards,
Andreas
Last edited by ladon on Wed Jul 04, 2018 8:37 am, edited 1 time in total.

altair4
Level 19
Level 19
Posts: 9152
Joined: Tue Feb 03, 2009 10:27 am

Re: Unable to mount CIFS share on boot with fstab in LinuxMint 19

Post by altair4 » Wed Jul 04, 2018 7:52 am

A couple of suggestions and it depends on why you want this share mounted at boot.

[1] If you want this to mount as required change your fstab mount to this:
//<NasIP>/<share> /media/pictures cifs credentials=/home/<user>/.credentials,rw,uid=1000,gid=1000,nounix,vers=1.0,iocharset=utf8,file_mode=0777,dir_mode=0777,user,noauto 0 0
Your share will not mount at boot or at login. It will mount when you select the "pictures" icon on the side panel of your file manager. Note: this will only work as described if your mount point is under /media ( which it is in your case ) or under your home directory ).

[1a] You can add the following to your Startup Applications ( Menu > Startup > Applications > + ):

Code: Select all

mount /media/pictures
Then it will mount at login not at boot.

[2] If you truly want it to mount at boot not "as required" or at login keep your fstab line as it is but:

** Create a new file at /etc/network/if-up.d/fstab
** With this content:

Code: Select all

#!/bin/sh
mount -a
** Make it executable:

Code: Select all

sudo chmod +x /etc/network/if-up.d/fstab
Something in if-up.d will run only after your network stack is operational on your Mint system which is why I suspect the orginal fstab line if not working.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

ladon
Level 1
Level 1
Posts: 11
Joined: Fri Nov 16, 2012 7:06 pm
Location: UK
Contact:

Re: Unable to mount CIFS share on boot with fstab in LinuxMint 19

Post by ladon » Wed Jul 04, 2018 8:36 am

Awesome!
That has solved my problem.
I added the "user,noauto" to the entries and that works perfectly fine.

Thank you very much for replying to that question and sharing your knowledge.
Very helpful indeed!

Kind Regards

Post Reply

Return to “Other networking topics”