SD card, eMMC, NAND or SSD? Choosing storage for embedded Linux
Storage is the most common cause of field failures in small Linux devices. Pick it deliberately.
The main options
- SD / microSD card. Cheap, removable and easy to flash, which is why single-board computers use it. It is also the usual suspect after corruption: quality varies widely, and heavy writes or sudden power loss can damage it.
- eMMC. Flash soldered to the board with its own controller. Generally sturdier and more consistent than a removable card, and a better default for products.
- Raw NOR flash. Small, reliable and good for bootloaders and tiny firmware, often over SPI.
- Raw NAND flash. Dense and cheap per bit but has bad blocks and needs wear levelling and error correction, usually through UBI and a flash filesystem such as UBIFS.
- SSD (SATA or NVMe). The right choice for workloads that write a lot or store a lot, such as a blockchain node. See Planning a Bitcoin node.
Understand endurance
Flash cells wear with each write. Cell type matters (SLC lasts longer than MLC, which lasts longer than TLC), and write amplification makes real wear higher than the data you write. Drives spread wear internally (wear levelling); raw flash relies on the filesystem to do it.
Pair it with a layout
| Storage | Sensible approach |
|---|---|
| SD card | Read-only system + small writable data partition; logs in RAM; a quality card |
| eMMC | Same, with A/B slots if you need field updates |
| Raw NAND | UBI + UBIFS |
| SSD | Ordinary Linux filesystem such as ext4; keep the OS separate from data |
For flash-friendly general storage, a filesystem such as F2FS can reduce wear; ext4 is the well-supported default.
Habits that protect any flash
- Keep
/tmpand logs in tmpfs or ship logs elsewhere. - Avoid swap on flash, or use compressed RAM swap instead.
- Design for power loss (read-only root filesystem guide).
- Monitor health where the device exposes it, and plan a replacement schedule.
There is no universally best medium: match it to how much you write, how long the device must last and whether anyone can swap it in the field.