The diskpart utility (available in Windows 2000, XP, Vista, 7, 8, 8.1 and 10) can be used to create or delete partitions on your PC.
Advertisements
The utility allows you to:
- Partition
- Remove partitions
- Remove formatting
- Assign and remove drive letters and mount points
- Convert disks from basic to dynamic
- Create and extend volumes
Most commands that you can perform in Disk Management are available with diskpart. Because it’s a command line utility, you need to open Command Prompt and type diskpart
.
On Windows Vista, 7, 8 and 10 systems, you can type diskpart
at Run, click OK or press Enter and Command Prompt will automatically open with diskpart loaded.
When the utility is loaded, you will notice the version installed on your computer:
Microsoft DiskPart version 10.0.19041.1
Copyright (C) Microsoft Corporation. On Computer: YOUR_COMPUTER
Advertisements
Commands and parameters
The diskpart tool has the following commands and parameters available:
select
can set the focus on a specific targetselect disk
– use this command to set the focus on a specific diskselect partition
– use the select partition command to set the focus on a specific partitionselect volume
– use this command to set the focus on a specific volumedetail disk
will deliver information about the current diskdetail partition
will deliver information about the current partitiondetail volume
will deliver information about the current volumelist disk
– use list disk to get summary information about the available disks on your computerlist partition
– use this command to get information about each partition available on a specific disklist volume
– use list volume to get information about each volume available on the computeractive
– use the active command to set the focus on the current partition to be activeassign
– use assign to assign a letter or a mount point to the current active partitioncreate partition primary size=SIZE_IN_MB
– use this command to create a new primary partition. TheSIZE_IN_MB
is the size of the partition you want to create, in MB.create partition extended size=SIZE_IN_MB
– use this command to create a new extended partition. TheSIZE_IN_MB
is the size of the partition you want to create, in MB.create partition logical size=SIZE_IN_MB
– use this command to create a new logical partition. TheSIZE_IN_MB
is the size of the partition you want to create, in MB.delete partition
will delete the current active partitionextend
will extend the current volumeremove
will remove a letter or a mount point from the current active partitionactive
– use this to set the current volume as activeadd disk
– use this command to add a mirror to the current active volumebreak disk
– use this command to break the mirror addedcreate volume stripe
– use this to create a stripe set volume on a specified diskcreate volume raid
– use this command to create a Raid-5 volume on a specified diskdelete disk
– use this command to delete a missing dynamic diskdelete partition
– use this command to delete the current active partitionextend disk
– use this command to extend the current volumeimport
can be used to import disks from a foreigh disk grouponline
can be used to bring a disk or a volume online that was previously offlineremove
can be used to remove a letter or a mount point from the current active volumeretain
is used to prepare a volume to be used as a boot or system volumeconvert mbr
will set the partition style of the current disk to MBRconvert gpt
will set the partition style to GPTconvert dynamic
will change a basic disk into a dynamic oneconvert basic
will convert a dynamic disk (empty disk) into a basic diskexit
will exit the utilityclean
will remove the partition or volume formatting from the current diskrescan
can rescann the I/O buses and can discover new disks added to the computerhelp
will display the list of all available commands
Advertisements