You are not logged in.

#1 2017-02-21 13:11:02

quellen
Member
From: Italy
Registered: 2014-05-24
Posts: 275

pendrive dead? (Read-only file system)

Hi,
i have a problem with my SanDisk Cruzer Blade 8GB: it is always on read-only mode:

$ sudo fdisk -l /dev/sdb
Disk /dev/sdb: 7.5 GiB, 8004304896 bytes, 15633408 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
Disklabel type: dos
Disk identifier: 0x8a052e3b

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdb1          63 15633406 15633344  7.5G  c W95 FAT32 (LBA)
$ sudo hdparm -r /dev/sdb

/dev/sdb:
 readonly      =  1 (on)
$ sudo hdparm -r0 /dev/sdb

/dev/sdb:
 setting readonly to 0 (off)
 readonly      =  0 (off)
$ sudo hdparm /dev/sdb

/dev/sdb:
SG_IO: bad/missing sense data, sb[]:  f0 00 05 00 00 00 00 14 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 multcount     =  0 (off)
 readonly      =  0 (off)
 readahead     = 256 (on)
 geometry      = 1020/247/62, sectors = 15633408, start = 0
$ sudo fdisk /dev/sdb

Welcome to fdisk (util-linux 2.29.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

fdisk: cannot open /dev/sdb: Read-only file system
$ sudo dd if=/dev/zero of=/dev/sdb
dd: failed to open '/dev/sdb': Read-only file system
$ dmesg | tail -n 25|grep sdb
[ 1905.533673] sd 2:0:0:0: [sdb] 15652864 512-byte logical blocks: (8.01 GB/7.46 GiB)
[ 1905.534025] sd 2:0:0:0: [sdb] Write Protect is off
[ 1905.534029] sd 2:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 1905.534318] sd 2:0:0:0: [sdb] No Caching mode page found
[ 1905.534326] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[ 1905.537731]  sdb: sdb1
[ 1905.538947] sd 2:0:0:0: [sdb] Attached SCSI removable disk
[ 1982.020929] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 2400.827699] sd 2:0:0:0: [sdb] 15633408 512-byte logical blocks: (8.00 GB/7.45 GiB)
[ 2400.828832] sd 2:0:0:0: [sdb] Write Protect is on
[ 2400.828837] sd 2:0:0:0: [sdb] Mode Sense: 43 00 80 00
[ 2400.829185] sd 2:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 2400.853680]  sdb: sdb1
[ 2400.856778] sd 2:0:0:0: [sdb] Attached SCSI disk
$ sudo fsck /dev/sdb1
fsck from util-linux 2.29.1
fsck.fat 4.0 (2016-05-06)
open: Read-only file system
$ sudo dosfsck -w -r -l -a -v -t /dev/sdb1
fsck.fat 4.0 (2016-05-06)
open: Read-only file system

Last edited by quellen (2017-02-21 13:14:14)


sorry for my bad english

Offline

#2 2017-02-21 13:53:32

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: pendrive dead? (Read-only file system)

I wouldn't trust hdparm to work properly with usb flash drives, I suppose it's not a problem with hdparm but just that usb flash drives do not support/implement the functionality.

Don't grep the output of dmesg as clues to the problem may be left out. That said, if fdisk and dd complain it is read only then the flash drive is most probably broken, backup all important data while you can. If the drive really is broken you should be thankful that it failed read only and not just died taking all data with it.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2017-02-21 14:43:32

seth
Member
Registered: 2012-09-03
Posts: 51,229

Re: pendrive dead? (Read-only file system)

Likely dead. Take a close look at the keys pins (bent, broke, corroded) and try another slot/system. But unless it really has a HW write protection switch, it's dead.

If you're lucky, you can use a vendor tool to write the controllers nvrm (typically windows only and untranslated chinese), but it's likely dead :-(

Offline

#4 2017-02-21 16:24:04

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: pendrive dead? (Read-only file system)

[ 1905.533673] sd 2:0:0:0: [sdb] 15652864 512-byte logical blocks: (8.01 GB/7.46 GiB)
[ 1905.534025] sd 2:0:0:0: [sdb] Write Protect is off
...
[ 2400.827699] sd 2:0:0:0: [sdb] 15633408 512-byte logical blocks: (8.00 GB/7.45 GiB)
[ 2400.828832] sd 2:0:0:0: [sdb] Write Protect is on

Wait, this is two different disks. Or is it shrinking?

In any case, the drive claims to be read only now (or at least the kernel thinks so). Maybe it reached its flash write endurance limit or just went nuts. Try it with Windows, if it doesn't work there you know what to do.

Offline

#5 2017-02-22 18:33:47

rafael.rocha
Member
Registered: 2017-02-22
Posts: 1

Re: pendrive dead? (Read-only file system)

Hello, quellen.

I am not an experient arch linux user, but here is the solution I used when I had this problem:
>install dosfstools package from arch repo to have the command dosfsck, which check and try to repair MS-DOS filesystems.
# sudo pacman -S dosfstools
>umount your device
>run dosfsck for your flash usb partition. -v flag is the verbose flag. /dev/sdc1 should be changed to your particular device label. You can find the label using the lsblk command and searching for the size of your flash usb drive.
# sudo dosfsck -v /dev/sdc1
>When executing the dosfsck command, allow it to make the suggested corrections.
>Mount it again to check if this solution worked for you.

Experienced arch users, please correct me if I'm wrong or forgetting something.

Edit: Sorry, you already tried this... I missed the last information on your post.

Last edited by rafael.rocha (2017-02-22 19:01:00)

Offline

Board footer

Powered by FluxBB