Unable to open /dev/sdb read-write (Read-only file system)
As in the title, I'm unable to format it as it says read-only. I've tried couple of searches and the solutions too. Even I tried GParted to see I have any luck. Unfortunately below is what I get.
GParted 0.11.0 --enable-libparted-dmraid
Libparted 2.3
Delete /dev/sdb1 (fat32, 14.91 GiB) from /dev/sdb 00:00:00 ( ERROR )
calibrate /dev/sdb1 00:00:00 ( SUCCESS )
path: /dev/sdb1
start: 32
end: 31,266,815
size: 31,266,784 (14.91 GiB)
delete partition 00:00:00 ( ERROR )
libparted messages ( INFO )
Unable to open /dev/sdb read-write (Read-only file system). /dev/sdb has been opened read-only.
Unable to open /dev/sdb read-write (Read-only file system). /dev/sdb has been opened read-only.
Unable to open /dev/sdb read-write (Read-only file system). /dev/sdb has been opened read-only.
Unable to open /dev/sdb read-write (Read-only file system). /dev/sdb has been opened read-only.
Unable to open /dev/sdb read-write (Read-only file system). /dev/sdb has been opened read-only.
Can't write to /dev/sdb, because it is opened read-only.
Unable to open /dev/sdb read-write (Read-only file system). /dev/sdb has been opened read-only.
Output of dmesg
:
[10061.878073] usb 2-1.3: new high-speed USB device number 8 using ehci_hcd
[10061.972140] scsi9 : usb-storage 2-1.3:1.0
[10062.969922] scsi 9:0:0:0: Direct-Access SanDisk Cruzer Blade 1.20 PQ: 0 ANSI: 5
[10062.971746] sd 9:0:0:0: Attached scsi generic sg2 type 0
[10062.972799] sd 9:0:0:0: [sdb] 31266816 512-byte logical blocks: (16.0 GB/14.9 GiB)
[10062.976439] sd 9:0:0:0: [sdb] Write Protect is on
[10062.976453] sd 9:0:0:0: [sdb] Mode Sense: 43 00 80 00
[10062.977353] sd 9:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[10062.999026] sdb: sdb1
[10063.003367] sd 9:0:0:0: [sdb] Attached SCSI removable disk
Output of fsck
:
sudo fsck -n /dev/sdb
fsck from util-linux 2.20.1
e2fsck 1.42 (29-Nov-2011)
fsck.ext2: Device or resource busy while trying to open /dev/sdb
Filesystem mounted or opened exclusively by another program?
Output of sudo fdisk -l /dev/sdb
:
Disk /dev/sdb1: 16.0 GB, 16008593408 bytes
64 heads, 32 sectors/track, 15266 cylinders, total 31266784 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6f20736b
This doesn't look like a partition table
Probably you selected the wrong device.
Device Boot Start End Blocks Id System
/dev/sdb1p1 ? 778135908 1919645538 570754815+ 72 Unknown
/dev/sdb1p2 ? 168689522 2104717761 968014120 65 Novell Netware 386
/dev/sdb1p3 ? 1869881465 3805909656 968014096 79 Unknown
/dev/sdb1p4 ? 2885681152 2885736650 27749+ d Unknown
Partition table entries are not in disk order
This is not yet fixed as I've tried plenty of ways. Any idea on how to fix this?
Solution 1:
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.
Solution 2:
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: