Several flash drives suddenly became read-only. What to do?

Moderator: Forum moderators

Post Reply
tosim
Posts: 422
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 673 times
Been thanked: 45 times

Several flash drives suddenly became read-only. What to do?

Post by tosim »

A few flash drives have suddenly become "read-only". I've tried out many times the 3 commands shown in attachment, to no avail. Have read, and re-read lots of cmd info, but have
gotten nowhere. BTW-Drives are NOT in locked status. I'm pretty sure I've gotten something(s) missing in the writing of my commands. Any assistance will be gratefully accepted.
Thanks a lot.

cmds.jpg
cmds.jpg (15.79 KiB) Viewed 2250 times
williams2
Posts: 1023
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 288 times

Re: Proper Command(s)

Post by williams2 »

Are you running Puppy? or some other OS?

If you are running Puppy, as user root, then you don't need sudo
If you are running as user spot spot can not use sudo
If you are not running Puppy, you probably do need sudo.

chown -R 777 /dev/sdb is wrong. It should be something like
chown -R root:disk /dev/sdb1
But, chmod and chown should not be needed. {they work on files and directories that are in a file system.)
/devsdb, /dev/sdb1. /dev/sdb2 etc. etc. are block devices. They are not file systems.

Block devices are not file systems, but they can contain file systems that can be mounted on a mount point.

What does this show ls -l /dev/sdb* ?

fdisk -l /dev/sdb might give you more information, like is the partition table dos or gpt?
Or is there any partition table?

User avatar
bigpup
Moderator
Posts: 6271
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 732 times
Been thanked: 1292 times

Re: Several flash drives suddenly became read-only. What to do?

Post by bigpup »

A few flash drives have suddenly become "read-only".

Anything specific, you did to them, before they started having this issue?

There are a few formats that are read only.

What does Gparted show as the format on them?

Most modern USB drives.
When they start having physical read write problems.
The internal controller will lock into read only.
This will allow you to still read the drive.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

tosim
Posts: 422
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 673 times
Been thanked: 45 times

Re: Several flash drives suddenly became read-only. What to do?

Post by tosim »

@williams2 @bigpup Thank you both for the replies. Flash drives are msdos, and partitioned mostly ext4. I was attempting these commands
while using Mint. Nothing specifically, was done to cause this. Would still, PLEASE, show proper command(s) to run. Please see attachments.

Attachments
pup2.jpg
pup2.jpg (7.11 KiB) Viewed 2171 times
pup.jpg
pup.jpg (10.81 KiB) Viewed 2171 times
User avatar
Flash
Moderator
Posts: 897
Joined: Tue Dec 03, 2019 3:13 pm
Location: Arizona, U.S.
Has thanked: 46 times
Been thanked: 105 times

Re: Several flash drives suddenly became read-only. What to do?

Post by Flash »

I don't think Linux can read exFAT file systems without help.

Chaos coordinator :?
User avatar
bigpup
Moderator
Posts: 6271
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 732 times
Been thanked: 1292 times

Re: Several flash drives suddenly became read-only. What to do?

Post by bigpup »

I was attempting these commands while using Mint

This is a Puppy Linux forum and talking about how Puppy Linux works.

You need to ask about this in a Mint forum.

If you are using a Puppy Linux version, maybe we can figure it out.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

tosim
Posts: 422
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 673 times
Been thanked: 45 times

Re: Several flash drives suddenly became read-only. What to do?

Post by tosim »

@bigpup You are correct;I apologize.

User avatar
mikeslr
Posts: 2791
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 173 times
Been thanked: 837 times

Re: Several flash drives suddenly became read-only. What to do?

Post by mikeslr »

Actually, tosim, before contacting Linux Mint, it might be useful to see if reformatting some flash-drives using Puppys' gparted also creates the problem; or Linux Mint's gparted to format a Linux Ext3 partition. Puppys' gparted can not create a 64-bit Linux Ext4 partition. But testing alternatives may serve to identify whether this is a gparted problem, or a LinuxMint implementation of gparted problem and, if so, under what circumstance.

williams2
Posts: 1023
Joined: Sat Jul 25, 2020 5:45 pm
Been thanked: 288 times

Re: Several flash drives suddenly became read-only. What to do?

Post by williams2 »

Puppys' gparted can not create a 64-bit Linux Ext4 partition.

That might not be true.

You can create a file system with 64 bit addresses like this:

mkfs.ext4 -n -b 4096 -O 64bit /dev/sdX

You can create a file system with 32 bit addresses like this:

mkfs.ext4 -n -b 4096 -O ^64bit /dev/sdX

The config file is /etc/mke2fs.conf where you can set whether the default is 64bit or ^64bit (not 64 bit).

If gparted uses the configuration file /etc/mke2fs.conf
then maybe you can configure it to use 64 bit addresses or not
as opposed to 32 bit addresses (not 64 bit)

Like this: features = 64bit,has_journal,extent,huge_file, ...

User avatar
mikewalsh
Moderator
Posts: 5575
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 570 times
Been thanked: 1681 times

Re: Several flash drives suddenly became read-only. What to do?

Post by mikewalsh »

@tosim :-

tosim wrote: Fri Apr 29, 2022 2:07 pm

@bigpup You are correct;I apologize.

Don't take it too much to heart. While bigpup is undoubtedly right, he's on an "efficiency" kick ATM; the rest of us will just have to suffer while he works it out of his system.... :lol: :lol:

@bigpup :-

We luv ya really, mate! :D :thumbup:

Mike. ;)

Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE! :D
_______________________________________________________

Image

tosim
Posts: 422
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 673 times
Been thanked: 45 times

Re: Several flash drives suddenly became read-only. What to do?

Post by tosim »

@mikeslr @mikewalsh @williams2 Thanks to the three of you. Actually, I had planned on trying out the chmod and chown commands
later today when I will be using FossaPup64, or possibly one of my other pups. I will update as necessary, and THANKS to y'all again.
UPDATE: Using (and writing this from) JammyPup32. Using gParted, I tried wiping out the 2 partitions on the flash drive, to no avail. Got the same "Read only" message. Also, tried using
the chmod and chown commands to no avail. I cleared the terminal and ran "that dd command) from one of the Mike's postings. Please see attachment. Thank all of you again.

Screenshot.png
Screenshot.png (51.5 KiB) Viewed 2481 times
User avatar
fredx181
Posts: 2561
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 274 times
Been thanked: 993 times
Contact:

Re: Several flash drives suddenly became read-only. What to do?

Post by fredx181 »

Hi tosim, there's one typo in the dd command line, needs to be /dev/sdc (slash at front), so:
dd if=/dev/zero of=/dev/sdc bs=512 count=1 conv=notrunc
If then it still says "read only", perhaps you can try with Gparted "create partition table" to wipe the sdc flash-disk.
EDIT: Make sure first that sdc1 and sdc2 are not mounted.

2022-05-01_10-30-17.png
2022-05-01_10-30-17.png (16.34 KiB) Viewed 2463 times
tosim
Posts: 422
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 673 times
Been thanked: 45 times

Re: Several flash drives suddenly became read-only. What to do?

Post by tosim »

fred.png
fred.png (8.23 KiB) Viewed 2441 times

@fredx181 Thanks for the correction, and suggestion. However, after running the command, I got a denial due to read-only; same denial when using "Create Partition Table" in gParted.
I'm really at a loss now. I hate to just throw away this not very old 64GB flash drive. Here's a crazy thought: I still have(and use to magnetize), a magnet that used to be on a magnetron tube from a very
high powered air search radar. Do you think I could try rubbing the flash drive against it might work? (Again, maybe just a crazy thought.)

User avatar
rcrsn51
Posts: 1205
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 274 times

Re: Several flash drives suddenly became read-only. What to do?

Post by rcrsn51 »

