How to format read only ISO 9660 USB drive

I put the wrong image (ISO 9960) with dd on an USB drive.
Now the drive is read-only and regardless what i do, i am not able to format the drive.

For example:

mkfs.vfat /dev/sda1
mkfs.fat 4.2 (2021-01-31)
mkfs.vfat: unable to open /dev/sda1: Read-only file system

Is there any chance to rescue the drive?

Write a new partition table to it.

Just run dd again with the correct ISO.

I tried it with parted but no success

sudo parted /dev/sda
Warning: Unable to open /dev/sda read-write (Read-only file system).  /dev/sda has been opened read-only.
GNU Parted 3.6                                                            
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: The backup GPT table is corrupt, but the primary appears OK, so that will be used.
OK/Cancel? OK                                                             
Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an
extra 106878524 blocks) or continue with the current setting? 
Fix/Ignore? ignore                                                        
Model: SanDisk Ultra Fit (scsi)
Disk /dev/sda: 62,1GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name       Flags
 1      32,8kB  7361MB  7361MB               ISO9660    hidden, msftdata
 2      7361MB  7387MB  26,2MB               Appended2  boot, esp
 3      7387MB  7387MB  307kB                Gap1       hidden, msftdata

(parted) mklabel                                                          
New disk label type? msdos                                                
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to
continue?
Yes/No? yes                                                               
Error: Can't write to /dev/sda, because it is opened read-only.

dd gives read-only error too :frowning:

You don’t have it mounted, do you?

No, not mounted.

looks more like defective drive..

You tried using dd to clean it?
sudo dd if=/dev/zero of=/dev/sdX bs=512 count=1

replace /dev/sdX with yours..

Yes, annd got read-only error :frowning:

sudo dd if=/dev/zero of=/dev/sda bs=512 count=1
dd: failed to open /dev/sda: Read-only file system

maybe this can help?

sudo mount -o remount,rw <device> <mountpoint>

To be sure it is not read only mounted but if you really umount the thumbdrive it shouldn’t make a difference

Is it possible the device has failed? Thumb drives generally have a pretty high failure rate.

Some USB sticks have a physical write-protect switch as a feature. When enabled, the storage hardware itself prevents any write operation.

This is not what happened here is it?

Filesystem corruption often causes a USB stick to mount as read-only. This can occur if we remove the USB stick without unmounting it or if a power failure causes an interruption.

To fix filesystem errors, we use the fsck command.

First, we need to unmount the USB stick:

$ sudo umount /dev/sda1

Here, we replace /dev/sda1 with the name of the USB stick.

Next, let’s check the USB stick for filesystem corruption. Since we’re using an exFAT-formatted USB stick, we employ fsck.exfat:

$ sudo fsck.exfat /dev/sda1

You can try this, if you know what filesystem is on the drive. then mount it and try again to remove everything with parted or Gparted and create a new filesystem.

good question. But i can mount it and read data from the drive.

thanks for your help. But all commands end with a read-only error :frowning:

It is pretty common for them to fail read-only but hard to say if that is the issue or not. dd should always be able to write no matter what the format is.

1 Like

Have you tried gnome-disk-utility ?

Mm i think that @dalto has the answer already given, if all this fails changes are that the thumbdrive has failed and remain in read only mode.

Even if you get it working again somehow it is probably unreliable so smash it with a big hammer :grinning_face:

1 Like

not yet. But will try it.

yay -S f3

This gives you f3write, f3read, f3probe, f3fix

1 Like

Same happend with my usb drive a few months ago. It was a pretty new one and i pulled it out without unmounting it. The usb locked it self out as what you have. I tried everything to format it and also used the commands above. In the end i destroyed the usb device and bought a new one.

Is it a philips usb stick ?