How to Reset USB Flash Drives: Restore Space

How to Restore USB drives back to their full capacity, recover lost storage space and reset a flash drive back to its original state. This post is for those who used tools like Etcher, Win32Disk Imager or dd to copy ISO to USB, overwriting the partition on a flash drive, and now want to repair USB by reverting back to a single FAT, FAT32, exFAT, or NTFS partition.

Reset USB Flash Drives: Restore - Recover Space

Restore USB - Reset USB - Fix USB

USB drive not showing up?

If your USB drive is not showing up, you may need to restore it to its original state by reformatting. This process effectively resets the flash drive, making it detectable, readable, and usable again on any computer.

Restoring or repairing a corrupted USB drive is often necessary after using tools like Balena Etcher to burn an ISO or Win32 Disk Imager to write an image to a removable device. These tools work much like the linux DD command and overwrite the USB drive's boot record, partition table, and filesystem, making the stick appear corrupted or unreadable. In which case, the following methods can be used to fix a corrupted flash drive.

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.

How to Test for Fake or Damaged Flash Drives

Before attempting to restore your USB drive, it’s crucial to verify that the drive is genuine and not counterfeit. Many fake flash drives show inflated storage capacities but cannot hold as much data as advertised. Testing tools can also reveal if the USB is damaged beyond repair. Here are two powerful tools for testing flash drives: H2TestW and F3.

Testing USB Drives with H2TestW (Windows)

H2TestW is a popular tool for detecting fake flash drives and checking for read/write errors. Here's how to use it:

  1. Download H2TestW and start the program.
  2. Run the Test
    Launch H2TestW and select the USB drive.
    Choose to test the entire drive or specify a smaller area.
    Click Write + Verify to test the drive's true capacity and detect errors.
  3. Review the Results
    A genuine drive will pass the test without errors, and its reported capacity will match the advertised size. A fake drive will fail, showing discrepancies between the claimed and actual capacities or data corruption during the write phase.

Testing USB Drives with F3 (Linux/macOS)

F3 (Fight Flash Fraud) is a command-line tool designed to verify flash drive capacities. It is an excellent alternative to H2TestW for Linux/macOS users. Follow these steps:

  1. Install F3
    For Linux, install via your package manager (e.g., sudo apt install f3 on Ubuntu/Debian).
    For macOS, use Homebrew: brew install f3.
  2. Test the Drive
    F3 offers two primary commands:

    • f3write: Writes test files to the USB drive until it’s full.
      f3write /mount/point
    • f3read: Reads the written files and checks for errors.
      f3read /mount/point
  3. Analyze the Results
    If the drive is genuine, it will show no errors, and the read/write speeds will be consistent. A fake or faulty drive will display errors, and the usable storage may be less than advertised.

Why Testing is Important

Running these tests ensures your efforts to restore the USB drive aren't wasted on fake or irreparably damaged hardware. If the drive fails the tests, it may need to be replaced. After confirming the drive is genuine and functional, proceed with restoration methods such as formatting, repartitioning, or resetting your USB stick.

Fix USB drives from Windows, Linux, or macOS

Windows users can follow the instructions below to fix USB drives, repair a corrupted USB drive or reset and restore a flash drive. Here we are using Diskpart, the SD Formatter, or BOOTICE for formatting a USB drive. MacOS users should also be able to use the SD tool. For those working from Linux this task can easily be accomplished via fdisk.

Restore USB drives using diskpart in Windows

To restore USB using diskpart for formatting a USB drive:

  1. Open a command Prompt as administrator (cmd.exe)
  2. Type diskpart
  3. Next type list disk
  4. Type Select Disk X (where X is the disk number of your drive).
  5. Type clean
     If you encounter an error, refer to the note below
  6. Next type create partition primary
  7. Type Format fs=exfat quick
    Note: (for 32GB and smaller drives, use fs=fat32) instead.
  8. Then type active
  9. Next type assign
  10. Finally, type exit to quit
DiskPart - Recover and Restore USB Flash Drive
Using DiskPart to recover lost space on a USB Drive

DiskPart Has Encountered an Error: Access is Denied

If you encounter an error like this, simply repeat step 5.

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 Drives with SD Formatter Tool

Windows and or Mac OS users can use the SD Formatter Tool for restoring a USB drive - by formatting it back 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 SD Formatter and launch the tool.
  2. Select your USB flash drive from the Drive: drop list.
  3. Choose your Format Option.
  4. Then press the Format button.
SD Formatter - Restoring USB Flash Drive
Using SD Formatter to Restore a USB Flash Drive

Using BOOTICE to Restore or Reset USB drives

