This article introduces how to extend partition with diskpart on Windows Server 2003 r2, and the limitations to extend volume with diskpart command.
In Windows Server 2003, the most common issue is C drive running out of space. But in most cases, there is plenty of free space in other volumes such as D. So many people ask whether it is possible to extend C drive with the free space in partition D. If yes, the low disk space issue can be solved without starting over. The answer is definitely yes. To extend partition on Windows Server 2003, you may use either Windows built-in Diskpart command tool or 3rd-party server partition software such as NIUBI Partition Editor. Because of many limitations, diskpart is not the best tool, it only works under very restricted condition.
About diskpart extend command
DiskPart is a text-mode command interpreter included from Windows XP. This tool enables you to manage objects (disks, partitions, or volumes) by using scripts or direct input at a command prompt. Diskpart differs from many command-line utilities because it does not operate in a single-line mode. Instead, after you start the utility, the commands are read from standard input/output (I/O). You can direct these commands to any disk, partition, or volume.Precondition to use diskpart extend command:
- This volume must be formatted with NTFS file system.
- For Basic volumes, the Unallocated space for the extension must be the next contiguous space on the same disk.
- You cannot extend the partition if the system paging file is located.
How to extend data volume with diskpart command
If you want to expand a data partition such as D, there must be another volume such as E on the right side of it. In addition, you must delete drive E. To better understand how it works, I suggest you open Disk Management, where you'll see all disk partition with structure and detailed information. In my test server, there are drive C, D and E on disk 0.
Steps to extend partition D with diskpart on Windows Server 2003:
- Press Windows and R together on keyboard, type diskpart and press Enter, then diskpart command prompt will be opened.
- Type list volume and press Enter in the command prompt window, then you'll see all partitions in a list.
- Type select volume E and press Enter. E is drive letter or number of the volume that you want to delete.
- Type delete volume and press Enter. (Caution: remember to transfer valuable files before this step).
- Type select volume D and press Enter.
- Type extend and press Enter. If you want to specify an amount, type extend size= (in MB).
As I said above, only when there's another partition (such as E) on the right and you can delete this partition, you can extend D: drive with diskpart. If you want to extend the last data partition, diskpart cannot help you.
Another key limitation of diskpart is that it cannot extend system partition. When I extend C drive with diskpart on Windows Server 2003, I received the error: The volume you have selected may not be extended. Please select another volume and try again.
Better way to extend volume on Windows Server 2003
If you can extend partition with third party software, the task becomes much easier, you just need to drag and drop on the disk map to shrink and extend partition.
Download NIUBI Partition Editor and follow the steps in the video to extend partition.
Besides shrinking and extending partition, NIUBI Partition Editor helps do many other operations such as merge, move, convert, defrag, wipe, hide, scan bad sectors. Better than other software, it has advanced Virtual Mode, 1-Second Rollback and Cancel-at-well technologies to protect system and data. In addition, it is much faster because of the unique file-moving algorithm.