The essentials
Quick reference
One focused task per row. Jump to the related section for complete, working examples.
| Use | Syntax | Examples |
|---|---|---|
| List candidate disks | list disk | View examples |
| Select the approved disk | select disk 3 | View examples |
| Inspect target details | detail disk | View examples |
| List existing partitions | list partition | View examples |
| List all volumes | list volume | View examples |
| Read clean help | help clean | View examples |
| Remove partition metadata | clean | View examples |
| Zero every sector | clean all | View examples |
| Read conversion help | help convert | View examples |
| Convert an empty disk to GPT | convert gpt | View examples |
| Convert an empty disk to MBR | convert mbr | View examples |
| Verify partition style | list disk | View examples |
| Verify the empty layout | list partition | View examples |
| Validate MBR2GPT conversion | mbr2gpt /validate /disk:3 /allowFullOS | View examples |
| Run MBR2GPT conversion | mbr2gpt /convert /disk:3 /allowFullOS | View examples |
| Exit DiskPart | exit | View examples |
DiskPart clean and partition-style conversion belong in rebuild and deployment workflows, not casual troubleshooting. Clean removes partition and volume metadata from the selected disk; clean all writes zeros to every sector and can take a long time. Both destroy access to existing data. Back up, disconnect look-alike devices where practical, identify the target with several independent properties, and prefer MBR2GPT when converting a supported Windows system disk without erasing it.
Step by step
Detailed examples
Prove disk identity before wiping
Disk numbers can change across boots and attachment order. Match number with size, model, unique ID, location path, current partitions, and volume labels. Confirm the disk is not boot, system, clustered, shared, encrypted, or hosting application data. A backup is useful only if its restore was tested and its location is not on the target disk.
list disk
select disk 3
detail disk
list partition
list volume
rem Stop if any identity, role, size, or layout differs from the approved change. Record the current layout and dependencies
Before cleaning, save DiskPart output, encryption status, mount points, partition types, application owners, and recovery instructions. Labels and drive letters are weak identifiers but useful corroboration. Remove the target from clusters, backup jobs, replication, and storage pools according to those products' procedures.
diskpart /s C:\Admin\disk-audit.txt > C:\Admin\disk-3-before.log
Get-Content C:\Admin\disk-3-before.log Choose clean or clean all deliberately
Clean removes partition and volume formatting metadata from the selected disk, including GPT partitioning information and the protective MBR. Clean all additionally writes zeros to every sector, so runtime scales with disk size. Neither operation has undo. Zero-filling is not a substitute for an SSD vendor sanitize, cryptographic erase, or a regulated media-disposal process.
select disk 3
detail disk
rem DANGER: the next command destroys the selected disk's partition layout.
clean
list partition Convert only an empty basic disk
DiskPart convert gpt and convert mbr require an empty basic disk. Cleaning first is destructive, so partition-style conversion with DiskPart is a rebuild path. GPT is the normal choice for modern UEFI systems and large disks; MBR is mainly for legacy BIOS compatibility and has partition-count and size limits.
select disk 3
detail disk
clean
convert gpt
list disk
list partition Use MBR2GPT for supported in-place system conversion
MBR2GPT is separate from DiskPart and can convert a supported Windows system disk from MBR to GPT without deleting data. Run validation first, protect recovery keys, review logs, and have rollback media. After conversion, firmware must boot in UEFI mode; changing partition style alone does not change firmware settings. MBR2GPT does not convert GPT back to MBR.
mbr2gpt /validate /disk:3 /allowFullOS
if ($LASTEXITCODE -ne 0) { throw "MBR2GPT validation failed: $LASTEXITCODE" }
# Run /convert only during the approved change window. Verify the style before creating partitions
After clean and conversion, repeat list disk, detail disk, and list partition. Confirm the GPT marker, empty layout, expected disk size, and identifier. Then apply a separately reviewed partition plan for the correct firmware mode. Do not continue automatically after unexpected output.
list disk
select disk 3
detail disk
list partition
exit Sources and further reading
References
Authoritative documentation used to verify and expand this cheat sheet.
Help us improve
Found a typo or missing example?
Tell us what would make this cheat sheet clearer, more complete, or more useful.



