blkmtd (and YAFFS)

Charles Manning manningc2 at actrix.gen.nz
Mon May 17 22:41:25 EDT 2004


As David already pointed out, CF hides the ECC stuff (indeed some CF is not 
even based on NAND flash) so YAFFS is probably not really the best choice.

> I know we're not supposed to talk about CF cards here, but I'm not sure who
> else to ask about this...

Yes, mentioning CF on mtd is poor form :-).
>
> We have recently found that it's very easy to wear out crummy CF cards
> using conventional disk-journalling systems (ext3 wears a hole in the end
> of a 512MB flash card in <10 reboots) because every write goes through the
> journal section of the device, and clearly its internal controller is doing
> a very simple sector->flashpage mapping (yes, we should have turned off
> atime, but still it's amazingly exactly not what you wanted :-)
>
> So what I really want to do is use something that distributes the writes
> better than the internal controller so I'm thinking that YAFFS or JFFS2
> should do a better job, but still give us journalling/power fail safety.
>
> blkmtd appears to allow this but I see few mentions of it since early 2002.
> Is it stable, does it work, has anyone ever tried it with YAFFS?

CF always has been and always will be a "Kleenex technology" for the consumer 
market. Designing it in as part of a rugged system has always been ill 
advised.

CF controllers don't do explicit wear levelling. At least some do "implicit 
wear levelling"  by using a free pool rather like SmartMedia does. It would 
appear though that some don't even do that.

CF cards do not necessarily fail due to wear-out. They can get screwed up by 
corrupting their logical to physical mapping which I hunch is the more likely 
scenario. If this is happening then extra wear levelling is not going to help.

>
> Is there a better FS for this purpose (anyone know if reiserfs helps
> distribute writes around your 'disk' at all?)

You're making the (possibly invalid) assumption that your failures are due to 
wear out. If that is indeed the case then some such wear levelling fs might 
help. 

The biggest problem I see is that YAFFS and JFFSx achieve their robustness by 
dealing with the flash directly and do not have logical to physical mapping 
layers. Balancing YAFFS of JFFSx on top of something that relies on a logical 
to physical mapping just gives a false sense of security since there is no 
mechanism to repair errors at that level.

Both YAFFS anf JFFSx are journaling/log structured file systems. They can 
cope with write failures and can handle unclean dismounts, but they cannot 
recover data that has been lost; for that you need a RAID system or such. A 
corruption in a CF card results in lost info which will not be recoverable.


-- Charles




More information about the linux-mtd mailing list