Re: [Yaffs] adding bad blocks back into a yaffs2 filesystem

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
Subject: Re: [Yaffs] adding bad blocks back into a yaffs2 filesystem
On Saturday 16 February 2013 11:30:43 Steven Hein wrote:
> I've had a situation where NAND blocks are being marked bad
> invalidly due to a HW/driver issue, and I am trying to recover them.
>
> I've patched the MTD code to allow bad block erase, and I've
> the scrounged together a MEMSETGOODBLOCK ioctl patch to
> allow bad blocks to be unmarked in the BBT.    All of this is working:
> I can erase bad blocks (and verify that data and OOB are all 0xff's),
> and I can unmark the blocks bad in the BBT.

>
> When I have a YAFFS2 filesystem that has bad blocks, I use this
> sequence to attempt to recover the blocks:
>
> (1) unmount the filesystem
> (2) erase the bad blocks
> (3) unmark the blocks bad
> (4) mount the filesystem
>
> After this sequence, I have found that I have files in the
> filesystem that are corrupted or missing, but they were
> correct before I started the sequence.


Adding erased blocks to a yaffs partition should not cause any problems so
long as you mount without the scheckpoint, thus forcing a rescan to find the
erased blocks.

I suspect your procedure might not be working properly. Sometimes drivers will
not erase a bad block.

Try changing the order:
unmount,
unmark then erase bad blocks.
check that the block really is erased
remount.

-- Charles