Run: hdparm -r /dev/sdb
Does it show the flash drive as read-only?
If so, run: hdparm -r0 /dev/sdb

If it continues to be read-only, run: dmesg
Look for error messages when the drive is plugged in.

tosim
Posts: 422
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 673 times
Been thanked: 45 times

Re: Several flash drives suddenly became read-only. What to do?

Post by tosim »

@rcrsn51 Thanks for your suggestion.
However, still getting same error messages. Also, the dmesg showed read only for the drive.

williwaw
Posts: 1595
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 145 times
Been thanked: 291 times

Re: Several flash drives suddenly became read-only. What to do?

Post by williwaw »

try this search term for info from the Ubuntu site (not all engines accept this particular syntax)

Code: Select all

usb read only failed to open file system site:https://askubuntu.com/questions

if you chase a few links at the site you will find numerous possibilities for your problem

User avatar
bigpup
Moderator
Posts: 6271
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 732 times
Been thanked: 1292 times

Re: Several flash drives suddenly became read-only. What to do?

Post by bigpup »

In Fossapup64 booting the computer.

Plug the USB drive in, but do not mount it.

Run Gparted program with the USB drive selected as device to work on.

Post an image of what Gparted is showing.

Fossapup64 has the program Take a Shot that can make the image.

Need to see exactly what is on the USB drive.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
fredx181
Posts: 2561
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 274 times
Been thanked: 993 times
Contact:

Re: Several flash drives suddenly became read-only. What to do?

Post by fredx181 »

@tosim

williwaw wrote: Sun May 01, 2022 5:56 pm

try this search term for info from the Ubuntu site (not all engines accept this particular syntax)

Code: Select all

usb read only failed to open file system site:https://askubuntu.com/questions

if you chase a few links at the site you will find numerous possibilities for your problem

Or search for posts at ubuntu forum, e.g. usb read only /dev/sdb site:ubuntuforums.org
For example, this post looks very similar to your problem: https://ubuntuforums.org/showthread.php?t=2030703
One suggestion there is to use the "HP USB Disk Storage Format Tool" (and/or other) on Windows, worth trying perhaps (if you have Windows).

tosim
Posts: 422
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 673 times
Been thanked: 45 times

Re: Several flash drives suddenly became read-only. What to do?

Post by tosim »

@bigpup Attached are 3 ss'.

Attachments
ss2.png
ss2.png (20.5 KiB) Viewed 2336 times
ss1.png
ss1.png (25.63 KiB) Viewed 2336 times
ss.png
ss.png (24.95 KiB) Viewed 2336 times
tosim
Posts: 422
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 673 times
Been thanked: 45 times

Re: Several flash drives suddenly became read-only. What to do?

Post by tosim »

@fredx181@williwaw Well, I did as you suggested, went to:
For example, this post looks very similar to your problem: https://ubuntuforums.org/showthread.php?t=2030703, and tried every cmd(some several times), on those 3 pages. All to no avail.

Clarity
Posts: 3273
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1349 times
Been thanked: 438 times

Re: Several flash drives suddenly became read-only. What to do?

Post by Clarity »

I use Ventoys, a lot, along with booting SG2D ISOs that are located in /BOOTISOS on the exFAT partition where ALL of my ISOs are kept for good housekeeping reasons.

I have too many machines and too many variations of booting Ventoys (ie MSDOS, GPT, non-Secureboot, Secureboot)for 4 different combinations of Ventoys.

I have been meaning to make a spreadsheet to layout what works on each of which BIOS/UEFI PCs I have. But the combinations became too many to post...not to mentions that depending on which Ventoy I use, the booting behaviors were also "inconsistently confusing" to understand and explain NOT TO MENTION would have to be machine by machine as their firmwares are different.

@tosim

  • which VERSION of Ventoy are you using?

  • Is it in /BOOTISOS folder or plopped into root?

  • Is the UEFI in normal mode with secureboot off or on?

  • Is the UEFI in legacy mode ?

  • Is your booting Ventoy a USB stick or a USB drive?

  • And are you using a KVM switching the USB-Video-keyboard-mouse between multiple PCs?

