Did your USB flash drive lose its full capacity after you used it to create bootable media? Writing an ISO or disk image can replace the drive's original partition layout, making Windows or Linux show only part of its storage or leave space unallocated. If the flash drive is physically healthy, you can usually restore its usable capacity by removing the old partitions, creating a new partition, and formatting it. This guide covers Windows, Linux, and macOS, plus how to test a drive that still reports the wrong capacity.
Why Is My USB Drive Not Showing Full Capacity?

This commonly happens after using tools such as Balena Etcher, Win32 Disk Imager, or the Linux dd command to write an ISO or disk image directly to a USB drive.
These steps remove the existing partition layout and erase data on the selected USB device. Before running any command, verify the drive by its model and capacity, not just its disk number or device letter. Disconnect other removable drives if that makes identification easier.
Raw-writing an image can replace the drive's original partition table and filesystem. The USB drive may then show less space than expected, contain unexpected partitions, display unallocated space, or appear inaccessible in File Explorer.
If the flash memory is healthy, recreating the partition layout and formatting the drive will usually restore its available capacity.
- Windows: Use DiskPart to remove the old partition layout, create a new partition, and format it.
- Linux: Use GParted or fdisk to recreate the partition table and filesystem.
- macOS: Use Disk Utility and erase the physical USB device, not just an existing volume.
- Still showing the wrong capacity? Test the flash drive with H2TestW or F3 to check for counterfeit or failing storage.
Important: These procedures erase data on the selected device. Back up anything you want to keep and verify the drive name or disk number before proceeding.
Restore a USB Drive in Windows with DiskPart
DiskPart is included with Windows and can remove the existing partition layout, create a new partition, and format the entire USB drive.
Warning: The clean command removes the partition information from the selected disk. Carefully identify your USB drive by its capacity. Selecting the wrong disk can erase another drive.
- Connect the USB flash drive.
- Open Command Prompt as Administrator.
- Type
diskpartand press Enter. - Type
list diskto display connected drives. - Identify the USB drive by its capacity.
- Type
select disk #, replacing#with the USB disk number. - Type
cleanto remove the existing partition information. - Create a new partition:
create partition primary
Format it as exFAT:
format fs=exfat quick
Or use FAT32:
format fs=fat32 quick
FAT32 note: Windows built-in formatting tools generally cannot format a volume larger than 32 GB as FAT32. For larger USB drives, exFAT is usually the simpler choice for general file storage. If you specifically need one large FAT32 partition, use a reputable FAT32 formatter that supports larger volumes.
Assign a drive letter and exit:
assign exit
The USB drive should now appear in File Explorer as a normal storage device.

