How to Recover Deleted Partitions from an NVMe SSD Using TestDisk in Windows
Quick Answer If an NVMe SSD suddenly shows its entire capacity as Unallocated in Windows Disk Management and its previous partitions have disappeared, the pa...
Quick Answer
If an NVMe SSD suddenly shows its entire capacity as Unallocated in Windows Disk Management and its previous partitions have disappeared, the partition information may have been deleted or damaged.
One possible cause is the Windows DiskPart clean command, which removes partition information from the selected disk. Another possibility is accidental partition deletion or partition-table corruption.
The free TestDisk utility can search for previously existing partitions and may help restore the partition structure. However, recovery is not guaranteed, particularly if the SSD has received TRIM or deallocation commands or has developed hardware problems.
Important: Do not initialize, format, partition or reinstall Windows on the affected SSD if the previous data is important. Stop unnecessary writes and prioritize creating a sector-by-sector image or obtaining professional recovery assistance.
Understanding the Problem
A computer may suddenly restart, display an error, stop booting into Windows or enter an automatic repair environment. During troubleshooting, a user may execute commands or select recovery options that modify the storage device.
In some cases, the computer may subsequently stop recognizing its original Windows partitions.
When the affected SSD is connected to another working computer, Windows Disk Management may show the entire disk as Unallocated, even though the physical SSD is detected correctly.
This situation does not necessarily mean that every sector containing the previous data has been erased. It may mean that Windows can no longer find the partition information required to identify the previous volumes.
Common Symptoms
- The laptop suddenly restarts and no longer boots into Windows.
- Windows displays automatic repair or recovery options.
- The original Windows and data partitions disappear.
- The SSD is detected in BIOS or Disk Management.
- Disk Management displays the entire SSD as Unallocated.
- Windows asks to initialize the disk.
- Diagnostic software reports sector read errors or OS I/O errors.
- Partition recovery software identifies possible previous partitions.
Possible Causes of Deleted SSD Partitions
1. Accidental DiskPart Clean Command
Windows includes a command-line storage management utility called DiskPart. It can create, delete, format and manage disks and partitions.
One of its commands is:
diskpart
list disk
select disk 0
clean
The example above demonstrates the general command sequence. Disk number 0 is only an example and must never be assumed to be the affected SSD.
According to Microsoft documentation, the clean command removes all partition or volume formatting information from the selected disk.
On a GPT disk, this includes the GPT partition information and Protective MBR. On an MBR disk, it removes the MBR partitioning information and hidden sector information.
The clean all command is different. It writes zeros to every sector of the selected disk, completely deleting its existing data.
Official documentation: Microsoft DiskPart Clean Command.
2. Accidental Partition Deletion
A partition can also disappear if a user deletes it through Disk Management or DiskPart.
Windows may then display the previously occupied space as Unallocated. The physical storage device can remain functional even though its partition information has been removed.
3. Damaged GPT or MBR Partition Table
GPT (GUID Partition Table) and MBR (Master Boot Record) are partitioning schemes used to organize storage devices.
If the partition table becomes damaged or its entries are overwritten, Windows may fail to identify the original partitions.
For modern UEFI-based systems, GPT is commonly used, although the actual partitioning scheme depends on the system configuration.
4. SSD or Storage Communication Problems
A failing SSD controller, unstable USB enclosure, defective cable or storage-driver problem may cause read failures.
These problems can produce OS I/O errors or prevent diagnostic software from reading particular sectors.
A USB-to-NVMe enclosure introduces an additional communication layer. Therefore, a read error observed through an enclosure should not automatically be interpreted as proof of NAND memory failure.
Before Attempting Partition Recovery
Data preservation should be the first priority. Partition recovery software may need to read large portions of the SSD, and further operations can reduce the chances of recovering important information.
Actions to Avoid
- Do not initialize the affected disk when Windows displays an initialization prompt.
- Do not create new partitions or volumes.
- Do not format the Unallocated space.
- Do not install Windows on the affected SSD.
- Do not execute
diskpart cleanorclean allagain. - Do not run CHKDSK repair commands on an unrecognized or deleted partition.
- Do not run unnecessary surface scans repeatedly on a potentially failing SSD.
- Do not save recovered files onto the affected SSD.
Make a Sector-by-Sector Image When Possible
If the customer's data is important, the preferred recovery approach is to create a sector-by-sector image of the SSD onto another healthy storage device before attempting repairs.
A recovery image preserves the readable contents of the source device and allows subsequent analysis to be performed on a copy.
However, imaging a failing SSD can also place additional read load on it. If the device is unstable, repeatedly disconnecting or scanning it, or if the data is business-critical, professional recovery assistance is preferable.
Ensure that the destination drive has sufficient free capacity for the complete source image. Never use the affected SSD as the image destination.
Step 1: Check the SSD in Windows Disk Management
Connect the affected SSD to a working computer and open Disk Management.
- Press
Windows + R. - Type
diskmgmt.msc. - Press Enter.
- Locate the affected SSD by checking its capacity and disk number.
- Examine the partition layout.
Different disk conditions require different approaches.
| Disk Management Status | Possible Meaning | Recommended Action |
|---|---|---|
| Entire disk Unallocated | Partition entries may have been deleted or damaged. | Investigate with partition recovery software. |
| Not Initialized | Partition metadata may be missing or unreadable. | Do not initialize if data recovery is required. |
| RAW partition | Windows cannot recognize the file system. | Investigate the file system before attempting repairs. |
| Healthy partitions | Partition entries are present. | Investigate file-system, boot or access problems. |
Important: A disk showing as Unallocated is not necessarily physically damaged. Conversely, a disk being detected in Disk Management does not prove that its hardware is healthy.
Step 2: Check the SSD Health
Before running an extensive recovery scan, examine the SSD's health and available SMART information.
SMART stands for Self-Monitoring, Analysis and Reporting Technology. It provides information about storage-device health and certain error conditions.
One commonly used utility is CrystalDiskInfo.
Check the following information where available:
- Health Status or Percentage Used.
- Critical Warning.
- Available Spare.
- Media and Data Integrity Errors.
- Error Information Log Entries.
- Operating temperature.
For an NVMe SSD, a Good health status is encouraging, but it does not guarantee that every sector is readable or that the previous data is recoverable.
Similarly, an Error Information Log Entry count is not, by itself, proof of physical NAND damage. The actual error details and other health indicators must be considered.
Check the USB Enclosure
If the NVMe SSD is connected through an external USB enclosure, the enclosure and USB connection should also be investigated.
- Try another suitable USB cable.
- Use a direct USB port instead of a USB hub.
- Try another compatible USB port.
- Check whether the enclosure supports the SSD's NVMe interface.
- If possible, test the SSD in another compatible enclosure.
- For advanced diagnosis, connect the SSD directly to a motherboard M.2 slot.
Some USB bridges do not expose all native NVMe SMART information or storage commands. A direct motherboard connection can provide a more complete diagnostic view.
Step 3: Download and Run TestDisk
TestDisk is a free, open-source data recovery utility developed by Christophe Grenier. It can search for lost partitions and help restore partition-table information in supported situations.
Download it only from the official website:
Download TestDisk from CGSecurity.
Preparing TestDisk
- Download the appropriate Windows version of TestDisk.
- Extract the downloaded archive into a folder.
- Connect the affected SSD to the working computer.
- Run
testdisk_win.exewith administrator privileges. - Choose Create to create a log file.
TestDisk works directly with physical disks. Select the physical SSD rather than an individual Windows drive letter.
Step 4: Select the Correct Physical SSD
TestDisk displays the available storage devices along with their reported capacities.
Identify the affected SSD carefully using its model and capacity.
For example, an Intel 256 GB NVMe SSD may appear with a reported capacity of approximately 238 GiB.
Do not select a different disk simply because its disk number looks familiar. Windows disk numbers can change depending on the connected devices and their enumeration order.
After selecting the correct physical SSD, press Enter to continue.
Select the Partition Table Type
TestDisk normally detects the partition-table type automatically.
For a typical modern Windows laptop using UEFI boot, the partition scheme is usually EFI GPT. However, the actual scheme should be verified rather than selected solely on the basis of the computer's age or operating system.
Use the detected partition-table type when it is correct, and proceed to the Analyse option.
Step 5: Perform TestDisk Quick Search
The Analyse function examines the current partition structure and searches for missing partitions.
- Select Analyse.
- Press Enter.
- Review the current partition information.
- Select Quick Search.
- Allow TestDisk to examine the disk.
TestDisk can display possible partitions as they are detected during the search.
A result may include information such as:
MS Data
32768 500115455 500082688 [New Volume]
This is an example of a possible Microsoft data partition reported by TestDisk.
The starting sector, ending sector and total number of sectors describe the candidate partition's location and size.
The label New Volume is not sufficient evidence that the partition belongs to the previous Windows installation. It may be a generic volume label or a partition name that does not identify its original contents.
Compare the reported partition size and location with the expected previous partition layout wherever possible.
Step 6: Check Whether TestDisk Can Read the Files
This is one of the most important checks during partition recovery.
- Wait for Quick Search to complete.
- Use the arrow keys to highlight the suspected partition.
- Press the
Pkey. - Check whether TestDisk can display the files and directories.
- Press
Qto return to the previous screen.
If the partition contains a readable supported file system, TestDisk may display its directory structure.
Look for familiar folders such as:
WindowsUsersProgram FilesProgramData- Previous customer data folders.
Finding these directories is encouraging because it suggests that at least some of the previous file-system information remains readable.
However, directory visibility does not guarantee that every file is intact.
Copy Important Files Before Restoring the Partition Table
If TestDisk can list the customer's files, use its file-copy function to copy important data to another healthy storage device.
In the file listing interface, select the required files or directories, use the copy command shown by the program, and choose a destination on a different physical drive.
Check that the copied files can be opened successfully.
Do not use the affected SSD as the destination for recovered data.
Step 7: What If TestDisk Remains Stuck at 99%?
During a partition search, TestDisk may appear to stop near completion. For example, the screen may display:
Analyse cylinder 31130/31129: 99%
MS Data
32768 500115455 500082688 [New Volume]
Stop
A progress value of 99% does not automatically indicate that the software has crashed.
Possible explanations include:
- The program is still attempting to read difficult or problematic disk areas.
- The USB enclosure or connection is experiencing communication delays.
- The SSD is returning read errors.
- The diagnostic software is waiting for a storage operation to complete.
These are possible explanations, not confirmed causes. TestDisk's progress display alone cannot identify which condition is responsible.
How to Investigate a 99% Scan
- Check whether the TestDisk window is still responding.
- Observe the USB enclosure's activity indicator, if available.
- Open Windows Task Manager and check whether the storage device is showing read activity.
- Allow additional time if the device is still actively reading.
- Check whether Windows Event Viewer records disk, storage-controller or USB errors.
- Try a different suitable USB cable or port if the connection appears unstable.
TestDisk documentation explains that deeper partition searches can take several hours depending on the device and its contents. However, this does not mean every Quick Search that remains at 99% is behaving normally.
If the software is completely unresponsive and there is no disk activity, avoid repeatedly restarting the scan. First consider the SSD's condition and whether a recovery image should be created.
Official documentation: TestDisk Step-by-Step Guide.
Step 8: Use Deeper Search If Partitions Are Missing
If Quick Search does not identify all the previous partitions, TestDisk provides another option called Deeper Search.
Deeper Search examines additional disk locations and may identify partitions that were not detected during Quick Search.
- Return to the partition search results.
- Select Deeper Search.
- Press Enter to begin.
- Allow the scan to complete.
- Review all detected partitions carefully.
- Use the
Pkey to inspect the contents of each suitable candidate.
Deeper Search can take several hours. The duration depends on the storage device, read performance, disk condition and the number of areas that need examination.
Keep the computer powered on and prevent automatic sleep during the scan.
If the SSD is unstable or produces repeated I/O errors, imaging or professional recovery should take priority over an extended scan of the original device.
Step 9: Should You Select Write in TestDisk?
TestDisk provides a Write option that saves the recovered partition structure to the disk's partition table.
This is a modification operation and should not be performed simply because a partition appears in the search results.
Before considering Write, verify all of the following:
- The selected physical SSD is definitely the affected device.
- The detected partitions correspond to the expected previous layout.
- The partition start and end positions are plausible.
- Partitions do not overlap incorrectly.
- The file listing displays the customer's expected folders and files.
- Important recoverable files have been copied or the source has been imaged.
TestDisk documentation advises confirming the recovered partition structure before writing it. The Write operation registers the selected partitions in the partition table.
Do not write a guessed or incomplete partition layout. If TestDisk detects only one large partition but the original disk had multiple partitions, further investigation is required.
Official documentation: TestDisk Partition Recovery Instructions.
Understanding SSD TRIM and Data Recovery Limitations
Recovering deleted partitions from an SSD can be more difficult than recovering them from a traditional mechanical hard disk.
SSDs use a feature called TRIM or deallocation to inform the storage device that particular logical blocks are no longer required.
Windows supports SSD optimization and TRIM operations. The SSD may use deallocation information during its internal garbage-collection processes.
As a result, even when TestDisk successfully identifies an old partition boundary, the original file contents may no longer be available.
Why TRIM Matters
- Deleting a partition and deleting its files are not necessarily the same operation.
- A partition-table deletion does not always erase the contents of every data sector.
- TRIM or deallocation may make previously stored logical blocks unavailable for normal reading.
- The recovery outcome depends on what operations were performed, whether deallocation was issued and how the SSD handled those commands.
Connecting an SSD through a USB enclosure does not guarantee that TRIM or deallocation commands were blocked. USB bridge capabilities and the storage software in use can affect command support.
Therefore, an SSD showing 86% health or zero media errors can still contain data that is no longer recoverable.
References:
Understanding OS I/O Errors During SSD Scanning
An OS I/O error means that an input/output operation requested by software could not be completed successfully by the operating system or storage interface.
For example, a diagnostic program may display:
Sectors 0-31 failed to read from G:
after 1 attempt.
Incorrect function (1)
This message indicates that the attempted read operation failed. It does not, by itself, prove that the first 32 sectors are physically damaged.
Possible causes include:
- Storage-device read problems.
- USB enclosure or bridge-controller communication issues.
- Defective USB or SATA connections.
- Storage-driver or controller problems.
- File-system or partition-related issues.
For an NVMe SSD connected through USB, compare the result using another enclosure or a direct motherboard M.2 connection where possible.
If read errors continue through a known-good direct connection, investigate the SSD itself and consider professional imaging or recovery.
Alternative Recovery Tools
TestDisk is useful for partition discovery and certain partition-table recovery operations. However, other tools may be more appropriate when the partition structure is badly damaged or individual files need to be recovered.
| Tool | Primary Purpose | Suitable Situation |
|---|---|---|
| TestDisk | Partition discovery and recovery | Missing or deleted partition entries. |
| PhotoRec | File recovery using file signatures | Recovering supported file types when file-system information is damaged. |
| R-Studio | Advanced data recovery | Complex file-system and partition recovery cases. |
Official websites:
Some advanced recovery tools are commercial products. Always verify the software's supported file systems, recovery capabilities and licensing before use.
What If Partition Recovery Is Not Possible?
If TestDisk cannot find the original partitions, or the detected partitions cannot display the expected files, do not immediately assume that the SSD is completely unusable.
Consider the following possibilities:
- The partition table was overwritten.
- The file-system boot records or metadata are damaged.
- The previous partition boundaries cannot be reliably identified.
- The SSD has unreadable logical blocks.
- TRIM or another deallocation operation has affected the previous data.
- The USB enclosure is preventing reliable access to the device.
If the customer's data is valuable, stop further experimentation and consult a professional data recovery service. Repeated scans and repair attempts may reduce the remaining recovery opportunities.
Making the SSD Usable Again After Data Recovery
If the customer confirms that no previous data is required, or all required files have been recovered and verified, the SSD can be prepared for a fresh Windows installation.
First check the SSD's health and resolve any persistent read or communication errors. Do not reuse a drive that shows signs of hardware failure for important customer data.
For a healthy SSD, the general preparation procedure is:
- Connect the SSD to the computer.
- Open Windows Disk Management.
- Identify the correct physical disk by model and capacity.
- Initialize it using the appropriate partition scheme if required.
- Create the required partition or partitions.
- Format the Windows installation volume using the appropriate file system.
- Install Windows using compatible UEFI and GPT configuration where applicable.
Initialization, partition creation and formatting modify the disk. Perform these operations only after confirming that data recovery is no longer required.
Frequently Asked Questions
1. Can TestDisk recover a partition after using DiskPart Clean?
TestDisk may identify previous partitions after a standard DiskPart clean operation because that command removes partition information rather than writing zeros to every sector. Recovery depends on whether the original partition and file-system information remains readable. A previous partition is not guaranteed to be recoverable.
2. Does Unallocated space mean the SSD is empty?
No. Unallocated means Windows does not currently recognize a partition occupying that space. It does not establish that all previous file contents have been erased.
3. Why does TestDisk show a partition called New Volume?
New Volume may be a volume label associated with a detected partition. Its name alone does not confirm that it is the original Windows or customer-data partition. Check its size, boundaries and file contents.
4. Why does TestDisk get stuck at 99%?
A scan that appears stuck may still be waiting for disk operations or experiencing read delays. USB enclosure problems and storage-device read errors are possible causes. Check actual disk activity and system logs rather than assuming that 99% means the scan is complete or permanently frozen.
5. Can I restore Windows without recovering the old data?
Yes. If the customer does not need the previous files and the SSD passes appropriate health checks, the drive can be initialized, partitioned and used for a fresh Windows installation.
6. Does CrystalDiskInfo showing Good health guarantee successful recovery?
No. SMART health information provides useful diagnostic indicators but does not guarantee that every logical block is readable or that deleted data remains available.
7. Can a USB NVMe enclosure cause OS I/O errors?
Yes. A defective cable, USB port, enclosure controller or compatibility issue can interrupt storage communication. Testing through another compatible enclosure or a direct M.2 connection can help isolate the problem.
Key Takeaways
- An SSD showing as Unallocated may have lost its partition information without necessarily losing every previous file.
- DiskPart
cleanandclean allhave different effects and should not be confused. - TestDisk can search for lost partitions using Quick Search and Deeper Search.
- Pressing
Pto inspect the detected partition's files is an important verification step. - Do not select Write until the original partition structure has been identified and verified.
- NVMe SSD TRIM and deallocation can reduce the chances of recovering deleted data.
- USB enclosure problems should be ruled out before concluding that an NVMe SSD has physical damage.
- Data preservation should take priority over making the disk bootable again.
Official References
Was this guide useful?
Your answer helps us keep BISONKB accurate and practical.