Updated By

Linda

Written By

Tracy King

Last Updated on April 19, 2024

Similar to the Command Prompt, DiskPart is defined as a command interpreter designed to aid in managing a user's computer drives, including hard disks, partitions, volumes, and even virtual disks. - Microsoft (Source: diskpart)

How much do you know about it? Is it a tool for beginners? What can an average Windows user do with it on their computer? Follow this article, and we'll introduce what Diskpart is and what you can do with the tool on your Windows 11/10 or even earlier versions of Windows PC.

Please provide the English content you want translated, and I'll do my best to translate it into Chinese.

In this article, you will learn:

  • What is Diskpart
  • How Diskpart Works
  • What are the Benefits of Using Diskpart? Pros and Cons
  • A List of Common Diskpart Commands
  • How to Enable Diskpart
  • Diskpart: How to Create, Format, and Manage Partitions [Step-by-Step Guide]
  • Download a Free Alternative to Diskpart

Note: These instructions apply to running DiskPart on Windows 11/10/8/7, older versions of Windows, and Windows Server.

What is DiskPart?

DiskPart is a free command-line tool that sends commands to the Windows operating system to perform various disk partition tasks.

DiskPart was introduced in Windows 2000 and later became the successor to fdisk in Windows operating systems. As mentioned, DiskPart is a disk partition utility that helps experienced Windows power users manage their system drives, data disks, external hard drives, USB flash drives, and even SD cards, among others.

How Does DiskPart Work?

But how does DiskPart work? Some of you might be wondering, well, how does DiskPart actually communicate these commands to the operating system to get the computer to do what we want?

Microsoft has accurately described how DiskPart interprets commands to help Windows users manage disks and partitions on their computers.

It is a process.

Step 1. Open DiskPart.

Step 2: List available objects, such as disks, volumes, partitions, or even vdisks.

    • list disk - Displays all disks on the computer.
    • volume - Displays all volumes on the computer.
    • list partition - Displays partitions on the focused disk on the computer.
    • list vdisk - Displays all virtual disks on the computer.

Step Three: Choose the Plane of Focus – you have to decide what to focus on.

It could be a disk, a volume, a partition, or even a virtual disk, such as

    • Select Disk 1
    • List Volumes
    • Select Volume 5

These commands tell the computer to focus on Volume 5, on Disk 1.

Step 4. Explain the command to the operating system with syntax.

How DiskPart Works

Important: These steps will only work if you run the DiskPart command as an administrator.

What are the advantages and disadvantages of using DiskPart?

What are the advantages of using DiskPart? Here's a table outlining the pros and cons of managing disk partitions on a Windows computer with the DiskPart command-line utility:

Advantages of DiskPart Disadvantages of DiskPart
  • Free
  • More disk partition control than Disk Management
  • Supports managing disks with or without Windows
  • Fast execution of commands on the operating system
  • Complicated to run
  • Hard to remember all syntax parameters
  • No undo option
  • No confirmation, easy to make mistakes
  • A wrong command can lead to serious issues

So who is DiskPart designed for? DiskPart is intended for use by Windows professionals, developers, and experienced administrators.

Note: If you're not comfortable with DiskPart or are new to Windows, alternative tools like Disk Management or other partition managers might be easier for you to use.

1. `list disk`: This command is used to list all the disks connected to the system. 2. `select disk X`: Selects disk X for operation. Here, X represents the disk number. 3. `detail disk`: Displays detailed information about the selected disk, such as size and status. 4. `clean`: Clears all partitions and data on the selected disk, preparing it for new formatting or partitioning operations. 5. `create partition primary`: Creates a primary partition on the selected disk. 6. `format fs=NTFS quick`: Quickly formats the selected partition with the NTFS file system. 7. `assign`: Assigns a drive letter to the newly created partition. 8. `extend`: Expands the selected partition to occupy more disk space. 9. `shrink desired=Y`: Shrinks the selected partition, with Y representing the desired amount of free space in MB. 10. `exit`: Exits the DiskPart tool. Use these commands cautiously, as certain actions like `clean` and `format` can permanently delete data.

Here, we've gathered some of the most commonly used DiskPart commands for managing disk partitions, so you can see what this tool is capable of:

Type Command
Manage Partitions
  • Create partition
  • Delete volume
  • Format partition
  • Assign drive letter
  • Extend partition
  • Shrink partition
  • Mark partition as active
