Cram FS on NAND - How to do this?

Pantelis Antoniou panto at intracom.gr
Wed Jun 11 05:54:58 EDT 2003


Jasmine Strong wrote:

>
> On Wednesday, Jun 11, 2003, at 09:43 Europe/London, Pantelis Antoniou 
> wrote:
> [snip]
>
> 1)  Where are you going to store this bad block list?
>
> There isn't anywhere on the Flash that can be guaranteed good.
> You can't pick a set location for the bad block list, so you must scan
> for it-  and once you have found it you must have some way to
> check that you are looking at a good copy of it.
>
> If you plan to generate it at mount time, you run the risk that
> a block has gone bad while the device has been dormant, and
> thus you may generate a block list that does not match the one
> the device was written with,  which could render a block
> -structured filesystem like cramfs unreadable.
>
> Also, all this scanning takes time, which makes mounting slow.

I'm talking about a read only filesystem, and generating
the bad block info at mount time.

Perhaps I could also use some kind of lazy bad block scanning technique
in which the list would only be generated up to point where
someone requested a read.

Well, and if a block goes bad what was written as good there
is nothing any filesystem can do but die complaining.

>
> 2)  What about blocks that go bad while the system is in service?
>
> Flash blocks go bad randomly, and often while they are in use.
> You must use a strategy to cope with this-  JFFS and YAFFS use
> Reed-Solomon forward error correction.

Well, blocks go bad generally at writting, something that is
quite rare at a read only filesystem.
As for error correction I won't reinvent the wheel, I'll use the
JFFS2 error correction.

>
> 3)  What about wear-levelling?
>
> Flash blocks do not last indefinitely.  Every erase brings the Flash
> block you are erasing closer to the end of its lifespan.  Obviously
> this is less of a concern on a static filesystem like cramfs.
>
> Why not put a cramfs filesystem into a file on a YAFFS or JFFS2
> filesystem and use a loopback to mount it?
>
> -Jas.
>
>
>
Again, no need for that on a read-only filesystem. The number of erases
I expect during the life of the device is lower than 100.

And using the loopback trick is impossible for the root filesystem.

Anyway thanks for the input.

Regards

Pantelis





More information about the linux-mtd mailing list