When Windows detects a USB flash drive but cannot format it, the correct first move depends on one question: does the drive still contain important files? If it does, stop formatting and repair attempts because every write can reduce recovery options. If the data is disposable or safely copied, inspect detection in Disk Management and reserve DiskPart for the final, destructive stage.

Quick fix: choose the next check

  1. Decide whether files need recovery before writing to the USB drive.
  2. Open Win + X → Disk Management and compare the device capacity and disk state.
  3. Use the recovery path for needed files; reserve the destructive DiskPart method for a verified empty or backed-up drive.

Check: the device size and model match the USB drive. Check: recovered files go to a different disk. If capacity is still unstable or files remain irreplaceable, stop before formatting.

Decide first: save data or reset the drive?

A quick format creates new file-system structures, while DiskPart clean removes partition information from the selected disk. Neither operation is a recovery technique. A drive that disconnects, reports an inconsistent capacity, becomes unusually hot, or disappears on several computers may have a hardware fault. Repeated writes are inappropriate when the data matters.

Choose a diagnostic path before writing to the drive
Observed situation Priority action Avoid
Important files remain Stop using the drive and copy or recover to another disk. Formatting, clean, or creating a partition.
Drive is empty or backed up Inspect Disk Management, then rebuild only if necessary. Identifying a disk only by its drive letter.
Zero or unstable capacity Try another port and computer; consider hardware failure. Repeated formats.
Disconnects or excessive heat Disconnect it and use a specialist for critical data. Long repeated scans.

A safe five-step procedure

  1. Preserve data and freeze the diagnosis

    Disconnect and reconnect the drive once through a USB port directly attached to the computer rather than a hub. Record the exact message, reported capacity, and any drive letter. If File Explorer can still read folders, immediately copy important files to another disk. Copy rather than move them, and never write recovered material back to the source drive.

    Stop here when the data is irreplaceable. A sector image produced by a recovery specialist is safer than repeated in-place repairs. Do not begin with a format attempt when files must still be recovered.

    Preserve files before attempting to format the USB flash drive
    Step 1 — Stop writes and protect data before destructive action.
  2. Identify the flash drive precisely in Disk Management

    Open the Windows quick-access menu and choose Disk Management , or run diskmgmt.msc . Identify the removable device by its approximate capacity and by observing which disk appears when it is connected. A letter such as G: can change and is never sufficient evidence on its own. Note whether the space is healthy, unallocated, RAW, or absent.

    Microsoft documents Disk Management as the built-in tool for creating and formatting volumes and assigning drive letters. A drive showing about 14.44 GiB is only a capacity example, not a disk identifier. Your device may be different. Do not delete a volume until the system disk and every other attached drive are unmistakably excluded.

    Identify the USB flash drive in Windows Disk Management
    Step 2 — Check capacity, volume and drive letter without changing the disk.
  3. Separate file-system corruption from device failure

    When Windows assigns a letter and can lock the volume, open an elevated Command Prompt and first run chkdsk X: , replacing X with the observed letter. Without a repair option, this reports status. chkdsk X: /f attempts to correct logical errors and changes the volume, so use it only after backup or when loss is acceptable. Microsoft notes that /f must lock the disk.

    In Device Manager, confirm that the USB storage device appears without a persistent error. Trying another direct port and another computer helps separate the drive from the local USB controller. Removing the device entry and asking Windows to detect hardware again can renew the built-in driver association, but it cannot repair failing flash memory. Avoid unofficial driver-download sites.

    Check the file system and USB device in Windows
    Step 3 — Separate logical corruption from a detection problem.
  4. Recover files before rebuilding the partition

    If Windows cannot mount the volume but its reported capacity stays stable, a recovery utility may search old file-system structures and file signatures. Install the application on the internal disk, scan the USB source, and save results to a separate healthy destination. Never use the damaged drive as the recovery destination because new writes can overwrite recoverable material.

    Copy recoverable files to a separate healthy storage device
    Step 4 — Restore to another disk, never to the examined USB drive.
  5. Rebuild with DiskPart only as a last resort

    This stage destroys the partition structure of the selected disk. Close applications, disconnect other removable media, and open Terminal or Command Prompt as administrator. Start diskpart , then run list disk . Identify the USB device by capacity, replace N with its disk number, and enter select disk N . Run detail disk and recheck model, size, and volumes. If anything does not match, type exit and stop.

    diskpart
    list disk
    select disk N
    detail disk
    clean
    create partition primary
    format fs=exfat quick
    assign
    exit

    exFAT is often appropriate for a flash drive shared between Windows, macOS, and many current devices. NTFS can suit Windows-focused use, while FAT32 improves support for some older equipment but limits individual files to 4 GiB. The command block above uses exFAT; NTFS is another option for Windows-focused use. Choose a file system for the devices that will use the drive; neither format is a universal requirement. After assign , copy a few non-critical files, safely eject the drive, reconnect it, and read them back. Immediate success does not guarantee long-term flash health.

    Select the correct disk before rebuilding the USB partition with DiskPart
    Step 5 — Verify the target before clean, formatting and drive assignment.

What each DiskPart command does

Effect and risk of the rebuild commands
Command Effect Risk
list disk Lists detected disks and their capacities. Read-only.
select disk N Places focus on disk N. Later commands act on that target.
detail disk Shows control information about the target. Read-only and essential for verification.
clean Removes partition and volume formatting information. Destructive to normal access to existing data.
create partition primary Creates one primary partition. Writes a new structure.
format … quick Quickly creates a file system. Replaces existing metadata.
assign Assigns a drive letter or mount point. Low, after correct selection.

Verify the repaired file system before trusting the drive

After rebuilding, copy disposable files, safely eject the drive, reconnect it and open the copies. If corruption, disconnections or a read-only state returns, replace the drive. A successful quick format only confirms that the new file-system structures were written; it does not test every flash-memory address.

Match the Windows 11 error before using DiskPart

Message First decision
Windows was unable to complete the format Check capacity and state in Disk Management; protect files before changing partitions.
The disk is write protected Check a physical lock if present and distinguish a read-only policy from a controller protecting failing flash.
No Media / 0 bytes Stop formatting: no usable sectors are exposed.

Open Disk Management with Win + X → Disk Management on Windows 11. For recoverable files, PhotoRec can search file signatures; choose a different destination drive. It may not recover original names and folders. H2testw can check usable capacity only after recovery and backup, using a write/read test on an empty drive. A fake-capacity or failing drive is not repaired by repartitioning.

References and related troubleshooting

Frequently asked questions

Why does Windows ask to format the flash drive?

Windows may detect the USB device while failing to understand its partition or file system. Possible causes include removal during a write, logical corruption, damaged partition information, or failure of the controller or flash memory.

Can clean repair defective hardware?

No. It resets partition information on the selected disk. It cannot repair worn flash cells, an unstable controller, or a damaged connector.

Can I format the drive immediately?

Only after selecting the correct partition or creating the intended one, and only after recovery is no longer required. A valid command executed against the wrong disk remains catastrophic.

What if the drive disconnects or reports the wrong capacity?

Stop repeated format attempts. Try one direct port and another computer to compare detection; persistent disconnections, heat, or inconsistent capacity can indicate a hardware fault.

Sources and traceability

CGSecurity — PhotoRec recovery instructions

Heise — H2testw capacity test