How to Extend Disk Partition Using Diskpart

How to Extend Server 2003 Partition with DiskPart Command 

What is Diskpart Command

Diskpart is a command-line hard disk partitioning utility included in versions of the Windows NT OS from Windows 2000 onwards, replacing fdisk which was used in MS-DOS based operating systems. The diskpart command supports the use of scripts to automate its usage.
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.

Launching Diskpart command

Go to a command prompt window and type diskpart and press "Enter" 

How to extend Server 2003 partition with Diskpart Command

Before running diskpart to extend a volume, you'd better open Disk Management and check the disk partition layout, as you cannot make clear the configuration in diskpart command prompt.
On my server, there is drive C: E: F: and a free unallocated space. Take note of the volumes and there size.

 

Steps to extend Windows 2003 partition with diskpart:

Step 1: Follow the steps above to open diskpart command prompt window, and then type "list volume", you'll see all the partitions but no Unallocated space.

Step 2: Type "select volume X" to give focus to the partition you want to extend. (X is the volume number)
Step 3: Type "extend" to proceed extending.

Now drive F: was extened. Try to extend drive E: with diskpart.

See the error message, you cannot extend drive E: why?
You cannot extend a partition if there is no next continuous Unallocated space.
OK, select drive F: and redo the steps.

Yes, drive E: was extended. How about C: drive, as it is system boot partition? The same test, delete drive E: and reserve Unallocated space behind C:.
Diskpart failed to extend system C: drive even though there is continuous free unallocated space.
In conclusion, you cannot extend a data partition if there is no next continuous free space. You cannot extend system partition with diskpart command.

A part from the disadvantages mentioned above, there are many limitations extending a volume with diskpart command line:
  • The volume must be formatted with the NTFS file system. (Only NTFS partition can be extended)
  • Only the extension of Data volumes is supported.
  • You cannot extend the partition if the system page file is located on.
  • Compared to graphical user interface tool, command line is hard to use for many users.
  • Operations cannot be undone, an incorrect operation leads to data loss.
So, Diskpart might not be the right tool for you, in this case you can use a third party server partitioning tool.

No comments:

Post a Comment