Howto: Resolve Centos 6 and Windows Share Error – CIFS VFS: cifs_mount failed w/return code = -22

Posted on August 6, 2012

When trying to mount a windows fileshare on centos 6.

[jared@localhost ~]$ sudo mount -t cifs // /tmp/share
mount: wrong fs type, bad option, bad superblock on //,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

Tail dmesg and you will find the following error.

[jared@localhost ~]$ sudo dmesg | tail
Slow work thread pool: Ready
CIFS VFS: cifs_mount failed w/return code = -22

Install cifs-utils

[jared@localhost ~]$ sudo yum install cifs-utils

Try mounting it again

[jared@localhost ~]$ sudo mount -t cifs -o username=YOUR_USERNAME,password=YOUR_PASSWORD // /tmp/share 
mount.cifs kernel mount options: ip=,unc=\\\share,,ver=1,user=YOUR_USERNAME,pass=********
[jared@localhost ~]$ cd /tmp/share