Partition Recovery™
An expert tool for recovering lost partitions
An expert tool for recovering lost partitions
Last updated: Apr 04, 2023

Everything you should know about diskpart commands

partition recovery

In this article you will find out:

  • how to use diskpart
  • diskpart commands
  • how to protect your data

Are you ready? Let's read!

A helpful tool for managing disks and partitions in Windows is the disk management tool, which enables you to delete, create, and change partitions. Nevertheless, it lacks diskpart's capabilities. If Windows does not start up correctly or if you are using PowerShell to resolve your issues, Diskpart is the best option.

This article will teach you how to properly manage Diskpart and make the most of it.

Guide on how to use diskpart

Using the Diskpart command line is only possible with administrative privileges using the command line or PowerShell terminal.

To access diskpart, you need to right-click the start menu button and select Windows PowerShell (Admin).

diskpart commands

Next, type diskpart and press Enter, so you are at the interface of the Diskpart utility.

If you no longer need the services of this tool, enter the command "exit" and press Enter.

Diskpart commands

Familiarize yourself with the main available parameters:

  • select - a specific choice of target.
  • select disk - select a specific disk.
  • select section - select a specific section.
  • select volume - select a specific volume.
  • drive list - get a summary of the available drives on your computer.
  • partition list - get a summary of each partition available on a specific disk.
  • volume list - get a summary of each volume available on your computer.
  • active - activate focus on the current section.
  • assign - assign a letter or mount point to the current active partition.
  • create partition primary size = SIZE_IN_MB - create a new primary partition. SIZE_IN_MB is the size of the partition you want to create, in MB.
  • delete disk - delete a dynamic disk.

Options available with Diskpart


Listening

As soon as Diskpart is opened, you must examine the storage and hard disk configuration as it is.

To achieve this, type list of drives into the search box and hit Enter to see every possible portable and stationary drive.

Each disc will have a unique number, beginning at zero. To utilize the hard disk number with subsequent Diskpart commands, you must keep it in mind.

You can also see the individual partitions of the hard disk:

With the list disk command and the hard disk number, choose the desired hard drive. The partition number in the following Diskpart command can now be used to remove or edit these partitions.

Deleting

If you want to remove one of the partitions or volumes, you can enter the following command on Diskpart.

So, first, enter the command to select a hard disk - select disk.

Next, enter the list of partitions, then select partition No., replacing No. with your section number.

Now, type the delete partition and hit enter. Diskpart will confirm that the partition has been removed.

Wiping

This is done as follows:

Select the disk you want to wipe by typing "select disk #", then type "clean" and press Enter. After completing the process, the program will confirm that the disk has been "clean" and is ready to create new partitions.

Creating and formatting

To create a partition, again, select a specific disk: select disk #, replacing # with your disk number, then enter create partition primary (in this case, the partition will use all the space on that disk).

If you want to create multiple partitions, enter create partition primary size = X instead, replacing X with the size of the partition, measured in megabytes.

Now re-enter the list of partitions, then enter select partition 1 and mark the partition as active by typing active in the "DISKPART>" line.

To format the disk to NTFS, enter format fs = NTFS label = R quick. Usually, Windows will automatically assign a drive letter.

Extending

To expand a volume or partition, you first need to select a disk using select disk #. Enter a list of volumes to display all available volumes on your PC, then select a volume: enter select volume #. Now it's worth introducing an extension to increase it to the maximum available size.

Protect your data with Partition Recovery!

DiskInternals Partition Recovery is a time-tested professional software for recovering data of any format and size. It works separately with each section of the hard drive and scans the deepest structures of the drive, which provides the best result. DiskInternals Partition Recovery supports the following file systems: HFS, NTFS, XFS, Ext2 / 3/4, ReiserFS, FAT12, ReFS, Reiser4, etc.

You can easily take advantage of the free trial version of DiskInternals Partition Recovery right now and ensure that there is no better solution to your problem with missing and damaged files. The application also supports the following operating systems: Windows 10/8/7 / XP / Vista, etc. and has a Preview function. With this free option, you are insured against wasted money in case of incorrect file recovery (although this is unlikely).

To export files, you can purchase a license and receive a license key with full access to the recovered data.

Related articles

FREE DOWNLOADVer 8.13, WinBUY NOWFrom $139.95

Please rate this article.
51 reviews