The built-in Diskpart utility is a useful tool for correcting logical errors and restoring hard drives, flash drives, and other storage devices.
- Getting started with Diskpart
- How do I create partitions and format an erased disk?
- How do I delete protected, active, and system partitions on my hard drive?
- How do I 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.
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)).
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.
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.
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).
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.
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 do I 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.
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”
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 do I 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…”
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.
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 do I recover lost files?
We recommend using a specialized program RS Partition Recovery for data restoration if a user has made a mistake at any stage, and valuable information has been deleted. This utility can return important information deleted, formatted, or deleted by viruses in the shortest possible time. In this way, you can recover photos, video files, audio tracks, documents, program files, and any other data.
It should be noted that RS Partition Recovery has advanced work algorithms that allow you to perform an in-depth analysis of the disk and recover long deleted files. We recommend that you familiarize yourself with all features and functions of the utility for fast data recovery RS Partition Recovery on the official page of RS Partition Recovery.