mirroring in JFFS2

Alan Cox alan at lxorguk.ukuu.org.uk
Tue Nov 12 12:22:29 EST 2002

On Tue, 2002-11-12 at 16:18, David Woodhouse wrote:
> 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

And vice versa. Its not quite as simple as it looks. For flash I think
you are right.

> 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.

The fs doesnt know enough about the block I/O layer to do that

> 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 :)

A dupfs layer is probably quite doable too yes. However for JFFS2 surely
all you actually want to do is write each log entry including its ID
number to both journals. When you hit a bad block you can play back that
bit of the journal from the other flash and then mark it bad. The only
fun case is working out the size of your journal since its effectively
the smaller of two journals can shrink online.

More information about the linux-mtd mailing list