How to recover data from a dead NVMe SSD via CLI
Learn how to access bricked NVMe storage controllers using low-level CLI tools to extract files before the drive fails permanently.
Summary
- Locked NVMe controllers often keep the PCIe bus active, allowing direct hardware access.
- Low-level commands bypass corrupted file systems to read raw physical sectors directly.
- Native Linux tools diagnose firmware faults before attempting any risky data extraction.
- Monitoring drive health regularly prevents catastrophic failures in solid-state units.
- Forensic block recovery requires patience and bit-by-bit copies to prevent permanent data loss.
What happens when an NVMe SSD dies suddenly?
When a modern storage drive stops responding, the general assumption is that all files are gone forever. In practice, the component that usually fails is not the flash memory cells where data lives, but rather the tiny controller chip that manages reading and writing operations. Before writing off the hardware or paying costly data recovery services, we can use command-line tools to wake up the controller and rescue important files. To fully understand hardware monitoring and prevent future disasters, checking out how to monitor NVMe SSD temperature on Linux via terminal provides great context on drive health diagnostics.
NVMe drives use the motherboard's PCIe bus, meaning they communicate directly with the processor at high speeds. When the operating system fails to recognize the device, the physical bus often still detects that an electrical circuit is plugged into the slot. This glimmer of hope allows recovery engineers to send proprietary low-level commands straight to the controller using text interfaces in Linux.
Identifying the frozen SSD on the system bus
The first practical step on the workbench is checking whether the motherboard still physically recognizes the electronic component. To do this, we open the Linux terminal and run utilities that scan the PCI bus for any sign of life. The lspci command lists all devices connected to the computer's high-speed lanes, letting us confirm if the SSD has vanished entirely or if only the file system has crashed.
In your terminal, run the following command to filter storage devices connected to the bus:
lspci -nn | grep -i non-volatileIf the SSD controller appears in the list, even without showing the drive size or familiar partitions, that is fantastic news. It means the electrical interface remains intact and we can proceed with deeper diagnostic commands. Otherwise, if the command returns nothing, the issue might be a catastrophic power failure on the SSD circuit board, requiring physical bench repair and soldering.
Diagnosing firmware status with nvme-cli
With the controller responding on the PCIe bus, the official tool for interacting with NVMe drives on Linux is the utility suite called nvme-cli. It allows administrators to send commands directly to the drive firmware, bypassing normal operating system layers that might block access due to read errors. Before attempting any file extraction, we need to inspect the health log and internal error codes stored in the drive's volatile memory.
To check the smart log and current status of the locked NVMe controller, run this command:
sudo nvme smart-log /dev/nvme0In practice, this command forces the main chip to report its current temperature, whether the flash cells have worn out, and if the firmware entered a read-only protection state. Often, an SSD deemed dead is simply stuck in safety mode due to a prior power surge. If the utility successfully reads this report, we have the green light to attempt raw data block extraction.
Extracting raw data blocks using ddrescue
When the main file system corrupts to the point of preventing normal partition mounting, the safest method to save files is bypassing the directory structure and copying the drive bit by bit. For this surgical mission, we use ddrescue, a program designed specifically to recover data from damaged media without stressing faulty flash memory sectors further.
The procedure involves connecting a healthy hard drive or secondary SSD with larger capacity to the computer and running the low-level clone:
sudo ddrescue -d -r3 /dev/nvme0n1 /media/user/backup/recovered_disk.img /media/user/backup/error_map.logIn this command, the -d flag enables direct disk access without relying on kernel caching, while -r3 tries reading problematic sectors up to three times before temporarily giving up. The generated log file is crucial for pausing and resuming the process if the frozen SSD disconnects mid-scan. For additional strategies on retrieving lost files on Linux systems, review the guide on how to recover deleted files on Linux via terminal. To explore these architectural concepts further in production, see our related technical analysis on How to test OLED display with oscilloscope and find faults.
Final thoughts on hardware data recovery
Recovering data from an NVMe SSD deemed dead by the graphical interface requires patience, system bus knowledge, and proper command-line tools. Although success depends directly on the severity of physical damage to the controller, knowing how to extract firmware logs and clone raw sectors using ddrescue drastically increases the odds of rescuing vital files. Always maintain up-to-date backups, as low-level recovery should always be treated as a last resort before permanent data loss.