Many people complain that their data and partition got deleted mistakenly as they run the DiskPart clean command on a wrong drive but don't know how to undo DiskPart clean.
If you are with the same issue, check out the content navigation. You'll find three practical methods to recover data and partition deleted by DiskPart clean command on Windows 10/8/7 with ease:
Note: Stop using your hard drive and don't save any new data once you've cleaned the disk using diskpart.
DiskPart Clean Overview
In this part, you'll learn: 1. What is Diskpart clean command; 2. When to use it.
DiskPart.exe is a disk utility in Windows that helps Administrators manage a computer's disk partitions with some commands.
DiskPart clean is a command that overwrites the partitioning information, including hidden sector information or the Protective MBR, on an MBR or GPT Disk. As a result, the command removes all partitions or volumes formatting from the disk. That's why you see data and partition lost after executing this command.
- Unlike DiskPart clean, the clean all command is set to write zero to each and every sector on the disk, which completely deletes all data on the disk. It's a way to erase a drive, making data and partition unrecoverable.
As explained, both Diskpart clean and clean all commands will cause serious data loss. It is not suggested to execute frequently as it's a "dangerous" command. So when should you use the DiskPart clean command?
- DiskPart clean - Use it when you want to clean a whole drive, it has some errors, or you want to free up disk space for other purposes.
- DiskPart clean all - Use it when you want to erase the drive or sell the drive, etc.
IMPORTANT: Be more careful while cleaning the drive with this command, your data will be removed. And it can happen at times.
Can You Undo Diskpart Clean and Recover Files
Can you recover files after Diskpart clean? The answer to this and other similar questions is YES. It's possible to undo the DiskPart command.
Sometimes, users may execute a wrong command in their storage devices or Windows hard drive partition, accidentally deleted data or deleted the partition by mistake.
As explained, the DiskPart clean command only deleted data and partition. Therefore, you can still recover files and partitions after DiskPart clean. However, if you executed "clean all" command, undoing diskpart clean in that situation is impossible.
You may come up with the next question of "How do I restore a partition using diskpart" or "How do I undo a clean command in Diskpart", right?
Follow the methods in the next part, you can undo the operation and bring your data and partition back immediately.
How to Undo Diskpart Clean in Windows 10/8/7 ( 3 Ways)
Now you know the files and partitions are recoverable if you use the diskpart clean command without the "all" parameter. Here, we collected 3 practical methods that can help you recover files and partition on your drive with ease:
- #1. Recover DiskPart Cleaned Data and Create New Volume - Safe & Sound
- #2. Use Partition Recovery Tool - Easy
- #3. Turn to Manual Partition and Data Recovery Service
Solution 1. Run EaseUS DiskPart Recovery Software
Applies to: 3-step data recovery, recover lost partition with DiskPart command.
One of the practical ways that you can try is to run a reliable DiskPart recovery software to restore lost data first. Then run the CMD command to create new volumes on the drive.
#1. Recover DiskPart Cleaned Data via EaseUS DiskPart Recovery Software
EaseUS Data Recovery Wizard is designed to scan and retrieve the files and folders from your disk from any data loss situations.
With it, you can undo diskpart clean in Windows 10/8/7 and even earlier versions with simple clicks.
Follow to recover your lost data in 3 steps:
Step 1. Select a drive to scan
To start recovering DiskPart deleted files, you must determine where the files were kept before deletion. EaseUS Data Recovery Wizard will list all the loaded drives on your PC, so it's for you to select the correct drive to scan. Hover the mouse pointer to the drive and click "Scan".
Step 2. Check for scanned results
After the scan process, select the "Deleted Files" and "Other Lost Files" folders in the left panel. Then, click "Filter" to display only the specified file types, such as pictures, videos, Word documents, PDF files, etc.
Step 3. Preview and recover
Once located the desired files that were deleted by DiskPart, you can double-click the files one by one for preview, or use the "Preview" button to check its integrity. At last, click "Recover". You shall choose a different drive to save the recovered files to avoid data overwriting.
Remember to save the found data to another secure location. Then follow the next tutorial to make the DiskPart cleaned drive usable again.
#2. Partition Recovery - Create New Volumes via Diskpart
Now, you can perform partition recovery on your hard drive, USB, or external hard drive with DiskPart.
The command is not a recovery command but you can use it to create new partitions on the drive, making the cleaned drive or USB, SD card usable again:
Step 1. Press Windows + R keys, type cmd in the Run dialogue, and hit Enter.
Step 2. Type below commands, hit Enter each time to create a new partition:
- select disk * (Replace * with the disk number of your drive.)
- create primary partition size=* (Replace * with the partition size.)
- assign letter=* (Replace * with a new drive letter.)
If you want to create more than one partition on your hard drive, just repeat the above process.
After this, you are good to use the drive or external storage devices and you may save the restored data back to the device again.
Solution 2. Use Partition Recovery Tool
Applies to: Recover partition and data together from a DiskPart cleaned drive.
If you want to recover both data and the partitions on the disk, which was cleaned by DiskPart, you can use EaseUS Partition Recovery to get things done. It is exclusively designed for partition and data recovery.
Note that sometimes, if the partition table gets corrupted, a normal partition recovery tool may not be able to detect nor find your lost disk partition. So it is to EaseUS Partition Recovery. In this case, you'll need to revert to Solution 1 and apply data recovery software for help.
Follow the steps here to restore partitions and files from the disk on which you use the diskpart clean command:
Step 1. Run EaseUS Partition Recovery on your PC.
Select the disk or device where you lost partition(s), click "Scan" to continue.
Step 2. Wait for the scanning process to complete.
Let the program scan the selected disk and find the lost partition(s).
Step 3. Preview and restore the lost partition(s).
Double-click on the partition which is marked as "Lost" with "Good" recoverability.
Preview the content of the lost partition. Click "OK" and click "Proceed" to start restoring the lost partition.
Step 4. Click "Recover Now" to finish the partition recovery process.
Note: If the program warns you that there is a conflict, back up the listed partition with essential data to an external hard drive first. Then execute the final operation to restore your lost partition.
#3. Turn to Manual Partition and Data Recovery Service
Applies to: Manually undo DiskPart clean, restore data, and partition on a hard drive from a third-party data recovery service.
Note that if the above two methods fail to help you undo the DiskPart clean command, there might be more problems on your disk. And you can turn to a manual partition and data recovery service for help.
EaseUS Data Recovery ServicesClick here to contact our experts for a free evaluation
Consult with EaseUS Data Recovery Experts for one-on-one manual recovery service. We could offer the following services after FREE diagnosis:
- Repair corrupted RAID structure, unbootable Windows OS and corrupted virtual disk file (.vmdk, .vhd, .vhdx, etc.)
- Recover/repair lost partition and re-partitioned drive
- Unformat hard drive and repair raw drive (BitLocker encrypted drive)
- Fix disks that become GPT protected partitions
The Bottom Line
On this page, we explained what is DiskPart clean command and the difference between "clean" and "clean all" commands. When you executed a solely clean command on your drive, you may still bring the lost data and partition back.
If you want to undo the DiskPart clean command. First, don't make any changes to your drive. Next, turn to a reliable method for help. If you only used "diskpart clean", you can recover all your data and partitions using a partition recovery tool, EaseUS DiskPart recovery software, or data recovery service.
Last, it's also recommended that you make a regular backup of all valuable files on your drive to another secure location.
Was This Page Helpful?
Cedric Grantham is one of the senior editors of EaseUS who lives and works in Chengdu, China. He mainly writes articles about data recovery tutorials on PC and Mac and how-to tips for partition management. He always keeps an eye on new releases and loves various electronic products.
Approved by Evan Galasso
Evan Galasso is a digital forensics and data recovery engineer with over 10 years of experience in the field. He presents opinions on the current state of storage media, reverse engineering of storage systems and firmware, and electro-mechanical systems of SSDs and HDDs.
RAW USB Recovery | How to Recover Data from RAW USB Drive
Daisy/Feb 22, 2023
Windows 10 Won't Update with/Without Sending Errors - (20+) Tips
Jean/Feb 22, 2023
Accidentally Formatted Hard Drive? Unformat Hard Drive Right Now!
Tracy King/Feb 22, 2023
Best File Repair Software for PC, Mac and Online (10+)
Jean/Mar 13, 2023