Diskpart extend volume in Windows Server 2012

Updated on: June 5, 2019

This article introduces how to extend partition with Diskpart command in Windows Server 2012, and the method when Diskpart cmd cannot extend volume.

How to extend volume with Diskpart Extend command

Besides GUI Disk Management tool, Windows Server 2012 has DiskPart to create, delete, format, shrink, extend partition, etc. DiskPart works via command prompt, which is integrated from Windows XP.

Comparing with Disk Management, Diskpart cmd is much easier and faster to extend partition. However, both tools have limitations while extending hard drive partitions. To better understand how Diskpart Extend command works, I open both tools at the same time.

Steps to extend partition with Diskpart in Windows Server 2012:

Step:1 type list volume and press Enter in diskpart command prompt window, then you'll see all single partitions without structure. Original C: drive is 30GB, 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, Unallocated space deleted from a Primary partition cannot be extended to any Logical partition. Free space deleted from a Logical partition can't 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 right adjacent Unallocated space, you'll receive error message - "There is not enough usable free space on specified disk(s) to extend the volume."

Extend error

No matter you shrink a volume (such as D:) with Disk Management tool or Diskpart command, Unallocated space can only be produced on the right side of D, so this Unallocated space can't be extended to the nonadjacent drive C or the right contiguous partition E.

That means, if you want to extend C: drive, you must delete partition D to get adjacent Unallocated space. In many servers, programs or some Windows services are running from D, so you can't delete it. In other words, both DiskPart command and Disk Management are useless if you want to extend a partition by shrinking another one.

Better way to extend disk partition in Server 2012

It is better to run server partition software such as NIUBI Partition Editor. Comparing with DiskPart command, NIUBI has more advantages such as:

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

Video guide

Comparing with other third party software, NIUBI Partition Editor is much safer and faster because of the innovative technologies: