After using USB to install Fedora 33, can't reformat the USB

I am using Fedora 33

Linux fedora 5.9.11-200.fc33.x86_64 #1 SMP Tue Nov 24 18:18:01 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

After using media writer to install the ISO on the USB, I wanted to delete the partitions and reformat the USB to be able to reuse.
I have rebooted the system off of the internal hard drive, plugged the USB into a slot.
Using gparted, I see sdb and sdc.
I was able to format the sdb partition which was about 1GB.
The sdc is where the majority of space for the drive is located and the actual ISO file.
This partition can’t be accessed because it is indicated as read only (even though it’s NOT mounted!)
I have tried to mount it read/write (mount -o rw) but get the same issue.
Can anyone give me a detailed way to get this USB to where I can use it?)

This is not right. The USB would have been either sdb or sdc, but never both. Sdb is one device and sdc is another device. The partitions would be sdb1,2,… etc. and sdc1,2,… etc.
Also, the F33 iso is about 2 G and would have had 3 partitions on the disk, so I cannot tell what you actually did.

Media writer would have been able to restore the USB to its default size for you, but if you actually changed it that may not work.

I suggest you remove all USB storage devices then do “ls /dev/sd*” to see what devices are on the system permanently. Then insert the USB and repeat the "ls /dev/sd*"command to see the changes.
Once you are certain of the name of the device then use “gparted /dev/sdX” to limit it to only the device of concern and delete any existing partitions and create a new partition table and partitions.

If, in fact, it is now read only then it is toast (has failed) and will need replaced.


Drives aren’t necessarily called sd*, depending on how they’re connected. NVMe drives for example will show up as /dev/nvme.... The USB drive will be /dev/sd, so it’s fine here, but generally I’ve found lsblk to be the easiest tool for identifying drives/partitions/mountpoints.

1 Like

True in many cases. This discussion is specifically related to problems with a USB stick so I did not throw in other things that could muddy the waters, and kept it simple enough for almost anyone to understand. Interpreting the output of lsblk is much harder for the inexperienced than looking at the differences in two iterations of “ls /dev/sd*”

You and I are probably both quite experienced. I don’t know that the OP is the same.


True, sorry for the noise :slightly_smiling_face: .

You are 100 percent correct. I learned too late that the one partition that WAS deleted was another USB connected to the workstation. So, as of this moment, from gparted, I have THREE partitions, none of which can be deleted by any means. Any time I try, I get an error saying that the partitions are read only. I’m inclined to believe that this 16GB USB has bitten the dust.

As a last resort you can try playing with hdparm to disable read-only flag on USB drive. Be careful not to mess up other drives and treat it as fun/exercise - if the drive is failing it won’t be reliable.

It looks like computersavvy’s answer should be marked as solution.

1 Like

insert flash memory and run fedora media writer again and try restore option .

Try to overwrite the entire block device content with zeros using dd with sudo.
If it fails, then the flash is most likely bricked.
You can check lsusb and search your vendor/device ID on the internet.
There are some vendor-specific low-level recovery tools.
But those are typically Windows-only and success is not guaranteed.


maybe this could help:

just do

sudo dnf install f3

This produced an error “Unfortunately, an error occurred during the process.Please try restoring the drive using your system tools”.

tried the following:

hdparm --yes-i-know-what-i-am-doing --dco-restore /dev/sdb

Got “bad/missing sense data” error with the following string:
f0 00 05 00 00 00 00 0a 00 00 00 00 26 …(all zeroes to end)

Can you give me the steps to do this?

Installed f3.
Ran f3write to mount point for affected USB (/run/media/dad/Fedora-WS-Live-31-1-9) got the following error:
“No space:”

# List USB devices
lsusb -v -v -t

# List block devices

# Overwrite with zeros
sudo dd if=/dev/zero of=/dev/sdX bs=1M

OK, tried this exact command and got “read-only file system”

1 Like

Tried which command.??
vgaetera suggested 3 commands and it was implied that we would like to see the output in your response post.

Just a reminder that has been said several times. Details are needed for us to be able to help.

Sorry, the lsusb gave me the details of the drive as did the lsblk.

It was the “sudo dd if=/dev/zero of=/dev/sdX bs=1M” command that gave me the error “read-only file system"

A USB flash stick that is not writeable has usually failed and should be replaced. When it says read-only that says the electronics in it see to many errors to be reliable and lock it out for writing.

Is there a way to definitively determine that the USB is bad? If that is the case, then your response is the resolution…