mtd · shipping · also MTD, Memory Technology Devices

Memory Technology Device (MTD)

MTD is the Linux kernel subsystem providing a common interface to flash and other memory devices, including raw NAND and NOR.

Related Observatory article: Memory Technology Device (MTD) on hesela.com

MTD covers flash, RAM and similar devices. It exposes device operations rather than supplying a filesystem or an SSD-style translation layer. [1]

Raw NAND has eraseblock, write and OOB geometry. An ECC step need not span a whole NAND page or match a host sector. [2] [3]

UBI adds logical eraseblocks, wear management and volumes; UBIFS supplies files above UBI. [4]

In the ECC-enabled mtd_read_oob path, nonnegative correction counts become 0 or -EUCLEAN according to bitflip_threshold; negative results are preserved. -EBADMSG does not count bad blocks or mean every returned byte is wrong. [5] [6]

Userspace differs: ordinary read() on /dev/mtdX can deliver bytes despite -EUCLEAN or -EBADMSG below it. MEMREAD returns per-request ECC statistics and can report EUCLEAN for below-threshold corrections. An ioctl error is -1 with errno set, not the kernel's negative errno value. [7]

MEMREAD distinguishes corrected_bitflips (total), max_bitflips (one ECC step) and uncorrectable_errors. MTD_OPS_RAW bypasses error correction. The request mode overrides the descriptor mode set by MTDFILEMODE; raw mode is not a stronger integrity check. [8]

Inspect returned len and ooblen with errno and ECC statistics. MEMREAD can copy data and still report an ECC error; returned bytes alone do not certify integrity. [7]

Relations

related
NAND flash, NOR flash, Unsorted Block Images (UBI), UBI File System (UBIFS), MTD bitflip threshold, Bad block management, Error-correcting code

Citations

  1. Linux v6.16, Memory Technology Device configuration (accessed 2026-10-22)
  2. Linux v6.16, MTD interface: device geometry and operations (accessed 2026-10-22)
  3. Linux v6.16, MTD sysfs ABI: ECC step, strength and bitflip threshold (accessed 2026-10-22)
  4. Linux kernel, UBIFS Authentication Support: MTD, UBI and UBIFS (accessed 2026-10-22)
  5. Linux v6.16, mtd_read and mtd_read_oob: status conversion (accessed 2026-10-22)
  6. Linux v6.16, ubi_io_read: corrected and uncorrectable read results (accessed 2026-10-22)
  7. Linux v6.16, mtdchar_read and mtdchar_read_ioctl: userspace read results (accessed 2026-10-22)
  8. Linux v6.16, MEMREAD request and per-operation ECC statistics (accessed 2026-10-22)
Sources & caveats
  • Source review scoped to Linux v6.16. No raw-flash device, fault injection or endurance experiment was run.

JSON: /data/terms/mtd.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Memory Technology Device (MTD). Hesela. 2026-10-22. https://hesela.dev/terms/mtd/