14

I have a valid, reachable SMB share on my Windows box, which I can mount with

sudo mount -t cifs //192.168.0.9/C /mnt/WinC -o username=foo,password=bar

but isn't mountable from my fstab. The fstab entry reads

//192.168.0.9    /mnt/WinC    credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777    0    0

and the credentials file (which has 777 permissions while I get this working) contains

username=foo
password=bar

but sudo mount -a results in an error, which from a dmesg | tail, shows

[225040.991705]  CIFS VFS: No username specified
[225050.991721]  CIFS VFS: cifs_mount failed w/return code = -22

Anyone else seen this issue and managed to resolve it?

0

2 Answers 2

28

Install smbfs.

Sounds silly that a package could fix this but when you use credentials files, the kernel diverts to the mount.cifs command rather than doing the mount itself. This package provides mount.cifs so should get you on the road to victory!

Edit: As Klaus points out in the comments, for 13.04 and later, you need cifs-utils.

6
  • That's fixed it, thanks. I'd assumed smbfs was already installed since I was able to mount it manually.
    – Rob Cowell
    Aug 10, 2010 at 10:09
  • 1
    Yeah it's crazy. smbfs is actually the deprecated predecessor to cifs so it's even stranger that the smbfs package provides this command.
    – Oli
    Aug 10, 2010 at 10:16
  • Nice explanation :)
    – invert
    Aug 11, 2010 at 11:04
  • 8
    If you're using ubuntu 13.04, you should install cifs-utils instead of smbfs. May 11, 2013 at 8:10
  • 1
    Answered decades ago, I know, but I needed this solution for LTS 12.04 and spent way-too-long searching. Aug 9, 2013 at 14:16
5

I went mad on 14.04. the credential= option was not mounting the share in fstab although I could mount it "by hand" in the cli. Issue was that the "cifs-utils" package was not installed...

sudo apt-get install cifs-utils

and everything was fine...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .