What Is DiskPart and How to Use It? (Ultimate Guide & Tips) [MiniTool Wiki]

  • Linkedin
  • Reddit

Quick Navigation :

What Is DiskPart Exactly?

What is diskpart? DiskPart is a disk partitioning utility which uses command lines to perform operations. As the successor to fdisk, it can be applied to Windows and Windows Server including Windows XP and Windows Server 2003 and later versions such as Windows 7/8/10, Windows Server 2008/2008 R2/2012/2012 R2/2016.

DiskPart utility can be used to manage partitions of hard disks, USB flash drives, etc., including creating partitions, deleting partitions, merging (expanding) partitions, and so on.

Essentially DiskPart command line is equivalent to the Disk Management tool embedded in Windows, only it is more powerful because it can implement some functions that cannot be realized by Disk Management, such as setting mirrored volumes, and it can take effect after performing partition operations without restarting the computer. It just runs under the command prompt interface.

How to Use DiskPart

If you are experiencing an unreasonable distribution of hard disk partitions that requires repartitioning, you want to format/create/resize a partition, or you want to partition your hard disk when Windows fails to boot... that’s when you can take advantage of DiskPart utility. As with any operation involving important data, it is worth backing up in advance.

Before starting the DiskPart process, you need to know that unlike Disk Management, when a dangerous operation (for example, when this operation may result in loss of data) is to be performed, it will prompt you to determine if you are sure you want to perform this operation, which can reduce the risk of dangerous operations.

It is recommended that you use the DiskPart command line with caution because DiskPart utility supports explicit control of partitions and volumes: once the command is executed, there is no regrettable way to go.

You need to run DiskPart in administrator mode. To use DiskPart, the command window should be opened. List two ways here: type diskpart in the Search box, and then right-click DiskPart in the search results to select Run as administrator; another way is to press Windows key and R at the same time, and then type diskpart in the Run box.

The general flow of performing an operation on a particular disk/partition/volume is this: you must first list objects, and then select a specific object to give it focus. When an object has been focused on, any following DiskPart commands that you type will act on that object.

You can list the available objects by using the list disk, list volume, list partition commands. The list diskand list volume commands will display all disks and volumes on the computer. However, the list partitioncommand only displays partitions on the disk that has been selected first.

Then you can select the target by using select command such as select volume Number (the Numbershould be the specific number of the selected volume). When you select an object, the focus remains on that object until you select a different new object. While some commands can automatically change the focus, such as when a new partition is created, the focus is automatically switched to the new partition.

Remember to hit Enter after typing every single command line. There will be some common commands below:

COMMAND FUNCTION
list disk/volume get summary information about the available disks/volumes on your computer
list partition get information about each partition available on a specific disk
select disk/partition/volume set the focus on a specific disk/partition/volume
detail disk/partition/volume deliver detailed information about the current selected disk/partition/volume
create partition primary/logical size=# create a new primary/logical partition. The # is the size of the partition you want to create, in MB.
delete disk/partition/volume delete the target disk/partition/volume
create volume stripe create a stripe volume on specified disks
convert basic/dynamic/mbr/gpt convert a disk from dynamic to basic/from basic to dynamic/from GPT to MBR/ from MBR to GPT
assign assign a drive letter or mount point to the selected volume
clean Clear the configuration information, or all information off the disk
format format the volume or partition.
active mark the selected partition as active

Now we give you an example of using the diskpart command line to create a 55000 MB primary partition.

Step 1: call out the Run box and type diskpart in it.

Step 2: type list disk and hit Enter (choose an available disk to create the new partition).

Step 3: type select disk 2 (any target disk that is allowed to create the partition) and hit Enter.

Step 4: type create partition primary size = 55000 (the size you want) and hit Enter.

Step5: type exit and hit Enter.

create a primary partition with diskpart

Bottom Line

After reading this post, do you know what DiskPart is? Yes, it is a great command line utility to manage disks. You know you can format, resize and convert your disks/partitions/volumes by using this powerful tool. Enjoy!

  • Linkedin
  • Reddit