How to fix USB drive not accessible or unable to format on Windows 10

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

Windows 10 fix USB flash drive
Windows 10 fix USB flash drive

On Windows 10, if you keep getting the “Please insert a disk into USB drive” message trying to access your USB flash drive, or the “Windows was unable to complete the format” message when trying to reformat the drive, chances are the drive has corrupted data or something else went wrong.

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

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

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

Repair USB flash drive from PowerShell on Windows 10

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

  1. Open Start on Windows 10.

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

  3. Type the following command to identify the removable drive you want to repair and press Enter:

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

    Get-Disk 6 | Clear-Disk -RemoveData

    In the above command, make sure to change “6” 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 new partition using the NTFS file system and assign a name for the USB drive, and press Enter:

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

    In the above command, make sure to change “6” with the disk number of the drive you want to repair and change “myUSB” with the name you want to use for the storage.

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

    Get-Partition -DiskNumber 6 | Set-Partition -NewDriveLetter G

    PowerShell commands fix USB flash drive

    In the above command, make sure to change “6” to the disk number of the drive you want to repair and change “G” to the letter you want to assign to the storage.

Once you complete the steps, open File Explorer and navigate to “This PC,” and you should now be able to access and store data on the removable drive.

About the author

Mauro Huculak is a Windows expert and the Editor-in-Chief who started Pureinfotech in 2010 as an independent online publication. He is also been a Windows Central contributor for nearly a decade. Mauro has over 12 years of experience writing comprehensive guides and creating professional videos about Windows, software, and related technologies, including Android and Linux. Before becoming a technology writer, he was an IT administrator for seven years. In total, Mauro has over 20 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.