1

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.

2
  • Can we assume that admin does not have an encrypted home directory? – steeldriver Apr 26 '19 at 8:41
  • @steeldriver correct – learnsomemore Apr 26 '19 at 19:15
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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.