What TRIM Does and Why It Destroys Data

TRIM is an ATA command (DATA SET MANAGEMENT) that the operating system sends to an SSD controller to identify logical block addresses that are no longer in use. When you delete a file, the OS marks those blocks as free in its filesystem table and sends a TRIM command to the SSD. The controller then schedules those physical NAND blocks for erasure during garbage collection. Once erased, the data is physically gone from the NAND cells and cannot be recovered.
What TRIM Tells the Controller to Do
On a hard drive, deleting a file only removes the directory entry that points to the file's data. The actual data remains on the platters until another file overwrites those sectors. This is why hard drive data recovery software can scan for deleted files and often find them intact.
SSDs work differently because of how NAND flash writes. NAND can be written at the page level (typically 4-16 KB) but can only be erased at the block level (typically 256-512 pages per block). Writing to a page that already contains data requires erasing the entire block first, then rewriting all valid pages in the block plus the new data. This is called write amplification.
TRIM reduces write amplification by informing the controller which pages contain deleted data. The controller can then skip those pages during block consolidation, and the garbage collector can erase blocks that contain only invalidated pages without needing to copy any valid data out first.
Garbage Collection: Deterministic vs Non-Deterministic
Garbage collection is the controller's background process of reclaiming blocks that contain a mix of valid and invalid (TRIMmed or overwritten) pages. The controller reads valid pages from partially used blocks, writes them to a new block, and erases the old block to make it available for new writes.
How the controller handles reads of TRIMmed blocks before garbage collection completes determines whether the TRIM implementation is deterministic or non-deterministic:
| TRIM Type | Read After TRIM | Recovery Window |
|---|---|---|
| Deterministic TRIM (DRAT) | Returns the same value every time a TRIMmed LBA is read (may be zeroes or stale data, but consistent) | Minimal. Data returned is deterministic but may not reflect actual NAND contents. |
| Deterministic Zero After TRIM (DZAT) | Returns all zeroes | None. Zeroes returned deterministically for all TRIMmed ranges. |
| Non-deterministic TRIM | May return old data or zeroes, unpredictably | Theoretical window exists, but unreliable and brief (seconds to minutes). |
Most modern consumer SSDs implement deterministic TRIM. The practical effect is that once the OS sends the TRIM command, recovery software reading those LBAs will get zeroes, regardless of whether the physical NAND erase has completed yet.
Why TRIMmed Blocks Are Unrecoverable
When garbage collection erases a NAND block, it applies an erase voltage that pulls all trapped electrons out of the floating gates (or charge trap layers) in every cell in the block. Every cell returns to its erased state: all 1s in binary. The data that was stored in those cells no longer exists in any physical form.
This differs from hard drive deletion in a critical way. On an HDD, deleted data remains as magnetic polarity patterns until overwritten. On an SSD, TRIM-triggered garbage collection physically resets the cells. There are no residual charge patterns to read. Chip-off NAND extraction (desoldering the NAND chips and reading them directly) will show erased blocks where the data used to be.
TRIM is why SSD data recovery differs from HDD recovery.
If you delete files from an SSD with TRIM enabled and the controller has processed the TRIM command, the data is gone. Recovery software cannot find data that has been physically erased from the NAND cells. This is the single most important fact that distinguishes SSD recovery from hard drive recovery.
TRIM Behavior Across Operating Systems
| OS | TRIM Enabled by Default | Notes |
|---|---|---|
| Windows 7+ | Yes (NTFS) | TRIM sent on delete. Weekly scheduled optimization also sends batch TRIM. |
| macOS 10.10+ | Yes (Apple SSDs) | TRIM for third-party SSDs requires manual enablement via trimforce command. |
| Linux (ext4, Btrfs, XFS) | Depends on mount options | Continuous TRIM via "discard" mount option or periodic batch TRIM via fstrim. |
| USB/Thunderbolt enclosures | Varies | Many USB-SATA bridge chips do not pass TRIM commands. This is actually favorable for recovery. |
The USB enclosure exception matters for recovery. Many consumer SSDs used as external drives in USB enclosures never receive TRIM commands because the USB-SATA bridge chip does not support the TRIM passthrough. In these cases, deleted data may still be present on the NAND because the controller never received the instruction to erase it.
Frequently Asked Questions
Can deleted files be recovered from an SSD with TRIM enabled?
In almost all cases, no. When a file is deleted, the OS sends a TRIM command identifying the freed blocks. The controller erases those blocks during garbage collection, physically zeroing the NAND cells. Unlike HDDs where deleting only removes the directory entry, TRIM causes the actual data to be erased.
Does TRIM happen instantly?
Not always. Deterministic TRIM (DRAT) guarantees the same value on every read of a TRIMmed LBA, but that value is not necessarily zeroes. DZAT guarantees zeroes. Non-deterministic TRIM may return different values on each read. Most modern SSDs process TRIM within seconds to minutes, making any recovery window negligible.
If you are experiencing this issue, learn about our SSD recovery service.