Flash Translation Layers and NAND Reconstruction
An SSD, memory card or managed-flash chip does not keep a logical sector at a fixed physical place. Its controller writes new data to new pages and keeps mapping information that says which physical page currently holds each logical block. When that mapping is lost or unreachable, raw pages have to be put back into logical order, and the result is only as good as the evidence for each choice made along the way.
- Physical page order is not logical sector order; mapping metadata and payload are needed together.
- Mapping schemes differ by controller; there is no single table format or update rule common to all flash.
- The newest-looking page or highest counter does not by itself prove which copy is the committed one.
- Erased, stale, deallocated, unreadable and unmapped are different states; zeros in an output must not hide unknown data.
- A working controller path and raw reconstruction each have strengths and risks; neither is always first or always best.
Host view and physical organisation
NAND can be programmed and read page by page, but erased only in larger blocks. Changing one logical block therefore usually means writing the new version to an already erased page elsewhere and marking the old one invalid. A flash translation layer (FTL) hides this from the host. Research on page-mapping FTLs describes it as performing out-of-place updates, wear levelling and garbage collection behind the scenes.
KIOXIA’s brief on managed flash describes a logical-to-physical (L2P) table stored in the system data of e-MMC and UFS devices and updated whenever a logical block is written, with background garbage collection and wear levelling moving data to other physical locations. That is one vendor’s description of its managed devices, not a specification for every SSD, but the consequence is general: a logical block can move without any change visible to the host, and reading NAND in physical order does not produce the logical disk.
Wear levelling relocates data that did not change logically, garbage collection copies still-valid pages out of a block before erasing it, and bad-block management substitutes reserve blocks for retired ones. All three spread one file across dies, planes, blocks and write generations.
Mapping is implementation-specific
“The FTL table” is a simplification. Controllers use page-level, block-level or hybrid mapping, hold parts of the mapping in RAM and parts in flash, and persist it through checkpoints, logs or per-page metadata in the spare area, in combinations that are proprietary and change between firmware versions. These are examples of implementations, not requirements of a format.
For reconstruction this means the evidence available differs from one device to the next. A recent checkpoint of the mapping, logs of changes since it, and logical addresses or sequence information stored with each page are all possible sources, but only where that architecture actually keeps them. Losing a single central table does not make reconstruction impossible if other structures carry the mapping; equally, none of those structures can be assumed to exist without knowing the controller.
Several physical versions of one logical block
Because updates go to new pages, one logical block can have several physical copies at once: older invalid ones waiting for garbage collection and the current one. Choosing between them is the core of reconstruction, and it is easy to get wrong. The copy with the largest sequence number or the most recent-looking position is not automatically the committed one: power loss can leave a page written but its mapping update incomplete, metadata can be torn, and controllers attach different meanings to their counters.
Illustration: two pages, one logical block
Two physical pages claim the same logical block. One carries a higher sequence value.
The higher value may be the committed version, or a write the controller never finished recording in its mapping.
Cross-check against the mapping checkpoints and logs that exist for this controller and against the file-system structures that reference the block.
A conceptual example. What a counter means is controller-specific.
An older copy is also not “deleted data that can be recovered” as a matter of course. It may be a superseded version, may already have been erased, and may be impossible to place in a coherent file system without the mapping that once referenced it.
Page states that must not be merged
A reconstructed image has to keep several states apart:
- Erased or never written: the page holds no data.
- Invalid or stale: an older version superseded by a newer write.
- Deallocated by the host: a logical range the host released, for example by TRIM; what the device returns for it depends on the device, see TRIM, Deallocate and Garbage Collection.
- Unreadable: the page could not be read or corrected.
- Unmapped: no surviving evidence says which physical page holds this logical block.
Writing zeros for every logical block that is not resolved makes all of these look alike. Unknown ranges are marked in a map that travels with the image, so that zeros in the output mean confirmed zeros, not missing evidence.
How access to the mapping is lost
Mapping metadata can be damaged by power loss during an update, by firmware faults, or by wear in the blocks that hold it; the controller can also fail while the metadata survives. In each case the NAND may be electrically readable and still not assemble into a logical drive, because what gave the pages their logical identity is unavailable. The symptoms at the host, and why they do not identify the failed layer, are covered in SSD Firmware, Translator and Controller-Level Recovery.
Controller path or raw reconstruction
Data on flash usually passes through several transformations: error correction, often descrambling, mapping, and on many devices decryption. Their order and form differ by controller, so a diagram of them shows dependencies, not a universal pipeline.
A stable path through the original controller, whether its normal interface or a controller-aware service procedure, can apply these transformations with knowledge only the controller has, including keys that never leave it. That is a real advantage, not a rule. The controller may be failing, the procedure may not support this model or firmware, and keeping it powered lets its own background activity continue. A host-side write blocker does not stop that internal activity.
Raw acquisition by chip-off or in-system access reads pages outside the controller and has to rebuild every transformation offline. Its output also depends on the interface: raw NAND access can include spare areas and invalid pages, while reading an e-MMC or UFS package through its managed interface returns data the package’s own controller has already translated. The physical side is covered in Chip-Off, ISP and Monolithic Flash Recovery. Which route fits depends on the exact device, its failure and what is supported; neither is universally first or last.
Validating a reconstructed image
A reconstruction that produces a mountable volume is a candidate. Check it by:
- geometry and bounds: logical size, block size and partition layout that match the device and its history;
- file-system structures that agree with each other across the volume, not only near the start;
- files of different types from different regions that open and parse completely;
- error-correction results per region, and a map of unresolved, unreadable and conflicting ranges.
A partial image is labelled as partial. Files assembled from the wrong version of a page can look plausible, so important data is checked across its whole length; see How to Validate Recovered Data.
Keep mapping evidence and physical pages together, choose between page versions by checked metadata rather than by the largest number, and mark every logical range the reconstruction could not resolve.
Technical references: KIOXIA, Understanding Logical Block Address — L2P table in e-MMC/UFS system data, updated on writes · Dayan and Bonnet, Garbage Collection Techniques for Flash-Resident Page-Mapping FTLs — out-of-place updates, page-mapping FTL class · Wei et al., FAST ’11, §2.2 — remapping leaves old physical copies. These describe one vendor’s managed flash and classes of FTL studied in research, not the closed firmware of any particular controller.
Related: SSD Recovery Fundamentals · SSD Firmware, Translator and Controller-Level Recovery · Chip-Off, ISP and Monolithic Flash Recovery · TRIM, Deallocate and Garbage Collection · SSD Controller Failure · USB Flash Drive Failure