Rootfs corruption due to unexpected power down - Read-only FS

Andrew Sampaio
I'm facing a huge problem with unexpected power down occurs. 
The Rootfs seems to get corrupted, Linux stops loading and the board keeps
rebooting.
I think this is happening because rootfs is not read-only. 
Does any of you guys ever tryed to use cramfs or squashfs with Tiny6410?
Is there a guide for the linux/rootfs read-only compilation?
Thanks

Juergen
Did you already try to mount and use it 'ro'?

Andrew Sampaio
Juergen,

thanks for you help.

Do you mean mount at boot time?

What file do i have to change to accomplish this?

Regards.

Andrew Sampaio
Juergen,

thanks for you help.

Do you mean mount at boot time?

Which file do i have to change to accomplish this?

Regards.

Juergen
Its a feature of the kernel command line. If there is the keyword "rw" the
root filesystem gets mounted read/write. No "rw" or "ro" lets the kernel
mount it read only. Sometimes also userland will re-mount it rw. So it
depends on your runtime environment how to modify it. There is no generic
answer.

Ilian TSachev
Dear Andrew

Did You manage to mount fs as read-only ?
When I boot without "ro" I can write in /bin for example. It seems that by
default fs is mounted "rw".

You can find kernel mounting configuration in mach-mini6410 file:

struct mtd_partition mini6410_nand_part[] = {
  {
    .name    = "Bootloader",
    .offset    = 0,
    .size    = (4 * 128 *SZ_1K),
    .mask_flags  = MTD_CAP_NANDFLASH,
  },
  {
    .name    = "Kernel",
    .offset    = (4 * 128 *SZ_1K),
    .size    = (5*SZ_1M) ,
    .mask_flags  = MTD_CAP_NANDFLASH,
  },
  {
    .name    = "File System",
    .offset    = MTDPART_OFS_APPEND,
    .size    = MTDPART_SIZ_FULL,
  }
};

Andrew Sampaio
Well,
After two months away from this project i'm back to the very same problem.

I saw the linux command line and found that there is no "rw" option. So by
default the system is mounting ro.

I also checked the struct mtd_partition mini6410_nand_part[], but didn't
find any options regarding RW or RO.

I really don't know what else can i do to make this work. Is it possible
that nobody else is facing a similar problem?

The program runs fine until the system gets corrupted at some point. After
thar the board starts to reboot over and over again and the only solution
is to reinstall the entire system trough SD Card.