Unable to open /dev/sdb read-write (Read-only file system)

First try the command sudo hdparm -r0 /dev/sdb (method taken from another askubuntu answer). Then try remounting rw the partition. If these steps don't work then you are most likely out of luck with that pendrive.

Since the kernel says that the whole drive is write protected you have to deal with the protection at the drive level.

hdparm does this. If it can't solve this it is likely that your pendrive is write protected by design or it is failed.

Maybe it has a hardware switch under its casing if you take it apart. If it was writable before maybe this switch got flipped, if it was never writable maybe it was always on.

Also googling for your device gives out a lot of hits with the same problem even on windows. This is from the Sandisk forums:

For the SanDisk USB stick the answer has been posted many times. If new return it to where you bought it. If under warrantee return it to SanDisk. BOTH options will get you a new USB stick. There are no other consistent options.

Also from the Sandisk forum:

This is an offical answer if you contact customer service:

"I understand that you are getting write protection error while accessing your Cruzer flash drive. The flash drive has detected a potential fault and has become write protected to prevent data loss. There is no method to fix this. You will need to backup your data and replace the flash drive. Our team of developers is in combination with the OS developers looking into a solution to resolve this issue. Please note that only a minor percentage of users are experiencing the write protection issue and these are the customers posting on the internet to find a solution."

So likely there is no way to solve it.


My problem is always that the little lock switch on the side of the SD card is moved to "lock". Yes, I mean the physical switch on the side of the SD card.

See this picture:

SD card labeled lock states