For me, my config is several combinations of these that I test. On one set of test-bench, I am using Ventoy v54 refusing to upgrade it (today's version is v74).

I have not experience your 'ro' experiences. Lastly, I ask, does this problem exist on just the Ventoy drive or does all of your system drives list as 'ro' after reaching desktop? Issue the mount command on a pristine boot to check...looking for disks that you mount showing up as 'ro' or as 'rw'...when mounted.

BTW: exFAT is NOT a native format that many PUPs understand. Even though exFAT is standardized and has been around for years, PUPPY is SLOW to both recognize and do something about it in the builds found on the forum. Thus, if you try to mount in on a PUP that doesn't have the means, if will NOT mount!

User avatar
bigpup
Moderator
Posts: 6271
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 732 times
Been thanked: 1292 times

Re: Several flash drives suddenly became read-only. What to do?

Post by bigpup »

Try this.
Boot Fossapup64 9.5

Plug the USB into computer.
Do not mount it.
See what it is identified as by the drive icon on the lower left of the desktop. (could be sdb, sdc, sdd, etc.....)
Should be a drive icon for each partition on the USB.
Example sdb with two partitions will have sdb1 and sdb2 drive icons are on desktop.

In a console or terminal.

For 1st partition.

Code: Select all

dosfsck -a /dev/sdb1

Do the same for the 2nd partition.

Code: Select all

dosfsck -a /dev/sdb2

If you get errors and corrections.
Run command again to make sure the corrections no longer needed.
Should just give some information nothing about errors.

Now see if you are still getting read only errors.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

User avatar
bigpup
Moderator
Posts: 6271
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 732 times
Been thanked: 1292 times

Re: Several flash drives suddenly became read-only. What to do?

Post by bigpup »

Not if the USB drives are actually physically damaged.
Something is drastically broken in some of the memory modules. Bad blocks.
The internal controller will lock them to read only.

Booting Fossapup64 9.5 to run the computer, using Linux commands in it.
Run the commands in a terminal. console.
USB drive not mounted.

You could check for bad memory blocks on the USB.

Warning: This will destroy any previously stored data on your USB pen/stick. Make sure you choose correct USB device name under Linux.

Example: if the USB is identified as sdb

run the following command to search a device for bad blocks:

Code: Select all

badblocks -w -s -o error.log /dev/sdb

Where options are as follows:

-w : Use write-mode test to scans for bad blocks by writing some patterns on every block of the device, reading every block and comparing the contents.
-s : Show the progress of the scan.
-o error.log : Write the list of bad blocks to the error.log file in the current working directory.

Use the cat command to view error.log:

Code: Select all

cat error.log

If it does find some bad blocks.
If they are not too many.

Next thing is to make them not seen, so they will not be tried to use.

Forum Global Moderator
The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

tosim
Posts: 422
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 673 times
Been thanked: 45 times

Re: Several flash drives suddenly became read-only. What to do?

Post by tosim »

@bigpup Did as you suggested above. Thank you.

flash.png
flash.png (33.3 KiB) Viewed 2666 times
flash2.png
flash2.png (30.09 KiB) Viewed 2666 times
User avatar
rcrsn51
Posts: 1205
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 274 times

Re: Several flash drives suddenly became read-only. What to do?

Post by rcrsn51 »

Because the kernel reported a problem with the device in dmesg, I suspect that nothing you try in user space will fix it.

You said "several flash drives". It seems unusual that several drives would fail together. I wonder if you are plugging them into a defective USB port that is damaging them.

tosim
Posts: 422
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 673 times
Been thanked: 45 times

Re: Several flash drives suddenly became read-only. What to do?

Post by tosim »

@rcrsn51 Thanks for the reply. No, all of my usb slots are, and have been, working correctly. I think it might just be time
to "bite the bullet", and throw it out. Thanks to all of you who answered my "call for help".

Post Reply

Return to “System”