Skip to content

Mounting a JFFS2 Filesystem on Linux

Steps and debugging notes for mounting JFFS2 flash filesystems.

This English edition keeps the original illustrations and reproducible command or configuration examples.

Commands and configuration

http://git.infradead.org/mtd-utils.git
cat /proc/mtd
dev:    size   erasesize  name
mtd0: 02000000 00020000 "mtd_partition"
flash_erase /dev/mtd0 0 0
mkfs.jffs2 -d /data/rootfs -o jffs2.img -n -e 8192 -s 256 -c 1024
nandwrite -p /dev/mtd0 jffs2.img
mkdir -p /mnt/qspi
mknod /dev/mtdblock0 b 31 0
mount -t jffs2 /dev/mtdblock0 /mnt/qspi
mount | grep jffs2
zcat /proc/config.gz | grep CONFIG_JFFS2_FS
CONFIG_JFFS2_FS=y
  CONFIG_JFFS2_FS_WRITEBUFFER=y
cat /proc/mtd
dmesg

Practical notes

Test each change on a recoverable target, keep logs from the boot or failure path, and record the exact kernel and userspace versions used in the result.