2

If I login and manually run mount -a it mounts without any problems. But auto-mount is not running.

I've tried the following:

`//192.168.0.85/someshare/Directory /var/log/remoteMount cifs auto,credentials=/home/admin/.smbcredentials,vers=3.0,iocharset=utf8,noperm 0 0`

//192.168.0.85/someshare/Directory /var/log/remoteMount cifs credentials=/home/admin/.smbcredentials,vers=3.0,iocharset=utf8,noperm,_netdev 0 0

`//192.168.0.85/someshare/Directory /var/log/remoteMount cifs credentials=/home/admin/.smbcredentials,vers=3.0,iocharset=utf8,noperm,_netdev,x-systemd.automount 0 0`

`//192.168.0.85/someshare/Directory /var/log/remoteMount cifs credentials=/home/admin/.smbcredentials,vers=3.0,iocharset=utf8,noperm,x-systemd.automount 0 0`

Each time on boot i get the following error in dmesg CIFS VFS: cifs_mount failed w/return code = -2

In all the above attempts, auto-mount does not work (each time tested by rebooting and checking for directory contents). However each time i ran mount -a everything works.

How can i get auto-mount working in /etc/fstab when using ver=3.0 and when using .smbcredentials instead of storing username and password in /etc/fstab?

UPDATE:

Also tried:

//192.168.0.85/someshare/Directory /var/log/remoteMount cifs credentials=/home/admin/.smbcredentials,vers=3.0,iocharset=utf8,noperm,noauto,x-systemd.automount 0 0 which won't automount or mount with mount -a

Using @reboot sleep 10; mount -a in root crontab with the first thing i tried in /etc/fstab for now.

jtlindsey
  • 2,100

2 Answers2

0

A useful thread here.

I have faced this problem before and have used vers=1.0 which works perfectly.

You could also try mount -a -vvv to give a verbose version of the error.

graham
  • 13,061
0

If you are going to use x-systemd.automount you have to add the noauto option to your list:

//192.168.0.85/someshare/Directory /var/log/remoteMount cifs credentials=/home/admin/.smbcredentials,vers=3.0,iocharset=utf8,noperm,noauto,x-systemd.automount 0 0

I don't think specifying the smb dialect as 3.0 is the issue since the version of mount.cifs in 18.04 already does that by default if the server allows it.

Morbius1
  • 8,437