Why is mount.cifs not working in fstab any more after upgrading from 16.04 to 18.04?
What worked for me was adding vers=1.0 to the options in fstab in combination with changing the option for password from passwd to password:
//192.168.111.112/RAID /home/moi/share/OMV cifs vers=1.0,noauto,users,username=USERNAME,password=PASSWORD
This helped to find an error-log:
tail -f /var/log/kern.log
I would appreciate any further input.
EDIT: Sept 2019
Today I realized that users
is no longer a valid argument of the mount cifs
command. Also, vers=1.0
should be the default, according to man mount.cifs
.
I have been struggling with this for a couple days, I could get to samba shares on an ubuntu 16.04 desktop system with my lubuntu 18.04 new installation using smb4k, but not in fstab. I used some of the parameters listed by 'mount' after mounting a share using smb4k. What I found was the credentials=/etc/samba/auth.myserver.me
did not work like it did with ubuntu 16.04. The following syntax would allow a mount:
//192.168.10.66/servershare /mnt/localdir cifs rw,vers=1.0,sec=ntlmssp,username=USER,password=PASSWORD,domain=YOURDOMAIN,uid=LOCALUSER,gid=LOCALUSER,posixpaths,mapposix,acl 0 0
What I do not know is which of the above options are required. Use your own values for USER, PASSWORD, and YOURDOMAIN.
Whenever I used the credentials=/etc/samba/auth.myserver.me
, I would always get a 'Permission denied' message. Apparently ubuntu 18.04 is not properly accessing the credentials file listed in fstab
or the syntax has changed.
You may have to experiment with the uid and gid. I normally only login as a particular user, which I am calling LOCALUSER, the default group for that login would also be LOCALUSER.
When upgrading to Ubuntu 18.04, our mount cifs scripts failed too, these were the following fixes I needed:
- Use
user
notusername
- Use
pass
notpassword
- Use
dom
notdomain
- Use
vers=1.0
- Use backslashes
\
not forward slashes/
in UNC - When invoked from bash scripts escape the backslashes, i.e.
\\
instead of\
.
Here's a sample mount command in a script:
#!/bin/bash
REMOTEHOST=contoso
REMOTEFOLDER=share
MOUNTDIR=/mnt/share
MOUNTUSER=billgates
MOUNTPASS=secret
MOUNTDOM=microsoft
sudo mount -t cifs \\\\${REMOTEHOST}\\${REMOTEFOLDER} ${MOUNTDIR} -o vers=1.0,user=${MOUNTUSER},pass=${MOUNTPASS},dom=${MOUNTDOM}
Here's the sample mount line in /etc/fstab
:
# /etc/fstab
\\contoso\share /mnt/share cifs vers=1.0,user=billgates,pass=secret,dom=microsoft
However, if you're using a credentials file, you need to use username
, password
and domain
as follows:
# /etc/fstab
\\contoso\share /mnt/share cifs vers=1.0,credentials=/root/.smb
# /root/.smb
username=billgates
password=secret
domain=microsoft