DiskPart: Access Is Denied
If DiskPart reports "Access is denied," first make sure Command Prompt is running as Administrator and that you selected the correct disk.
If the clean command still fails, check whether the disk is marked read-only:
attributes disk
If appropriate, clear the read-only attribute:
attributes disk clear readonly
Retry only after confirming that the correct USB disk is selected. A drive that remains inaccessible may be write-protected, in use, or experiencing hardware failure.
Restore a USB Drive in Linux
Linux users can use GParted for a graphical approach or fdisk from the terminal. Both can replace the old partition layout and create a new partition using the available space.
Important: Identify the correct device first. In the terminal examples below, /dev/sdX is a placeholder for the whole USB drive. Replace X with the actual device letter shown by lsblk. For example, if your USB drive is listed as /dev/sdb, use /dev/sdb instead of /dev/sdX. Do not type /dev/sdX literally. A name such as /dev/sdX1 refers to a partition on that drive, for example /dev/sdb1. Check the model and capacity carefully before running commands that erase or format anything.
Option 1: Use GParted
GParted is a graphical partition editor. It can create a new partition table and format a USB drive.
- Install GParted if needed:
sudo apt install gparted. - Open GParted and select the USB device from the device list.
- Unmount any mounted partitions on that device.
- Choose Device > Create Partition Table.
- Select msdos for broad compatibility or gpt if you need GPT.
- Apply the change, then create a new partition using the unallocated space.
- Choose a filesystem such as FAT32 or exFAT and apply the operation.
Make certain that the selected device is the USB drive, not your computer's internal disk.
Option 2: Use fdisk from the Linux Terminal
First, identify the USB drive and its partitions:
lsblk -o NAME,SIZE,MODEL,TRAN,MOUNTPOINTS
Unmount every mounted partition belonging to the USB device before changing its partition table. Use the MOUNTPOINTS column from lsblk to identify them. For example, if the USB drive is /dev/sdb and its mounted partitions are /dev/sdb1 and /dev/sdb2, unmount each one:
sudo umount /dev/sdX1 sudo umount /dev/sdX2
Run a command for each mounted partition shown for your USB device. Omit any example partition that does not exist.
Open the whole device with fdisk:
sudo fdisk /dev/sdX
Inside fdisk, use these commands:
- Type
oto create an MBR partition table, orgto create a GPT partition table. - Type
nto create a new partition. - Accept the default partition number, first sector, and last sector to use the available space.
- Type
wto write the changes and exit.
Refresh the partition information. If the new partition does not appear, unplug and reconnect the USB drive.
sudo partprobe /dev/sdX
For FAT32, install the required utility if needed and format the new partition:
sudo apt install dosfstools sudo mkfs.vfat -F 32 /dev/sdX1
For exFAT:
sudo apt install exfatprogs sudo mkfs.exfat /dev/sdX1
Replace the example device names with the actual USB device and partition. Do not run formatting commands on the whole disk when the intended target is its new partition.
Advanced Linux Cleanup: dd and sgdisk
Ordinary repartitioning with GParted or fdisk is usually sufficient. If old partition metadata remains, Linux offers two additional cleanup options. Both are destructive, so verify the whole-device name carefully. Use /dev/sdX, not a partition such as /dev/sdX1.
Method A: Use dd to Clear Both Ends of the Drive
The dd command can overwrite the beginning and end of a USB drive. Clearing the beginning removes the primary partition information. Clearing the end also overwrites the area where backup GPT metadata is stored.
First set the correct device name. This example uses 10 MiB at each end of the drive:
DEV=/dev/sdX SECTORS=$(sudo blockdev --getsz "$DEV") COUNT=20480
Clear the first 10 MiB:
sudo dd if=/dev/zero of="$DEV" bs=512 count="$COUNT" conv=fsync status=progress
Clear the last 10 MiB:
sudo dd if=/dev/zero of="$DEV" bs=512 seek=$((SECTORS - COUNT)) count="$COUNT" conv=fsync status=progress
blockdev --getsz reports the device size in 512-byte sectors, allowing the second command to calculate the ending position for that particular drive. These commands overwrite partition metadata at both ends; they do not securely erase all data stored on the device.
Method B: Use sgdisk to Remove GPT and MBR Structures
sgdisk --zap-all is generally the simpler option when you want to remove the primary and backup GPT structures as well as the MBR.
On Debian or Ubuntu, install the gdisk package:
sudo apt install gdisk
Then run:
sudo sgdisk --zap-all /dev/sdX
Replace /dev/sdX with the whole USB device. The command removes GPT and MBR partition-table structures, but it is not a secure wipe of the drive's contents. Afterward, create a new partition table, partition, and filesystem using the instructions above.
Restore an SD Card with SD Memory Card Formatter
If your goal is to format an SD, SDHC, or SDXC memory card, the SD Memory Card Formatter from the SD Association is a purpose-built option for Windows and macOS. It is intended for SD memory cards, not ordinary USB flash drives. A USB card reader can be used to connect an SD card to your computer.
- Download and install SD Memory Card Formatter from the official SD Association website.
- Insert the SD card into your computer or connected card reader.
- Launch the formatter and select the correct card.
- Choose the available formatting option and start formatting.
Check the selected card carefully before formatting because the operation erases its contents.

