Diskpart is a Windows built-in disk partitioning utility that helps Windows administrators partition hard drives, create, delete, format, wipe, and even convert disks for free using respective syntax command lines. Follow this page, and you'll know all the information on Diskpart commands
Most Windows beginners might know that the Diskpart is a free disk utility that helps take control of some disk partitions on the computer. However, what command should you use to process specific orders to the Operating Systems, and do you know how to protect your data from being removed from these Diskpart commands? Following this guide, you'll further learn what exactly Diskpart does, what Diskpart commands you can apply to manage disk drives, and you can even follow some tips to fix Diskpart errors like a professional.
Let's see how to use Diskpart on your computer now.
In this article, you'll learn:
From Wikipedia, Diskpart is a newer command-line disk partitioning tool to replace the older fdisk, and it supports all Windows users to run Diskpart syntax parameters to manage disk partitions on desktop computers, laptops, and even external storage devices.
Here is a list of basic information about Diskpart that you may feel like knowing:
Do you know how the operating system processes the command parameters and applies the executions on the target hard drive partitions? Here is the working procedure of Diskpart, and you may follow it to learn how this utility works:
Step 1. Open the Diskpart.
Step 2. Input available object, such as a disk, partition, or even a virtual disk, with commands:
Step 3. Focus on an object - the disk, volume, or partition:
Step 4. Process operation orders to the OS via specific Diskpart syntax parameters.
"The diskpart command interpreter helps you manage your computer's drives (disks, partitions, volumes, or virtual hard disks)." - by Microsoft.
"The diskpart is a utility used for partitioning hard drives but can also format removable media such as flash drives." - by Wikipedia.
Briefly, Diskpart could be applied to execute the following tasks:
So why is Diskpart so popular? Here is a list of Pros and Cons of Diskpart, and you may follow to learn the benefits of this tool:
Pros of Diskpart:
Cons of Diskpart:
So which command is for formatting a volume, and which is for creating a new partition? First, check the listed Diskpart commands here in the below table, and you'll understand what each Diskpart command does:
Diskpart Commands | Function |
---|---|
| Get information about all disks on your computer. |
| Get information about all partitions/volumes on a disk. |
| Focus on a specific disk, partition, or volume. (* means the number of selected disks or partitions.) |
| Display detailed information about the selected disk, partition, or volume. |
| Create a new primary or logical partition. (* means the volume size that you want to create in MB.) |
| Delete a specific disk, partition, or volume. (* means the disk or partition number.) |
| Convert a disk between basic and dynamic, MBR and GPT. |
| Assign a drive letter to a new volume. |
| Delete all partitions on a disk and remove all existing data. Or completely erase a hard drive or SSD, and wipe out all existing data. |
| Format a partition or a volume, change its file system to NTFS, FAT32, exFAT, etc. |
| Set a selected partition active. |
Note that we only listed some common Diskpart commands here. If you need to learn more advanced Diskpart commands, you can follow this link provided by Microsoft for help: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/diskpart.
So how do I access the Diskpart utility on a Windows computer? Here we list 4 paths that you can follow the respective one to open Diskpart based on your operating system:
After you open the Diskpart, it's your turn to follow the full guide below to manage your hard disk partitions or external storage devices with respective Diskpart commands as introduced above.
Here in this part, you'll get a respective guide as listed below to apply the Diskpart command to manage disk partitions for different purposes:
This applies to creating a new simple volume, primary partition, or logical partition.
Step 1. Open Diskpart.
Step 2. Type list disk and hit Enter.
Step 3. Type select disk * and hit Enter. (Replace * with the number of the target disk you want to create a partition on it.)
Step 4. Type the respective command to create a partition on the selected disk:
LEARN MORE
Aside from creating a primary or logical partition, you can also use Diskpart commands to create boot volume, dynamic volume, RAID-5, mirrored volume, and more. Follow this link and learn How to Create Volume by Using Diskpart.
Applies to: Format hard drive/SSD, quick format USB, or external disks using Diskpart/CMD.
Step 1. Open Diskpart.
Skip Step 2 if you need to format an internal hard drive.
Step 2. Connect a removable external hard disk or USB to your PC.
Step 3. Type the following command lines one by one and hit Enter each time:
Note that you need to repeat the process if you need to format multiple partitions on your computer.
Step 4. Type exit and close Diskpart when the process completes.
Applies to: Delete volumes, remove recovery partition, clean disk, or erase HDD/SSD using Diskpart.
To Delete Partitions from Hard Drive:
Note that if you need to delete a recovery partition, replace delete partition with delete partition override.
Bonus Tip:
If you want to delete all existing partitions on a disk quickly, you can follow this link for help: How to Use Diskpart to Delete All Partitions.
To Cleanup or Erase Disk:
If you are about to get rid of everything from your hard drive or SSD, Diskpart Clean command is exactly what you need. Here is how to do so:
If you need to continue using the disk for other purposes, you can revert to the first guide to Create Partition with Diskpart on the disk.
Applies to: Change disk type, convert MBR to GPT or GPT to MBR using Diskpart.
Bonus Tip:
Note that Diskpart will remove all existing partitions on a disk before converting its disk type to another one. For a seamless solution, you may try a third-party disk conversion tool. Follow this link, and you can successfully Convert GPT Disk to MBR without losing data.
Alongside creating, formatting, cleaning, or converting disk partitions, you can also apply Diskpart commands to execute other partitioning tasks, such as extending, shrinking, and active partitions.
To Extend Partition with Diskpart:
To Shrink Partition with Diskpart:
To Mark Partition as Active with Diskpart:
Aside from this, you can also use Diskpart command lines to merge partitions, hide partitions, and even show hidden partitions.
Though Diskpart is free for all Windows users to apply and resolve some daily disk management issues, however, it's still a bit complex for some Windows users who have no computing skills. EaseUS Partition Master Free, with its reliable disk partition features, is entirely qualified to replace Diskpart and assist all of you in fulfilling all types of disk partition requests with simple clicks.
On this page, we thoroughly discussed that is Diskpart, what Diskpat can do for you, the benefits of using Diskpart, and displayed some common Diskpart commands.
Following this page, you will learn how to master these Diskpart commands to manage your hard drive partitions and external storage devices.
Also, you can apply some troubleshooting fixes to eliminate normal device errors like Read-only, or the device becomes RAW and makes your device function normally again.
For beginners, if you are reluctant to use Diskpart as it's complex to remember all the commands, your best shot is to turn to EaseUS Partition Master Free for help. It will always save your device from deathly errors and bring life back to your disk partitions.
Related Articles
What Is SSD and How Do I Set Up and Make Use of SSD [Beginners' Guide]
Disk Partition: How to Partition A Hard Drive You Must Know in 2023
Computer Won't Boot? Causes & Fixes for PC Not Turning On
Ultimate Guide: What Is GPT Disk, How to Use GPT in Windows