Error mounting samba share, cannot mount block device xxxx read-only

11

5

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.

Jeff Ward

Posted 2012-12-06T16:55:44.217

Reputation: 438

Also adding the following (depending on your environment) to your fstab mount point. sec=ntlmssp OR sec=ntlm OR sec=ntlmv2 – Mark McLean – 2014-09-29T14:28:50.663

Answers

12

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.

Jeff Ward

Posted 2012-12-06T16:55:44.217

Reputation: 438

1nice question and answer - the error is definitely completely misleading... good job ;-) – nicorellius – 2013-09-18T21:09:36.403

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 – 2013-09-18T22:56:58.497

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 – 2013-12-03T13:50:31.857