Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

After installing Ubuntu 12.04, I'm trying to mount a samba share from Windows under Linux, using a scripted command that's always worked, and the server hasn't changed.

The error is as follows:

$ mount -t cifs //<host>/<share> /media/<share> -o username=<user>,password=<pass>
mount: block device //<host>/<share> is write-protected, mounting read-only
mount: cannot mount block device //<host>/<share> read-only
$

I've read a lot of discussions about permissions, but unfortunately, that wasn't the issue. I'm submitting my own answer below for reference, hope this helps someone else.

share|improve this question
    
Also adding the following (depending on your environment) to your fstab mount point. sec=ntlmssp OR sec=ntlm OR sec=ntlmv2 –  Mark McLean Sep 29 at 14:28

1 Answer 1

The error message is completely misleading, given the solution (for me anyway, I'm sure permissions problems might plague others, but in my case, this was a script that has always worked and a server that hadn't changed - only the client OS had changed). The solution for me was that the cifs-utils package was missing, as indicated by the missing file /sbin/mount.cifs

$ ls /sbin/mount.cifs
ls: cannot access /sbin/mount.cifs: No such file or directory
$ mount.cifs
The program 'mount.cifs' is currently not installed.  You can install it by typing:
apt-get install cifs-utils

After installing cifs-utils using the above command, the mount worked fine.

I realize it's a silly mistake to use mount -t cifs without /sbin/mount.cifs, but the error message was completely misleading. I have a Samba server installed on this client machine, so perhaps that's why it's confused.

share|improve this answer
1  
nice question and answer - the error is definitely completely misleading... good job ;-) –  nicorellius Sep 18 '13 at 21:09
    
also, in my case, I had some samba configuration issues that confounded the problem. it might help to check the smb.conf and make sure that the share is added correctly... –  nicorellius Sep 18 '13 at 22:56
    
Doesn't seem to be a "silly mistake" because I run into the same problem and the error message didn't help me at all. Thanks for posting the solution! –  scai Dec 3 '13 at 13:50

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.