UBIFS recovery fails

Artem Bityutskiy dedekind1 at gmail.com
Mon Oct 17 16:17:48 EDT 2011


On Mon, 2011-10-17 at 15:29 +0200, Daniel Kuhn wrote:
> Hi,
> 
> I have a problem with a device which uses UBI + UBIFS on a 32GB NAND 
> Flash (16*2GB). The
> filesystem worked without problems for a couple of months but now I get 
> an error if I try to mount the volume.
> Attaching the UBI-Device works fine as you can see in the following 
> messages:

This issue looks like one of the MLC-specific ones. Unfortunately,
no one really invested time into making UBIFS support MLC very well.
It needs some more work. It also have some issues related to unstable
bits in modern SLC.

In short - if you want to use UBIFS on MLC - you should not have unclean
reboots. If you want to make UBIFS 100% uclean-reboot save on MLC - you
need to work on it some more.

We (the original authors) developed and tested it on very robust SLC
NAND.

Unfortunately, I do not work with MTD for few years already and have
no spare time to make it MLC-robust. My last attempt was this spring -
I started making integck test (in mtd-utils) support emulated power
cuts. The idea was to improve UBIFS power-cut emulation infrastructure
and make it emulating unstable bits, and then test and fix all issues.
But then I realized that I simply will not have time to finish it,
so left the work half-done.

If someone wants to see UBIFS 100% or near 100% power-cut safe on
MLC or one of shitty modern SLCs - he needs to invest men-hours.
I can help by suggesting and reviewing. Although the funny thing is
that eMMCs die and lose data in case of power cuts very often :-)

> UBI: wear-leveling threshold:    4096
Are you sure it is good for MLC? What is your eraseblock life-cycle?

> Is there a way to recover the data on the device?

If you just have precious data which you need - I think:
1. Make a dump of the flash.
2. Verify that on another device you can flash it and reproduce this
issue.
3. Just hack the function in kernel that fails to return 0 instead
of error for that case, and I think you will be able to mount your
flash and copy your data.

But if you want this to never happen again - you need to prepare
for a several months project (providing you have a good kernel
engineer).

HTH :-)





More information about the linux-mtd mailing list