Friday, October 29, 2010

CIFS VFS No username specified cifs_mount failed code = -22

I wanted to use a credentials file instead of plain text user and password in fstab. I did that before in Ubuntu but for some reason in one of my servers I was getting the below:
# mount /mnt/mymount
mount: wrong fs type, bad option, bad superblock on \\windowsbox\shared,
       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount. helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

From system logs:
# dmesg|tail
[8628151.305806]  CIFS VFS: No username specified
[8628151.306141]  CIFS VFS: cifs_mount failed w/return code = -22


This was related to smbs not being installed:
# apt-get install cifs-utils
# which mount.cifs


Alexander said...

Thx man! Helped me a lot.

Chris Lambert said...


Chris Lambert said...
This comment has been removed by the author.
Unknown said...

For centos, install cifs-utils
# yum install cifs-utils

Craig said...


Anonymous said...


Unknown said...

For Debian 7
apt-get install cifs-utils

caoin said...

On a new install of Ubuntu 14.04 I had to open Synaptic and reinstall cifs-utils (even though it claimed to be installed) before this would work.

smbfs doesn’t seem to be in the repositories any more.

Nestor Urquiza said...

@caoin Thanks I have updated the post to reflect the change. You are correct.

Krim Barbarroja said...

After ripping my hair off because of this...thanks!! I was feeling like a total idiot, lol.

Unknown said...

Saved me so much time. Thanks!

vernetto said...

you saved my life!

Ahmed said...

This helped me thanks a lot

Nestor Urquiza said...

@Ahmed My pleasure.