Manage Disks
  • Clean or wipe disk
  • Convert disk

So how do you use DiskPart to do these things on your computer? First, you'll need to enable and launch DiskPart. Then, follow along with either of these two guides to successfully manage partitions on your computer.

Guide 1: How to Open or Enable DiskPart?

Here, we will show you the standard way most Windows users access and enable DiskPart on their computers.

Here are the steps:

Step 1: Open DiskPart in Windows 11:

    Press Windows + S, type diskpart, right-click it, and select “Run as administrator.”

Open DiskPart in Windows 11

Step 2: Open DiskPart on Windows 10:

    1. Press the `Windows` key + `R` to open the Run dialog box. 2. Type `cmd` and click "OK" to open the Command Prompt. 3. Type `diskpart` and press Enter to launch DiskPart.

Open DiskPart in Windows 10

Step 3: Open DiskPart in Windows 8:

    1. Click on the Start menu, choose Search, and enter "cmd" in the search box. 2. Right-click on "Command Prompt" and select "Run as administrator." 3. Type **diskpart** in the command prompt and press Enter.

Open DiskPart in Windows 8

4. Launch DiskPart in Windows 7:

    1. Click the "Start" button, then type "cmd". 2. Find "Command Prompt" in the search results, right-click it, and select "Run as administrator". 3. Type **diskpart** in the Command Prompt and press Enter.

Open DiskPart in Windows 7

With DiskPart enabled on your computer, you can easily create, format, or manage disk partitions by following the guides in Section 2 below.

Guide 2: How to Create, Format, and Manage Partitions with DiskPart [Step-by-Step Tutorial]

#1. How to Manage Disk Partitions in Windows Using DiskPart

In this segment, we'll show you how to use the DiskPart command to manage partitions on your computer. Let's get started.

