How to fix USB drive that is inaccessible or cannot be formatted on Windows 10

In Windows 10, if you still get the message “Please insert a disk into the USB drive” or the message “Windows was unable to complete the format” when trying to access your USB flash drive when reformatting the drive, There is a possibility that the drive has corrupted data or something else went completely wrong.

In these scenarios, cleaning the drive completely and creating a new partition with the correct settings will likely fix the problem. In Windows 10, you can quickly fix this problem with your USB flash drive, SD card, or other removable storage device using a few PowerShell commands.

This guide will show you how to use PowerShell commands to repair a USB flash drive that is inaccessible and therefore cannot be reformatted on Windows 10.

How to repair a USB drive using PowerShell

To repair a USB drive using PowerShell commands, do the following:

Quick note: This process will completely erase everything stored on the drive. Also, make sure you choose the correct drive as you could accidentally erase the wrong storage.
  1. Open minded begin under Windows 10.

  2. Search for Power Shell, right click on the result and select the Execute as administrator Opportunity.

  3. Enter the following command to identify the removable drive to be repaired and press Enter:

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

    Get-Disk 1 | Clear-Disk -RemoveData

    In the command above, make sure you change “1” with the volume number of the drive you want to repair. If you enter the number incorrectly, you can erase the wrong drive, resulting in data loss.

  5. Type AND to confirm that you want to erase the specified drive and press Enter.

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

    New-Partition -DiskNumber 1 -UseMaximumSize | Format-Volume -FileSystem NTFS -NewFileSystemLabel myUSB

    In the command above, make sure you change “1” with the hard drive number of the drive you want to repair and change “My USB” with the name you want to use for storage.

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

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

    In the command above, make sure you change “1” with the hard drive number of the drive you want to repair and change “F” with the letter you want to assign to the memory.

Once you’ve completed the steps, open File Explorer and navigate to “This PC”. You should now be able to access and save data on the removable drive.

Update September 6, 2021: This guide was originally published in September 2017 and has been updated to ensure that the information is still accurate.