bad-block-management · shipping

Bad block management

Bad block management identifies and excludes NAND eraseblocks that are unusable at manufacture or become unusable during service.

Related Observatory article: Read on hesela.com

Raw NAND relies on an external controller or software stack for bad-block handling. Managed NAND integrates that responsibility; on-die ECC alone does not provide it. [1]

Retiring a block prevents its reuse but does not reconstruct unreadable bytes. In Linux v6.16, UBI's recover_peb path attempts to copy readable prior data and retry the failed write in another physical eraseblock. Recovery can fail; the dynamic-volume write path then enters read-only mode. [2]

Corrected bitflips, uncorrectable ECC errors and retirement are distinct events. UBI's I/O layer distinguishes corrected data from an uncorrectable ECC read result, while its wear-leveling layer can relocate data for scrubbing. The corrected-bitflip notification is governed by MTD's bitflip_threshold per ECC step, not by every individual corrected bit. [6] A corrected read therefore does not by itself mean a block was permanently marked bad. [5] [3]

Linux v6.16 defaults MTD_UBI_BEB_LIMIT to 20 maximum expected bad eraseblocks per 1024, using the entire NAND chip rather than only the attached partition. This configurable planning limit is not a universal SSD spare percentage. In the erase-worker bad-block path, an empty reserved pool can be supplemented by available unallocated eraseblocks; if both pools are empty, UBI switches to read-only mode. [4] [3]

Relations

related
Flash translation layer (FTL), NAND flash, Solid-state drive (SSD), Wear leveling, Over-provisioning, SSD controller, S.M.A.R.T., NOR flash, Byte-addressable storage, Unsorted Block Images (UBI), UBI File System (UBIFS), Memory Technology Device (MTD), MTD bitflip threshold, Bad block table

Limitations

  • A read-only transition stops writes but does not certify that every previously stored byte remains readable.

Citations

  1. Micron. Choosing the right NAND: raw, managed and on-die ECC (accessed 2026-10-20)
  2. Linux v6.16, drivers/mtd/ubi/eba.c: try_recover_peb, recover_peb and ubi_eba_write_leb (accessed 2026-10-20)
  3. Linux v6.16, drivers/mtd/ubi/wl.c: scrubbing and __erase_worker bad-block reserve handling (accessed 2026-10-20)
  4. Linux v6.16, drivers/mtd/ubi/Kconfig: MTD_UBI_BEB_LIMIT and whole-chip sizing (accessed 2026-10-20)
  5. Linux v6.16, drivers/mtd/ubi/io.c: ubi_io_read return values and corrected versus uncorrectable errors (accessed 2026-10-20)
  6. Linux v6.16, MTD sysfs ABI: bitflip_threshold and ECC-step reporting (accessed 2026-10-21)
Sources & caveats
  • The Linux v6.16 code is a versioned raw-flash implementation example, not a description of every SSD controller or later kernel. [2] [3]
  • The read-only limitation follows from separating allocation and write policy from the ability to recover existing bytes; it is not a hardware test result.

JSON: /data/terms/bad-block-management.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Bad block management. Hesela. 2026-11-13. https://hesela.dev/terms/bad-block-management/