Do you ever face a problem like drive can’t be formatted, Disk is write Protected or show the wrong capacity. If your Pen Drive (USB Flash Drive), SD card or any drive isn’t working quite right, “Cleaning” the drive and removing its partition is one possible solution. This trick will also delete partitions that can’t be deleted with normal tools, like the graphical disk management disk partitioning tool built into windows.
Warning : This process will completely wipe the entire disk you select, so be sure you back up any important files first. You should also be very careful to specify the correct disk, or you could accidentally wipe the wrong disk.
Launch a Command Prompt as Administrator :
On Windows 10 or 8.1, you can simply right-click the Start button (or press Windows Key + X) and select “Command Prompt (Admin)”.
On Windows 7, you’ll need to locate the “Command Prompt” shortcut in the Start menu — you can just search for “Command Prompt” in the Start menu. Right-click the Command Prompt shortcut and select “Run as Administrator.”
Use Diskpart to Clean a Disk
Before continuing, be sure you’ve connected the Pen Drive (USB flash drive), SD card or any other drive.
To launch the diskpart tool, type the “diskpart” command into the command prompt window and press Enter.
Now type “list disk” command into command prompt and press Enter to identify the number of the disk connected to your computer.
In the screenshot below, we can see that “Disk 0” is 238 GB in size and “Disk 1” is 14 GB in size. We know that our particular USB drive is 14 GB in size. This tells us that Disk 1 is the USB drive connected to the computer, and Disk 0 is the computer’s internal system drive.
Once you know the disk number, select the disk by typing the following command, replacing # with the number of the disk you identified above.
Warning: Be very careful you specify the correct disk number! Enter the wrong disk number and you’ll end up blowing away everything on the wrong disk.
select disk #
To completely wipe the selected disk’s partition table, type the following command and press Enter
Warning: This will erase all data on the selected disk! Be sure you have backups of the important data before continuing!
You’ll see a “diskpart succeeded in cleaning the disk” if everything worked properly. You’re now done. Close the Command Prompt window to continue.