Using DiskPart.exe As Disk Management Alternative in Windows Vista, 2000, 2003 and XP
Disk Management under Computer Management in Administrator Tools is a GUI (Graphical User Interface) based disk partitioning utility that allows Windows 2000, Windows 2003 Windows XP and Windows Vista users to set active partition, change drive letter and paths, extend volume, shrink volume, delete volume, and format the drives. However, Disk Management extension in Microsoft Management Console (MMC) does not always work properly. Problems faced by users including random grayed out or disabled of Extend Volume and Shrink Volume options, as Disk Management snap-in prohibits you from inadvertently performing actions that may result in data loss.
If you’re getting frustrated with Disk Management, try out DiskPart utility, a text-mode command line interpreter based on scripts to manage, create, delete and resize objects such as disks, partitions and volumes in Windows Vista, XP, 2003 and 2000. (Later 3 operating systems do not install with DiskPart.exe by default, so users need to download and install DiskPart manually). As DiskPart is a command line utility, users will have to use various commands to instruct DiskPart to perform a disk related task. Users can use HELP command to list out all available commands for DiskPart. For various options for a command, append the command name to HELP, i.e. HELP [command], or simply type the command name itself only. For detailed explanation and guide to use the command, append the full command syntax to the HELP, i.e. HELP [full command syntax with option].
For easy reference and getting start guide, here’s some simple operation that you can perform on your hard disk and partition or volume with DiskPart. But before you continue, make sure that you backup important files and programs in case of any failure.
- Start and Run DiskPart
To run DiskPart, type DiskPart.exe in Start Search in Windows Vista, or in Run command text box in Windows 2000, 2003 and XP finished off by Enter key. A command prompt window with DISKPART shell is loaded.
- List all disks on system in DiskPart
To all your available installed hard disks on the system, simply type list disk, and hit Enter.
- Select and set target disk to use in Disk Part
To set and select a disk which you want to work with in DiskPart, use the following command syntax:
select disk <disk number (###)>
The disk number is retrieved from “list disk” command.
- Create a partition with DiskPart
If the hard disk is empty without any partition or still has unallocated space, a partition can be created on it with the following command syntax:
create partition <partition type> [size=<n>] [offset=<n>] [id={<byte> | <guid>}] [align=<n>] [noerr]
The partition types that are supported are primary partition (the only bootable type, but limited to four per hard disk), extended partition (also limited to four per hard disk to supplement those need more than 4 primary partitions), logical drive (to define within extended partition to allow many volumes to be created), EFI system partition and MSR (Microsoft Reserved partition). Note that not all options are available for all partition type.
Example: create partition primary size=1000 (Create a primary partition with the size of 10GB.)
- Create a volume in DiskPart
DiskPart allows user to create RAID (RAID-5) volume using three or more specified dynamic disks, simple volume or striped volume using two or more specified dynamic disks. The syntax for the command is:
create volume <volume type> [size=<n>] disk=<n>,<N>,<n>[,<n>[,...]] [align=<n>] [noerr]
Example: create volume raid size=1000 disk=1,2,3 (Create a RAID-5 array volume with 1 GB (1000MB) using disk 1, 2 and 3.)
- List all volumes in DiskPart
Use the following command to list all volumes in order to check which number is associated with the volume we want to work with:
list volume
- Select a volume to manage in DiskPart
Use the following command to select a volume in order to manage (shrink, extend, delete format) the volume:
select volume <number>
The number for the volume is retrieved from “list volume” command.
- List all partitions in DiskPart
Use the following command to list all partitions in order to check which number is associated with the partition we want to work with:
list partition
- Select a partition to manage in DiskPart
Use the following command to select a volume in order to manage (shrink, extend, delete format) the partition:
select partiton <number>
The number for the partiton is retrieved from “list partition” command.
- Shrink a volume (reduce size of partition) in DiskPart
To reduce the size of the volume with focus by the specified amount and makes free disk space available from unused space at the end of the volume, use following command syntax:
shrink [desired=<n>] [minimum=<N>] [nowait] [noerr]
Example: shrink desired=500 minimum=250 (Shrink volume by 500 MB, with 250 MB as minimum size to be freed if not possible.)
To check and determine how much is the maximum number of bytes that a volume can be reduced by (the free space that is available on the volume), use following command:
shrink querymax [noerr]
- Extends the volume or partition (increase size) in DiskPart
To extend the volume or partition with focus and its file system into free (unallocated) space which can be used to store data on a disk, use following command syntax:
extend [size=<n>] [disk=<n>] [noerr]
The above command works on when both volume or partition is selected.
Example: extend size=500 (Increase the size of current partition or volume selected by 500MB.)
- Delete partition or volume with DiskPart
Note that system, boot or any volume/partition that contains the active paging file or crash dump (memory dump) cannot be deleted. And users must select a partition or volume before start deletion operation. Dynamic disks should be removed by using “delete volume” command.
delete partition
delete volume
- Format a volume or partition in DiskPart
Simply select a partition or volume, and then type Format.
Related posts:
- DiskPart.exe Free for Windows XP, 2003 and 2000 Direct Download Link
- View and Retrieve or Change Windows (XP, Vista, 2003, 2000 and more) and Office (XP, 2003, 92) Product Key or CD Key
- Change or Resize Partition (NTFS, FAT or FAT32) Size in Windows Vista
- Free Ramdisk for Windows Vista, XP, 2000 and 2003 Server
- Fast Shutdown Faster Windows 2000, Windows XP, Windows 2003 and Windows Vista





forum profile service become very spread nowadays! That is a great way to tell everyone about your ideas!
Considerably, the report is really the freshest on this notable subject. I concur using your conclusions and may thirstily appear forward for your forthcoming updates.
well, i'm sorry.
it seems that i put the wrong name of partition tool.
it's easus partition master.
Hi all,
in my opinion, a professional parition tool is a better choice for resizing or enlarging paritions.
One doesn't have to learn the complicated DOS command, because most of the partition tools are wizard, easy to undertand and easy to use.
here's a recommended software: easeus todo backup
In reply to the previous comment to show the unallocated disk space wouldn't you just type in LIST DISK, as in the example further up this page? It then shows the total size of the drive and the free (unallocated) space available.
Anyway, I just wanted to say thanks for this DISKPART link. For some reason my Vista 64 returns an error whenever I try to go into the Device Manager. I am adding a 750GB drive to my notebook. I needed to partition and format it and I was getting rather frustrated.
Then I learned of DISKPART and what all it can do. This reminds me of my old DOS days but it is getting the job done. A little over an hour to go as DISKPART is formatting my D: drive in the background.
Unless I'm missing something, a weakness of DISKPART is that there is no way to list unallocated space on a drive.
I'm currently attempting to set up several identical Windows XP workstations completely from the command prompt, without using the GUI tools (for reasons of documentation and automation). In the "Computer Manager -> Disk Management" there is 83GB Unallocated, which I want to format. However I cannot detect this unallocated space using DISKPART. How can that be accomplished from the command prompt?
Howdy,
Were you able to figure out how to fix this problem? If so, would you email me? Cheers!
Caleb
Many thanks for the instructions, I successfully formatted a disk using diskpart, much appreciate it.
I just got a new laptop (hp touchsmart tm2) with windows 7, the 320 gb hd is already partitioned in 4 primary, system (active), c, d (recovery) and hp tools. I want to make the c drive an extended partition with two logical drives, one for os/apps and the other for documents. Is there a way to convert the c from primary to extended and then create the 2 logical partitions? If so, how?
disk C : doesnt allow shrinking more than 400mb why ? although there are 120Gb free space
For all that the only thing that want is to DELETE the unallocated space and merge it to the active partition so they get the storage of the unallocated particion back: With Computer management, just extend your original partition! I can't believe i spend an hour on this. is very easy. hope it could help. Thanks.
thank you for this topic
Exactly the tool I needed! I wanted to create an Extended partition with twelve Logical partitions – and no Primary partitions. Vista's Disk Manager would automatically make the first three partitions Primaries and then put the rest as Logicals in an Extended partition. DiskPart gave me a finer-grained control over the creation and management of partitions.
…of course, any third party tool would have done the same for me, I just didn't want to shell out $50 today. I will eventually because I'm going to want to move and resize on the fly, not just shrink and grow. (Sad how MS always half-asses the job when they copy a successful program, isn't it?)
Shrink is not available as an option on any OS lower than Vista. Not on Diskpart or Diskmgmt. Vista's disk utilities does the job, which is why Norton stopped Vista PartitionMagic support.
Right click >> My Computer >> Manage >> Disk Management. Then from there you can right click on different volumes and hit shrink and then type in how much to shrink by then right click new volume and use the unallocated space. Pretty easier than command line.
there isn’t shrink on my diskpart.
win xp/win 2003
if i have 2 partitions.
C:6503M
D:62G
I want to extent c: 10 G.
how?
there isn't shrink on my diskpart.
win xp/win 2003
I HAVE 150 GB HARD DICK IN INSPIRON 1525 WITH TWO PARTIONS ONLY. RECOVERY DICK IS D AND OD DRIVE IS C. I WANT TO MAKE MORE PARTITIONS , IT IS POSSIBLE.
To extend a volume, the unallocated space must be contiguous to the partition you are extending.
Your config
C: 40gb
D: 162gb
E: 11gb (recovery)
Unallocated is 20gb
If the 20gb is physically between D: and E: on the drive, you could only extend D: or E:, but not C:.
[...] Does Not Run on the Shared Cluster Disk Dynamic vs. Basic Storage in Windows 2000 Using DiskPart.exe As Disk Management Alternative in Windows Vista, 2000, 2003 and XP Shrinking Hard Disk With Free Tools – VMWare Disk Manager And DiskPart TechNet: [...]
[...] any indication of an external drive The full command set for the diskpart Command Line utility is Here The specific instructions for deleting an EISA partition is Here Deleting the EISA partition will [...]
I have 20gb unallocated. I get error message there isnt enought free space on specified disk(s) to extend the volume.
I have partitions as this:
C: 40gb
D: 162gb
E: 11gb (recovery)
Unallocated is 20gb
Using DiskPat I select only disk in system (laptop) disk 0. I select partition (partion 2 is the C: drive partition).
Type in extend and get the error message.
What am I missing?
Dit is de grootste onzin die ik ooit gelezen heb!!!
You can't shrink a partition with this tool under Windows 2000, this seems to be a Vista-only feature.
Hi,
I have 180GB with windows vista installed, if I try to create or shrink partition for linux like:
keep 80 GB for Windows & rest for Linux.
I use the "create partition" but when i give the size=100000 or 80000 this says size is too large !
Anyhelp please
regards,
—saleem