Restore Your USB Key to its original state

After having tooled around with a USB Linux version using your dd raw image overwritten or multi partitioned flash pen drive, you might find it necessary to revert it back to a single Fat, Fat32, exFAT or NTFS partition. Essentially recovering or restoring the USB Flash Drive back to its original state. This allows the storage device to be detected, readable, and useable again by all computers.

You’ll find this particularly necessary after working with tools such as Etcher to burn an ISO or Win32 Disk Imager to write an image. Depending on the file used, these tools can make your USB device appear corrupted or unreadable. In some cases, the Flash Drive might no longer be detected by your Computer. This is because these tools use raw-write style dd tasks to put an .img or .iso file on a USB flash drive. As a result, the existing boot record, partition table data, and filesystem is overwritten with that of the raw image file.

Windows users can follow the instructions below to Repair or Restore a Flash Drive using Diskpart, BOOTICE, or the SD Formatter. Mac OS users should also be able to use the SD tool. For those working from Linux this task can easily be accomplished via fdisk. As shown in the related the Linux Flash Drive Restoration tutorial.

Easily Restore a USB Flash Drive from Windows, Mac OS, or Linux

How to Restore a USB Flash Drive using Diskpart – Windows

  1. Open a command Prompt as administrator (cmd.exe).
  2. Type Diskpart then press enter.
  3. Next type List Disk then press enter.
  4. Type Select Disk X (where X is the disk number of your USB drive) then press enter.
  5. Then type Clean and press enter.
  6. Next type Create Partition Primary then press enter.
  7. Type Format fs=Fat32 Quick then press enter (You can also use NTFS or exFAT).
  8. Then type Active and press enter.
  9. Finally, type Exit then press enter to Quit.

DiskPart - Restore USB Flash Drive

Restore a USB with SD Formatter Tool – Windows/Mac OS

Windows and or Mac OS users can also use the SD Formatter Tool to reformat and restore a USB to its original state.

Though originally designed to be used on SD cards, this tool can be used to reformat a flash drive as well.

  1. Download and launch the SD Formatter Tool.
  2. Select your flash drive from the drop list.
  3. Choose your Formatting Option.
  4. Then Press Format.

SD Formatter

Restoring your USB key to its original state using Linux

The following manual tasks to restore a USB drive can be performed from a terminal window.

A. First we need to delete the old partitions that remain on the USB key.

  1. Open a terminal ctrl+alt+t and type sudo su.
  2. Type fdisk -l and note your USB drive letter.
  3. Then type fdisk /dev/sdx (replacing x with your drive letter).
  4. Next type d to proceed to delete a partition.
  5. Type 1 to select the 1st partition then press enter.
  6. Then type d to proceed to delete another partition, if necessary. (fdisk should automatically select the second partition).

B. Next we need to create the new partition.

  1. Type n to make a new partition.
  2. Then type p to make this partition primary then press enter.
  3. Type 1 to make this the first partition then press enter.
  4. Next press enter to accept the default first sector.
  5. Press enter again to accept the default last sector.
  6. Type w to write the new partition information to the USB key.
  7. Type umount /dev/sdx1 (replacing x with your drive letter).

C. The last step is to create the fat filesystem.

  1. Type mkfs.vfat -F 32 /dev/sdx1 (replacing x with your USB key drive letter)

That’s all there is to it, you should now have a restored USB key with a single fat 32 partition that can be read from any computer.

Using BOOTICE to repair a USB drive

Windows users can also use BOOTICE to format and restore a flash drive. The tool uses a simple and intuitive GUI.
NOTE: It looks like BOOTICE may no longer be in development as the last revision was in 2016.

  1. Download, extract, then run Pauly’s BOOTICE Tool.
  2. (1.) Select your USB Flash Drive from the list, (2.) Click Parts Manage.
    BOOTICE
  3. (1.) Click Repartitioning.
    BOOTICE Repartition
  4. (1.) Under Disk Mode, Choose USB-FDD, USB-HDD, or USB-ZIP mode I use USB-HDD as it works with every BIOS I use. (2.) Click OK. USB Repartitioning

Note: You can also Recover Lost USB Storage Space. This is especially useful if you’ve used dd to raw write an ISO image to your USB, and now the device appears smaller than its original capacity and is no longer usable for traditional storage purposes.