Restore USB drives back to full capacity. Recover or reset USB drive to factory settings or original state. After having tooled around with your dd raw image overwritten or multi partitioned flash drive, you might find it necessary to revert back to a single Fat, Fat32, exFAT or NTFS partition.
Table of Contents
USB drive not showing up?
If your USB drive is not showing up, you'll need to restore it back to its original state by performing a reformat. Which essentially results in a reset USB. Afterwards, your removable drive should be detected, readable, and useable again by all computers.
It is often necessary to restore USB drives after working with tools such as Etcher to burn an ISO or Win32 Disk Imager to write an image to a removable device. Depending on the raw image file used, these tools can make your removable device appear to be corrupted or unreadable.
In some cases, the flash drive might not even be assigned a drive letter and can not be detected by your Computer. This is because these tools use raw-write style dd tasks to put an .img or .iso file on the drive. As a result, the boot record, partition table data, and filesystem becomes overwritten with that of the raw image file.
Restore USB flash drive from Windows, Linux, or Mac OS
Windows users can follow the instructions below to repair or restore a flash drive using Diskpart, the SD Formatter, or BOOTICE for formatting a USB drive. 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.
How to Restore USB flash drive using diskpart in Windows
To restore USB using diskpart for formatting a USB drive:
- Open a command Prompt as administrator (cmd.exe)
- Type diskpart
- Next type list disk
- Type Select Disk X (where X is the disk number of your drive).
- Type clean
* If Error, See Note Below - Next type create partition primary
- Type Format fs=exfat quick
Note: (for 32GB and smaller drives, use fs=fat32) instead. - Then type active
- Next type assign
- Finally, type exit to quit
DiskPart Has Encountered an Error: Access is Denied
If you encounter an error like this, simply repeat step 5.
DISKPART> clean
DiskPart has encountered an error: Access is denied.
See the System Event Log for more information.
If repeating DiskPart clean does not work, you'll need to Fix the Corrupted USB Flash Drive with dd. This appears to be because Windows is unable to detect the Linux file format.
Restore USB with SD Formatter Tool — Windows/Mac OS
Windows and or Mac OS users can use the SD Formatter Tool for formatting a USB drive — restoring it 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.
- Download and launch the SD Formatter Tool.
- Select your flash drive from the drop list.
- Choose your Formatting Option.
- Then Press Format.
Using BOOTICE to repair corrupted USB drives
Windows users can also use BOOTICE to format and restore flash drives. The tool uses a simple and intuitive GUI.
NOTE: It looks like this software may no longer be in active development as the last revision was in 2016.
- Download BOOTICE, extract, then run Pauly's Tool.
- (1.) Select your drive from the list, (2.) Click Parts Manage.
- (1.) Click Repartitioning.
- (1.) Under Disk Mode, choose USB-FDD, USB-HDD, or USB-ZIP mode
(I prefer USB-HDD as it works with most BIOS systems)
(2.) Click OK.
Restoring a USB key to its original state using Linux
For wiping, resetting, partitioning and formatting a USB drive from a Linux terminal, you can use the following commands:
A. First we need to delete the old partitions that remain on the USB key.
- Open a terminal Ctrl+Alt+T and then type sudo su.
- Type fdisk -l and note which letter belongs to your flash drive.
- Then type fdisk /dev/sdx (replacing x with your drive letter).
- Next type d to proceed to delete a partition.
- Type 1 to select the 1st partition and press enter.
- Then type d to proceed to delete another partition, if necessary. (fdisk should automatically select the second partition).
B. Next we need to create a new partition.
- Type n to make a new partition.
- Then type p and press enter to make this partition primary.
- Type 1 and then press enter to make this the first partition.
- Next press enter to accept the default first sector.
- Press enter again to accept the default last sector.
- Type w to write the new partition information to the USB key.
- Type umount /dev/sdx1 (replace x with your drive letter).
C. The last step is to create the fat32 or exFAT filesystem.
- For Fat32, type mkfs.vfat -F 32 /dev/sdx1 (replacing x with your drive letter)
- For exFAT, (if using Ubuntu or Debian), type apt install exfat-utils and then type mkfs.exfat /dev/sdx1 (again replace x with your drive letter)
Recover a corrupted USB drive or SD card with dd
USB drive not showing up or still isn't being detected? If none of the options mentioned above worked to help you restore USB. Or if you need to recover from a corrupted flash drive or SD card. Here is a last resort you can try before tossing your removable drive or sd card into the trash. Windows users need to download dd.exe to follow along.
- Open up a terminal (or command prompt in Windows)
- Next, we will wipe out the partition table and leading filesystem information.
For Windows users using dd.exe. Replacing X with your actual USB drive letter, type the following and then press enter;dd if=/dev/zero od=X: count=1 bs=4096 --progress
If that fails, try the following, instead. Replace 1 with your disk number which can be found by running diskmgmt.msc
dd if=/dev/zero of=\\?\Device\Harddisk1\Partition0 count=1 bs=4096 --progress
For Linux users. Replacing X with your actual USB device, type the following and then press enter;
dd if=/dev/zero of=/dev/sdX count=1 bs=4096 status=progress
- Then try to format your thumb drive using any method you want.
That's all there is to it, several methods you can use from Windows, Linux, or MacOS operating systems for formatting a USB to restore USB drives back to full capacity. You should now have a restored USB key with a single exFAT or fat32 formatted partition that can be read from any computer. There you have it. Several methods to help you format and restore USB flash drives back to their original state with full capacity.
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 drive, and now the device appears smaller than its original capacity and is no longer usable for traditional storage purposes.