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
Windows 11 fix USB drive
  • To fix USB drive problems on Windows 11, open PowerShell (admin), run the “Get-Disk 7 | Clear-Disk -RemoveData” command to clear and repair the drive, and then run the command to create a new partition and set a drive letter.
  • This process completely erases the USB flash drive data and partition to fix issues like corruption and other errors and then configures the drive as a fresh new device.

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, which could indicate data corruption or something wrong happened to the storage.

Regardless of the reason, 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.

Important: 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.

Repair USB drive using PowerShell on Windows 11

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

  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, change “7” to 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.

About the author

Mauro Huculak is a Windows How-To Expert who started Pureinfotech in 2010 as an independent online publication. He has also been a Windows Central contributor for nearly a decade. Mauro has over 15 years of experience writing comprehensive guides and creating professional videos about Windows and software, including Android and Linux. Before becoming a technology writer, he was an IT administrator for seven years. In total, Mauro has over 21 years of combined experience in technology. Throughout his career, he achieved different professional certifications from Microsoft (MSCA), Cisco (CCNP), VMware (VCP), and CompTIA (A+ and Network+), and he has been recognized as a Microsoft MVP for many years. You can follow him on X (Twitter), YouTube, LinkedIn and About.me. Email him at [email protected].