Windows users can also use BOOTICE to format and restore USB flash drives and attempt to fix or repair them, if they appear corrupted. 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 released in 2016. A download link to the latest available version is being provided.

  1. Download BOOTICE, extract, then run Pauly's Tool.
  2. Once BOOTICE is running:
    (1.) Select your drive from the list, (2.) Click Parts Manage.

    Use BOOTICE to Restore USB flash drive
    Using BOOTICE to reset USB
  3. Then, (1.) Click Repartitioning.
    BOOTICE Repartition
  4. (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.
    Repair Corrupted USB - Repartitioning with BOOTICE

Restore or Reset USB Drives using Linux

For wiping, resetting, partitioning and formatting a USB drive from a Linux terminal, you can use the following fdisk commands:

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

  1. Open a terminal Ctrl+Alt+T and then type sudo su.
  2. Type fdisk -l and note which letter belongs to your flash drive.
  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 and 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 a new partition.

  1. Type n to make a new partition.
  2. Then type p and press enter to make this partition primary.
  3. Type 1 and then press enter to make this the first partition.
  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 (replace x with your drive letter).

C. The last step is to create the fat32 or exFAT filesystem.

  1. For Fat32, type mkfs.vfat -F 32 /dev/sdx1 (replacing x with your drive letter)
  2. 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)

Repair Corrupted USB drives or SD cards 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 want to try another way to attempt to fix or repair a corrupted USB flash drive or SD card. Here is a last resort you can try before tossing your USB drive or sd card into the trash. Windows users will need to download dd.exe to follow along.

  1. Open up a terminal (or command prompt in Windows)
  2. 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 Harddisk1 with your actual 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
  3. Then try to format your thumb drive using any method you want.

That's it! These methods let you fix, reset, repair, and restore USB drives to their full capacity using Windows, Linux, or macOS. After completing these steps, your reset USB drive should be fixed with a single exFAT or FAT32 partition, making it compatible with any computer.

Note: You can also recover lost USB storage space. This is especially helpful if you've used dd to raw write an ISO image to your drive, which can make the device appear smaller than its original capacity and unusable for traditional storage. That tutorial can help you create a second partition to use for regular storage purposes.

Frequently Asked Questions (FAQ)

How can I restore my USB drive to its original capacity?
You can restore your USB drive by reformatting it to a single partition using tools like Diskpart, SD Formatter, or BOOTICE. You will need to delete any existing partitions and create a new one with a suitable file system (e.g., FAT32, exFAT, NTFS).
Why is my USB drive not showing up?
If your USB drive is not showing up, it might be because its partition table and boot record were overwritten, possibly by tools like Etcher or Win32 Disk Imager. You can restore it by reformatting or using Diskpart to reset the drive.
How can I test if my USB drive is fake?
To test if your USB drive is fake, use tools like H2TestW for Windows or F3 for Linux/macOS. These tools will check for discrepancies in storage capacity and data integrity, revealing any counterfeits.
What is the purpose of testing my USB drive before restoring it?
Testing ensures your USB drive is not counterfeit or damaged beyond repair. If the drive fails the test, it may need to be replaced. Only proceed with restoration if the drive is verified as genuine and functional.
How do I restore a USB drive using Diskpart in Windows?
In Windows, you can use the diskpart tool. Start by opening Command Prompt as Administrator, then use commands like clean, create partition primary, and format fs=exfat quick to reset and format the USB drive.
Can I use SD Formatter to restore my USB drive?
Yes, the SD Formatter tool can be used to reformat USB drives. Though designed for SD cards, it works for USB flash drives as well. Simply select your USB drive, choose the format option, and press the Format button.
What is BOOTICE and how can it help restore my USB drive?
BOOTICE is a tool for managing USB drives, allowing you to repartition and format them. It’s particularly useful for fixing corrupted USB drives. You can use it to restore or reset your drive to a usable state.
How do I restore a USB drive on Linux?
On Linux, you can use the fdisk tool to delete old partitions and create new ones. Afterward, you can format the drive with mkfs.vfat for FAT32 or mkfs.exfat for exFAT file systems.
What should I do if none of the methods work to fix my USB drive?
If the USB drive still isn't working, you can try using the dd command to wipe out the partition table and then attempt to format the drive again. This method can be a last resort to restore functionality.

Final Thoughts on How to Reset or Fix USB Drives

Fixing, restoring or resetting USB flash drives can be a straightforward process, whether you're dealing with corrupted partitions or recovering lost storage space after using tools like Balena Etcher or Win32 Disk Imager. By following the steps outlined above, you can repair most issues and fix USB drives bringing them back to full capacity and functionality.

Whether you choose to use Diskpart, the SD Formatter, BOOTICE, or Linux's fdisk tools, the key to success here is knowing which method works best for your operating system. skill level, and the specific issue you're encountering. For more severe problems, tools like dd can be your last resort for wiping and resetting the drive.

Remember to always back up your data before making any changes, as these methods may erase existing files. If all else fails, it's essential to verify that your USB drive is genuine and not counterfeit, as faulty hardware might need to be replaced.

With these steps, I hope you were able to confidently reset a flash drive or restore USB drives lost space. Happy USB booting!