Open main menu

DAVE Developer's Wiki β

Changes

Memory Tecnology Device (MTD)

1,781 bytes added, 16:35, 11 May 2012
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:
<shell>
flash_eraseall /dev/mtdX
</shell>
# As an alternative to point 1, launch the following command:
<shell>
ubiattach /dev/ubi_ctrl -m X
</shell>
# 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):
<shell>
ubimkvol /dev/ubi0 -N rootfs -s 128MiB
</shell>
# The device /dev/ubi0_0 is now available and can be mounted with one of the following comands:
<shell>
mount -t ubifs ubi0_0 /mnt/ubifs
mount -t ubifs ubi0:rootfs /mnt/ubifs
</shell>
# 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:
<shell>
ubi.mtd=6 root=ubi0_0 rootfstype=ubifs rw
</shell>
 
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 ===
customer
235
edits