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.
Several flash drives suddenly became read-only. What to do?
Moderator: Forum moderators
Several flash drives suddenly became read-only. What to do?
Re: Proper Command(s)
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?
- bigpup
- Moderator
- Posts: 6439
- Joined: Tue Jul 14, 2020 11:19 pm
- Location: Earth, South Eastern U.S.
- Has thanked: 769 times
- Been thanked: 1332 times
Re: Several flash drives suddenly became read-only. What to do?
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
Re: Several flash drives suddenly became read-only. What to do?
@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 (7.11 KiB) Viewed 2357 times
-
- pup.jpg (10.81 KiB) Viewed 2357 times
- bigpup
- Moderator
- Posts: 6439
- Joined: Tue Jul 14, 2020 11:19 pm
- Location: Earth, South Eastern U.S.
- Has thanked: 769 times
- Been thanked: 1332 times
Re: Several flash drives suddenly became read-only. What to do?
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
- mikeslr
- Posts: 2851
- Joined: Mon Jul 13, 2020 11:08 pm
- Has thanked: 173 times
- Been thanked: 862 times
Re: Several flash drives suddenly became read-only. What to do?
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.
Re: Several flash drives suddenly became read-only. What to do?
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, ...
- mikewalsh
- Moderator
- Posts: 5677
- Joined: Tue Dec 03, 2019 1:40 pm
- Location: King's Lynn, UK
- Has thanked: 611 times
- Been thanked: 1749 times
Re: Several flash drives suddenly became read-only. What to do?
@tosim :-
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....
@bigpup :-
We luv ya really, mate!
Mike.
Puppy "stuff" ~ MORE Puppy "stuff" ~ ....and MORE!
_______________________________________________________
Re: Several flash drives suddenly became read-only. What to do?
@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.
- fredx181
- Posts: 2672
- Joined: Tue Dec 03, 2019 1:49 pm
- Location: holland
- Has thanked: 294 times
- Been thanked: 1054 times
- Contact:
Re: Several flash drives suddenly became read-only. What to do?
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.
Re: Several flash drives suddenly became read-only. What to do?
@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.)
Re: Several flash drives suddenly became read-only. What to do?
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.
-
- Posts: 1678
- Joined: Tue Jul 14, 2020 11:24 pm
- Has thanked: 149 times
- Been thanked: 302 times
Re: Several flash drives suddenly became read-only. What to do?
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
- bigpup
- Moderator
- Posts: 6439
- Joined: Tue Jul 14, 2020 11:19 pm
- Location: Earth, South Eastern U.S.
- Has thanked: 769 times
- Been thanked: 1332 times
Re: Several flash drives suddenly became read-only. What to do?
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
- fredx181
- Posts: 2672
- Joined: Tue Dec 03, 2019 1:49 pm
- Location: holland
- Has thanked: 294 times
- Been thanked: 1054 times
- Contact:
Re: Several flash drives suddenly became read-only. What to do?
williwaw wrote: ↑Sun May 01, 2022 5:56 pmtry 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).
Re: Several flash drives suddenly became read-only. What to do?
@bigpup Attached are 3 ss'.
- Attachments
-
- ss2.png (20.5 KiB) Viewed 2548 times
-
- ss1.png (25.63 KiB) Viewed 2548 times
-
- ss.png (24.95 KiB) Viewed 2548 times
Re: Several flash drives suddenly became read-only. What to do?
@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.
-
- Posts: 3370
- Joined: Fri Jul 24, 2020 10:59 pm
- Has thanked: 1388 times
- Been thanked: 446 times
Re: Several flash drives suddenly became read-only. What to do?
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.
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!
- bigpup
- Moderator
- Posts: 6439
- Joined: Tue Jul 14, 2020 11:19 pm
- Location: Earth, South Eastern U.S.
- Has thanked: 769 times
- Been thanked: 1332 times
Re: Several flash drives suddenly became read-only. What to do?
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
- bigpup
- Moderator
- Posts: 6439
- Joined: Tue Jul 14, 2020 11:19 pm
- Location: Earth, South Eastern U.S.
- Has thanked: 769 times
- Been thanked: 1332 times
Re: Several flash drives suddenly became read-only. What to do?
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
Re: Several flash drives suddenly became read-only. What to do?
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.
Re: Several flash drives suddenly became read-only. What to do?
@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".