Quite often a hard drive supplied in a laptop or as part of a pre-built system will contain a number of recovery or system partitions which cannot be deleted using the Windows disk management tool. The partitions may be labeled as Healthy (Recovery Partition) or Healthy (OEM Partition) and can vary in size from a few hundred megabytes up to tens of gigabytes. If the disk is being reused for another purpose the recovery partitions will not be needed so the best option is to remove them.
Normally I would boot Parted Magic from a USB pendrive and use the partition editor to clear the drive. However there are times when removing the partitions without rebooting is preferred, thankfully there is a way to do this from the command line. Simply follow the steps below to delete the offending partitions.
Using Diskpart to delete partitions
*** Ensure the partitions are not needed before continuing. Normally this would not be done on the main Windows disk as it could easily result in a damaged Windows install ***
- Open a command prompt as an administrator
- Type diskpart and hit enter
- Type rescan and hit enter, the drives will be scanned for partitions
- Type list disk and hit enter to display a list of disks in the system
- Select the required disk from the list by typing select disk x (where x is the number of the disk) then hit enter
- Type list partition and hit enter to display a list of partitions of the selected disk
- Type select partition x (where x is the partition number) and hit enter to select the partition to be deleted
- Type delete partition override and hit enter to delete the partition. There will be no confirmation before the partition is deleted so ensure the correct partition has been selected.
To delete more than one partition simply repeat steps 7 and 8 until all the unwanted partitions have been deleted.