How can I wipe a "Read only" flash drive?

Issues and / or general discussion relating to Puppy

Moderator: Forum moderators

tosim
Posts: 481
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 932 times
Been thanked: 59 times

How can I wipe a "Read only" flash drive?

Post by tosim »

I've got several flash drives, and several chips, each with Ventoy(various versions) on each. I am having absolutely no luck
in trying to wipe them clean. Have used gparted, and many different cmds I found on the net, all to no avail. Have also
used chown and chusr, again. could wipe none. Received "Read only" message. Please see attachment to verify.
I REALLY NEED a cmd that wipes the flash drives and chips clean. PLEASE, PLEASE HELP. Thank you.

ven.jpg
ven.jpg (92.56 KiB) Viewed 2760 times
geo_c
Posts: 2882
Joined: Fri Jul 31, 2020 3:37 am
Has thanked: 2208 times
Been thanked: 880 times

Re: Delete cmd Needed

Post by geo_c »

I ran into a similar situation recently.

I have a USB hard drive that would suddenly have partitions become "read only" and I could do absolutely nothing to them.

It turned out it was a bad cable. I kid you not.

Though somehow certain directories on the fat32 partition of that drive remained read only. And I still can't get rid of them. That drive may be going bad.

Have you tried rewriting the File Allocation Table using gparted?

It would wipe the entire drive if it worked.

geo_c
Old School Hipster, and Such

User avatar
Chelsea80
Posts: 362
Joined: Tue Mar 09, 2021 12:44 am
Has thanked: 47 times
Been thanked: 75 times

Re: Delete cmd Needed

Post by Chelsea80 »

@ tosim

If you have access to a Windows OS -

Go to -

https://www.hddguru.com/software/HDD-LL ... rmat-Tool/

This utility will:

"WARNING: After running this low level format tool, the whole disk surface will be erased.
Data restoration is impossible after using this utility!"

You can then use Gparted or Windows to partition and format the USB to your choice -

Best regards

Chelsea80

Chelsea80

1. BionicPup32+28 19.03 - Linux 4.9.163 - lxpup - 32-pae [i686] - (UPup Bionic Beaver)
....Frugal Install - Internal HDD - Gateway MX8716b - HDD 120GB - RAM 2GB

2. Friendly-Bionic32 v1.1
....USB Stick 2GB

tosim
Posts: 481
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 932 times
Been thanked: 59 times

Re: Delete cmd Needed

Post by tosim »

T hank you both. Will try as you each suggested.

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

Re: How can I wipe a "Read only" flash drive?

Post by mikewalsh »

@tosim :-

Hallo, mate.

Well, as with so many other apparently unrelated things, 'dd' is your friend here. You can use it to overwrite each and every single byte on the drive, turning them from '1s' to '0s'.

Make sure you have the offending drive plugged-in, but NOT mounted. You want it unmounted for this to work. You're writing to the device itself, NOT the mount-point where it's linked to the file-system.

Make a note of the drive letter. Double-check this detail before you start, THEN check again..........because this is irreversible. Anything on the drive that you may want later, save it FIRST.....when 'dd' has done its thing here, this drive will be wiped CLEAN. Everything that was on it will be history.....

-----------------------------------------

Open a terminal, and enter the following (you can copy/paste if you find that easier):-

Code: Select all

dd if=/dev/zero of=/dev/sdX bs=1M

.......substituting the appropriate drive letter in place of 'X'. Then hit 'Enter', and just leave it to do what it does best. It's not called the "disk destroyer" for nothing, y'know! :D

This may take some little while, depending on the capacity of the drive. Be patient.

Obviously, you'll need to write a new partition/FAT table to it afterwards, since even this will all be gone. It will be like a brand-new drive, fresh off the production line, before it's even been formatted. Might seem a wee bit drastic to some, but this operation will remove ANY issues you might have with the drive, believe me....

And it ALWAYS works. :thumbup:

Mike. ;)

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

Re: How can I wipe a "Read only" flash drive?

Post by mikewalsh »

@tosim :-

I'm moving this into 'Users'. It's a better place for it, I feel.

Mike. ;)

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

Re: How can I wipe a "Read only" flash drive?

Post by rcrsn51 »

For some deja-vu, google "puppy linux read-only flash drive".

tosim
Posts: 481
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 932 times
Been thanked: 59 times

Re: How can I wipe a "Read only" flash drive?

Post by tosim »

@mikewalsh Thanks for moving to correct place, I really wasn/t sure where it belonged. Have tried this cmd before, and did NOT work.
Here are results from this attempt, still NOT working-on this flash drive; have not tried it today on rest of drives, chips.

wipe.jpg
wipe.jpg (7.88 KiB) Viewed 2585 times
tosim
Posts: 481
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 932 times
Been thanked: 59 times

Re: How can I wipe a "Read only" flash drive?

Post by tosim »

@rcrsn51 Have partially done it this morning. Tried several of various cmds offered-none get through.
@Chelsea80 Tried that-it did NOT work. Still read only.
Thank you both.

User avatar
Chelsea80
Posts: 362
Joined: Tue Mar 09, 2021 12:44 am
Has thanked: 47 times
Been thanked: 75 times

Re: How can I wipe a "Read only" flash drive?

Post by Chelsea80 »

@ tosim

OK, thanks for letting me know -

Worth a try -

So you have access to a Windows OS to have tried the Low Level Format tool, so you could try this -

https://www.howtogeek.com/235824/how-to ... -problems/

If it doesn't work then at least it has been tried -

Also, just in case it has ben overlooked (doubtful) -

Some USB sticks have a lock switch on them -

In the 'ON' position they become read only -

'Clutching at straws' comes to mind -

If you find a way of clearing the USB sticks, please share, thanks -

Best regards

Chelsea80

Chelsea80

1. BionicPup32+28 19.03 - Linux 4.9.163 - lxpup - 32-pae [i686] - (UPup Bionic Beaver)
....Frugal Install - Internal HDD - Gateway MX8716b - HDD 120GB - RAM 2GB

2. Friendly-Bionic32 v1.1
....USB Stick 2GB

User avatar
wizard
Posts: 1990
Joined: Sun Aug 09, 2020 7:50 pm
Has thanked: 2662 times
Been thanked: 694 times

Re: How can I wipe a "Read only" flash drive?

Post by wizard »

@tosim

While doing a lot of USB install testing sometimes a flash drive wouldn't want to reformat. I found that Rosa Image Writer's Clear button would often correct it. Note that after "clearing" you must then use GParted to create a partiton table and repartition the drive.

wizard

Attachments
rosa.png
rosa.png (23.63 KiB) Viewed 2549 times

Big pile of OLD computers

tosim
Posts: 481
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 932 times
Been thanked: 59 times

Re: How can I wipe a "Read only" flash drive?

Post by tosim »

@wizard Thanks for the reply. I went to that "osa Image Writer" url, and, just in case, dl'd the 32b, and 64b Linux, and the windows one.
Will try to use tomorrow, hopefully. And please, just to keep me clear, do I place in the "Image" line, if anything, prior to hitting the clear button?
BTW-I just about always use gparted to format,etc. Thanks again.

User avatar
wizard
Posts: 1990
Joined: Sun Aug 09, 2020 7:50 pm
Has thanked: 2662 times
Been thanked: 694 times

Re: How can I wipe a "Read only" flash drive?

Post by wizard »

@tosim

do I place in the "Image" line, if anything,

No, just make sure the USB device line is correct and click the clear button.

wizard

Big pile of OLD computers

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

Re: How can I wipe a "Read only" flash drive?

Post by mikewalsh »

wizard wrote: Sun Aug 20, 2023 6:36 pm

@tosim

do I place in the "Image" line, if anything,

No, just make sure the USB device line is correct and click the clear button.

wizard

@wizard :-

Hm. 'Twould surprise me if it worked, y'know. ROSA is 'dd'-based, and will pretty much do the same as the commands I posted about above.

tosim's problem appears to be that whatever solution he tries, the drive will not allow access in the first place. "Permission denied". I think this is what we ought to be looking into before we go any further.....but /dev - along with /proc - are two directories I will not touch with a barge-pole. I learnt this lesson several years ago; through not understanding what I was doing, I quite successfully "bricked" a perfectly functional Puppy (and I didn't have a backup at that point in time....)

Mike. :|

User avatar
wizard
Posts: 1990
Joined: Sun Aug 09, 2020 7:50 pm
Has thanked: 2662 times
Been thanked: 694 times

Re: How can I wipe a "Read only" flash drive?

Post by wizard »

@mikewalsh

On the drives I was was working with Rosa's clear button worked when the dd command did not. Also, does it in a fraction of the time required by dd.

