Memory Technology Device: Difference between revisions

Content deleted Content added
Mmtmmt (talk | contribs)
No edit summary
The source notes that such is a kernel interface and doesn't mention anything about OS's
 
(47 intermediate revisions by 36 users not shown)
Line 1:
A{{Short '''Memorydescription|Type Technologyof Device'''device (MTD)file isin aLinux typefor ofinteracting embeddedwith [[flash memory]] that:}}
{{primary sources|date=December 2013}}
__NOTOC__
 
[[File:Macronix MX29LV320ATTC-70G 20110908.jpg|thumb|150px|Flash-[[EEPROM]] in a Router – a true MTD]]
* consists of eraseblocks rather than [[Cluster (file system)|clusters]] like in [[hard drives]].
A '''Memory Technology Device''' (MTD) is a type of [[Device file system|device file]] in [[Linux]] for interacting with [[flash memory]]. The MTD subsystem was created to provide an [[abstraction layer]] between the hardware-specific device drivers and higher-level applications. Although character and block device files already existed, their semantics don't map well to the way that flash memory devices operate.
* eraseblocks are large (32KiB, 128KiB) compared to hard drive's sector size (512 to 1024{{fact}} bytes).
* maintains three main operations - read from eraseblock, write to eraseblock, and erase eraseblock.
* bad eraseblocks are not hidden and should be dealt with in software.
* eraseblocks get worn-out (i.e., bad and unusable) after about 10<sup>4</sup>-10<sup>5</sup> erase cycles.
 
[[USB stick]]s, [[MultiMediaCard|MMC]]s, [[Secure Digital|SD]]s, [[CompactFlash]]es and other popular removable devices are not MTDs. Although they contain flash memory, this is hidden behind a [[block device]] interface using a [[Flash Translation Layer]] and not directly interfacing with the kernel.<ref>{{cite web | url=http://www.linux-mtd.infradead.org/doc/general.html#L_overview | title=Memory Technology Device Overview | accessdate=1 September 2012}}</ref>
MTD devices are somewhat more difficult to operate than hard drives due to their specific architecture.
 
When using an MTD, the use of an MTD aware file system such as [[UBIFS]], [[JFFS2]] or [[YAFFS]] is recommended. The MTD subsystem exports block devices as well, which allows the use of common filesystem like ext4. However, using an MTD this way is not recommended since there is neither detection of bad blocks nor any kind of wear leveling.
 
MTDs don't address to the kernel like traditional storage devices ([[Solid State Drive]], [[Hard Disk Drive]]...) using [[Logical block addressing|LBA]]s, but rather using offsets and sizes.
 
==References==
<references/>
 
==Further reading==
* {{cite book|author=Christopher Hallinan|title=Embedded Linux Primer: A Practical Real-World Approach|year=2010|edition=2nd|publisher=Pearson Education|isbn=978-0-13-706110-5|___location=chapter 10}}
 
== External links ==
* http://www.linux-mtd.infradead.org
 
{{Linux kernel}}
{{compu-storage-stub}}
 
{{Use dmy dates|date=March 2022}}
 
[[Category:Solid-state computer storage media]]
[[Category:Linux kernel features]]
 
 
[[cs:Memory Technology Device]]
{{compu-storage-stub}}
[[zh:MTD]]