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. 

How to clean a Flash Drive,   SD card, Hard Disk to fix   Partition and Capacity Problems

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.

Diskpart Command

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. 

Diskpart List Disk Command

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 #

Diskpart Select Disk Command

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!


Diskpart Clean Command

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.

Video : 4 Ways to Format a USB Flash drive, Hard disk or SD card

About the author

Michal Flip is a Tech Lover and founder of Digital Adda, a popular how-to tech guides and software tutorials. Sign-up for the email newsletter for your daily dose of tech tips & tutorials.

One Comment

  1. […] If your SD card is corrupted, try to format the sd card using DiskPart command in PC. If SD card isn’t working quite right, cleaning the drive and removing its partition is one possible solution. I’ve already written an article on how to format a SD card using Diskpart command. […]

Leave a reply

Leave a Reply