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.
- To open Disk Management: press Windows and X on the keyboard, click Disk Management from the list.
- To open Diskpart command prompt: press Windows and R on the keyboard, type diskpart and press Enter.
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.
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.
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.
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.
But Diskpart can extend drive E successfully.
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.
To be short:
- On basic disk, there must be adjacent Unallocated space on the right side of the volume that you want to extend.
- Only the partitions that are formatted as NTFS or without file (RAW) system can be extended.
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."
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:
- Both NTFS and 32 partitions can be shrunk and extended.
- Unallocated space can be made on either side while shrinking a partition.
- Unallocated space can be combined to either adjacent partition by 1 step.
- Unallocated space can be moved and then combined to any nonadjacent partitions.
- Drag and drop to operate, you'll see disk partition structure and other information all the time.
- You can undo the operations if you did something wrong.
Download NIUBI and follow the steps in the video to shrink and extend partition in Windows Server 2012:
Comparing with other third party software, NIUBI Partition Editor is much safer and faster because of the innovative technologies:
- 1 Second Rollback - automatically reverts server to original status in a flash if encounter any error.
- Virtual Mode - all operations will be listed as pending for preview, simply click Undo to cancel if you did something wrong.
- Cancel-at-well - if you applied incorrect operations, you can also cancel the ongoing operations without causing damage.
- Advanced file-moving algorithm - resize and move partition 30% to 300% faster.