Influence of mkfs.jffs2 parameters on file system behavior

Michał Leśniewski mlesniew at gmail.com
Tue May 19 02:24:41 PDT 2015


Hi,

I have a question about the parameters passed to mkfs.jffs2 and their
influence on the JFFS2 behavior.

When generating an image one can specify the erase block size of the
flash, for which the image is generated, by suppling
`--eraseblock=...` on the command line.  There is also a `--pagesize`
parameter -- this parameter allows specifying the virtual memory page
size of the target system (often 4kB).

I found out that by mistake, I generated images with the wrong values
of these two parameters:

1. Some of the images I used were generated with the right page size
(4kB), but the wrong erase block size (flash memory has 128kB blocks,
the parameter supplied to mkfs.jffs2 was 64kB).  Surprisingly, I
didn't experience any problems with the file system, even when the
file system was heavily used (lots of file reads, rewrites, etc.).
However, when I switched the kernel from version 2.6.27 to version
3.4.31, sometimes files seemed to be trimmed or parts of them were
zeroed.  Could this be caused by the erase block size mismatch? The
documentation states that generating an image with a smaller erase
block than the actual flash device uses is harmless
(http://www.linux-mtd.infradead.org/doc/jffs2.html)...

2. Some other images I generated used the right erase block size but
the wrong virtual memory page size (2kB instead of 4kB).  I didn't
encounter any problems with the file system.  So in this case my
question is what influence does the `--pagesize` parameter have and
what's the worst thing that can happen if it's wrong?

Regards,
Michał Leśniewski



More information about the linux-mtd mailing list