Issue while mounting Jffs2 image

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

If we face an error like sector is locked and trying to erase read only filesystem -EROFS) when we mount a jffs2 using “mount –t jffs2 /dev/mtdblock3 test/”, how should we proceed further?


First confirm if you using the DVEVM or your own flash on a custom Davinci board? It is very likely to occur if there is a mismatch in the sector erase size between what you create using mkfs.jffs2 and what the JFFS2/NOR driver thinks about the sector erase size for the flash device you're using.

If you are using the DVEVM flash, the erase size is 128Kb (0x10000). So when your create your jffs2 image, you need to specify the correct sector erase size:

     mkfs.jffs2 -d myrootfsdir -o rootfs.jffs2 -e 0x10000

In terms of unlocking locked sectors, use the protect off command under u-boot to unlock the sectors (use flinfo to see which sectors are locked).

Also, the flash layout is defined in

 arch/arm/mach-davinci/board-evm.c

make sure the .mask_flags is set to 0 if you want to be erase and write to it:

    static struct mtd_partition davinci_evm_partitions[] = {
         /* bootloader (U-Boot, etc) in first 4 sectors */
         {
               .name             = "bootloader",
               .offset           = 0,
               .size             = 4 * SZ_64K,
               .mask_flags       = MTD_WRITEABLE, /* force read-only */
         },
         /* bootloader params in the next 1 sectors */
         {
               .name             = "params",
               .offset           = MTDPART_OFS_APPEND,
               .size             = SZ_64K,
               .mask_flags       = 0,
         },
         /* kernel */
         {
               .name             = "kernel",
               .offset           = MTDPART_OFS_APPEND,
               .size             = SZ_2M,
               .mask_flags       = 0
         },
         /* file system */
         {
               .name             = "filesystem",
               .offset           = MTDPART_OFS_APPEND,
               .size             = MTDPART_SIZ_FULL,
               .mask_flags       = 0
         }
     };
Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox