State of read-only filesystems in NAND / MTD bad blocks handling when reading
Atlant Schmidt
aschmidt at dekaresearch.com
Wed May 2 13:14:45 EDT 2012
> [ bad-block-skip read is easy for boot loader, user space ]
> > > Unfortunately it seems to be impossible to provide this read behavior
> > > via an MTD API to other parts of the linux kernel. All the workarounds
> > > seem such a waste, and this bad block-free read-only API seems such a
> > > good idea for a lot of things I'm really curious why the work on
> > > something as cool as MTD_BLOCK_RO_BBFREE ceased in 2006.
> >
> >
> > I don't know for sure, but I think the majority of flash subsystem effort
> > has been centered around UBI and ubifs; for instance, there is very little
> > (if any) development on jffs2 nowadays, with all the effort going into ubifs
> > (and yaffs, different mailing list). One of the main points of UBI is to
> > handle bad blocks, consequently with UBI in the mainstream kernel for a
> > while now, most other efforts have a limited appeal.
>
> I find this whole MTD / UBI thing, let alone UBIFS, incredibly blurry.
> There seems to be no consequent abstraction between the "layers" mtd,
> ubi, ubifs, let alone unique responsibilities for either of the
> layers.
I can answer that one.
MTD "materializes" an imperfect block storage device. It contains
m PEBs (Physical Erase Blocks) of n pages each. It can erase whole
PEBs, write pages, and read pages, but some of these pages are
bad, other pages may go bad, and you have to be aware that you
can wear out PEBs by repeated erasures.
UBI (on top of MTD) "materializes" a perfect block storage device.
It contains a maximum of m-fudge_factor LEBs (Logical Erase Blocks)
of n-ovehead pages each. It can erase whole LEBs, write pages, and
read pages. By providing bad block mapping and wear leveling, it
provides a device which is slightly smaller than the MTD device
it's layered upon, but that device doesn't have bad blocks and
you can't wear out any individual LEB faster than the whole
device wears out. The device remains perfect until its reserve
of replacement (spare) blocks is exhausted as blocks go bad.
UBIfs (on top of UBI on top of MTD) "materializes" a file system.
It contains ordinary Linux/Unix files on a perfect storage medium.
It depends upon the perfect storage provided by UBI.
Atlant
This e-mail and the information, including any attachments, it contains are intended to be a confidential communication only to the person or entity to whom it is addressed and may contain information that is privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender and destroy the original message.
Thank you.
Please consider the environment before printing this email.
More information about the linux-mtd
mailing list