Flash Memory

Flash memory, which can come in several different technologies, is non-volatile memory, which means that its contents persist after its source of power is removed. Two of the most common types of flash devices are defined by their respective technologies: NOR and NAND. NOR-based flash is the older technology that supported high read performance at the expense of smaller capacities. NAND flash offers higher capacities with significantly faster write and erase performance but more complicated input/output (I/O) interface.

Flash Card Survey provides more information about the generic topics as well.

Read-Write Operation

Flash parts are commonly divided into partitions, which allows multiple operations to occur simultaneously (erasing one partition while reading from another). Partitions are further divided into blocks (commonly 64KB or 128KB in size). The only Write operation permitted on a flash memory device is to change a bit from a one to a zero. If the reverse operation is needed, then the block must be erased (to reset all bits to the one state). NOR flash memory can typically be programmed a byte at a time, whereas NAND flash memory must be programmed in multi-byte bursts (typically, 512 bytes)

An Erase is a special operation with the flash device and can be time-consuming. Erasing is an electrical operation that drains the electrons from each cell in an entire block. NOR flash devices typically require seconds for the Erase operation, whereas a NAND device can erase in milliseconds because NOR technology requires a precursor step to clear all values to zero before the Erase operation can begin

File system comparison on eMMC and SD shows experimental test result.

Flash File System

A flash file system is a file system designed for storing files on flash memory devices. Solid state media, like flash memory, are similar to disk drive in their interfaces. While practically eliminating seek times, they require special handling such as wear leveling and different error detection and correction algorithms to optimize for several reasons.

  • Erasing blocks : Flash memory blocks have to be explicitly erased before they can be written to. The time taken to erase blocks can be significant, thus it is beneficial to erase unused blocks while the device is idle.
  • Random access : Disk file systems are optimized to avoid disk seeks whenever possible, due to the high cost of seeking. Flash memory devices impose no seek latency.
  • Wear leveling : Flash memory devices tend to wear out when a single block is repeatedly overwritten; flash file systems are designed to spread out writes evenly.

General Linux File system architecture Linux flash file system architecture

In practice, flash file systems are used for "Memory Technology Devices" ("MTD"), which are embedded flash memories that do not have a controller. Removable flash memory cards and USB flash drives have built-in controllers to manage MTD with dedicated algorithms, like wear leveling, bad block recovery, power loss recovery, garbage collection and error correction, so use of a flash file system has limited benefit

FTL stands for "Flash Translation Layer" and it is software which emulates a block device on top of flash hardware early days FTL ran on the host computer but nowadays FTL is usually firmware, and it is run by the controller which is built into the storage device. All FTL devices have an interface which provides block I/O access. Well, the interfaces are different and they are defined by different specifications, e.g., MMC, eMMC, SD, USB mass storage, ATA, and so on. But all of them provide block-based access to the device

Linux has an abstraction of a block device. For example hard drives are block devices. Linux has many file systems and the block I/O subsystem, which includes elevators and so on which have been created to work with block devices (historically - hard drives). The MTD can automatically detect the width of the flash device bus and the number of devices necessary for implementing the bus width.

  • JFFS

JFFS was the first flash-specific file system in Linux, but it was quickly superseded by JFFS2, originally developed for NOR flash then JFFS2 was updated to support NAND flash too. JFFS is a log-structured file system that was designed for NOR flash devices. JFFS viewed the flash device as a circular log of blocks and embedded garbage collector allows file system automatically wear leveled both statically and dynamically. The fundamental problem with this architecture is that the flash device is erased too often (instead of an optimal erase strategy), which wears the device out too quickly.

The structural details are read into memory when a JFFS is mounted, which can be slow at mount-time and consume more memory than desired

  • JFFS2

In JFFS2, each block in the flash is treated independently. JFFS2 maintains three different block lists to sufficiently wear-level the device and more intelligent garbage collection. clean list (blocks on the device that are full of valid nodes), dirty list (blocks with at least one obsoleted node), free list (blocks that have been erased and are available for use) but still move data around the flash to support static wear leveling


YAFFS was released in 2002, developed for NAND flash. YAFFS also maintains trees in RAM to represent the block structure of the flash device, including fast mounting through checkpointing —the process of saving the RAM tree structure to the flash device on a normal unmount so that it can be quickly read and restored to RAM at mount time so Mount-time performance is a great advantage of YAFFS2 over other flash file systems

  • LogFS

LogFS, another Linux flash-specific file system, is currently being developed to address very scalable and can support large flash parts. LogFS maintains a tree structure on the flash device itself so that the mount times are similar to traditional file systems, such as ext2. It also uses a wandering tree for garbage collection (a form of B+tree). This significantly reduces both startup time and memory consumption. This becomes more important as the size of the flash device increases

  • TrueFFS

True flash file system or TrueFFS is designed to run on a raw Solid-state drive (most modern consumer SSDs are not raw). TrueFFS implements error correction, bad block re-mapping and wear leveling. TrueFFS presents a normal hard disk interface externally. that is TrueFFS does not provide a file system interface but a disk interface. A flash translation layer is used to adapt a fully functional file system to the constraints and restrictions imposed by flash memory devices. A derivative of TrueFFS, called TFFS or TFFS-lite, is found in the VxWorks operating system

  • ExtremeFFS

ExtremeFFS is a technology being developed by SanDisk allowing for improved random write performance in flash memory compared to traditional systems such as TrueFFS


UBI(Unsorted Block Images)FS is a flash file system developed by Nokia engineers with help of the University of Szeged. Unlike traditional file system - it does not work on top of block devices (like hard drives, MMC/SD cards, USB flash drives, SSDs, etc). UBIFS was designed to work on top of raw flash, which has nothing to do with block devices. UBI manages multiple logical volumes on a single flash device. It provides a mapping from logical blocks to physical erase blocks. UBI provides a flexible partitioning concept which allows for wear-leveling across the whole flash device

  • Btrfs

is a new copy-on-write filesystem that first appeared in the kernel in 2.6.29-rc1 and was merged in 2.6.30. Btrfs has been adopted as the MeeGo platform's file system.

  • e•MMC v4.5

After JEDEC announced eMMC v4.41in 2010, e•MMC (Embedded MultiMediaCard) v4.5 standard JESD84-B45 has been defined again from JEDEC to improve the interaction between the host processor and the memory device at the interface, configuration and protocol levels, resulting in potential gains in overall system performance and reliability. eMMC v4.5 hardware will be available H2/2012

See more eMMC 4.41 performance review, Linaro's efforts for eMMC

  • UFS

UFS (Universal Flash Storage) is designed to be the most advanced specification for both embedded and removable flash memory-based storage in mobile devices such as smart phones and tablet computers especifically tailored for mobile applications and computing systems requiring high performance and low power consumption. The initial data throughput for UFS will be 300 megabytes per second (MB/s), and the standard also supports command queuing features to raise random read/write speeds. UFS standard JESD220 can be download from the JEDEC website.

Linaro is working with Samsung to support UFS and Samsung's UFS patches merged upstream into 3.4 kernel after intial review and feedback from Kernel Working Group (KWG) storage team. see Linaro's efforts for UFS

Technical Topics In Linaro

Linaro is working on bunch of technical topics of file system by kernel working group based on the requirements from members and you may overview interesting topics at Linaro flash technical topics



Flash memory (last modified 2013-02-14 19:56:59)