What to do right now
- Do not initialise the disk, create partitions or run any more diskpart commands on it.
- Check whether the command was clean, which takes seconds, or clean all, which takes hours.
- Scan the whole physical disk for lost partitions read-only and save the files to another disk.
Step by step
Stop and leave the disk as it is
Close diskpart with exit. When Disk Management opens it will usually show the disk as Unknown and Not Initialized and ask to initialise it. Cancel that dialog. Initialising writes a new partition table, and creating a partition afterwards writes a new file system.
Scroll back in the command window
If the window is still open, the output of list disk shows each disk's number and size. That tells you which disk was really selected and how large it is, which helps you recognise the right partitions later. Note whether it was an SSD or a hard drive.
Work out whether it was clean or clean all
Both end with the same message saying the disk was cleaned successfully. Plain clean finishes almost instantly. clean all runs for a long time, often hours on a large hard drive, because it overwrites every sector. If it finished, the data is gone; if you stopped it early, only the area it already reached is lost.
Open FileFix Ultimate as administrator
Run the portable version from a USB stick or another drive so nothing is written to the cleaned disk. Administrator rights are needed to read a disk that has no partitions.
Search the physical disk for partitions
In Deleted file recovery, select the cleaned disk as a whole physical disk. The app looks for NTFS, FAT32, exFAT and other boot sectors and for the NTFS backup boot sector at the end of each partition, then lists the partitions it finds with their start, size and file system.
Scan the right candidates
Pick the candidates whose sizes fit the disk layout you remember and run the Balanced scan on each. If no partition is found, run the Deep signature scan on the whole disk; files come back without names but with their content.
Save everything to another disk
Recover to a different physical disk and check the results before you repartition the cleaned disk or put it back into use.
clean versus clean all
According to Microsoft's documentation, clean removes all partition and volume formatting from the selected disk. On an MBR disk it overwrites the MBR partitioning information and hidden sectors; on a GPT disk it overwrites the GPT partitioning information, including the protective MBR. In practice it typically zeroes only about the first and last megabyte, which on a GPT disk also removes the backup table at the end.
Windows normally starts the first partition at the 1 MB mark, so the boot sectors of the partitions and everything after them are usually untouched. That is why a lost partition search often finds every partition again. clean all is a different command: it writes zeros to each sector of the disk. When it has completed, no software or laboratory can bring the data back.
How the wrong disk gets selected
The usual story is preparing a USB stick or a new drive. list disk shows Disk 0, Disk 1 and Disk 2, the sizes look similar, and select disk picks the wrong number. Disk numbers can also change after a reboot or when a drive is plugged in, so a number noted earlier may point to another disk now.
Windows refuses to clean the disk it is currently running from, so if your PC still boots normally, the system disk was not the one cleaned. The risk is higher from the command prompt of a Windows installer, where the internal disk is not in use and can be cleaned without complaint.
Why SSDs are different
On an SSD, clean can make Windows send TRIM for the entire disk. The drive may then erase all blocks internally, and a scan finds nothing but zeros. Whether this happens depends on the drive, the connection and the Windows version, so scanning is still worthwhile. FileFix Ultimate marks results that consist only of zeros as likely unrecoverable rather than saving empty files.
When it won't work
- clean all ran to the end: every sector was overwritten with zeros.
- The disk is an SSD and TRIM erased the whole drive after clean.
- The disk was initialised, repartitioned and formatted, and new data was copied onto it.
- Windows or another system was installed onto the cleaned disk.
- The partitions were ReFS, APFS or part of a RAID 6 or RAID 10 set, which are not analysed.
How FileFix Ultimate helps
- Reads the cleaned disk read-only and never writes a partition table, boot sector or anything else to it.
- Searches the whole physical disk for lost NTFS, FAT32, exFAT, ext4 and HFS+ partitions, using backup boot sectors where they exist.
- Falls back to the Deep signature scan with 68 file signatures when no partition structure is left.
- Can make a drive image first if the disk shows read errors, and scans the image instead.
- Free for personal use with no recovery limit, and it runs portable from a USB stick.
FileFix Ultimate is free for personal use, works offline and never writes to the drive you are recovering from. Business use needs a one-year licence per PC. Check the signature before you run it.
Frequently asked questions
Is there an undo command for diskpart clean?
No. diskpart has no undo. The partitions can often be found again by searching the disk, and the files copied off, but nothing inside diskpart reverses the command.
The message said DiskPart succeeded in cleaning the disk. Does that mean my data is gone?
Not necessarily. clean and clean all print the same message. What matters is how long it took. A command that finished in a second or two removed the partition table, not the data.
Can I put the old partition table back instead of copying files?
Partition repair tools can rewrite a table from the partitions they find, but a wrong guess can cause new damage. Copy the important files to another disk first; after that, restoring the table is a low-risk experiment.
I stopped clean all after a few minutes. What is left?
clean all writes from the start of the disk onward, so the beginning, where the first partition and its file system records were, is likely zeroed. Data further along the disk may survive and can be found with the Deep signature scan, usually without names.