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,237
|
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,376
|
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,295
|
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 
|
|
|
|
10-09-2025, 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.
|
|
|
|
Yesterday, 12:29 AM
|
#8
|
|
Senior Member
Registered: Apr 2010
Posts: 2,376
|
From this link: https://darwinsdata.com/what-happens...s-write-limit/
It says:
However, an SSD past its write endurance may still be readable for months or years in a read-only state.
Maybe true for older ssd's, for newer ssd's I believe this is not applicable anymore.
|
|
|
|
Yesterday, 02:47 AM
|
#9
|
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 25,024
|
Quote:
Originally Posted by exerceo
Doesn't work. It seems to be on a hardware level.
|
Yes, probably a real switch. Or a corrupted filesystem. Or a damaged device. Or a damaged usb port.
|
|
|
|
Yesterday, 05:31 AM
|
#10
|
|
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,589
|
Sandisk will go read-only at the USB controller firmware level if it detects too many errors. Back stuff up and throw it in the bin or shred it.
|
|
|
|
Yesterday, 06:30 AM
|
#11
|
|
Moderator
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: Slackware®
Posts: 14,044
|
Member Response
Hi,
No " SanDisk Ultra USB stick" have a physical protect switch.

|
|
|
|
Yesterday, 07:01 AM
|
#12
|
|
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,589
|
Quote:
Originally Posted by onebuck
Hi,
No " SanDisk Ultra USB stick" have a physical protect switch.

|
Yes, while they may have a physical protect switch, they ALSO have firmware that makes the drive read-only when errors are detected.
I'm not pulling this info out my butt, but from the research I previously did when I had a similar problem.
|
|
|
|
Yesterday, 07:34 AM
|
#13
|
|
Moderator
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: Slackware®
Posts: 14,044
|
Member Response
Hi,
You can check the Sandisk site to find none have a write protect physical switch but yes there are the means to switch via firmware.
EDIT: Some older SD/microSD cards do have a physical switch but no USB. As stated before if USB Sandisk is showing protected then it is software related.

Last edited by onebuck; Yesterday at 07:57 AM.
Reason: add information
|
|
|
|
Yesterday, 08:19 AM
|
#14
|
|
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7 / 8
Posts: 3,589
|
Quote:
Originally Posted by onebuck
Hi,
You can check the Sandisk site to find none have a write protect physical switch
|
I'm positive I had one "back in the day", although that could be obscured by the mists of time! Or maybe it was a thing then 
|
|
|
|
Yesterday, 09:20 AM
|
#15
|
|
Moderator
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: Slackware®
Posts: 14,044
|
Member Response
Hi,
Quote:
Originally Posted by TenTenths
I'm positive I had one "back in the day", although that could be obscured by the mists of time! Or maybe it was a thing then 
|
A lot of off brand sometimes do have a write protect switch. But as I said before that some older SD/microSD cards do have a physical switch which is a standard but no consumer Sandisk USB Flash. As stated before if USB Sandisk is showing protected then it is software /firmware related via the controller or the system.
As one should consider a write protect switch is a potential failure point. Firmware/software level write protect is flexible plus a secure means to protect.
Hope this helps!

|
|
|
|
All times are GMT -5. The time now is 07:42 AM.
|
|
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
|
|