Using Diskpart: manage and recover a hard drive, memory card or USB flash drive

The built-in Diskpart utility is a useful tool for correcting logical errors and restoring hard drives, flash drives, and other storage devices.

Using Diskpart: manage and recover a hard drive, memory card or USB flash drive

Contents

  1. Getting started with Diskpart
  2. How to create partitions and format an erased disk?
  3. How to delete protected, active, and system partitions on my hard drive?
  4. How to recover lost files?

Incorrect drive operation, incorrect size display in the explorer, inability to format, and other problems – all of these problems make the use of flash drives and hard drives much more difficult, so if you find the above problems, you should immediately resort to troubleshooting them.

Important: Before you begin, you should take care to save the information on the problem drive, as fixing the problem drives will require a complete erase, as well as deleting the partition table, which will certainly delete all information.

Getting started with Diskpart

First, connect the problem flash drive to your computer or determine the exact drive you need. Make this is to avoid accidentally erasing a normally functioning drive with valuable information. In our case, the problem drive will be a 14.4-gigabyte flash drive.

How to use Diskart

After that, you should run the command prompt or Windows PowerShell with administrator rights. You can do this by right-clicking on “Start” and selecting the appropriate item (command line(s) or Windows PowerShell(s)).

How to use Diskart

In the opened command line window you should enter the “Diskpart” command and press Enter (the Enter button confirms the commands, so you should press it after each new command) to start working with the utility.

How to use Diskart

Now you need to identify the problem disk in the utility accurately. To do this, enter the command “list disk”, which displays the entire list of connected media.

How to use Diskart

As you can see from the screenshot, the utility has detected two disks: disk 0 with the size 111 gigabytes and disk 1 with the size 14 gigabytes. Since the system disk with a large size works fine, and the problems are exactly with a 14 gigabyte USB flash drive, we remember that in Diskpart it is called “Disk 1”.

Important: In this point you need to pinpoint the drive you need so that you do not delete all information from the system drive.

Select the problem drive with the “select disk 1” command (if the user has additional drives installed, after the command select disk you should enter the number corresponding to the problem drive).

How to use Diskart

The next step is the final one, so we recommend that you double-check the correctness of the selected drive. Once the command is complete, all data will be erased. To erase the selected drive, enter the “Clean” command and confirm Enter.

How to use Diskart

After erasing the drive, Diskpart will display a message “DiskPart succeeded in cleaning the disk”. You can then close the “Windows PowerShell” window.

It is worth noting that for the erased disc to work correctly, you need to create partitions on the disc and format it.

How to create partitions and format an erased disk?

An erased disk needs to be partitions on it and formatted in the correct file system. To do this, you will need to do the following:

Open the “Disk Management” menu by right-clicking on the “Start” button, and selecting the corresponding item.

How to use Diskart

In the window that opens, we find an erased disk. Usually, it has no letter or does not appear in the menu, but it can be detected as an unallocated area at the bottom of the window. Right-click on an unallocated space and select the first item “Create a simple volume”

How to use Diskart

In the windows that open, you should select a letter and the file system and disk size. By default, the system selects the maximum size, the letter, and the NTFS file system, so you can click “Next” in this item.

How to use Diskart

How to delete protected, active, and system partitions on my hard drive?

To delete hard disc partitions, you can use the functionality of the built-in Disk Management utility. You can right-click on the desired partition and select “Delete volume…”

How to use Diskart

In some cases, it may not work because..:

  • The logical disk has a corrupted file system (you can fix it by checking Chkdsk).
  • It has failed sectors and bad blocks (you can fix the problem by checking with the free program Victoria).
  • Logical disk is protected from deletion (system partitions, hidden and service partitions, etc. are protected from deletion).

However, there are several ways to remove absolutely any partition.

Deletion via command prompt in a running OS

To remove unwanted protected partitions in running Windows, you can use the command line and the built-in Diskpart utility. This method will remove all problematic partitions except for system and service ones.

To do this:

Step 1: Open a command prompt as administrator and enter the following commands one by one: diskpart, list disk, select disk 0 (in our case the partition is located on disk 0), list part (the command opens a list of partitions on the disk).

Step 2: select the desired partition with the command select partition 4, after that we enter the command delete partition to delete the partition.

