mirroring in JFFS2

David Woodhouse dwmw2 at infradead.org
Tue Nov 12 11:18:37 EST 2002


joern at wohnheim.fh-wedel.de said:
>  Are you trying to put the mirroring stuff into jffs2?
> In the hard disk world, people use md for this, which uses two devices
> and returns one. The filesystem does not need to worry about anything.

RAID is done at the wrong layer. The file system knows stuff about the
contents of the media which a block device driver cannot possibly know. So
you end up having a RAID rebuild take ages to reconstruct parts of the disc
which the file system _knows_ are currently unused, etc. 

You can have journalled RAID to help alleviate this problem -- or you could 
just let the file system do it because that already has a journal anyway.

So, for example, you scribble it to your journal, then to both your mirrors,
and mark the journal transaction complete only when it's hit both discs. 

Getting back to JFFS2, the same applies -- if you have a bad block in one 
of your flash chips, what do you do about it? Refrain from using the 
equivalent block in the other chip? Have some kind of block remapper 
underneath JFFS2, which keeps a whole lot of address information which is 
in fact entirely superfluous to the file system?

I think it does want to be done in the file system, or possibly even in a 
layer _above_ the individual file system, which duplicates writes to two or 
more underlying file systems of a mountpoint, and do whatever's deemed 
appropriate for reads. Doing it in the individual file system is probably 
easier, if less interesting :)

--
dwmw2






More information about the linux-mtd mailing list