The essentials

Quick reference

One focused task per row. Jump to the related section for complete, working examples.

UseSyntaxExamples
List volumeslist volumeView examples
Select a volumeselect volume 7View examples
Inspect the selected volumedetail volumeView examples
List disk partitionslist partitionView examples
Query maximum shrinkshrink querymaxView examples
Shrink by up to 10 GBshrink desired=10240 minimum=8192View examples
Extend by 20 GBextend size=20480View examples
Use all eligible free spaceextendView examples
Grow filesystem to partitionextend filesystemView examples
Select a partitionselect partition 4View examples
Inspect a partitiondetail partitionView examples
Delete a partitiondelete partitionView examples
Override partition protectiondelete partition overrideView examples
Delete a volumedelete volumeView examples
Verify the resulting layoutlist partitionView examples

Resize operations preserve data only when every storage and filesystem prerequisite is satisfied; delete operations do not. DiskPart has no WhatIf and no transaction rollback. Capture the layout, verify a tested backup, suspend or coordinate encryption and applications, check contiguous free space, and repeat select plus detail immediately before each state-changing command.

Step by step

Detailed examples

01

Capture layout, health, encryption, and ownership

Map the selected volume to its disk and partition, then capture order, size, filesystem, free space, mount paths, health, BitLocker status, cluster ownership, paging, snapshots, and application dependencies. Back up and test restore. DiskPart cannot preview a resize and success does not guarantee application consistency.

Read-only resize preflight
list volume
select volume 7
detail volume
list partition
filesystems
rem Verify backup, encryption, cluster, pagefile, and application state outside DiskPart.
Back to quick reference ↑
02

Measure movable space before shrinking

Shrink querymax reports the current maximum based on movable data and filesystem constraints. The number can change while a volume is active. Shrink sizes are in MB. Desired is the requested reduction; minimum lets the operation succeed with a smaller reduction only if at least that amount is available. Do not shrink below application, recovery, or free-space requirements.

Query before an approved shrink
select volume 7
detail volume
shrink querymax
rem Recheck the application capacity plan before continuing.
shrink desired=10240 minimum=8192
detail volume
Back to quick reference ↑
03

Confirm eligible unallocated space

For a basic volume, unallocated space normally must be contiguous, immediately after the partition, and on the same disk. Supported basic volumes are generally NTFS for extension. Dynamic-volume rules differ. Extending a virtual or hardware disk container first does not automatically grow its partition or filesystem. Specify size to avoid consuming space reserved for another partition.

Extend an approved basic volume by 20 GB
select volume 7
detail volume
list partition
rem Confirm 20480 MB of contiguous free space follows this partition.
extend size=20480
detail volume
Back to quick reference ↑
04

Reserve override for intentional rebuilds

Delete partition removes the selected partition. Override bypasses type-based protection and can destroy EFI, MSR, OEM, recovery, or other utility partitions. Never infer safety from a partition's size or missing letter. Verify its type, attributes, offset, contents, and boot or recovery role, and keep override out of general-purpose cleanup scripts.

Inspect a partition without deleting it
select disk 3
list partition
select partition 4
detail partition
rem Do not use delete or override until the partition role is independently proven.
Back to quick reference ↑
05

Delete volumes only after removing every consumer

Deleting a volume destroys its filesystem access and may remove extents across dynamic disks. Remove it from applications, shares, backups, replication, clusters, mount points, and monitoring first. Capture all paths and volume identity. Delete volume has no override switch; an unexpected refusal often signals a protected role or dependency that must be investigated rather than bypassed.

Volume deletion preflight
list volume
select volume 7
detail volume
attributes volume
rem Stop services and verify an offline restore before: delete volume
Back to quick reference ↑
06

Validate capacity and keep rollback practical

Repeat detail volume, list partition, and list volume. Validate filesystem health, free space, mount paths, encryption state, cluster health, and application writes. A resize rollback is another risky resize and may not be possible if data movement changes; the real rollback is a tested restore or redeployment plan.

Post-resize verification
detail volume
list partition
list volume
exit
Get-Volume | Sort-Object DriveLetter | Format-Table DriveLetter, FileSystem, HealthStatus, Size, SizeRemaining
Back to quick reference ↑

Sources and further reading

References

Authoritative documentation used to verify and expand this cheat sheet.

  1. Microsoftextendlearn.microsoft.com
  2. Microsoftshrinklearn.microsoft.com
  3. Microsoftdelete partitionlearn.microsoft.com
  4. Microsoftdelete volumelearn.microsoft.com
  5. MicrosoftExtend or shrink a data volumelearn.microsoft.com

Help us improve

Found a typo or missing example?

Tell us what would make this cheat sheet clearer, more complete, or more useful.

Share feedback