How to use Diskpart.exe to extend a data volume in Windows
How to use Diskpart.exe to extend a data volume in Windows Server 2003, in Windows XP, and in Windows 2000
Introduction
This article describes how to use the Diskpart.exe command-line utility to extend a data volume into unallocated space. You can use the Diskpart.exe utility to manage disks, partitions, and volumes from a command-line interface. You can use Diskpart.exe on both Basic disks and Dynamic disks. If an NTFS volume resides on a hardware RAID 5 container that has the capability of adding space to the container, you can extend the NTFS Volume with Diskpart.exe while the disk remains a Basic disk.
Use the extend command to incorporate unallocated space into an existing volume while preserving the data.
Requirements for the extend command
The following are the requirements for the extend command:
- The volume must be formatted with the NTFS file system.
- For Basic volumes, the unallocated space for the extension must be the next contiguous space on the same disk.
- For Dynamic Volumes, the unallocated space can be any empty space on any Dynamic disk on the system.
- Only the extension of data volumes is supported. System or boot volumes may be blocked from being extended, and you may receive the following error:
Quote:
Diskpart failed to extend the volume. Please make sure the volume is valid for extending
- You cannot extend the partition if the system page file is located on the partition. Move the page file to a partition that you do not wish to extend.
Re: How to use Diskpart.exe to extend a data volume in Windows
I use diskpart from a BartPE boot CD to extend boot partitions, and if it works, it works quite well. After extending the boot partition, I run defrag and chkdsk to ensure that everything is uptodate. From that point on, I have no problems at all with applications.
However, when I do get the error that the partition cannot be extended, I don't seem to be able to figure out why. I think it is a BIOS setting that defines the type of drive. For example, my BartPE CD cannot even see the hard drive on most Dell PCs .. such as a Dell Dimension 9100. I discovered a BIOS setting on those machines that let BartPE see the SATA drive, but then I cannot extend it, and get the error. I wonder why?
I know I could buy a product like Acronis, but I consider that to be a rip-off to do something as simple as extend a partition. I have over 200 PCs in my labs that need extending, and at $50 each for Acronis, I simply will not do that.
This is a nice and very useful hack. I can do an entire lab in a couple of hours. The problem deserves a solution.