You are not logged in.

#1 2013-12-20 18:31:05

Senketsu
Member
From: Mexico
Registered: 2013-12-20
Posts: 6

Problem with USB mounted in "read-only"

Yesterday i was using my Sandisk USB (16GB) between Windows 7 and Arch Linux, but in the second time i was moving some files it became impossible for me to paste files in the USB.

I had been reading a lot of post and tried a lot of ways to repair this.

#dmesg | tail

[ 5771.818423] usb 1-1.1: new high-speed USB device number 5 using ehci-pci
[ 5771.903861] usb-storage 1-1.1:1.0: USB Mass Storage device detected
[ 5771.905035] scsi8 : usb-storage 1-1.1:1.0
[ 5772.909262] scsi 8:0:0:0: Direct-Access     SanDisk  Cruzer           1.26 PQ: 0 ANSI: 5
[ 5772.911089] sd 8:0:0:0: [sdb] 31266816 512-byte logical blocks: (16.0 GB/14.9 GiB)
[ 5772.912593] sd 8:0:0:0: [sdb] Write Protect is on
[ 5772.912602] sd 8:0:0:0: [sdb] Mode Sense: 43 00 80 00
[ 5772.915030] sd 8:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 5772.930130]  sdb: sdb1
[ 5772.933947] sd 8:0:0:0: [sdb] Attached SCSI removable disk

# df

Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda3      247058872 31219332 203266648  14% /
dev              1921536        0   1921536   0% /dev
run              1924264      860   1923404   1% /run
tmpfs            1924264      740   1923524   1% /dev/shm
tmpfs            1924264        0   1924264   0% /sys/fs/cgroup
tmpfs            1924264      772   1923492   1% /tmp
/dev/sdb1       15632380  1279196  14353184   9% /run/media/miguel/LeUSB

fdisk -l /dev/sdb

Disk /dev/sdb: 14.9 GiB, 16008609792 bytes, 31266816 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: 0x3fcaaacd

Device    Boot Start       End   Blocks  Id System
/dev/sdb1       2048  31266815 15632384   7 HPFS/NTFS/exFAT

dd if=/dev/zero of=/dev/sdb

dd: failed to open ‘/dev/sdb’: Read-only file system

Already tried with Gparted, editing the fstab file and using some other utilities but i cant get my USB to work properly.

Offline

#2 2013-12-20 18:39:12

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,737
Website

Re: Problem with USB mounted in "read-only"

Do you have ntfs-3g installed?

I don't think you mean to dd directly to the block device.. That would zero out everything on it (eventually).


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2013-12-20 18:40:57

Senketsu
Member
From: Mexico
Registered: 2013-12-20
Posts: 6

Re: Problem with USB mounted in "read-only"

Yes, ntfs-3g is already installed.

I read in  a post that dd could rewrite the sectors in the usb and then i could format it again.

Offline

#4 2013-12-20 21:55:57

nextoscore
Member
Registered: 2012-01-25
Posts: 5

Re: Problem with USB mounted in "read-only"

Senketsu wrote:

[ 5772.912593] sd 8:0:0:0: [sdb] Write Protect is on

The fuck is this? Do you have anything like mechanical switcher on that USB drive by any chance? I mean, "turn write on/off" one?
Quickly googled that line: http://askubuntu.com/questions/101637/u … ection-off

Try to use hdparm, it is a nice tool.
Also, as you can see, you can't even write a byte to the block device, so the problem is not the fs support.
Also, simply dd-ing from one file (device) to another means you will write data until either a source data ends or destination device is full.
For erasing the MBR (after it you can re-partition the drive) you only should

dd if=/dev/zero of=/dev/sdb bs=512 count=1

You might want to check what this command do first big_smile
Never do this unless you have a backup copy of your main hdd MBR record:

dd if=/dev/zero of=/dev/your_main_hdd bs=512 count=1

Offline

#5 2013-12-21 00:19:33

Senketsu
Member
From: Mexico
Registered: 2013-12-20
Posts: 6

Re: Problem with USB mounted in "read-only"

nextoscore wrote:
Senketsu wrote:

[ 5772.912593] sd 8:0:0:0: [sdb] Write Protect is on

The fuck is this? Do you have anything like mechanical switcher on that USB drive by any chance? I mean, "turn write on/off" one?

No, there is not a mechanical switch

nextoscore wrote:

Quickly googled that line: http://askubuntu.com/questions/101637/u … ection-off
Try to use hdparm, it is a nice tool.

Im checking this right now, but it seem like hdparm turned off readonly to 0, even with that i cant formate the usb.

nextoscore wrote:

Also, as you can see, you can't even write a byte to the block device, so the problem is not the fs support.
Also, simply dd-ing from one file (device) to another means you will write data until either a source data ends or destination device is full.
For erasing the MBR (after it you can re-partition the drive) you only should

dd if=/dev/zero of=/dev/sdb bs=512 count=1

Senketsu# dd if=/dev/zero of=/dev/sdb bs=512 count=1
dd: failed to open ‘/dev/sdb’: Read-only file system

Offline

#6 2013-12-21 04:20:05

Hydranix
Member
Registered: 2013-02-10
Posts: 56

Re: Problem with USB mounted in "read-only"

This is typical of a flash drive, or SDCard, or any flash-memory storage device. SSDs included.

It's damaged. At a very low level.


I've had it happen with 2 Patriot Xporter Pulse 64GB flash drives. One of which I was able to recover, the other is still stuck in this state.


This isn't physical damage to the NAND chips, it's actually just retarded proprietary firmware on the stick. It almost feels they do it intentially to a select percent of their drives to rake in more money. No way to prove it true or false though..


Anyway, I have a Windows-Only tool that MIGHT recover your stick. It's danagerous as hell to use, and likely only works on Patriot stick, but I can confirm it saved one of mine once. So you're free to try it.

Before you do anything follow this procedure...
[It obviously clears the drive in the process so back it up]

Boot windows XP/Vista/7/8 or 8.1

Plug in your read-only flash drive.

unplug ALL OTHER USB EVERYTHINGS
I left my mouse and keyboard attached but definately NO OTHER FLASH DRIVES.

Run the .exe and click go or whatever if it finds your USB Drive.

If not, welp sorry. I tried.

Link to tool.
MD5: CD853BAF7CA951E16F2F4BB783D194C8
SHA256: 35F25B583618DCE8217BC0BBB84ED47545E418F5

Virus Total: Link

The Tool: Link

Offline

Board footer

Powered by FluxBB