Step 3: The final step is creating a new partition and formatting it. Enter one by one: create partition primary, format fs=ntfs quick, assign letter Z (the command assigns a letter to the created partition) and exit.

After performing these actions, the previously locked partition will be ready for use, deletion and other manipulations in Disk Management menu.

How to delete any partition

To delete system, reserved, and hidden partitions, the user will need a bootable flash drive or an installation disk. Boot from them and in the language selection menu press Shift+F10 to open the command line.

How to use Diskart

In the command line, similar to the previous method, we enter the commands: diskpart, list disk, select disk 0, lis part, select partition 2 (or any other partition that cannot be removed) and remove it with the command del par override.

It should be noted that the command del par override removes absolutely any partition, regardless of its attributes.

Important: Deleting some partitions on a disk may affect its operation, so we recommend that you not resort to deleting protected partitions.

How to recover lost files?

Often when manipulating a drive through the command prompt, users accidentally format the wrong drive or perform actions that cause important data to be lost.

In addition, it is not uncommon to wipe and format a drive and not have all the important data stored in a safe place.

One way or another, all these actions lead to the loss of important information, which, in turn, can even lead to financial losses, as the value of the data is getting higher every year.

If any of these situations happened to you and you lost important files – do not rush to despair

Better yet, use RS Partition Recovery — a professional tool for recovering lost data.

[dowlnoad_partition]

The program is very convenient in use which appreciably sets it apart from competitors, and allows to restore the lost files practically in a few mouse clicks.

But the most important thing is that RS Partition Recovery supports ALL modern file systems. It means that no matter the device type (computer, server, smartphone) or file system type – you will be able to recover important information.

RS Partition Recovery -- supporting all modern file systems

Plus, one more very useful feature of RS Partition Recovery is the deep disc scan mode. Thanks to it you will be able to recover even files that were lost several months ago.

Frequently Asked Questions

Diskpart is a Windows system utility designed to work with disks attached directly to the computer. The program has no graphical interface, and all manipulations are done using the command prompt or Windows PowerShell.
To remove any partition from the disk, boot from the boot disk/flash drive, and run the command prompt. Then run several commands in turn (pressing "Enter" after each one): "diskpart", "list disk", "select disk 0", "list part", "select partition 2" (where "2" is the number of the partition to be deleted), "del par override". More details can be found on our website.
RS Partition Recovery is designed just for such cases and allows to recover data that was lost due to accidental formatting of a partition or disk, accidental deletion, damaged disk file structure, and many other cases.
Usually, such partitions are created by the system For example, Windows 10 creates an additional hidden partition 100 MB in size that stores the Recovery menu and other additional data. Deleting such partitions may affect the functionality of the entire operating system.
Open the command prompt and run a few simple commands, pressing "Enter" after each one: "diskpart", "list disk", "select disk 0" (where "0" is the number of the disk you want), "select partition 1" ("1" is the number of the partition to be formatted), "format fs=ntfs quick" You will find more information on our site.
Leave a comment

Related Posts

Restoring data from Hyper-V virtual machines
Restoring data from Hyper-V virtual machines
How to recover data from Hyper-V virtual machines? Data loss can occur due to hypervisor failure, Windows failure, or user actions. In this article, we will discuss what can be done in such situations. We will cover topics such as … Continue reading
Top 7 Tools to Recover Data from RAID
Top 7 Tools to Recover Data from RAID
Even though they are regarded as data safety mechanisms, fail-tolerant RAID systems are still not perfect. Data can be lost even from arrays with high redundancy, and there is nothing to say about arrays with zero fault tolerance at all. … Continue reading
Data Recovery from Linux KVM Virtual Machines
Data Recovery from Linux KVM Virtual Machines
How to recover data from Linux KVM virtual machines? If some important data is stored inside the machine, but it is beyond repair, how can you access the contents of its virtual hard disk? What should you do if the … Continue reading
Recovering Data with Read/Write Errors
Recovering Data with Read/Write Errors
If you cannot access data stored on a properly configured computer, receiving errors or having your computer freeze for several seconds (or hang up completely), you may have a problem with the hard drive (assuming you’re not having a virus, … Continue reading
Online Chat with Recovery Software