Most regular linux (and unix more generally) systems use a storage abstraction called block devices. A block device is a sequence of blocks (sectors). Individual blocks can be read or written. There is an assumption that reading or writing sequential blocks will be faster than reading and writing and an assumption that it's ok to write to the same place repeatedly.
That is a pretty good model for disk drives. It's not a good model for flash memory.
Flash memory has to be erased before it can be re-written. The erase circuitry is relatively complex so erase blocks (especially in NAND flash) are usually substantially bigger than write blocks. Each erase block can only be erased a limited number of times before failing. Therefore to maximise usable life a mechanism is needed to even out the wear across the device.
There are two approaches. One approach is to create a controller that presents a standard block device interface and handles wear leveling through remapping logical blocks to different physical ones and in some cases moving "cold" (rarely modified) data from low wear blocks to high wear ones. That means that any normal file system can be used, but the remapping system is difficult to implement correctly. In particular handling power failure correctly is very difficult. This is the approach used by SSDs, USB sticks, SD cards etc.
The other approach is not to try and pretend that flash is a disk drive at all but to create a new device type that represents a flash chip directly. The filesystem (or in the case of ubifs the ubi layer) then takes on the responsibility for wear leveling. Linux calls such devices mtd devices. As with hard drives each device can be split into multiple partitions (though IIRC the partitions are usually defined by the system firmware rather than by a partition table on the flash device in question). This approach is frequently seen in embedded devices, smartphones and smartphone-like tablets.
manpreet
Best Answer
2 years ago
Documentation and webpages are not very clear on this. Is it a Linux technology? Is it a type of storage device?
Some other questions: