Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-05-2025, 02:46 PM
|
#1
|
|
Member
Registered: Oct 2022
Posts: 159
Rep:
|
USB stick refuses to leave read-only mode. How to make it writable again?
[ Log in to get rid of this advertisement]
dmesg:
Code:
[2304237.356095] scsi 5:0:0:0: Direct-Access USB SanDisk 3.2Gen1 1.00 PQ: 0 ANSI: 6
[2304237.356396] sd 5:0:0:0: Attached scsi generic sg4 type 0
[2304237.356778] sd 5:0:0:0: [sdd] 60063744 512-byte logical blocks: (30.8 GB/28.6 GiB)
[2304237.359283] sd 5:0:0:0: [sdd] Write Protect is on
[2304237.359287] sd 5:0:0:0: [sdd] Mode Sense: 43 00 80 00
[2304237.359617] sd 5:0:0:0: [sdd] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
hdparm:
Code:
# hdparm -r0 /dev/sdd
/dev/sdd:
setting readonly to 0 (off)
readonly = 1 (on)
It's a SanDisk Ultra USB stick. It's fully readable and no data is corrupted.
It is also write-protected on a different computer, so the issue is with the USB stick.
If there is no way to get it writing again, it's not that big of a loss, but it would be nice to have it working again.
|
|
|
|
10-05-2025, 03:16 PM
|
#2
|
|
Senior Member
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 2,235
|
I'm not familiar with that model. Dmesg says write protect is on. Is there a physical switch on the device? SD cards have a write-protect switch, but I don't know about that device. If there is no switch, the drive is possibly failing. Becoming read-only is a classic failure mode for flash drives.
Last edited by sgosnell; 10-05-2025 at 03:18 PM.
|
|
|
|
10-05-2025, 03:44 PM
|
#3
|
|
LQ Guru
Registered: Oct 2004
Distribution: Arch
Posts: 5,642
|
|
|
|
|
10-05-2025, 08:33 PM
|
#4
|
|
Senior Member
Registered: Apr 2010
Posts: 2,375
|
Quote:
Originally Posted by exerceo
dmesg:
Code:
[2304237.356095] scsi 5:0:0:0: Direct-Access USB SanDisk 3.2Gen1 1.00 PQ: 0 ANSI: 6
[2304237.356396] sd 5:0:0:0: Attached scsi generic sg4 type 0
[2304237.356778] sd 5:0:0:0: [sdd] 60063744 512-byte logical blocks: (30.8 GB/28.6 GiB)
[2304237.359283] sd 5:0:0:0: [sdd] Write Protect is on
[2304237.359287] sd 5:0:0:0: [sdd] Mode Sense: 43 00 80 00
[2304237.359617] sd 5:0:0:0: [sdd] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
hdparm:
Code:
# hdparm -r0 /dev/sdd
/dev/sdd:
setting readonly to 0 (off)
readonly = 1 (on)
It's a SanDisk Ultra USB stick. It's fully readable and no data is corrupted.
It is also write-protected on a different computer, so the issue is with the USB stick.
If there is no way to get it writing again, it's not that big of a loss, but it would be nice to have it working again.
|
some usb stick, got a slide switch to make the USB read only. I am not sure whether that USB stick got one, check on it.
or try:
sudo mount -o remount,rw /dev/sdd /mnt/usbpoint
Last edited by JJJCR; 10-05-2025 at 08:37 PM.
Reason: edit
|
|
|
|
10-06-2025, 10:00 AM
|
#5
|
|
LQ Veteran
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,943
|
Is the partition table something other than msdos or gpt?
|
|
|
|
10-06-2025, 11:02 AM
|
#6
|
|
LQ Veteran
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Salix
Posts: 6,294
|
Linux makes usb sticks read-only when the filing system seems to be corrupt to prevent you making it even worse.
The first step is to use fsck to see if it will clean up the device. If that works, you are probably OK.
If fsck doesn't work, or if the device gives trouble again in the future, you need to save the contents and reformat it. Gparted should work, but if it won't, you may still be able to rescue the thing. Unmount, after noting its /dev name, and run this command after which gparted should work.
Code:
dd if=/dev/zero bs=1M count=10 of=/dev/whatever
If you have further trouble, then the only solution is replacement 
|
|
|
|
Today, 04:51 PM
|
#7
|
|
Member
Registered: Oct 2022
Posts: 159
Original Poster
Rep:
|
Quote:
Originally Posted by JJJCR
some usb stick, got a slide switch to make the USB read only. I am not sure whether that USB stick got one, check on it.
|
A physical switch?
Quote:
or try:
sudo mount -o remount,rw /dev/sdd /mnt/usbpoint
|
Doesn't work. It seems to be on a hardware level.
Quote:
Originally Posted by DavidMcCann
If you have further trouble, then the only solution is replacement 
|
I did some research and my closest guess would be that firmware of the USB stick refuses to write any more because it reached its end of life, as suggested by this post by AnthonyNYC from the now defunct CNET forum.
I used it as for a portable Linux installation for some time, so it might have been exposed to workloads it wasn't designed for. But it still reads at solid 140 MB/s, which is close to its advertised speed of 150 MB/s. And it never had corrupted data. But it shouldn't anyway, because that's expected from a reputable brand. Maybe SanDisks's firmware is "over-cautious" and pre-emptively write-protected it.
|
|
|
|
All times are GMT -5. The time now is 04:55 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|