Thanks
wizard

Big pile of OLD computers

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

Re: How can I wipe a "Read only" flash drive?

Post by bigpup »

Try this:
Do this from a running Puppy version using programs in it.

First make sure desktop drive icon for the USB is showing it is not mounted.
If it is mounted.
Unmount it.

Use Gparted to get back to normal setup.
Select the USB stick as device to work on.

Make a new partition table
GParted > Device > Create Partition Table > MS-DOS

Make a partition and format it fat32.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
If still no good, may have to first do this and then use Gparted.
In a terminal (console)
Be very careful to identify the USB stick in dev/sd part of command.
In this example it is sdb (desktop drive icons. Should be one for the USB giving it's label sdb, sdc, sdd, etc.......)

Code: Select all

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

This basically deletes everything on the drive and writes all zeros on it.

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

superchook
Posts: 51
Joined: Mon Dec 23, 2019 9:57 pm
Location: Sydney, Australia
Has thanked: 15 times
Been thanked: 4 times

Re: How can I wipe a "Read only" flash drive?

Post by superchook »

In one of tosim's posts in this thread about 15 + hours back he reported on the failure of

dd if=/dev/zero of=/dev/sdb1 but he should have used "of=/dev/sdb"

cheers,
Ken

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

Re: How can I wipe a "Read only" flash drive?

Post by mikewalsh »

superchook wrote: Mon Aug 21, 2023 7:32 am

In one of tosim's posts in this thread about 15 + hours back he reported on the failure of

dd if=/dev/zero of=/dev/sdb1 but he should have used "of=/dev/sdb"

cheers,
Ken

@superchook :-

Yup, very true, Ken. I admit even I didn't pick up on that. Good catch, mate!

@tosim :-

As Ken says, the command you used was

Code: Select all

dd if=/dev/zero of=/dev/sdb1 bs=4M

.....where it SHOULD have been

Code: Select all

dd if=/dev/zero of=/dev/sdb bs=4M

bigpup's addition of

Code: Select all

count=1

.....at the end - if I remember correctly - ensures that the command is only applying the operation once (the first 4 MB), from the start of the drive.....which essentially overwrites the drive's MBR, where the File Allocation Table lives. If this is zeroed, there's no need to overwrite the entire drive. This is in all likelihood exactly what Rosa's 'Clear' button' does, and is why it takes very little time.

Try the modified command example as given by bigpup above, and let us know what happens, please. It actually doesn't matter whether you use

Code: Select all

bs=4M

OR

Code: Select all

bs=1M

Both will do the trick, since the MBR is contained within the first 512 kb on the drive.....so either command will work. But do make sure to include the

Code: Select all

count=1

at the end.

Mike. ;)

stevie pup
Posts: 266
Joined: Mon May 10, 2021 7:40 pm
Location: Derbyshire, UK
Has thanked: 18 times
Been thanked: 70 times

Re: How can I wipe a "Read only" flash drive?

Post by stevie pup »

There are countless articles on the net about USB sticks becoming read only. There are also countless articles saying that various efforts to restore them have all failed.

It's only ever happened to me once, and I spent more time than I can remember reading articles and trying different methods to restore the stick. Absolutely nothing worked, so the stick went in the bin.

Considering the price of a USB stick, if it ever happens again I will try Gparted and if that fails then ditch it. I'm certainly not going to spend that length of time on a USB stick ever again. :roll:

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

Re: How can I wipe a "Read only" flash drive?

Post by mikewalsh »

stevie pup wrote: Mon Aug 21, 2023 10:51 am

There are countless articles on the net about USB sticks becoming read only. There are also countless articles saying that various efforts to restore them have all failed.

It's only ever happened to me once, and I spent more time than I can remember reading articles and trying different methods to restore the stick. Absolutely nothing worked, so the stick went in the bin.

Considering the price of a USB stick, if it ever happens again I will try Gparted and if that fails then ditch it. I'm certainly not going to spend that length of time on a USB stick ever again. :roll:

Generally speaking, I'd agree with you. In most cases, it isn't worth the hassle. But in rare cases, you might want to save a more expensive, or favourite drive. It's worth knowing how to do this if at all possible, no?

Mike. ;)

User avatar
wiak
Posts: 4082
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1208 times
Contact:

Re: How can I wipe a "Read only" flash drive?

Post by wiak »

