What Is Diskpart? Ultimate Guide to Use Diskpart Commands on Windows - Qiling  

What Is Diskpart? How to Master and Use Diskpart Commands on Windows [Full Guide]


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:

  • What Is Diskpart
  • Learn About Most Common Diskpart Commands 
  • How to Open Diskpart Utility in Windows
  • How to Use Diskpart to Manage Hard Drive Partitions
  • How to Use Diskpart to Fix Device Errors
  • Troubleshooting Diskpart Errors On Windows

What Is Diskpart

Diskpart is a command-line disk partitioning utility included in Windows 2000 and later Microsoft operating systems, replacing its predecessor, fdisk.
                                                                                                  - by Wikipedia

Definition of Diskpart

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:

How Does Diskpart Work? 

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.

Diskpart working process

What Does Diskpart Do - Benefits of DiskPart [Pros & Cons]

"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:

01

Pros of Diskpart:

  • 1. Free
  • 2. Cross-platform: Windows & ReactOS
  • 3. Applicable to all levels of users.
  • 4. Support more operational features than Disk Management.
  • 5. Rapid to process orders to the OS.
02

Cons of Diskpart:

  • 1. Complex
  • 2. No confirm option, and no undo option.
  • 3. Hard to remember all syntax parameters.
  • 4. Easy to type false commands and cause serious problems.
 

Learn About Most Common Diskpart Commands  

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 actually does:

Diskpart Commands Function
  • list disk
Get information about all disks on your computer.
  • list partition/volume
Get information about all partitions/volumes on a disk.
  • select disk/partition/volume *
Focus on a specific disk, partition, or volume. (* means the number of selected disks or partitions.)
  • detail disk/partition/volume
Display detailed information about the selected disk, partition, or volume.
  • create partition primary/logical size=*
Create a new primary or logical partition. (* means the volume size that you want to create in MB.)
  • delete disk/partition/volume *
Delete a specific disk, partition, or volume. (* means the disk or partition number.)
  • convert basic/dynamic/mbr/gpt
Convert a disk between basic and dynamic, MBR and GPT.
  • assign
Assign a drive letter to a new volume.
  • clean/clean all
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
Format a partition or a volume, change its file system to NTFS, FAT32, exFAT, etc.
  • active
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.

How to Open Diskpart Utility in Windows

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:

1. Open Diskpart in Windows 11:

Open Diskpart in Windows 11

2. Open Diskpart in Windows 10:

Open Diskpart in Windows 10

3. Open Diskpart in Windows 8:

Open Diskpart in Windows 8

4. Open Diskpart in Windows 7:

Open Diskpart in Windows 7

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. 

How to Use Diskpart to Manage Hard Drive Partitions

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:

Notice:
Note that formatting, deleting, cleaning, erasing, or converting disks with Diskpart command lines may all cause serious data loss issues. So please make sure you create a backup of all existing essentials before trying the next tutorials. 

#1. Use Diskpart to Create Partition (Primary or Logical)

Applies to: create 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:

Format partition

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.

#2. Use Diskpart to Format or Quick Format Hard Drive/SSD or USB

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. 

Formt partitoin using Diskpart

BONUS TIP:

How to Clean and Format a Disk Using Diskpart

Aside from quick formatting a storage device, you can also apply the Diskpart Utility to clean and format a disk so as to make use of it as fresh as new. Follow to learn the details.

Format disk using diskpart

#3. Use Diskpart to Delete Partition, Cleanup, or Erase Disk 

Applies to: Delete volumes, remove recovery partition, clean disk, or erase HDD/SSD using Diskpart. 

To Delete Partitions from Hard Drive:

Delete partition usig Diskpart

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:

Clean all paritions on disk with diskpart

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.

#4. Use Diskpart to Convert Disk from MBR to GPT or GPT to MBR

Applies to: Change disk type, convert MBR to GPT or GPT to MBR using Diskpart.

Convert disk to mbr or gpt 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.

#5. Other Hot Commands to Manage Partitions with Diskpart

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:

Extend partition using Diskpart

