Russ Dill Russ.Dill at
Wed Jan 8 14:42:15 EST 2003

On Wed, 2003-01-08 at 05:40, Srinivasu.Vaduguri at wrote:
> Hi all,
> I am trying to mount CRAMFS using MTD driver on a NAND flash. 
> If there is a BAD block in the CRAMFS area of the NAND flash then i get the following error during mount. 
> Error -3 while decompressing!
> 802c3674(666163445)->83d7d000(4096)
> Then the applications on the mounted cramfs are not running properly.

NAND *will* have bad blocks, cramfs does not handle bad blocks. There
isn't an elegant solution for this right now, but here are some options:

cramfs on top of nftl: This works resonably well, but seems like
overkill to me, and it puts you in questionable legal status if you
aren't using an m-systems product afaik (this is what I use)

yaffs: desgined for NAND, but has no compression

jffs2: The NAND code is pretty new, and the journalling is probably
overkill for your application, but it will work, and should be able to
adapt to bad blocks.

roll your own: Please, make a static compressed filesystem (like cramfs)
that incorporates extra blocks, so that when the checksum is bad while
initially writing the filesystem, or reading the file system (in the
case where ecc can save the data), it rewrites this block to a free
sector). It would seem like a simple modification to cramfs to me.

More information about the linux-mtd mailing list