2

I'm facing two problems on mounting jffs2 on NOR flash:

I'm running a board with squashfs as rootfs and I tried to mount jffs2 on another mtdblock as below :
mount -t jffs2 /dev/mtdblock6 /tmp/jffs


After that I copy some files into /tmp/jffs but system gives the error when the files larger than 4096 bytes:
cp: write error: Input/output error

Then I unmount the mtdblock and re-mount it again, but the files I just copied has disappeared.

I confirmed the flash block has been written by dumping /dev/mtd6 or /dev/mtdblock6, but those files cannot be seen after remounting.

=====
I opened the printk log and have following message showed up when I put a file in mounted folder:
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00120814: 0x0219 instead Node totlen on flash (0x0000000c) != totlen from node ref (0x00000044)


and below message appeared when I tried to re-mount the mtdblock:
JFFS2 notice: (608) jffs2_get_inode_nodes: Node header CRC failed at 0x0e0050. {0000,9600,01e88b11,01000000}


Very appreciate if there is any suggestion.
  • 1
    Have you check if the model of the NOR flash is correct detect by the Linux? Also, is the block size of the NOR flash is indeed 4096 or other size? – SSC Jun 23 '15 at 10:14
  • Hi SSC thanks for your reply, the NOR flash should be no problem because the rootfs (using squashfs) could be flashed and booted normally. And the eraseblock is 64k bytes (I checked it from /proc/mtd) – maverick ou Jun 24 '15 at 08:21
  • I found it's related to the mtdblocks, my flash is mx25L256(32MB), and there is no problem on first half of the flash (16MB), but the problem happens on the bottom half. – maverick ou Jun 24 '15 at 12:35
  • Have you tried to build a jffs2 image with mkfs.jffs2 and flash the image direct into the flash and access the file in the flash afterwards? According to the [`jffs2`](http://www.linux-mtd.infradead.org/faq/jffs2.html#L_magicnfound) website, the magic number is missing issue related to dirty data with your flash. – SSC Jun 25 '15 at 02:11
  • Yes I tried building a jffs2 image and flash the image into the mtdblock by ./mkfs.jffs2 -p 1536K -r testdir -e 0x10000 -l -v -o jffs2.img , this is work for the blocks in first half of the flash (i.e. 0~16MB), but the content didn't exist in the blocks of second half of the flash (17~32MB). And I read the jffs2 website for that Q&A section and tried all it recommends. And the result is consistent: first half of the flash is working but not second half. – maverick ou Jun 26 '15 at 02:32
  • I think the problem is with address mode. If your flash works in 3byte address mode you can only use up to 16MB so you should switch your flash to 4byte address mode to use whole flash. – Michal Gonda May 25 '16 at 12:56

0 Answers0