Technical Anshu
Tutorials Blog
💽 DiskPart Fix

DiskPart at Windows Setup Clean and Convert a Disk That Will Not Take Windows

The drive is visible but setup refuses it over a partition style error. DiskPart, opened without leaving setup, clears the old table and converts the disk to GPT in under a minute — after you read the warning.

✍️ Technical Anshu🪟 Windows 10 / 11 Setup⏱️ 7 minute read
🎥 Watch the video — the missing drive fix and the RST VMD RAID settings shown live

Sometimes the drive does appear in Windows Setup, but installation refuses to start: "Windows cannot be installed to this disk. The selected disk has an MBR partition table", or a GPT style error, or leftover partitions from a previous life. The fix is DiskPart, opened from inside setup itself — and it comes with the sharpest warning on this page: the key command erases the entire disk. Read the warning first, then follow the steps.

🔴 Data loss warning — read before step one: the clean command in this guide removes every partition and all data on the selected disk. There is no undo. If the disk holds anything you need, stop here, back it up from another system first, and only return when the disk is genuinely disposable.
Command Prompt from Windows Setup — Shift + F10
diskpart list disk Disk 0 Online 476 GB Disk 1 Online 28 GB (your USB stick) select disk 0 clean convert gpt exit
The full DiskPart sequence. Disk sizes are examples — always identify YOUR target disk by its capacity in list disk, and never clean the USB stick you booted from.
1

Open DiskPart From the Setup Screen

  1. Boot into Windows Setup and reach the screen that lists your drives
  2. Press Shift + F10 — a Command Prompt window opens on top of setup
  3. Type diskpart and press Enter, then list disk
  4. Study the list carefully. Your Windows USB also appears here, usually the small one. Identify the target disk by its capacity, not by its number alone
2

Clean the Disk and Convert It to GPT

  1. Select the target: select disk 0 — replace 0 with your disk's number, and re-read the warning above before continuing
  2. Erase the old partition table: clean
  3. Set the modern partition style that UEFI setup expects: convert gpt
  4. Leave DiskPart and close the prompt: exit, then exit again
  5. Back on the setup screen click Refresh — the disk now shows as one block of Unallocated Space
  6. Select it and click Next. Setup creates the partitions it needs by itself
3

Which Errors This Fixes — and Which It Does Not

This route fixes partition style clashes (MBR disk on a UEFI install, the reverse on a legacy install where you would use convert mbr instead), damaged partition tables, and stubborn leftover recovery partitions that block setup. It does not fix a drive that is missing entirely — that is the RST driver or BIOS problem from the main guide — and it does not repair a physically failing drive that reports 0 MB or throws write errors. Clean will happily wipe a dying disk and setup will still fail; the failure signs are covered in their own page in this series.

🔴 Honest note: technicians type clean from muscle memory — and every year it wipes the wrong disk on someone's machine. The ten seconds spent matching the disk number to its capacity in list disk is the cheapest insurance in all of PC repair.

🎥 Watch the Complete Fix in the Video

Watch the video for the full missing drive walkthrough, including what to try before DiskPart becomes necessary.

▶️ Watch Full Video
❓ Frequently Asked Questions

Does DiskPart clean delete everything on the disk

Yes — clean removes all partitions and every file on the selected disk, and it cannot be undone from setup. Only use it on a disk you have backed up or do not need. Always confirm the disk in list disk by its capacity first; your boot USB appears in the same list and must not be selected.

Should I convert to GPT or MBR

For any modern UEFI PC installing Windows 10 or 11, convert gpt — UEFI setup requires a GPT system disk. Convert mbr is only for very old legacy BIOS machines. If setup complained the disk has an MBR partition table on a UEFI system, GPT is the fix; the mirror-image error on a legacy system calls for MBR.

Setup still fails after clean and convert gpt — what now

Then the partition table was not the real problem. A disk that shows 0 MB, vanishes during setup, or produces write errors like 0x80300024 is usually failing hardware or a controller mode issue. Recheck the storage mode in BIOS and test the drive's health before blaming setup.

This guide is based on the Technical Anshu video linked above • Stuck on a step? Ask in the video comments — you will get a reply 🙏