Diskpart shrink volume on Windows Server 2012 R2

by John, Updated on: November 22, 2024

This article explains how to shrink a volume using the diskpart command on Windows Server 2012 R2, the limitations of the diskpart command, and a better method for shrinking partitions on Windows Server 2012/2016/2019/2022/2025.

How to shrink volume with Diskpart command

DiskPart is a native Windows disk partition management tool that runs via the command prompt. It can create, delete, format, convert, shrink, and extend volumes, among other tasks. To open this tool, press the Windows key + R on your keyboard, type diskpart, and press Enter. In the diskpart.exe command prompt window, type "?" to see a list of all commands. This article focuses on how to shrink a partition using the DiskPart command on Windows Server 2012.

Compared to the GUI-based Disk Management tool, DiskPart is easier and faster. However, there is a disadvantage: it only lists individual partitions without showing their structure. To better demonstrate how the DiskPart Shrink command works, I will open both tools at the same time.

Steps to shrink partition with Diskpart on Windows Server 2012 R2:

Step:1 Type list volume and press Enter in Diskpart command prompt window, then you'll see all partitions.

List volume

Step:2 Type select volume 2 and press Enter to give focus to C drive.

Step:3 Type shrink desired=10240 and press Enter. Diskpart reports successfully shrunk this volume by 10GB.

Partition C shrank

If you want to shrink drive D, repeat from Step 1.

Partition D shrank

You can't shrink drive E because it is a FAT32 partition, you'll receive error message "The volume cannot be shrunk because the file system does not support it."

Cannot shrink

Restrictions when shrinking partition with Diskpart

Typing help shrink , Diskpart lists the restriction of Shrink command including:

If you want to extend another partition after shrinking, neither Diskpart extend command nor Disk Management can help you. Because unallocated space can't be combined to the adjacent partition on the right or any non-adjacent partitions. Learn why can't extend volume in Server 2012 Disk Management.

Better way to shrink drive with NIUBI

It is better to shrink partition in Windows server with NIUBI Partition Editor. Compared to Diskpart shrink command, NIUBI has advantages such as:

Download NIUBI Partition Editor and follow the steps in the video to shrink and extend partition in Windows Server 2012:

Video guide