|This page is a Work In Progress. The goal is to make it similar to opkg and then link to it as often as possible|
mtd is a utility we use to write to an MTD (Memory Technology Device). Please read the Notes to learn more.
Usage: mtd [<options> ...] <command> [<arguments> ...] <device>[:<device>...]
||unlock the device|
||refresh mtd partition|
||erase all data on device|
||write <imagefile> (use - for stdin) to device|
||append <file> to the jffs2 partition on the device|
||fix the checksum in a trx header on first boot|
||quiet mode (once: no [w] on writing, twice: no status messages)|
||write without first erasing the blocks|
||reboot after successful command|
||force write without trx checks|
||erase <device> before executing the command|
||directory for jffs2write, defaults to "tmp"|
||integrate <file> into jffs2 data when writing an image|
||offset of the image header in the partition(for fixtrx)|
||alter the fis partition table to create new partitions replacing the partitions provided as argument to the write command (only valid together with the write command)|
mtd4 labeled as
linux and reboot afterwards:
mtd -r write linux.trx linux
The differences between
dd (disc dump) and
mtd are …
- To make it more clear, here is a small comparison of MTD devices and block devices:
- MTD devices represent flash devices and they consist of eraseblocks of rather large size, typically about 128KiB. Block devices consist of small blocks, typically 512 bytes. MTD devices support 3 main operations - read from some offset within an eraseblock, write to some offset within an eraseblock, and erase a whole eraseblock. Block devices support 2 main operations - read a whole block and write a whole block.
- The whole eraseblock has to be erased before it becomes possible to re-write its contents. Blocks may be just re-written.
- Eraseblocks become worn out after some number of erase cycles - typically 100K-1G for SLC NAND and NOR flashes, and 1K-10K for MLC NAND flashes. Blocks do not have the wear-out property.
- Eraseblocks may become bad (only on NAND flashes) and software should deal with this. Blocks on hard drives typically do not become bad, because hardware has mechanisms to substitute bad blocks, at least in modern LBA disks.
- Sometimes flash memory uses FTL: Raw Flash vs. FTL (Flash Translation Layer)
- Although most flashes on the commodity hardware have FTL, there are systems which have bare flashes and do not use FTL! Those are mostly various handheld devices and embedded systems.
doc/techref/mtd.txt · Last modified: 2012/08/07 13:57 by mirko