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 pen drive back to its original state. This allows the storage device to be readable again, and usable 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. 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 Restoring your USB key from Windows, Mac OS, or Linux

How to Restore a USB drive using Diskpart – Windows

  1. Open a command Prompt as administrator (cmd.exe)
  2. Type Diskpart then press Enter
  3. 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. Type Clean then press Enter
  6. Type Create Partition Primary then press Enter
  7. Type Format fs=Fat32 Quick then press Enter (You can also use NTFS or exFAT)
  8. Type Active then press Enter
  9. Type Exit then press Enter

DiskPart - Restore USB Flash Drive

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

Windows and or Mac OS users could use the SD Formatter Tool to reformat and restore a USB Drive.

SD Formatter

Using BOOTICE to repair a USB drive

Windows users can also simply use BOOTICE to format and restore a flash drive. The tool uses a simple and intuitive GUI.

  1. Download, extract, then run Pauly's BOOTICE Tool
  2. (1.) Select your USB Flash Drive from the list, (2.) Click Parts Manage
  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

Restoring your USB key to its original state using Linux

The following manual tasks to restore a USB drive can be performed using 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. Type fdisk /dev/sdx (replacing x with your drive letter)
  4. Type d to proceed to delete a partition
  5. Type 1 to select the 1st partition then press enter
  6. 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. 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.

Restore Your USB Key to its original state published under USB Help and Flash Drive Tools, Using and Configuring Linux