I recently purchased some inexpensive 4GB USB drives from Amazon and right away, I ran into problems. Mageia Linux essentially mandates that you use their utility, IsoDumper, to write ISO images to USB drives. A nice feature is that if any space is left on the drive, it can format it in one of several different formats compatible with whatever OS the ISO is. For example, I installed the FreeDOS ISO and formatted the remainder of the drive as a FAT partition, perfect for including some DOS apps.
However, if the ISO image is installed and is corrupted, the drive becomes "read only" and can't be overwritten on a second attempt with IsoDumper.
Unfortunately, because the USB's partition table seems borked, you can't just use:
$ sudo dd if=/dev/zero of=/dev/sdX bs=4096 count=1
$ sudo dd if=/dev/zero of=/dev/sdX bs=4096 count=1
to zero out the partition table because it returns the error message that /dev/sdX is "read-only".
I had an unused drive , so I imaged it with:
$ sudo dd if=/dev/sdX of=4MB_USB.img
$ sudo dd if=/dev/sdX of=4MB_USB.img
You do need to know where your USB drive is mounted so you don't screw up a valuable partition.
Fortunately, Mageia will automount that "extra" partition and if you let it, while the borked drive is mounted you can then:
$sudo dd if=4MB_USB.img of=/dev/sdX
and, as if by magic, your USB drive is "restored".

Comments