Restore a USB Drive in macOS with Disk Utility
macOS includes Disk Utility, which can erase a USB flash drive and create a new partition layout.
- Connect the USB flash drive and open Disk Utility.
- Choose View > Show All Devices.
- Select the physical USB device at the top level of the sidebar, not just an existing volume.
- Click Erase.
- Choose ExFAT for the format.
- Choose Master Boot Record for broad compatibility or GUID Partition Map for a modern GPT layout.
- Click Erase to create the new layout.
When the process finishes, the drive should be available for normal file storage again.
Test a USB Drive for Fake or Damaged Storage
If repartitioning and formatting do not restore the expected capacity, the problem may be the flash memory or USB controller rather than the partition layout. Some counterfeit drives report more storage than they physically contain. Failing flash memory can also cause read/write errors or corrupted files.
Two useful tools for testing USB flash drives are H2TestW for Windows and F3 (Fight Flash Fraud) for Linux and macOS.
Test with H2TestW in Windows
- Download H2TestW and start the program.
- Select the USB drive you want to test.
- Choose to test all available space.
- Click Write + Verify.
- Review the results for capacity errors or read/write failures.
A genuine, functioning USB drive should be able to store and retrieve the amount of data it reports.
Test with F3 in Linux or macOS
Install F3 on Debian or Ubuntu:
sudo apt install f3
On macOS with Homebrew:
brew install f3
Mount the USB drive and write test files:
f3write /mount/point
Then verify the written data:
f3read /mount/point
Replace /mount/point with the actual mount location. Remove the test files when finished. If the drive reports errors or cannot store its advertised capacity, it may be counterfeit or failing. Repartitioning and formatting cannot repair defective flash memory.
Recover Lost Space Without Resetting the Entire USB Drive
If you want to keep the bootable portion of a USB drive while making additional space available for normal file storage, see our guide to recovering lost USB storage space. That approach differs from a full reset because it aims to retain the existing bootable setup.
Frequently Asked Questions
Why is my USB drive not showing its full capacity?
A USB drive may show less space after a bootable ISO or disk image replaces its original partition layout. Unallocated space or unexpected partitions can also make the drive appear smaller. Counterfeit or failing flash storage can cause similar symptoms.
How do I restore a USB drive to full capacity?
Remove the existing partition layout, create a new partition using the available space, and format it. Windows users can use DiskPart, Linux users can use GParted or fdisk, and macOS users can use Disk Utility.
Can formatting restore a USB drive's full capacity?
Formatting an existing partition does not necessarily recover space outside that partition. If the drive has an unusual partition layout or unallocated space, recreate its partition table and partition before formatting.
Can dd remove backup GPT information too?
Yes. If you calculate the device's size correctly, dd can overwrite both the beginning and end of the drive, clearing the primary and backup GPT metadata. sgdisk --zap-all is generally the simpler alternative.
Does sgdisk --zap-all securely erase a USB drive?
No. It removes GPT and MBR partition-table structures, but it is not a secure full-device data wipe. It is destructive because it removes the information used to locate existing partitions.
How can I tell if my USB drive is fake or damaged?
Use H2TestW on Windows or F3 on Linux or macOS. These tools write test data to the drive and verify that it can be read correctly, helping identify counterfeit capacity and storage errors.
Can I use SD Memory Card Formatter on a USB flash drive?
SD Memory Card Formatter is designed for SD memory cards. A USB card reader can connect an SD card to your computer, but the formatter should not be recommended as a general-purpose USB flash drive formatter.
Can I recover extra space without removing my bootable USB setup?
Sometimes. You may be able to create an additional storage partition while retaining the bootable portion. See the related USB lost-space recovery guide for that approach.
Final Thoughts
A USB drive that shows less than its full capacity after creating bootable media often just needs a new partition layout. DiskPart, GParted, fdisk, and macOS Disk Utility can usually restore the available space without additional recovery software.
If old partition metadata remains, Linux users can use dd to clear both ends of the device or use sgdisk --zap-all to remove GPT and MBR structures. If the drive still fails capacity testing, the problem may be counterfeit or failing flash memory rather than its partition layout.
Always verify the selected device before running destructive commands, and back up any files you need to keep.
Happy USB booting!