I have around three usb sticks that can't be 'seen' at all when I plug them in. i.e. no /dev/sdb or sdc or whatever available so I can't even re-format them. I guess their interface controllers are 'broken'. I am not sure why that might have happened (and it is very annoying since all are 16GB and more in size - two being 32GB sticks). However, the old faithful core2duo machine I used to do all my dev work on went 'weird' a couple of years ago - still worked but seemed to be dogdy when it came to plugged in usb sticks - maybe voltage regulator or something failed such that instead of 5v for usb it was something else or more. I keep meaning to check it out thoroughly, but would need an oscilloscope since might not be DC (direct current) any more... The machine seemed to go 'flakey' in that way after I had plugged in a usb bluetooth transmitter stick thingy I had picked up in a $2 store - it did transmit bluetooth, but seemed to do a lot of unexpected damage. Maybe that was innocent, but I blamed it anyway because that's when the problem began. I threw out about ten usb sticks thereafter because I didn't trust they didn't have shorted supply lines or similar after being used in that computer and might damage my other computers... maybe I was just alarmed??? but cheap rubbish anyway. Miss the old faithful beast though - sad end, especially since I lost a lot on not backed up work.

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

tosim
Posts: 481
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 932 times
Been thanked: 59 times

Re: How can I wipe a "Read only" flash drive?

Post by tosim »

Thank you all for the replies.Have retried the dd cmd with using both the sdb, and sdb1, still "permission denied. And yes, I agree, if, this
problem was only on 1 or 2 drives, I too would toss them. However, this problem is on 4 flash drives-3 which each are 64b, and 1with 16b,
and about 5 chips.(Accumulated in past 2 years.) Below is latest ss. Will get to Rosa later, hopefully. Thanks again.

Attachments
big.jpg
big.jpg (10.7 KiB) Viewed 2392 times
rosa_3901770606613.jpg
rosa_3901770606613.jpg (7.95 KiB) Viewed 2411 times
flash.jpg
flash.jpg (25.09 KiB) Viewed 2411 times
Last edited by tosim on Mon Aug 21, 2023 5:36 pm, edited 1 time in total.
User avatar
Flash
Moderator
Posts: 979
Joined: Tue Dec 03, 2019 3:13 pm
Location: Arizona, U.S.
Has thanked: 52 times
Been thanked: 127 times

Re: How can I wipe a "Read only" flash drive?

Post by Flash »

Do you know what filesystem is or was on those flash drives? If they are unformatted, i.e., have no filesystem installed, or some weird filesystem not recognized by Linux, they can't be opened or mounted. What does Gparted say about them?

Chaos coordinator :?
User avatar
rockedge
Site Admin
Posts: 6561
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 2770 times
Been thanked: 2646 times
Contact:

Re: How can I wipe a "Read only" flash drive?

Post by rockedge »

Hate to say this......have you tried with Microsoft Windows to access the USB flash drive? I have run across problems during experimentation and distro building where a directory on a drive can't be deleted and I have had some success using Windows, as a last resort, to delete it and also have been able fix read only flash drives and reformat into a FAT32 partition. Then with GParted on a Linux system it was possible to again format that drive into the desired partition types.

If Windows also can't access the USB flash drive then it's next stop should be the trash can.

tosim
Posts: 481
Joined: Thu Jul 23, 2020 1:13 pm
Has thanked: 932 times
Been thanked: 59 times

Re: How can I wipe a "Read only" flash drive?

Post by tosim »

I'm afraid I'll have to agree with rockedge,but I thought maybe one other try. Am first hoping to get responseS, from several of you, as to what I'm thinking of trying:
I still have a huge magnet that was a part of the magnetron on an extremely high powered air search radar, and thinking maybe rubbing the drives and chips
across it would wipe them clear. After all-nothing to lose, eh?? Your comments, please. Thanks again to all.

User avatar
Jafadmin
Posts: 385
Joined: Tue Aug 04, 2020 4:51 pm
Has thanked: 68 times
Been thanked: 85 times

Re: How can I wipe a "Read only" flash drive?

Post by Jafadmin »

dd doesn't care about permissions. If you tell it to overwrite a disk, it will. Even if it is mounted.

If dd won't work on it, it has a hardware problem. Probably going bad. This is common.

good luck.

User avatar
wizard
Posts: 1990
Joined: Sun Aug 09, 2020 7:50 pm
Has thanked: 2662 times
Been thanked: 694 times

Re: How can I wipe a "Read only" flash drive?

