Get it working

How to fix USB drive not working on Windows 11

When your USB drive or SD card isn't working on Windows 11, you can use these PowerShell commands to fix the problem.

Windows 11 fix USB drive

On Windows 11, when you connect a USB flash drive, you may receive the “Please insert a disk into USB drive” or “Windows was unable to complete the format” as you try to reformat it that could indicate data corruption or something happened the storage.

Whatever the reason it might be, clearing the drive and re-creating the partition can fix most problems. On Windows 11, you can run some PowerShell commands to resolve these and other issues on a USB flash drive, SD card, and different removable drives. In addition, if the USB drive was configured as bootable installation media, this process will help you clean the drive to start with a fresh partition.

In this guide, you will learn the steps to repair any USB flash drive that is not accessible, and as a result, you can’t reformat it on Windows 11.

Repair USB drive using PowerShell on Windows 11

To repair a USB drive with PowerShell commands, use these steps:

Quick note: This process will erase everything stored on the drive. Also, make sure to select the correct drive, as you could accidentally wipe the incorrect storage.
  1. Open Start on Windows 11.

  2. Search for PowerShell, right-click the result, and select the Run as administrator option.

  3. Type the following command to identify the USB flash drive and press Enter:

    Get-Disk
  4. Type the following command to erase the entire drive and press Enter:

    Get-Disk 7 | Clear-Disk -RemoveData

    In the command, make sure to change “7” with the disk number of the drive you want to repair. If you specify the number incorrectly, you could wipe out the wrong drive causing data loss.

  5. Type Y to confirm that you want to wipe the specified drive and press Enter.

  6. Type the following command to create a partition using the NTFS file system and assign a name for the USB drive, and press Enter:

    New-Partition -DiskNumber 7 -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel myUSBflash

    In the command, change “7” with the disk number of the USB drive you want to repair and change “myUSBflash” with the name you want to use for the storage.

  7. Type the following command to assign a drive letter to the removable drive and press Enter:

    Get-Partition -DiskNumber 7 | Set-Partition -NewDriveLetter F

    PowerShell fix USB drive

    In the command, make sure to change “1” with the disk number of the flash drive to repair and change “F” with the letter to assign to the storage.

Once you complete the steps, the USB flash drive should appear accessible through File Explorer unless it’s physically broken, in which case, you will need a replacement.

If you are in the market for a new USB flash drive, we recommend the PNY brand for its durability, speed, and price. At the time of this writing, you can a pack of three PNY 64GB Turbo Attaché 3 USB 3.0 Flash Drive for only $21.99.