A flash file system is a file system designed for storing files on flash memory–based storage devices. While the flash file systems are closely related to file systems in general, they are optimized for the nature and characteristics of flash memory (such as to avoid write amplification), and for use in particular operating systems.
Contents
Overview
While a block device layer can emulate a disk drive so that a general-purpose file system can be used on a flash-based storage device, this is suboptimal for several reasons:
Log-structured file systems have all the desirable properties for a flash file system. Such file systems include JFFS2 and YAFFS.
Because of the particular characteristics of flash memory, it is best used with either a controller to perform wear leveling and error correction or specifically designed flash file systems, which spread writes over the media and deal with the long erase times of NAND flash blocks. The basic concept behind flash file systems is: when the flash store is to be updated, the file system will write a new copy of the changed data over to a fresh block, remap the file pointers, then erase the old block later when it has time.
In practice, flash file systems are used only for Memory Technology Devices (MTDs), 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.
Flash-based memory devices are becoming more prevalent as the number of mobile devices is increasing, the cost per memory size decreases, and the capacity of flash memory chips increases.
Origins
The earliest flash file system, managing an array of flash as a freely writable disk, was TrueFFS by M-Systems of Israel, presented as a software product in PC-Card Expo at Santa Clara, California, in July 1992 and patented in 1993.
One of the earliest flash file systems was Microsoft's FFS2, for use with MS-DOS, released in autumn 1992. FFS2 was preceded by an earlier product, called "FFS", which however fell short of being a flash file system, managing a flash array as write once read many (WORM) space rather than as a freely writable disk.
Around 1994, the PCMCIA, an industry group, approved the Flash Translation Layer (FTL) specification, based on the design of M-Systems' TrueFFS. The specification was authored and jointly proposed by M-Systems and SCM Microsystems, who also provided the first working implementations of FTL. Endorsed by Intel, FTL became a popular flash file system design in non-PCMCIA media as well.
Linux flash filesystems
Union filesystems
Overlayfs, Unionfs, and aufs are union filesystems, that allow multiple filesystems to be combined and presented to the user as a single tree. This allows the system designer to place parts of the operating system that are nominally read-only on different media to the normal read-write areas. OpenWrt is usually installed on raw flash chips without FTL. It uses overlayfs to combine a compressed read-only SquashFS with JFFS2.
Translation layers
Some subsystems are often called flash file systems, while they are more precisely block drivers performing different translations, and they actually do not have a file system interface. Such subsystems include the following:
TrueFFS
Despite the name, TrueFFS is not a file system at all; it does not provide a file system interface but a disk interface. TrueFFS is correctly termed a flash translation layer. 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. Externally, TrueFFS presents a normal hard disk interface.
TrueFFS was created by M-Systems on well-known "DiskOnChip 2000" product line, who were acquired by Sandisk in 2006. A derivative of TrueFFS, called TFFS or TFFS-lite, is found in the VxWorks operating system, where it functions as a flash translation layer, not as a fully functional file system. A flash translation layer is used to adapt a fully functional file system to the constraints and restrictions imposed by flash memory devices.
ExtremeFFS
ExtremeFFS is a technology developed by SanDisk (which acquired M-Systems) allowing for improved random write performance in flash memory compared to TrueFFS. Sandisk claimed that the technology improves random access speed in Solid-state drives by a factor of 100. In 2008 the company promoted using ExtremeFFS in a multi-level cell implementation of NAND flash memory.