UBIFS volume corruption (bad node at LEB 0:0)
mho.linux-mtd at b2n.ca
Fri Jan 16 16:23:26 EST 2009
sorry my primary MX was acting up badly, I just got a bunch of spooled
On 2009-01-14, at 11:17, Artem Bityutskiy wrote:
> 1. Try to remove the "sync" parameter of "mount -o remount,rw,sync".
> BTW, -o sync makes your rsync work much slower than if you had async
> mount and call sync after rsync is done.
Ah! Continuing on my nandsim testbed, it appears that re-mounting with
sync is indeed responsible, so:
ro -> rw,sync = bad (breaks in ~20 rounds)
ro -> rw = good (survived 630 rounds before I moved on)
rw,sync = good (survived 370 rounds and counting...)
I can live with ro -> rw; `rsync & sync`; rw -> ro; reboot
I intend to use UBIFS on a solar+battery powered device, so I really
want to opt-out of write-back caching altogether, write performance is
less important to me than reliability. Since a rw,sync initial mount
seems to work fine, I will be using that on my writable data volume.
> 2. Try to avoid re-mounting the fs into RO mode, but just call "sync".
AFAIK, most init scripts will remount the rootfs read-only at
shutdown, it's pretty much due process since if it's not remounted
read-only, the rootfs would remain dirty (I don't think '/' is ever
unmounted). Anyway, it doesn't look like the rw -> ro direction is
causing any problems.
> 3. When you reboot, I guess your boot scripts try to mount the FS in
> mode first. Try to tweak them and mount the FS read-write for the
It's the kernel that mounts read-only first. I do want my rootfs to be
read-only during normal operations, and I have no kernel cmdline
arguments control from the userland.
On 2009-01-14, at 11:23, Artem Bityutskiy wrote:
> Hmm, could you please check if -f is essential here. I mean, can you
> still reproduce the bug if you reboot cleanly, with unmount. When you
> reboot uncleanly, UBIFS starts so called "recovery" process, so I want
> to check whether recovery may be guilty.
I have no recovery at all in any of my test cases. Because I remount
read-only before I reboot -f, the filesystem is clean.
Many thanks for your help on this.
More information about the linux-mtd