MTD JFFS OverlayFS related on small 4MB device

I've tried to educate myself with mtd and overlayfs on Buffalo WHR-G300N V1 device.

The issue I'm trying to fix is that what ever 18 or 19 version I try to install, it goes fine, but it is read only overlayfs so no settings are persistent.

This is how things look:

 cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00030000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "factory"
mtd3: 003a0000 00010000 "firmware"
mtd4: 0014a0bb 00010000 "kernel"
mtd5: 00255f45 00010000 "rootfs"
mtd6: 00030000 00010000 "rootfs_data"
mtd7: 00010000 00010000 "user"
df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.0M      3.0M         0 100% /rom
tmpfs                    13.8M     56.0K     13.7M   0% /tmp
tmpfs                    13.8M     60.0K     13.7M   0% /tmp/root
overlayfs:/tmp/root      13.8M     60.0K     13.7M   0% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /tmp/root type tmpfs (rw,noatime,mode=755)
overlayfs:/tmp/root on / type overlay (rw,noatime,lowerdir=/,upperdir=/tmp/root/upper,workdir=/tmp/root/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)

I've tried to figure out with mtd in commandline etc. but some things I do not understand.
How to figure out what is the maximum capacity usable etc for jffs or overall flash?
Why it is not working out of the box it just says like:

mount_root: jffs2 not ready yet, using temporary tmpfs overlay
[   51.781455] jffs2: Too few erase blocks (3)

Why is not that 3 enough, I thought it should be?
Is it possible to remove or move sizes to have it so that I could increase?

This is not mandatory to get this working but just trying to learn. Could also build / reconfigure if that would be the right way. Then maybe pointers how to get this thinner so what could be removed from basic packages.

Sorry to have so many things on this but really could not found answers for the above.

This is good psherman on the packages that can be removed, but still there is at least the main issue on why that 3 blocks is not enough and what could be easily done on that?

JFFS is designed so that a power cut can occur at any time and all data in the filesystem will be recoverable. This requires setting aside a few blocks for data which is in transition. I don't know if 5 is the minimum number of blocks to have a workable jffs but that is what the designers chose.

1 Like