linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* UBIFS automatic recovery
@ 2016-05-13  8:47 Johan Borkhuis
  2016-05-13  9:11 ` Richard Weinberger
  0 siblings, 1 reply; 5+ messages in thread
From: Johan Borkhuis @ 2016-05-13  8:47 UTC (permalink / raw)
  To: linux-mtd

Hello,

On our current system we had some issues with corrupted file systems after
power failures. The system is a TI AM3517 with kernel 2.6.37 and the
backport of UBIFS. The system had one partition, so when the file system
is corrupted the system cannot boot any more.

To improve I change the layout:
- UBI0: 2 partitions, ubi0_0 (rootfs) and ubi0_1 (application), both
read-only
- UBI1: 2 partitions, ubi1_0 (settings) and ubi1_1 (logging)

To test how good this is working I wrote a test application to have a lot
of disk-I/O on the logging partition. Now I cut the power every minute.
I see the erase-counters increase quite fast on UBI1, but UBI0 stays at
the same value (which is what I was looking for)

Once in a while this test results in an error on one of the UBI1
partitions (both settings and logging). The partition cannot be mounted
any more. I can fix this using ubiupdatevol, but I loose the data on this
partition. This was expected and works quite well, the system is always
accessible.

However, when I continue to pull the power on a system with a broken
partition (without running the test-application, this is only started when
all partitions are mounted correctly) after some time (this can be a few
reboots, or a couple of 100 reboots) the system fixes the partition
itself, and I can access the data again, without any indications in the
log.

When it fails it shows the following during a mount (also shown sometimes
for LEB 3 and 6):
UBIFS: recovery needed
UBIFS error (pid 640): ubifs_recover_log_leb: unrecoverable log corruption
in LEB 5

Another UBIFS message I see during a failed mount is:
UBIFS error (pid 637): ubifs_recover_master_node: dumping first master node

As long the mount fails the same message is repeated.

But the first time it succeeds again I get the following output when
mounting:
UBIFS: recovery needed
UBIFS: recovery completed

Now my question is if there is a process in the background that fixes the
problem. If this is the case, how can I trigger or help this process, so
that it will fix the problem on the first time the problem is detected.

Or is there another way to fix/repair a broken partition without loosing
the data that is stored on it?

Regards,
    Johan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-16  7:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-13  8:47 UBIFS automatic recovery Johan Borkhuis
2016-05-13  9:11 ` Richard Weinberger
2016-05-13 10:27   ` Johan Borkhuis
2016-05-13 13:57     ` Richard Weinberger
2016-05-16  7:23   ` Iwo Mergler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).