Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

Issue while mounting Jffs2 image

From Texas Instruments Wiki
Jump to: navigation, search

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


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