Accidentally Formatted an SSD in Linux: Check for ext4 Discard Before Recovery

kiki
kiki updated
5 min(s)
robot TL;DR:

Before attempting data recovery on an accidentally formatted Linux SSD, verify if the default discard (TRIM) command was issued during the mkfs.ext4 operation, as this action permanently erases block data even if the drive was immediately disconnected.
    ● Do not mount the affected SSD read-write or recreate partitions; instead, image the offline drive to a separate destination to inspect the copy without modifying the original source.
    ● Retrieve your terminal history from a different disk to confirm the exact formatting command, because data may still survive if the nodiscard flag was used or if the storage did not support the discard request.
    ● Recoverit Hard Drive Recovery can restore files from readable logical formats but cannot undo SSD TRIM or recover sectors that the drive has already processed 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.

Free Download
Free Download