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 actually 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:
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:
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.
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.
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. 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.
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:
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.
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.)
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.
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
Troubleshooting: Fix DiskPart I/O Device Error in Windows 10/8/7
Error 2: Diskpart Has Encountered an Error, Access Is Denied
Troubleshooting: How to Fix Diskpart Has Encountered an Error Access Is Denied Error
Error 3: 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
Troubleshooting: 8 Fixes to Remove System Cannot Find The File Specified Error
Error 5: Virtual Disk Service errors in Disk Part
Troubleshooting: How to Fix DiskPart Virtual Disk Service Errors
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.