Data recovery after disk formatting and Linux installation: limits, tools, and SSD traps
Back to blog

Data recovery after disk formatting and Linux installation: limits, tools, and SSD traps

9/24/2026 · 3 min · Infrastructure

Data recovery after disk formatting and Linux installation: technical limits and the SSD TRIM impact#

Accidentally formatting the wrong partition during a clean operating system installation is a classic nightmare scenario: a drive is wiped, and a new Linux distribution is written over the first 500 MB to 1 GB.

The immediate question is: can the previous files still be recovered?

To answer accurately, it is necessary to examine how storage hardware and filesystems handle data structures, the mechanics of high-level formatting, and why SSD storage fundamentally altered data recovery dynamics.


1. Logical file structures vs. physical disk sectors#

To understand file recovery, distinguishing logical files from physical storage blocks is essential.

From an application perspective, a file is a continuous, sequential stream of bytes. If a single block within that stream is corrupted or overwritten, the logical structure breaks, and the file cannot be opened.

At the physical disk layer, however, files are scattered across disk sectors. The operating system manages an index table (such as the Master File Table on NTFS or inode tables on Linux filesystems) that maps which physical sectors belong to each file.

High-level formatting: wiping the index#

Standard Linux distribution installers perform a high-level format when creating ext4, Btrfs, or XFS filesystems.

A high-level format only initializes a new partition table and overwrites the initial metadata blocks with the fresh operating system. It does not zero out the entire drive. Previous file data remains physically intact on untouched magnetic sectors, waiting until future write operations overwrite them.


2. Data carving and the role of photorec#

When the filesystem index is wiped, standard file undelete utilities fail because they depend on directory trees that no longer exist.

The effective path forward is Data Carving, using established open-source utilities like PhotoRec:


3. The critical divide: why SSDs change everything#

While data carving is highly effective on mechanical hard disk drives (HDDs), the underlying physics of modern SSDs (NVMe and SATA) alter the outcome completely.

SSDs rely on hardware-level management routines:

  1. The TRIM command: Sent by the OS during partition formatting, TRIM notifies the SSD controller that previously allocated blocks are no longer in use.
  2. Garbage Collection and the Flash Translation Layer (FTL): The SSD controller actively wipes the underlying flash memory cells to maintain write speeds. Once TRIM executes, the FTL returns zeros on subsequent read attempts.

If a format and reinstall occurred on an SSD with active TRIM support, recovery chances via software carving drop to near zero almost immediately.


Practical rescue checklist#

If you experience an accidental format on a mechanical HDD:

  1. Stop using the drive immediately: Power down the machine. Any running process generates background writes that permanently overwrite recoverable sectors.
  2. Isolate via Live USB: Never install recovery software onto the affected drive. Boot into a Linux Live USB environment and mount the target disk strictly as read-only.
  3. Execute Data Carving: Run PhotoRec targeting the raw disk, saving recovered output to a separate external storage drive.
  4. Recognize SSD hardware limits: If the formatted disk is a modern SSD with TRIM enabled, understand that software tools cannot recover cells purged by the hardware controller.

Was this article helpful?

Leave a quick reaction to help prioritize future technical guides:

CC BY-NC

This post is licensed under CC BY-NC.

Comments

Join the discussion below.

0 comments