Create the partition in DiskPart:

    • Open DiskPart, and then type the following commands to create the partition: • Press Enter after you type each one:
    1. **list disk** 2. **select disk * (Replace * with the disk number you choose)** 3. **list partition** 4. **create partition primary size=1024** (1024MB equals 1GB) (Alternatively, you can use "create partition extended size =" or "create partition logical ="" for this command) 5. **assign letter=* (Replace * with the desired drive letter)** 6. **exit**

Create partition with Diskpart

Delete a volume using DiskPart:

    1. Open DiskPart, and then type each of the following commands on a new line.
    2. Press Enter after each line.
    • list disk
    • select disk * (replace * with your disk number)
    • list partition
    • select Partition * (replace * with the partition number you want to delete)
    • delete Partition

Use DiskPart to delete partition on USB drive

Format a partition using Disk Management.

    Open DiskPart in Windows, and then enter each of the following commands one at a time, pressing Enter after each one:
    1. diskpart
    2. list disk
    3. select disk # (replace # with the number of your USB drive)
    4. list volume
    5. select volume # (replace # with the volume number of your USB flash drive)
    6. format fs=ntfs quick (you can also replace NTFS with FAT32 or exFAT)
    7. exit

Format hard drive with DiskPart

Use a disk management tool to assign a drive letter:

    • Open DiskPart, and then type each of the following commands on a separate line, pressing Enter after each one:
  1. List Volumes
  2. Select Volume * (replace * with the target volume number)
  3. Assign Letter=* (replace * with the drive letter you want to assign to the target volume)

Use Diskpart to assign a drive letter

Extending a partition using DiskPart:

    Open DiskPart, and then type each of the following commands on a separate line, pressing Enter after each one:
    ```markdown 1. **List Volumes** 2. **Select Volume \*** (replace \* with the volume number you want to expand) 3. **Extend or size=\*** (replace \* with the amount of size you want to add to the target volume) ```

Extend partition with DiskPart

Note that this operation requires unallocated space behind the volume you want to extend. If there isn't any, you'll need to shrink or delete the volume that's adjacent to it first.

Using DiskPart to Shrink a Partition:

    Open DiskPart in Windows, and then enter each of the following commands one at a time, pressing Enter after each:
    • List Volumes
    • Select Volume * (replace * with the volume number you want to shrink)
    • Shrink desired=* (replace * with the size you want to shrink the selected volume to)

Shrink partition with Diskpart

Use DiskPart to mark the partition as active:

    • Open DiskPart, and then type each of the following commands, pressing Enter after each one.
    • List Disks
    • Select Disk *
    • List Partitions
    • Select Partition *
    • Activate

Mark partition as active with DiskPart

#2. How to Manage Disks (HDD/SSD, External) in Windows Using DiskPart

In addition to managing partitions, DiskPart also supports user-managed disk operations in Windows, such as cleaning a drive or converting disk types to MBR or GPT.

You can do this on your computer by following these steps.

Note: Remember to back up all important content on the target disk before performing these tasks.

Use Disk Management to clean up or delete a disk:

    • Open DiskPart, and then type each of the following commands in turn, pressing Enter after each one:
    Here are the sentences translated into American English: 1. **diskpart** 2. **list disk** 3. **select disk * ** 4. **clean** (To clear all data and partitions, use the clean command.) OR **clean all** (To erase the entire disk, use the clean all command.) 5. **exit**

Erase disk with DiskPart clean all command

Use DiskPart to convert a disk to MBR or GPT:

    < li > Open DiskPart, and then enter the following commands one at a time. Press Enter after each one: < /li >
    • diskpart
    • select disk *
    • clean
    • convert mbr (or convert gpt)

Convert GPT to MBR without OS

Download a Free DiskPart Alternative Tool (Suitable for Windows Beginners)

While DiskPart can be a convenient tool for most experienced Windows users to perform certain specific tasks, especially when Windows won't boot, it can be a bit complicated for many Windows novices.

If you're looking for a qualified alternative to DiskPart to meet your disk management needs, then the professional Partition Manager - AOMEI Partition Assistant, could be a worthy option to try.

This tool will help you easily partition and manage disk drives, external HDD/SSD, and even virtual disks with just a few clicks.

See how Partition Master tool can help:

#1. Partition Hard Drive

Step 1. Launch Partition Master and check the available space in the “Partition Management” section.

    • If your hard drive has unallocated space, skip to Step 3 to create a partition. • If your hard drive has no unallocated space, continue to Step 2.

Step 2. Shrink the disk partition to create unallocated space.

Then right-click on the target disk partition with much free space and select “Resize/Move Partition”.

Shrink Volume Step 1

Then, you can shrink the partition by dragging the left or right endpoint inward to free up enough unallocated space. You can see how much you've reduced the size by in the “Size” field. Click “OK.”

Resize/Move Partition Step 2

Click “Perform XX Task,” and then click “Apply” to save all the changes.

Resize/Move Partition Step 3

Back in the Disk Management tool, you should see the unallocated space on the same disk, and you can proceed to create a new partition on your hard drive.

Step 3. Create a new partition on the target drive to allocate the unassigned space.

Right-click the unallocated space, and select “New Simple Volume.”

Create Partition Step 1

Customize the partition size, drive letter, volume label, file system (NTFS, FAT32, EXT2/3/4, exFAT), and so on in the "Advanced Options." Click "OK."

Step 2 of Creating a Partition Step 2 of Creating a Partition

Finally, click “Execute Tasks” and “Apply” to create the partition using the unallocated space on your disk. Repeat these steps to partition the hard drive and create more partitions.

Create Partition Step 3 Create Partition Step 3

#2. Convert disk to MBR/GPT

Step 1. Download and run the Partition Master tool on your computer.

Step 2. Enter the Disk Converter and choose “Convert MBR to GPT”, then click “Next” to continue.

Convert MBR to GPT - 1 convert MBR to GPT - 1

Step 3. Select the MBR disk that you want to convert to GPT and click "Convert" to start the conversion.

Convert MBR to GPT - 2

#3. Migrate the operating system to an HDD/SSD

This is an iframe code for embedding a YouTube video. When placed on a webpage, it will display a video player with the video ID "bQiRrQsFauI".

In addition to the above features, you can also use this software to:

The bottom line?

On this page, we discuss what DiskPart is, how it works, and the most common commands.

We also showed you how to enable DiskPart and run different commands on it to perform various tasks in Windows 11/10/8/7. Apart from DiskPart, we also introduced an alternative to DiskPart for Windows beginners – the Partition Master tool.

Compared with DiskPart, a disk partition software tool is more qualified and performs better in managing disk partitions. It's simpler yet more comprehensive, helping Windows users make the most of their disk partitions and storage devices. If you need an efficient and user-friendly hard drive partitioning and disk management tool, don't miss out on it.