How to extend partition using diskpart command

Diskpart command: This is a Windows built in partition resize trick. You can read the diskpart command article that there are many tricks diskpart command could perform like converting basic disk to dynamic disk, converting mbr disk to gpt disk, creating/deleting a partition, extending partition etc.

Diskpart command may fail

Diskpart command is not able to extend partition if it is FAT, boot partition, and no existing unallocated space. We recommend some freeware to you.

Here we are going to make an example to extend the size of existing partition with diskpart command since it is really helpful and can save you a lot of bucks. However you should keep the following notes before performing partition resize.

  • Firstly, there must be unallocated space right besides the partition which you want to extend.
  • Secondly, it must be NTFS file system.
  • Thirdly, it must be non boot partition. (To resize system partition be free to read the following tutorial: How to extend system partition)
  • Fourthly, if it was the dynamic disk you want to extend, it should be only simple volume or spanned volume.

You can perform the diskpart to extend partition on both Windows OS for home and Server.

Step by Step Tutorial to extend partition using diskpart command

We tested Windows XP Operating System with H drive 40GB and unallocated 40GB on its right side of the partition on disk 1. It is not system partition. Our commission is to extend the H drive with diskpart command to claim the unallocated space without data loss. The steps are as the following:

  • Start—Run

start to run diskpart

  • Type “diskpart” to enter the diskpart command.

type diskpart

  • Let’s check the disk partition status in disk management. As the picture shows that on disk 1 there is around 40GB just on the right side of volume H. Now we are going to extend it via diskpart command.

partition size before diskpart

When the diskpart.ext is open, firstly type”list volume” to see which volume you should choose to extend H drive. As the list volume says it is volume 5 that matches drive H. Next to type”select volume 5” and the command will tell you it is selected. Once the drive is selected, then you can type “extend” to send out the order for extending the selected partition.

extend volume H with diskpart

As you can see there is also unallocated space right next to the boot drive. To make you believe that it is not capable to extend the boot partition, we are going to try to extend the boot drive via diskpart command. Be free to see the steps in the picture below.

extend boot drive with diskpart

As you could see right after successfully extending the non boot drive H, we tried to extend the boot drive. However the test shows us diskpart is not able to extend the system partition.

Besides system partition, diskpart also can not do the following operations if there is no free space on the same disk or it is RAID5, Stripped volume, and mirrored volume. If you are under the non diskpart capability, we have solutions for you:

Tutorial : Resize partition by freeware

 

Related products

Related articles