DiskPart – How to remove a partition

Microsoft DiskPart is a powerful tool that you can run on the CMD without using a GUI. The tool is more flexible than Disk Management.

Run DiskPart:

Type DiskPart on the CMD or invoke the tool with the Run window. A User Account Control message pops up.


Provide admin rights to the tool and accept the message to run the tool.

Clean the drive

  1. List disk: Displays the list of attached disks and USB flash drives
  2. Sel disk (select disk): Selects the scope to work in
  3. Clean all: Removes partition and volume information from the selected device

This is where I normally stop and then use an imaging tool to finish off my drive but if you do not have an image ready then we need to create a new partition

Create a partition

  1. List part: Display partitions available on the drive (a fabric state would not have partitions)
  2. Sel part: Used to select a partition to work on
  3. Del part: Used to delete the selected partition
  4. Create part primary: This command creates a primary partition of the full size of the drive. You can also specify an extended or logical partition or the size desired for the partition using size=”xxx”.

Now select your partition to format and configure it with the selected partition type:

Format override fs=”NTFS” label=”label”: Performs a low-level format (secure erase), configures your partition on NTFS file system and sets the desired label.
To run a quick format in place of override, type Format quick fs=”NTFS” label=”test”

Set the drive letter

  1. List vol: List all volumes available
  2. Sel vol: Select the volume that you already created with the last commands.
  3. Assign letter: Assign a letter to the drive so Windows sees your drive. The drive is ready to use. For example: assign letter=”D”.

Issues:

If you drive will not clean and you get an error message then do the following.

Is it write protected?

Some SD cards are write protected.

Check to ensure the slider on the side of the sd card is sent to unlock.

Is there a hardware failure

Sometimes there may be a hardware error on the SD card. If your drive is not write protected then the drive may be damaged. Do the following to check the logs.

Open event viewer

Select Windows log > System. The error should be one of the first and the source should be DISK. My error was “The IO operation at logical block address 0x0 for Disk 1 (PDO name: \Device\000001a3) failed due to a hardware error.” This error is unfixable and needs to be returned to the vendor.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.