Ubuntu – Cannot mount samba network share

cifsmountsamba

I recently switched to a new computer at work and since then I am not able to mount my personal network share via cifs. I checked twice with my old computer about the command and even the exact version of cifs-utils, which is exactly the same. I have currently no idea why it doesn't work and I hope you can give me some hints to debug this.

Here's the command I'm using:

sudo mount -t cifs -o user=shareuser,uid=myuser,gid=mygrp //path/to/my/network/share /home/myuser/mountpoint --verbose

And here's the error I receive:

mount error(22): Invalid argument

Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

which is not very helpful as -22 seems to be a generic "something went wrong" error code.

I checked syslog while executing the above command:

 Jul 19 15:31:28 kernel: [23412.098328] Key type cifs.idmap registered
 Jul 19 15:31:28 kernel: [23412.098578] No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
 Jul 19 15:31:28 kernel: [23412.115297] CIFS VFS: DFS capability contradicts DFS flag
 Jul 19 15:31:28 kernel: [23412.123565] CIFS VFS: cifs_mount failed w/return code = -22

Second and third message also appear on my old computer so this doesn't seem to be any problem.

System information:

  • (K)Ubuntu 18.04
  • Linux 4.15.0-23-generic #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018
  • cifs-utils version 2:6.8-1

EDIT:

I also tried to mount the share by adding it to fstab:

#network share
//path/to/my/network/share /home/myuser/mountpoint cifs credentials=/home/myuser/.smbcredentials,uid=myuser,gid=mygrp,file_mode=0777,dir_mode=0777 0 0

Applying fstab results in the same error message.

Best Answer

I ran into a similar problem where mount using cifs produced the -22 error. The share aught to be mountable as I was able to access it using smbclient.

Based on this bug report: https://bugs.launchpad.net/ubuntu/+source/cifs-utils/+bug/1772148, I tried installing the 'keyutils' package and that fixed it for me. It could be that your old computer has this package but the new one doesn't for whatever reason.

Related Question