Accidentally Formatted an SSD in Linux: Check for ext4 Discard Before Recovery
Before attempting data recovery on an accidentally formatted Linux SSD, you must determine if the format command issued a TRIM request, because trimmed sectors are permanently cleared and cannot be restored by software.
● The `mke2fs` utility enables the `discard` option by default when creating ext4 filesystems, meaning data may already be physically unavailable if the SSD processed the request and the `nodiscard` flag was absent.
● Keep the affected SSD offline without mounting it read-write, and create a complete disk image to a separate storage drive to safely inspect the remaining data.
● Recoverit Hard Drive Recovery can retrieve files from readable logical formatting scenarios, but it cannot bypass SSD TRIM execution or recreate sectors that now read as discarded.
Ask AI for a summary
Disconnecting the SSD was the right immediate precaution, but it cannot reverse a discard command already issued during formatting. In this Linux format-mistake question on Reddit, the owner says a primary SSD with roughly 2TB of important data was formatted. They shut down the computer, physically unplugged the SSD and ordered a new disk for recovery. The post does not reliably establish the exact format command or what its full output showed.
Did the Linux Formatter Send TRIM to the SSD?
This is the question that matters before buying recovery software. The official mke2fs manual says that, when creating ext-family file systems, its discard option is enabled by default and attempts to discard blocks at format time on supporting storage; nodiscard disables that request. Therefore, if the user ran the usual mkfs.ext4 workflow and the SSD honored discard, much of the previous data may be unavailable despite the drive not being reused. That is a condition to check, not a claim that the Reddit post proves all 2TB were trimmed.
If the formatter was different, the storage did not support or process discard, or only part of the disk was formatted, the outcome can differ. An empty-looking new filesystem is not by itself proof of physical data erasure, and a post-format filename scan is not proof the file contents survive.
What Should Happen Before the Next Power-On?
Stop and Evaluate
- Do not boot or mount the SSD read-write: preserve the only original; avoid recreating partitions, running filesystem repair or writing recovery output to it.
- Identify the operation: retrieve the installer or terminal history from a different disk if available, not by restarting the affected installation. Determine which disk, filesystem and command were involved.
- Choose a recovery path by remaining data: for irreplaceable material, seek a specialist's evaluation of SSD model and discard behavior before repeated scans. If doing a controlled assessment, image the offline SSD to a separate destination and inspect the copy without modifying the source.
Recoverit Hard Drive Recovery can address some readable logical formatting cases, but it cannot undo SSD TRIM or recreate sectors that now read as discarded. Buying another disk is useful for preserving recoverable data; it does not itself make a trimmed SSD recoverable.