Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 9 down vote accepted

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.

share|improve this answer
    
That's fixed it, thanks. I'd assumed smbfs was already installed since I was able to mount it manually. –  Rob Cowell Aug 10 '10 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 '10 at 10:16
    
Nice explanation :) –  invert Aug 11 '10 at 11:04
2  
If you're using ubuntu 13.04, you should install cifs-utils instead of smbfs. –  Klaus Schüssler May 11 '13 at 8:10
    
Answered decades ago, I know, but I needed this solution for LTS 12.04 and spent way-too-long searching. –  bobthechemist Aug 9 '13 at 14:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.