How To Properly Clean Install Windows

Blog Post Featured Image: Windows Partitioning Wizard

Deleting all partitions on your system before reinstalling Windows does not clear the partition table and this can cause problems when trying to reinstall Windows. For that reason whenever I am reinstalling Windows I like to use diskpart to return the drive to a clean uninitialized state. Here's how:

⚠️
This is not a replacement for a secure erase, if you are planning on selling your PC please do that instead
  1. Click through till you are at the partitioning wizard, take note of the disk number, Windows is installed on (if you have multiple drives its, usually the one with the MSR and System reserve partitions):
Windows 11 Setup partition list showing Disk 0: Partition 1 (200.0 MB, System), Partition 2 (16.0 MB, MSR Reserved), and Partition 3 (63.8 GB, Primary).
Windows 11 Custom Install Partitioning Wizard

In my case I only have one physical drive Disk 0 which is the one I want to wipe

  1. Press Shift + F10 on your keyboard and you should see a command prompt window appear like the one below:
Administrator Command Prompt in Windows Setup
WinPE Command Prompt
  1. Now type diskpart and hit enter, you should be at a prompt like the one seen below:
Windows Setup with Administrator Command Prompt running DiskPart; shows ‘Microsoft DiskPart, prompt at `DISKPART>`
WinPE Command Prompt at DiskPart prompt
  1. Now type list disk to list all available drives and their capacity, to confirm we have the right disk:
DiskPart ‘list disk’ output: Disk 0 - Status Online, Size 64 GB, Free 0 B, GPT flagged (*), not dynamic
DiskPart List Disk Output
  1. Now that we are sure of the drive we want to erase type select Disk N of course N being the drive you want to select in my case select Disk 0 :
DiskPart confirmation: `Disk 0 is now the selected disk`
DiskPart confirmation: `Disk 0 is now the selected disk`

You should now see the message: Disk N is now the selected Disk.

Warning: This next command will completely destroy all data on the drive
  1. Now that we have confirmed we have selected the correct disk we can proceed with cleaning it using the command `clean` and hitting enter
DiskPart confirmation after `clean` command: `DiskPart succeeded in cleaning the disk.`
DiskPart confirmation: DiskPart succeeded in cleaning the disk
  1. Now that it has succeeded you can exit the command prompt by typing exit twice... once to exit diskpart , and once to close command prompt, or just click the X in the top corner
  2. Once back at the Partition Wizard click "Refresh", Once complete you should see an entry labelled "Unallocated Space", Select it and click "Next".
Windows 11 Setup partition screen showing Disk 0 Unallocated Space: 64.0 GB total, 64.0 GB free; options include Create Partition, Format, Delete, and Next
Windows Partition Wizard with "Unallocated Space" selected
  1. Congratulations 🎉, Windows is now installing!!!