Diskpart extend volume on Windows Server 2012 R2

by John, Updated on: November 22, 2024

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

How to extend volume with Diskpart command

Besides the GUI-based Disk Management tool, Windows Server 2012 also includes DiskPart, which allows you to create, delete, format, shrink, and extend partitions, among other tasks. DiskPart operates via the command prompt, a feature that has been integrated into Windows since XP. Compared to Disk Management, the DiskPart command is much easier and faster for extending partitions. However, both tools have limitations when extending hard drive partitions. To better demonstrate how the DiskPart Extend command works, I will open both tools at the same time.

Steps to extend 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 individual partitions without structure. Original C: drive is 30GB, and unallocated space is not shown by Diskpart.

List volume

Step:2 Type select volume C or select volume 2 and press Enter.

Step:3 Type extend and press Enter. If you want to indicate an amount, type extend size=10240 in MB (there is only 10GB Unallocated behind C in my server)

C: drive is extended to 40GB by merging the contiguous unallocated space.

Extend volume

Diskpart cannot extend drive D because it is a FAT32 partition.

You'll receive error message - "The volume cannot be extended because the file system does not support it." When you right click drive D in Disk Management, Extend Volume option is grayed out.

Cannot extend

If you right click drive E in Disk Management, Extend Volume is also disabled.

In Disk Management console, unallocated space deleted from a primary partition cannot be extended to any logical drive. Free space deleted from a logical drive cannot be extended to any primary partition.

Extend disabled

But Diskpart can extend drive E successfully.

Extend drive E

Restrictions when extend partition with Diskpart cmd

Although Diskpart is better than Disk Management tool while extending disk partition. It also has restrictions. In Diskpart command prompt window, type help extend and you'll see these restrictions.

Diskpart restrictions

To be short:

If you try to extend a partition without adjacent unallocated space on the right, you'll receive error message - "There is not enough usable free space on specified disk(s) to extend the volume."

Extend error

Whether you shrink a volume (such as D:) using the Disk Management tool or the DiskPart command, unallocated space can only be created on the right side of D. As a result, this unallocated space cannot be extended to the non-adjacent drive C or the right contiguous partition E.

This means that if you want to extend the C: drive, you must delete partition D to create adjacent unallocated space. However, in many servers, programs or Windows services are running from D, so deleting it is not an option. In other words, both the DiskPart command and Disk Management are not useful if you want to extend a partition by shrinking another one.

Better way to extend disk partition on Server 2012 R2

Compared to the DiskPart command, NIUBI Partition Editor is the better choice, because it is much more powerful.

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

Video guide

Compared to other disk partition software, NIUBI Partition Editor is much safer and faster because of the innovative technologies: