Call Us Free 773-759-7945
user heart cart0
order Free Shipping on Orders Over $100

Why you should utilize DiskPart on Windows, and how to use it

On Windows OS, managing hard disks and their partitions can sometimes become challenging, especially with the limited and somewhat confusing functionality of the official Windows Disk Management tool. If your internal or external disk becomes corrupted and the system runs into recovery mode, there will be no graphical Disk Management tool readily available to help fix disk problems. That's where DiskPart comes into play.


DiskPart is a hidden Windows feature that requires a command-line tool to run. It's built into Windows and is primarily used for managing hard disk partitions and dealing with disk errors. It is pretty straightforward to use, and you just need to know a few commands to create, shrink, extend, or delete partitions using it.

The Windows command prompt is a powerful tool you can leverage with these helpful prompts.

How to use DiskPart on Windows 11 (or 10)

Launch DiskPart on Windows

DiskPart can be accessed through command-line tools, such as Command Prompt or Windows PowerShell. You should have administrative rights to open and use DiskPart on your system. If you haven't accessed it previously, here's how to do so.

  1. Right-click the Start button and select Terminal (Admin) from the Power User Menu. On Windows 10, you can choose Command Prompt (Admin) or Windows PowerShell (Admin).
  2. In the command line, type diskpart and hit enter to open it.
    Command to launch diskpart

  3. Click Yes if you get the UAC warning.
  4. You'll now be under the DiskPart environment and can start executing the commands.
  5. If you want to view all the commands that DiskPart supports at any time, type help and hit enter.
    Executing Diskpart help command

  6. When you are done with the DiskPart environment, use the exit command to come out of it.
    Diskpart exit command

Check current hard disks, volumes, and partitions

Before you make any changes to your hard disks through DiskPart, you can review the current layout, including the number of volumes, partitions, and other information. This will give you a clear idea of the drive architecture, and you'll avoid mistakes when executing the commands.

  1. Under the DiskPart environment, type the list disk command and hit enter. You'll be presented with all the disks attached to your system (internal or external) with details like Status, Total Size, Free Size, and more.
  2. Similarly, use the list volume command to check the volumes on your system and list partition to have a look at the partitions.

Create a partition using DiskPart

With DiskPart, you can quickly create partitions on your brand-new drive or divide your existing disk further for better data management. You will have control over the partition's size, drive letter, and file system. Follow these steps.

  1. Under the DiskPart environment, view all your device's disks using the list disk command.
  2. Now, use the select disk N command to select the disk on which you want to create a partition. Replace N with the disk number of your choice.
  3. If you want to create a fresh partition on the selected disk, you can wipe it using the clean all command to ensure that no existing partitions exist. This is an optional step, so you can skip it if you do not wish to completely delete and reformat the drive.

    If you decide to clean the disk, do it carefully, as DiskPart never sends a warning before executing any command. If you choose the wrong disk, it will be wiped entirely and you will lose everything on it. To ensure you selected the correct disk, use the list disk command and check for the asterisk (*) mark next to your intended disk. The * indicates that this is the disk that has been selected for further actions.

  4. Next, use the create partition primary command to create a partition with the entire unallocated space of the disk. If you would like to assign a particular amount of space to the partition, use the create partition primary size=X command, where X is the intended partition size in megabytes (MB). For example, create partition primary size=2048.
    Diskpart command to create a new partition

  5. After creating the partition, the next step is to format it using a file system. Use the format fs=ntfs quick command for the NTFS file format. Replace ntfs with fat32 or any other format as per your requirements.
    Diskpart command to assign a format to a partition

  6. After formatting, DiskPart will automatically assign the letter to the new partition. However, you could manually do that using the assign letter=G command. Of course, replace G with the letter you want.
    Diskpart command to assign a letter to the partition

  7. Launch File Explorer and check out the newly created partition.
    New partition created using Diskpart

That's the whole process of creating a new partition using DiskPart. You can create multiple parts of the disk by following these steps again. Just ensure that enough unallocated space is available.

Shrink a partition using DiskPart

If one or more of your partitions have extra space that can be used to extend another partition or create a new one, you can shrink it using DiskPart. Here's how to do that.

  1. Under the DiskPart environment, use the list disk command to view all disks on your system, and then use the select disk N command to select the disk of your choice (replacing N with the number of the disk you want).
  2. Next, use the list volume command to list all the volumes under the selected disk.
  3. You can select the volume you want to shrink by typing select volume X (replacing X with the volume number).
  4. Use the command shrink desired=Y (replace Y with the amount of space in megabytes (MB) you want to reduce from the volume); for example, shrink desired=2024.
    Shrink a volume using Diskpart

  5. DiskPart will shrink the volume, creating an unallocated space.

Extend a partition using DiskPart

If you find yourself struggling with low disk space, you can extend your existing partition using DiskPart if there's unallocated space right next to it. Follow these steps to do so.

  1. Under the DiskPart environment, select the volume you want to extend by typing select volume X (replacing X with the volume number). Ensure that you are under your intended disk.
  2. To extend the selected volume, use the command extend size=Y (replace Y with the amount of space in megabytes you want to add to the volume); for example, extend size=2024. If you wish to extend the volume to use all available space, simply type extend without specifying a size.
    Diskpart command to extend a volume

Delete a partition using DiskPart

If you wish to delete unnecessary partitions on your drive to merge them with another partition, you can do that easily through DiskPart by following the steps below.

  1. Select the disk whose partition you want to delete.
  2. Under the chosen disk, use the list partition command to list all its partitions.
  3. Now, use the select partition N (replacing N with the partition number) command to choose the partition to delete.
  4. Finally, type the delete partition command and hit enter. If the partition is protected, such as a system or OEM partition, you may need to use the override parameter, i.e., delete partition override. Again, make sure you are certain that this is the partition you wish to remove before deleting its contents.
    Delete partition using Diskpart

Completely wipe a hard disk using DiskPart

If you aim to completely eradicate your hard disk, including its data and file system, DiskPart lets you do that, too.

  1. Under the DiskPart environment, use the list disk command.
  2. Check the disk number you want to wipe clean and use the select disk N command to choose that (replacing N with your intended disk number). Be very careful with this step.
  3. Finally, use the clean all command to delete the data on your selected disk completely. Depending on the disk size and type (SSD or HDD), this process might take several hours to complete.
    Diskpart command to clean a disk using

This command will thoroughly eradicate the data, making it impossible to recover. So, use it accordingly.

Why you should use DiskPart

DiskPart might feel intimidating since it requires a command-line tool to function. However, no other disk management tool is as advanced and robust as it is. With just a few commands, you can have total control over your hard disks and partitions. The best part is that it works equally well with internal and external drives. So, if you would like to partition an external SSD or HDD, DiskPart is your go-to tool.

Related video: Why do computers slow down? (And how to fix it) (Viral Tech)

One crucial aspect of DiskPart is that it will help you manage your hard disk even in recovery mode when the Windows OS doesn't boot and the graphical Disk Management tool is unavailable. It can help you troubleshoot and fix disk-related issues such as unallocated space, corrupted partitions, or incorrect partition formatting.

Master disk management with DiskPart

You might have to face several frustrations while using Windows OS, but disk management shouldn't be one of them. With DiskPart, you have everything you'll need at your fingertips, from creating or deleting a partition to shrinking or extending it. Just always keep in mind that this program doesn't warn you before taking extreme measures like wiping out the hard disk. You won't get a second chance to undo your actions to restore precious data. Other than that, it's an excellent tool for Windows users to utilize for better efficiency and accuracy while managing hard disk partitions.

Leave a comment