Mounting cifs drive gives: mount error(22): Invalid argument

maybe this helps with this, mount error(22): Invalid argument... possible error is the argument/s (mode) on mount command.

  1. check your logs on the errors encountered.

    tail -f  /var/log/kern.log 
    
  2. remove the invalid argument


Another possible cause is the presence of sec=ntlm in /etc/fstab and it's incompatibility with newer SMB protocols like SMB3.

While not the OP's case, this can also cause mount error(22): Invalid argument errors, as it did for me after upgrading an old server.

Even though kern.log includes a suggestion to specify vers=1.0 on mount, it may be safer to remove or change sec=ntlm instead. Perhaps use the defaults to allow automatic negotiation of the SMB version and security, or specify compatible options such as vers=3.0,sec=ntlmssp.

Obviously this depends on your SMB server's features, but I would try and avoid vers=1.0 unless necessary.


I had the same issue on Arch Linux, with this message in log:

kernel: CIFS VFS: cifs_mount failed w/return code = -22

For me the solution was to specify older version of cifs (by default it was 3.0):

/etc/fstab:

//my-router/share /media/share cifs ver="2.1",rw,soft,uid=ele,gid=ele,file_mode=0770,dir_mode=0770,credentials=/etc/router-credentials.conf 0 0

Tags:

Mount

Cifs