dual jffs2 mtd partition problem
Hi all,
I am fascing problem while updating a "Jffs2 root filesystem" on my cm-x270 arm target board. The board has bootloader on the NOR and statically defined dual Jffs2 partitions on the NAND devices for the root filesystem.
cm-debian:~# cat /proc/mtd dev: size erasesize name mtd0: 00400000 00010000 "phys_mapped_flash" mtd1: 00200000 00020000 "OsmoConfig" mtd2: 0fa00000 00020000 "rootfs_1" mtd3: 10600000 00020000 "rootfs_2"
For an update rootfs process, I perform the following procedure...
A flash updating scheme employing 2 JFFS2 partitions, allowing to update one while running the other.
For example, if I am running with mtdblock2 as main root filesystem in ro, when I want to update my root, I can program the new image into mtdblock3 and then switch the root filesystem to mtdblock3 when I reboot (by specifying in the kernel cmdling as root=/dev/mtdblock3 ). The next time I update, the process would be reversed (program and switch to /dev/mtdblock2).
So, during an update process, if any failure occurs in the middle ( like power failure or write error), the system should boot with the old rootfs partition. The problem is that during an update rootfs, when I power down the board, on reboot the board throws a "kernel panic" error
...
Warning: unable to open an initial console.
Kernel panic - not syncing: No init found. Try passing init= option to
kernel.
Analysing the MTD partitions by mounting via nfs on the host shows the partitions got erased partially and hence the kernel panic.
Can anyboby precise me, how come the current rootfs partition getting erased when theres is an error while updating the alternate partition. ?
Thanks
Sara