Post by wizard »

@tosim

Unlike mechanical hard drives and floppy disk, USB flash drives don't contain magnetic media, so doubt the magnet will have any effect. But, hey the price is right give it a shot.

If it's data security you are worried about, a small hammer or even a good rock will certainly "wipe" it. :D

wizard

Big pile of OLD computers

stevie pup
Posts: 266
Joined: Mon May 10, 2021 7:40 pm
Location: Derbyshire, UK
Has thanked: 18 times
Been thanked: 70 times

Re: How can I wipe a "Read only" flash drive?

Post by stevie pup »

mikewalsh wrote: Mon Aug 21, 2023 11:34 am

Generally speaking, I'd agree with you. In most cases, it isn't worth the hassle. But in rare cases, you might want to save a more expensive, or favourite drive. It's worth knowing how to do this if at all possible, no?

Yes I see your point Mike. Thing is, I currently have 16 USB sticks varying from 4Gb to 32Gb (not sure how I've accumulated that many), none of which were particularly expensive and I don't have any favourites, they're all just there to serve a purpose. At the moment 8 of them have got something on them, and the other 8 are blank. So it's no big deal if one goes haywire. :lol:

rockedge wrote: Mon Aug 21, 2023 5:06 pm

If Windows also can't access the USB flash drive then it's next stop should be the trash can.

Agree entirely. On the one I had an issue with, as well as various Linux methods, I also tried to clean it using the command line in Windows. Still wouldn't have it, and displayed as read only.

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

Re: How can I wipe a "Read only" flash drive?

Post by mikewalsh »

@stevie pup :-

Heh. Oh, I'm a bit like you in one respect; I've got thumb drives coming out of my ears. They're all over the place; I have a small drawer-full of the things (when I remember to put 'em in there). The collection spans almost the entire size-range.......from tiny, USB 1.0-gen 256 MB drives from 20-odd years go - still functioning! - all the way up to a couple of USB 3.2 Gen1 'nano' drives from SanDisk, rated at 256 GB each. They do one of these in a 512 GB size, which MAY be my next purchase; I'm doing the same thing with the 'new'-ish D630 Latitude as I did with ye anciente Inspiron lappie some years ago.

I can't be arsed to open up the Latitude and upgrade the 120GB SSD it has installed within; rather than have to re-install everything, AND copy a bunch of new stuff across, given the number of USB ports it's blessed with it's just as simple to put my entire media collection on 1 or 2 high-capacity 'nano'-sized thumb drives, and just leave 'em permanently plugged-in. They're so tiny nowadays you don't even notice they're there.

This pair of 256GB drives have added a half-terabyte of permanent, 'external' storage to the Dell. I don't even need to bother with a USB HDD or SSD with its short cable; these tiny thumb drives are just there, all the time.......essentially part OF the laptop.

https://www.amazon.co.uk/SanDisk-Ultra- ... r=8-3&th=1

(I currently have 4 of these. I bought a 32 GB to try out a year or so ago, almost immediately buying a 128 GB afterwards. Then, the pair of 256 GB early this year. At GBP £20 each from Amazon - £40 in total - that's around 7 pence per GB. A pretty simple, cheap way to add a ton of extra data storage!)

Given the billions of these things that are churned out every year, it'd be pretty surprising NOT to have a small percentage of them "go bad". Invariably, it's the firmware in the controller chip that goes tits-up.....and once it has, there is nowt the average user can do with them. Data recovery specialists might be able to do summat with 'em, but who's paying those kinds of prices to get a cheap flash drive "fixed"? It simply isn't cost-effective.

Mike. ;)

User avatar
wiak
Posts: 4082
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1208 times
Contact:

Re: How can I wipe a "Read only" flash drive?

Post by wiak »

rockedge wrote: Mon Aug 21, 2023 5:06 pm

Hate to say this......have you tried with Microsoft Windows to access the USB flash drive? I have run across problems during experimentation and distro building where a directory on a drive can't be deleted and I have had some success using Windows, as a last resort, to delete it and also have been able fix read only flash drives and reformat into a FAT32 partition. Then with GParted on a Linux system it was possible to again format that drive into the desired partition types.

If Windows also can't access the USB flash drive then it's next stop should be the trash can.

That's true, and what I do as last resort too. My not detectable usb sticks remained undetectable on Windows too unfortunately so I resigned.

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

Post Reply

Return to “Users”