unable to mount windows share on linux 5.1

Hi,

I am using redhat linux 5.1 - 64bit,

using command

mount -t cifs //192.192.192.192/SW/Ex  /192.192.192.192 -o username=test

I am getting below error.

mount: block device //192.192.192.192/SW/Ex is write-protected, mounting read-only
mount: cannot mount block device //192.192.192.192/SW/Ex read-only

Please suggest

Regards,

Manoj

Please be aware that there is no "Linux 5.1" and you are referring to Red Hat Enterprise Linux 5.1, which is a distribution. The kernel is Linux (or collectively the different distributions based on that kernel) which is still on version 2.6.x.

That will hopefully clear up some confusion people may have.

Does the user for the share you have specified have write permissions?

Take a look at this :

Using SAMBA/CIFS to access Windows Shares - PrincetonUnixFAQ

And you can specify the rw option for the mount command

The reason probably is that you're trying to mount the share without a password, and mount won't ask you for one. You'll have to install the smbfs package, and have these options available to successfully mount:

  • mount -t cifs -ousername=<user>,password=<pw> //host/share /path/to/mount : will work, but the username and password will be available to everyone on the machine.
  • mount -t cifs -ocredentials=/path/to/credential.file //host/share /path/to/mount : Tells mount.cifs to use the credentials from a file, which contains 2 lines:
    text username=<user> password=<pw>
  • mount -t cifs -ousername=<user>,guest //host/share /path/to/mount : Mount the share as the guest user

See this documentation and man mount.cifs for more information and options.