12

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.

1
  • Also adding the following (depending on your environment) to your fstab mount point. sec=ntlmssp OR sec=ntlm OR sec=ntlmv2 Sep 29, 2014 at 14:28

1 Answer 1

13

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.

3
  • 1
    nice question and answer - the error is definitely completely misleading... good job ;-) Sep 18, 2013 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... Sep 18, 2013 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, 2013 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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