Diskpart Extend Volume Command in Windows Server 2019/2022

by John, Updated on: August 9, 2022

The same with all previous versions, system C drive is running out of space in Windows 2019 server. You'd better expand C drive before it becomes full, otherwise, you'll encounter many problem such as server stuck and reboot unexpectedly. To extend partition in Windows Server 2019/2022, there's a native tool - diskpart. Unlike Disk Management, it runs via command prompt. This article introduces how to extend C drive with diskpart in Windows Server 2019/2022 and the shortages to extend volume in Server 2019/2022 with diskpart command.

How to extend C drive with diskpart in Windows Server 2019/2022

To extend volume with diskpart in Windows Server 2019/2022 and other versions, your disk partition must meet all requirements below:

  1. The partition that you want to extend must be formatted with NTFS file system. (It is not an issue to system partition C.)
  2. There must be another partition (such as D:) contiguous and on the right of C drive.
  3. You must delete the right contiguous partition before expanding C drive. (Don't do this if you installed programs in this volume.)

Steps to extend C drive with diskpart in Windows Server 2019/2022:

  1. Press Windows and R together on your keyboard, type diskpart and press Enter.
  2. Type list volume in diskpart.exe command prompt and press Enter.
  3. Type select volume D and press Enter.
  4. Type delete volume and press Enter.
  5. Type select volume C and press Enter.
  6. Type extend and press Enter.

Immediately, diskpart reports successfully extended the volume. Run list volume again, C drive is extended from 40GB to 110GB.

  • Steps 2 is not required, but it displays the initial partition size and other information, so it's helpful.
  • Before you delete, shrink or extend a partition, you must select it to give focus.
  • If you want to extend part of Unallocated space to C drive, type extend size=XX (XX is an amount without MB) in Step 6.

Diskpart extend

Shortages to extend partition in Server 2019/2022 with diskpart command

1. Unallocated space must be contiguous and on the right side

Type help extend in diskpart command prompt window, you'll see the syntax and limitation of extend command.

Diskpart extend

As you see, the free (Unallocated) space must be on the same disk and immediately follow the volume or partition with focus. If you shrink D to expand C drive with diskpart, you'll receive error "The size of the extend is less than the minimum". In fact, this error message is not accurate, maybe it's easier to understand if change the error message to "There's no contiguous free space".

Diskpart error

After you shrink D drive with Diskpart shrink command, Unallocated space is generated on the right of D drive, so it is non-adjacent to C drive. Shrink command cannot make Unallocated space on the left side. This is the reason why you should delete the right contiguous drive (D:) before extending C drive with diskpart in Windows Server 2019.

2. Only NTFS partitions can be extended

As the screenshot shows above, diskpart extend command only supports NTFS partition, FAT32 and any other types of partitions can't be extended.

3. Lack of significant information

Diskpart command prompt only show you all partitions in a list with little information. If you open Server 2019 Disk Management, you'll see all disks with partition structure and other information such as used and free space of each partition. So you'll see clearly which partitions are on the same disk and how much free space can be shrank from and extended to other volume. However, Disk Management has same restrictions when shrinking and extending partitions.

Better way to extend partition in Windows Server 2019/2022

Comparing with diskpart command and Disk Management, server partition software  such as NIUBI Partition Editor is much more powerful. It is able to shrink partition to make Unallocated space on either left or right, and move/merge Unallocated space to other partition on the same disk.

Download NIUBI Partition Editor and follow the steps to shrink and extend partition in Windows Server 2019/2022:

How to extend system partition:

Video Server 2019

How to extend a data partition:

Video Server 2019

Better than other disk partition software, NIUBI Partition Editor is much safer and faster because of the advanced technologies:

Besides shrinking and extending partitions, this tool helps do many other operations such as move, merge, convert, copy, defrag, hide, wipe, scan bad sectors.