Score:0

FSTAB Stopped Mounting CIFS SAMBA Share

mx flag

Installed KUBUNTU 20.04 two weeks ago on my desktop. For the last two weeks fstab has been mounting my SAMBA share (hosted on a headless Ubuntu 14.04 LTS server) without issue. Now for some reason starting today the SAMBA share is not mounting at bootup/login. I can manually mount it using sudo mount -a. Here is my fstab entry.

//192.168.1.71/fs1 /mnt/FS1 cifs rw,credentials=/var/credentials,uid=1000,gid=1000 0 0

I'm stumped, I've spent several hours digging through various related questions, the only thing I can think of is for some reason all of a sudden the computer is attempting to mount the share before the network comes up (gigabit Ethernet). However all the "solutions" I could find haven't worked, such as using a noauto option in fstab and then putting sudo mount -a in /etc/rc.local I did find by default /etc/rc.local was not on my system, so maybe I set it up wrong?

Also noticed the share is listed in Dolphin (KDE Filemanager) but if I click on it, I get an error saying "only root can mount". If do a manual mount with sudo mount -a then Dolphin can access the share.

Thanks!

David avatar
cn flag
is the problem on the 14.04 or 20.04 machine?
Infurious avatar
mx flag
@David, the problem is with the 20.04 machine. The 14.04 machine is a headless server that I host Plex, Samba Shares, Pi-Hole, and a few other services on. It has been running solid without issue. Other computers, smartphones, and devices on the LAN (Ethernet and WiFi) can access the Samba Shares on the 14.04 Server. For some reason after two weeks without isse, the 20.04 machine stopped mounting the Samba Share that is hosted on the 14.04 server.
Score:1
es flag

Given the location of your mount point I would suggest a systemd automount.

Add noauto,x-systemd.automount to your list of options:

//192.168.1.71/fs1 /mnt/FS1 cifs rw,credentials=/var/credentials,uid=1000,gid=1000,noauto,x-systemd.automount 0 0

The way this will work is that it will not mount at boot time but when the /mnt/FS1 folder is accessed. Accessed by you directly, or by a script, or by another process, or by another application ... The whole thing is rather seamless.

EDIT: For it to work though Dolphin I have to add the 'user' option to fstab:

//192.168.1.71/fs1 /mnt/FS1 cifs rw,credentials=/var/credentials,uid=1000,gid=1000,noauto,x-systemd.automount,user 0 0
Infurious avatar
mx flag
Morbius1, thanks for the help... it got me "90%" there. Works great if I use a terminal to access the Samba Share first, but for some reason if I first try to access the share via a GUI window, like Dolphin File Manger, before accessing it via the terminal, I still get the "root required to mount" error message and it won't mount. For the short term until I figure it out, I kind of hacked a fix by having a Bash Script do a quick directory listing of the root folder of the Samba Share after login.. then everything works. Not an elegant solution but working for now.
Morbius1 avatar
es flag
My mistake. I made a bad assumption that it would work in KDE the way it does in Gnome and it's derivatives. After installing KDE on a test box it clearly does not - at least not through Dolphin. I has to add the `user` option to the list for it to work there. Please see my edit above.
Infurious avatar
mx flag
Awesome! That works. Thank you for the help!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.