To Shrink Partition with Diskpart:

Shrink partition using Diskpart

To Mark Partition as Active with Diskpart:

Set partition active usign diskpart

Aside from this, you can also use Diskpart command lines to merge partitions, hide partitions, and even show hidden partitions. 

Diskpart Alternative Free Download

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. Qiling 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.

Bonus Tip:

If you are about to look for more free and equal tools that could be applied to manage disk partitions, you may follow Best Diskpart Alternatives for Windows 11, 10, 8, 7 and get to learn more details.

How to Use Diskpart to Fix Device Errors 

The Diskpart Utility is also practical to assist you in resolving some common device errors. For example, a storage device becomes RAW, or a hard drive becomes read-only.

If you happen to have the same issue on your storage devices, follow the tips here, and you'll make your device work normally again:

#1. Fix Drive Read Only with Diskpart

Command: attributes disk clear readonly command

Applies to Fix: hard drive partition or storage devices show Read-only.

Step-By-Step Guide:

Step 1. Open Diskpart by clicking the Start menu, typing cmd in the search box, and hitting Enter. Then type diskpart in the command prompt and hit Enter.

Step 2. Type list disk and hit Enter.

Step 3. Select disk * and hit Enter. (Replace * with the number of your disk, which is read-only.)

Step 4. Type attributes disk clear readonly and hit Enter.

Fix device read only issue with Diskpart

LEARN MORE

Note that the Disk Read Only error could be caused by various reasons. Aside from using Diskpart, you can also try Registry, Read-only removal software, and other solutions to fix this issue on your device. Follow this link to learn 5 methods about How to Change Drive from Read Only to Read and Write.

#2. Convert Device from RAW to NTFS

Command: chkdsk, format FS=NTFS

Applies to Fix: USB, hard drive, or external disk becomes RAW, inaccessible.

If you have essential data saved on a RAW device, you may refer to reliable data recovery software to scan and restore all content from the device first. 

Step-by-Step Guide: 

Step 1. Open Diskpart.

Step 2. Type chkdsk e: /f /r /x and hit enter. (Replace E: with the drive letter of RAW device.)

Fix device becoming RAW issue with diskpart

Step 3. Type list partition and hit Enter.

Step 4. Type select partition * and hit Enter. (Replace * with the number of the RAW partition.)

Step 5. Type format fs=NTFS quick and hit Enter.

LEARN MORE

Aside from Diskpart, you can also apply disk management or a third-party disk partitioning software to get rid of the RAW issue on your device. You just need to follow this link: Convert RAW to NTFS to learn more details.

Troubleshooting Diskpart Errors On Windows

According to many experienced Windows service providers and Windows beginners, the Diskpart utility may also report some strange error messages in the command prompt window. 

If you are having one of the following error messages, stay calm. You may follow the resolutions below to eliminate Diskpart errors and make it function normally again. 

Error 1: Diskpart I/O Device Error

Error message of I/O device error in Diskpart

Troubleshooting: Fix DiskPart I/O Device Error in Windows 10/8/7

Error 2: Diskpart Has Encountered an Error, Access Is Denied

Diskpart has encountered an error

Troubleshooting: How to Fix Diskpart Has Encountered an Error Access Is Denied Error

Error 3: Diskpart Failed to Clear disk Attributes

Diskpart failed to clear disk attributes

Troubleshooting: How to Fix Diskpart Failed to Clear Disk Attributes Error

Error 4: The System Cannot Find The File Specified

System cannot find the file specified

Troubleshooting: 8 Fixes to Remove System Cannot Find The File Specified Error

Error 5: Virtual Disk Service errors in Disk Part

Clean is not allowd with virutual disk service error

specified disk is not convertable with virtual disk service error

Troubleshooting: How to Fix DiskPart Virtual Disk Service Errors 

Conclusion

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 Qiling Partition Master Free for help. It will always save your device from deathly errors and bring life back to your disk partitions.

Related Articles


Is this information helpful?     

What can we do to improve this information? (Optional)
Refresh Please enter the verification code!