Welcome! Log In Create A New Profile

Advanced

Warning: ubifs corruption after power fail

Posted by ecc 
ecc
Warning: ubifs corruption after power fail
September 17, 2010 11:22AM
My dockstar couldn't reboot after a power failure. The 255M ubifs partition had been corrupted, and u-boot doesn't perform automatic recovery the way the linux kernel does. I think this is because u-boot currently only includes "read-only" ubifs support.

Here's what u-boot showed:
UBIFS: recovery needed
Error reading superblock on volume 'ubi:root'!

I was able to load the kernel from a USB stick (tftpboot would also have worked), which then recovered just fine. But until u-boot is fixed, it's a serious drawback to the single-NAND-partition approach. A separate uImage partition will be much more reliable (although more of a hassle to update with official kernels once they're available).

I'm going to request support for ubifs recovery on the u-boot mailing list and see what kind of response I get.
Re: Warning: ubifs corruption after power fail
September 17, 2010 04:02PM
Does corruption happen when system files are (read only) ro also, or only when they are changed to rw?

If it doesn't happen with ro, any reason why we can't build UBIFS NAND-flashable in a read-only format, with fixes made by having temporary mounts of paths that need to be rw? Just curious.
Re: Warning: ubifs corruption after power fail
September 17, 2010 04:16PM
It's just when the ubifs system is rw. I mentioned it in the 'Debian on NAND' instructions, but hopefully this thread brings a little more visibility to the issue.

This concern is also one of the motivating factors behind the new recovery system. If you have a rw ubifs on mtd3 and it fails, your system will fall over to the new recovery system on mtd2, which has support for cleaning the ubifs system on mtd3.

Of course, getting uBoot to handle it naively would be even better.

-- Jeff
Re: Warning: ubifs corruption after power fail
September 24, 2010 11:36PM
ha ha, just happen to me also.
Following Jeff and ECC's direction after booting from USB recovers just fine:
 mkdir /tmp/ubifs
 ubiattach /dev/ubi_ctrl -m 3
 ubimkvol /dev/ubi0 -m -N rootf
 mount -t ubifs ubi0:rootfs /tmp/ubifs
 umount /tmp/ubifs
 
la4de
Re: Warning: ubifs corruption after power fail
November 08, 2010 11:02AM
ecc Wrote:
-------------------------------------------------------
> My dockstar couldn't reboot after a power failure.
> The 255M ubifs partition had been corrupted, and
> u-boot doesn't perform automatic recovery the way
> the linux kernel does. I think this is because
> u-boot currently only includes "read-only" ubifs
> support.
>
> Here's what u-boot showed:
>
> UBIFS: recovery needed
> Error reading superblock on volume 'ubi:root'!

I had same problem with u-boot but on different platform (128mt ram, 1gt nand, avr processor). I debugged the main reason for error and in my case problem was in memory allocation. I got errno 12 (ENOMEM, Not enough space). Issue was resolved by increasing u-boot's malloc pool (CONFIG_SYS_MALLOC_LEN) from 1MiB to 2MiB. Maybe you had similar situation.
la4de
Re: Warning: ubifs corruption after power fail
November 09, 2010 07:29AM
I didn't remember to tell that memory error occurred inside ubifs_replay_journal function. In my case u-boot was able to load file from "corrupted" ubifs in ro mode without recovering filesystem if memory was available enough.

There is only 256M nand chip in dockstar. I'm not sure if the problem is same in dockstar but increasing malloc pool size helped for my device.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: