Cannot remove partitions using Windows Disk Management after using HDDs for VMware ESXi


You’ve used a Hard Disk Drive (HDD) to install VMware ESXi on. It worked perfectly, but now you need to reuse the HDD for other purposes. You start to install a Windows Operating System like Server 2008 R2, only to find that the installation routine fails as you cannot remove the partitions made by ESXi.

Here’s how to remove the partitions, and restore peace to your troubled server:


  1. Attach the HDD to a computer already running Windows.
  2. At the command prompt (Windows key + r, cmd), type diskpart.
  3. Type list disk to list all physical HDDs:
  4. Type select disk [disknumber] to select the HDD you just connected, eg. select disk 2:
  5. Confirm with list disk, and look for the asterisk next to your disk:
  6. Type either clean (quick, deletes all partitions and volumes) or clean all (slow, zeros out whole disk):

    Yes, you noticed I changed the selected disk…I didn’t want to hose my backup HDD, so I connected a spare USB key; the process and outcome is still the same.
  7.  In Disk Management, you can see the disk is now free of partitions/volumes and ready to be formatted to your choosing:


  1. Angel Rodriguez says

    How do I make this work on my primary HD?

    • Hi Angel.

      The process should be the same for any drive, but make sure you connect it to another PC if it’s the one with your OS on it.

      Is that what you meant? If not, provide more details, and I’ll do my best to help.

  2. Thanks Adam, your solution worked like a charm!!!