Technology card
ShippingNAND Flash
NAND
From targets and logical units to planes, pages and erase blocks: how NAND is organized, and which resources an SSD controller can share.
Glossary entry on hesela.dev · JSON record · NAND spare area · NAND target · NAND logical unit · NAND plane · Die stacking
Raw-flash software
Related
On this page7 sections
In one minute
NAND flash is non-volatile memory built from strings of cells, with page-oriented reads and programming and block-oriented erasure.
Read the hierarchy before counting parallel work. In ONFI terminology, a target groups LUNs behind a chip-enable signal; a LUN is a command and status unit, and planes group blocks inside it. A NAND LUN is not a host-facing SCSI logical unit. [6]
Counting host chip-enable pins is not enough to count NAND targets. ONFI 4.0 describes optional CE_n pin reduction: several NAND targets share one host CE_n signal and are selected by a Volume address. Here Volume denotes the target-selection mechanism, not an SSD namespace or filesystem volume. [6]
Concurrency has boundaries. LUNs can overlap array activity but share the target's output bus. Multi-plane operations coordinate the same operation type within a LUN; address restrictions depend on the component and command. Neither a plane count nor a die count is a direct throughput multiplier. [7] [8]
Keep packaging and accounting separate. Die stacking combines physical dies; Linux's NAND geometry records targets, LUNs per target, planes per LUN and erase blocks per LUN separately. If a block count is already per LUN, multiplying by planes again double-counts capacity. [9]
Worked geometry: 2 targets x 2 LUNs per target x 1,024 blocks per LUN x 64 pages per block x 4,096 data bytes per page = 1,073,741,824 bytes, or 1 GiB. Two planes per LUN divide those blocks; they do not turn this example into 2 GiB. This counts nominal main-array data bytes, excluding spare bytes and without deducting bad blocks or controller reservations; it is not the SSD's advertised usable capacity. [9]
On Linux raw flash, keep three responsibilities separate: MTD exposes the device, UBI manages logical eraseblocks and wear, and UBIFS supplies files, an on-flash index and journal recovery above UBI. UBI is not a filesystem, and UBIFS does not mount directly on an ordinary SSD block device. [17]
UBI Fastmap reduces attachment scanning by keeping a checkpoint of volume mappings and eraseblock state. On the Fastmap attach path, Linux v6.16 first searches an anchor region of 64 physical eraseblocks, then validates the checkpoint and scans pools for changes since it was written. The 64-block region is discovery work, not a bound on all reads. This is separate from UBIFS's filesystem index and journal recovery. [2] [3] [5] [17]
The fast path is conditional. In Linux v6.16, devices with at most 64 physical eraseblocks force a full scan. If no Fastmap is found, UBI continues the ordinary scan beyond the searched prefix. An invalid Fastmap or an uncorrectable ECC error returned from that path triggers a fresh scan; other negative errors can abort attachment. Debug verification may itself scan the whole device. A slow attach therefore does not by itself identify a filesystem-index problem or permanent media damage. [2]
Fastmap trades scanning work for metadata and configuration. Linux v6.16 marks its build option experimental and off by default, reserves eraseblocks for two Fastmaps, and calculates a checkpoint size that grows with physical eraseblock count. fm_autoconvert permits creating Fastmap on older images; the per-device disable flag still forces scanning. Record the effective settings and fallback path before comparing startup timings. These source-level mechanisms are not a measured boot-time speedup. [1] [3] [4]
The 2008 performance study used a modified, trace-driven DiskSim model. Interleaving helped IOzone and Postmark in its evaluated configurations, but not TPC-C and Exchange, where queues per flash package were nearly empty. The authors left detailed validation of real SSD caching and flash-management behavior to future work. This is evidence that scheduling and workload matter, not a measured speedup for a current SSD. [18]
A successful Linux kernel MTD read need not mean that ECC corrected no errors. Linux v6.16 MTD compares the largest driver-reported count within one ECC step against bitflip_threshold. Corrections below that threshold can still return 0; meeting or exceeding it produces -EUCLEAN on the normal ECC-enabled path. The count is not a sum over the page or request. [13] [14]
Do not treat that warning as a failed recovery. UBI converts -EUCLEAN to UBI_IO_BITFLIPS and its logical-eraseblock read path can request scrubbing. By contrast, -EBADMSG can originate from an ECC error or, at UBI's static-volume layer, a CRC mismatch. The reporting API and volume type matter: these results do not mean that a block has necessarily been permanently marked bad. [15] [16]
Userspace has another boundary. Linux v6.16 ordinary read() on /dev/mtdX can return bytes even after an ECC error. MEMREAD can report EUCLEAN for corrections below bitflip_threshold; it also returns per-request ECC statistics. Check the interface before treating a completed dump as verified data. [10] [11]
For a repeatable dump, record both the descriptor mode and the operation mode. MTDFILEMODE sets the descriptor mode, but MEMREAD takes its mode from the request. MTD_OPS_RAW disables error correction; fewer warnings in that mode do not demonstrate healthier flash. Inspect returned len and ooblen alongside errno and ECC statistics: an error status and copied data can coexist. [11] [10]
An ECC count also does not identify the physical cause. Cai et al.'s DSN 2015 experiments used 2Y-nm MLC NAND and an FPGA platform. Their reduced-pass-voltage study emulated changes with read-retry on one wordline per block across ten blocks. Lowering that voltage traded reduced disturbance against additional read errors, with available correction margin changing over retention age. That device-level trade-off is different from changing a Linux warning threshold, which does not alter the sensing voltage or ECC strength. [12] [14]
A NAND read has two stages: sensing cells into an internal page register, then transferring requested data over the interface. Programming loads data into a register before changing the array; erasing resets a larger block for reuse. These units explain why a host's small write cannot be treated as a direct overwrite of one arbitrary flash byte. [18]
An SSD adds address translation and reclamation around these constraints. A logical overwrite can be placed in a different physical page; surviving data must be preserved when reclaiming a block. The host's logical sector, the NAND page and the erase block are different units. [18]
A NAND page can include an out-of-band (OOB), or spare, area alongside its main data. That area carries ECC and other reserved information; it is not an extra pool of host-addressable blocks. Desnoyers warns that stronger ECC can leave less room for translation metadata, so an FTL must not assume that every spare byte is available. [22]
Choose who owns the management work. Raw NAND exposes responsibilities to the external controller or software stack. Fully managed NAND integrates a controller. On-die ECC occupies a narrower middle ground: correcting bits inside the device does not by itself provide wear leveling or bad-block management. [19]
For raw-NAND integration, preserve factory bad-block information, apply the required ECC scheme, inspect program/erase status, and retire blocks that fail as specified. A serial interface does not remove these obligations. Micron's guidance also describes loading NAND boot code into DRAM, rather than assuming the array behaves like directly executable NOR. [20]
Block retirement and data recovery are separate steps. Linux v6.16 UBI attempts to move readable prior data and the pending write into another eraseblock after a write failure. That recovery can itself fail and put the dynamic-volume write path into read-only mode. Excluding a damaged block from future allocation does not reconstruct bytes that cannot be recovered. Replacement eraseblocks are also distinct from a page's OOB spare area. [21] [22]
Choose the update boundary explicitly. Linux v6.16 UBI marks a volume before replacing its contents. If that operation is interrupted, the marker leaves the volume damaged and normal I/O restricted until a new update; it is not an automatic rollback to the old image. A separate atomic LEB change replaces one logical eraseblock, not a multi-block filesystem transaction. [23] [24]
Unmapping is another boundary: UBI schedules physical erasure but does not wait for it. An unclean reboot before erasure can expose the old mapping again. The erase operation waits for the corresponding physical block to be erased. Neither API name alone establishes a complete sanitization protocol. [25]
A research example makes the distinction concrete. Reardon, Capkun and Basin's UBIFSec prototype atomically replaced key-storage LEBs, then explicitly flushed erasures of obsolete physical copies. Its key-state and recovery protocol matters as much as the atomic replacement. This USENIX Security 2012 design is not a secure-deletion guarantee of ordinary UBIFS, and its phone measurements are not current SSD benchmarks. [26]
Do not turn one generation's numbers into NAND constants. Desnoyers documents variation in geometry and the relationship between endurance and retention. Read the exact part's data sheet and qualification conditions before choosing ECC, planning spare capacity or estimating service life. [22]
Compared to neighbors
Package-level management changes the host's job. A serial bus and an integrated ECC engine are separate features.
| NAND form | ECC | Wear / bad blocks |
|---|---|---|
| Raw | External | External |
| On-die ECC | On device | External |
| Managed | Controller | Controller |
Uncertainty notes
- This is a source review, not a benchmark. The 2008 and 2013 papers support mechanisms and constraints; their part-specific dimensions, timings and cycle counts are not presented as current universal values.
Sources
- 01Linux v6.16, UBI Fastmap configuration and reserved eraseblocks · accessed 2026-11-30
- 02Linux v6.16, scan_fast and ubi_attach: discovery, fallback and errors · accessed 2026-11-30
- 03Linux v6.16, ubi_calc_fm_size and scan_pool: checkpoint size and changed blocks · accessed 2026-11-30
- 04Linux v6.16, UBI setup: Fastmap conversion and per-device disable flag · accessed 2026-11-30
- 05Linux v6.16, UBI_FM_MAX_START: Fastmap anchor-search region · accessed 2026-11-30
- 06ONFI 4.0, sections 1.4.1, 2.20 and 3: NAND hierarchy and CE_n pin reduction · accessed 2026-10-23
- 07ONFI 4.2, sections 3.1.2-3.1.3: shared data bus and multiple-LUN operation restrictions · accessed 2026-10-20
- 08ONFI 5.2, section 7: multi-plane operations and device-specific address restrictions · accessed 2026-10-20
- 09Linux v6.12, include/linux/mtd/nand.h: nand_memory_organization, nand_pos and nanddev_target_size · accessed 2026-10-20
- 10Linux v6.16, mtdchar_read and mtdchar_read_ioctl: userspace read results · accessed 2026-10-22
- 11Linux v6.16, MEMREAD request and per-operation ECC statistics · accessed 2026-10-22
- 12Cai et al., Read Disturb Errors in MLC NAND Flash Memory: Characterization, Mitigation, and Recovery, DSN 2015, sections 3.1 and 3.6-3.7 · accessed 2026-10-22
- 13Linux v6.16, MTD sysfs ABI: ECC step, strength and bitflip threshold · accessed 2026-10-22
- 14Linux v6.16, mtd_read and mtd_read_oob: status conversion · accessed 2026-10-22
- 15Linux v6.16, ubi_io_read: corrected and uncorrectable read results · accessed 2026-10-22
- 16Linux v6.16, ubi_eba_read_leb: volume-specific CRC and scrubbing paths · accessed 2026-10-22
- 17Linux kernel, UBIFS Authentication Support: MTD, UBI and UBIFS · accessed 2026-10-21
- 18Agrawal et al. - Design Tradeoffs for SSD Performance, USENIX ATC 2008, sections 2, 4.1-4.3 · accessed 2026-10-23
- 19Micron - Choosing the right NAND: raw, managed and on-die ECC · accessed 2026-10-18
- 20Micron - FAQs: NAND Flash ECC, bad-block management and boot code · accessed 2026-10-18
- 21Linux v6.16, UBI eraseblock association: try_recover_peb, recover_peb and ubi_eba_write_leb · accessed 2026-10-20
- 22Desnoyers - What Systems Researchers Need to Know about NAND Flash, HotStorage 2013, sections 2-3 · accessed 2026-10-18
- 23Linux v6.16, UBI volume-update marker and start/update paths · accessed 2026-10-21
- 24Linux v6.16, ubi_leb_change, ubi_leb_unmap and ubi_leb_erase · accessed 2026-10-21
- 25Linux v6.16, UBI userspace interface and ioctl contracts · accessed 2026-10-21
- 26Reardon, Capkun and Basin, Data Node Encrypted File System: Efficient Secure Deletion for Flash Memory, USENIX Security 2012, sections 2 and 4.2 · accessed 2026-10-21