Difference between revisions of "Memory Tecnology Device (MTD)"

From DAVE Developer's Wiki
Jump to: navigation, search
(UBI)
(UBI)
Line 10: Line 10:
  
 
=== UBI ===
 
=== UBI ===
 
UBIFS can be considered as the next-generation of the JFFS2 file system. It is a new journaled flash file system which works on top of the UBI (Unsorted Block Images) subsystem, a wear-leveling and volume management system for raw flash devices. UBI volumes are higher level entities than MTD devices, which represents the raw flash devices (/dev/mtdX) and provide the interface to access flash chips. The following figure shows the involved subsystems:
 
 
[[File: Ubifs stack.png]]
 
 
The default MTD partition associated to the NAND flash is mapped as number 4. Let’s assume we run the kernel by using the net_nfs configuration. Since using UBIFS shares some points with using JFFS2, please refer to ... for further details.
 
 
To access and use UBIFS:
 
* Add the ubi.mtd=X parameter to the kernel command line, where X is the number of the mtd partition
 
* Erase the MTD partition:
 
<pre class="board-terminal">
 
flash_eraseall /dev/mtdX
 
</pre>
 
* As an alternative to point 1, launch the following command:
 
<pre class="board-terminal">
 
ubiattach /dev/ubi_ctrl -m X
 
</pre>
 
* The device /dev/ubi0 is now available. To create the UBI volume, launch the following command (-N sets the name and -s sets the size of the volume):
 
<pre class="board-terminal">
 
ubimkvol /dev/ubi0 -N rootfs -s 128MiB
 
</pre>
 
* The device /dev/ubi0_0 is now available and can be mounted with one of the following comands:
 
<pre class="board-terminal">
 
mount -t ubifs ubi0_0 /mnt/ubifs
 
mount -t ubifs ubi0:rootfs /mnt/ubifs
 
</pre>
 
* To mount the UBI file system as root file system, the binding between MTD and UBI must be specified from the kernel command line, adding the following parameters:
 
<pre class="board-terminal">
 
ubi.mtd=6 root=ubi0_0 rootfstype=ubifs rw
 
</pre>
 
 
Please note that
 
# the file system is formatted automatically the first time it is mounted
 
# the mount command don't use the /dev/ prefix before ubi0_0 device
 
  
 
=== File system on MTD ===
 
=== File system on MTD ===

Revision as of 16:41, 11 May 2012

Info Box
Tux.png Applies to Linux


WorkInProgress.gif

Introduction[edit | edit source]

MTD Partitions[edit | edit source]

UBI[edit | edit source]

File system on MTD[edit | edit source]

JFFS2[edit | edit source]

UBIFS[edit | edit source]