Restore a destroyed USB drive

Please note: this deletes all data on the target device and requires a real OS (so no Macs or Windows 😉 ).

I enjoy trying out new Linux distrobutions from time to time, occasionally I destroy the odd USB stick as my knowledge on partition tables is not where I would like it to be. I found a series of commands that will restore a USB stick to its former glory (even when gparted or any other program says it’s basically bin worthy)

Install prerequisite:

Assuming the target USB is at /dev/sdb

(please check first with lsblk or gnome-disks or sudo fdisk -l and be sure you know what you are formatting)

Make sure the device has no mounted filesystem and unmount it if necessary, for example:

Destroy existing partition table:

Create new GPT:

Format as FAT32:

Check it:

Should output something like:

That’s it, your stick should be clean.

Leave a Reply

Your email address will not be published. Required fields are marked *