Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does cifs_mount failed w/return code = -22 indicate

Tags:

mount

samba

cifs

I am trying

sudo mount -t cifs //<server>/<share> -o username=user@domain,password=**** /mnt/<mountpoint> 

error message:

mount: wrong fs type, bad option, bad superblock on //server/share,        missing codepage or other error        In some cases useful info is found in syslog - try        dmesg | tail  or so 

The syslog has

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

I am able to mount the same share on another centos system. I can ping the server, mount point directory has been created.

like image 566
Adi Pandit Avatar asked Jul 18 '11 14:07

Adi Pandit


2 Answers

I ran into this problem when using a host name and solved it by using an IP address. E.g.:

use

mount -t cifs //192.168.1.15/share 

rather than

mount -t cifs //servername/share 

Another possible solution is to install

cifs-utils

.

like image 158
akame Avatar answered Sep 30 '22 23:09

akame


Ah, the dreaded -22. Basically this seems to be used as a catchall for "something didn't work", although technically it's referred to as an invalid argument.

The client does IMHO a very poor job of telling you the actual problem. (This may not be its fault - it doesn't always have access to that information).

However -- have you checked the logs on the server/machine you are connecting to?

I was connecting to an OS X samba server, and learned from what I found in the logs there that it was necessary to specify additional options under -o as follows:

nounix,sec=ntlmssp

Among the things these settings enable are "allow long names", and "ignore UNIX filename endings"...sec is to specify security flags.

Another possibility is that you're trying to access a filesystem of a type that mount.cifs can't actually handle.

like image 40
jsh Avatar answered Sep 30 '22 23:09

jsh