USB Flash Disk Won't Format (Read Only)

sudo umount /dev/sdb1 (or whatever number is mounted, if anything)

2 Likes

I think there might be some confusion here.

When changing permissions or doing things your user does not have rights for … you will need to use something like sudo.

But … regardless of all that … lets help you clean/format the device …

Maybe fdisk would be friendly to use;
First make sure the thing is unmounted:

sudo umount /dev/sdb1

Then you can start fdisk in interactive mode

sudo fdisk /dev/sdb

From there you can hit d for delete and select the partition.
Then hit g to create a new GPT partition table or o for MBR table - as yours seems broken.
Then hit n to create a new partition.
To write/exit hit w.

3 Likes

not working :frowning:

``
sudo fdisk /dev/sdb

Welcome to fdisk (util-linux 2.38.1).
Changes will only remain in memory until you decide to save them.
Be careful before using the write command.

fdisk: could not open /dev/sdb: Read-only file system
``

sudo fdisk /dev/sdb

Welcome to fdisk (util-linux 2.38.1).
Changes will only remain in memory until you decide to save them.
Be careful before using the write command.

fdisk: could not open /dev/sdb: Read-only file system

That might be a sign of faulty hardware tbh.
Doesn’t linux automatically put anything in read only mode if it detects hardware irregularities?
Edit. I cross my fingers I am wrong.

OK … try this:

sudo hdparm -r0 /dev/sdb

(then try mounting or interacting with it again - fdisk, i suppose)

Also please verify your device does not have some sort of hard switch - for example many SD cards may have a little toggle for ‘locking’ which can force this read-only situation.

2 Likes

Could be then only:

A) Flash Disk reaches its lifetime, no more write cycles possible, therefore it is readonly.
B) A physical switch let it be locked as read only.

sudo hdparm -r0 /dev/sdb

/dev/sdb:
 setting readonly to 0 (off)
 readonly      =  1 (on)

Nothing bruh :cry:

Right, alternative B would not be possible, because I don’t have a physical switch on this device.
But, considering alternative A, how do you know if it really has reached the end of its useful life?

Look, every Flash Drive has a Controller and a Flash Memory. The controller controls how much data can be written and how in simple words. There is a hard limit of write cycles, like on any SSD. On dump USB Flash Drives, you can only detect it when you cannot write data on it (create, modify, delete), but still you can read everything.

Got it, from that, I believe that’s the problem then, because everything we tried went down the drain.

:smiling_face_with_tear:

You could try installing gsmartcontrol and maybe you might find some info there if you are curious.

pamac install gsmartcontrol

Edit. I revoke that, I tried with a usb stick and it shows nothing, guess it’s not S.M.A.R.T capable. xD
My “ssd” usb stick gave me info though. :smiley:

Just an alternative you don’t have a Flash Drive… wrote that myself and I use it on all of my Manjaro systems:

2 Likes

I’ll try this another time. Thanks!

@megavolt Wow, I’m def bookmarking that for playing around with, I have played around with mounting isos directly in my standard grub, this is a very nice reference! Thank you!

To use nvidia do I only have to change set dri="free" to nonfree, or does this still bring up the grub menu (I see a timeout) and this is just the menu chooser will be at default?

1 Like

You see the Grub Menu, where you can choose to boot the ISO. The grub menu of the ISO will be skipped, since all parameters are already set.

Ah, I see, thank you very much for this, I will def play around with it!

1 Like

Would this work to zero the critical initial sectors when normal formatting tools don’t work?

dd if=/dev/zero of=/dev/sdY bs=4k count=1 status=progress

where “Y” in sdY is the actual USB drive.

It has been around for a long time in Tutorials section

You cannot do that - the command may return OK but it won’t work.

In the Tutorials section is a utility script to handle the task

If @cscs suggestion in #10 is failing - it is likely end of life - it happens more often than you think.

1 Like

Simple alternative is install package
grml-rescueboot

See also explanation for Debian
http://wiki.grml.org/doku.php?id=rescueboot

Now its as simple as copy your *.iso to
/boot/grml/
then update-grub and you have aditional boot entry for your *.iso

3 Likes