I want to install and use OpenWrt on a 4/32 device (edimax 3G-6200n).
I installed the latest available image (19.07.2). I noticed that the jffs2 partition rootfs_data doesn't get utilized, all settings are just temporary until reboot.
Upon digging further, I noticed that the jffs2 driver complains about having too few erase blocks:
Thu Feb 27 21:06:22 2020 kern.err kernel: [ 86.664819] jffs2: Too few erase blocks (2)
Thu Feb 27 21:06:22 2020 daemon.err mount_root: failed - mount -t jffs2 /dev/mtdblock7 /rom/overlay: Not a tty
I was irritated by the error message, but kept investigating.
This is the output of /proc/mtd
root@OpenWrt:~# cat /proc/mtd
dev: size erasesize name
mtd0: 00030000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "factory"
mtd3: 00020000 00010000 "cimage"
mtd4: 00390000 00010000 "firmware"
mtd5: 0014864d 00010000 "kernel"
mtd6: 002479b3 00010000 "rootfs"
mtd7: 00020000 00010000 "rootfs_data"
The relevant output of logread
Thu Feb 27 21:05:27 2020 kern.notice kernel: [ 0.701953] 5 fixed-partitions partitions found on MTD device 1f000000.cfi
Thu Feb 27 21:05:27 2020 kern.notice kernel: [ 0.715977] Creating 5 MTD partitions on "1f000000.cfi":
Thu Feb 27 21:05:27 2020 kern.notice kernel: [ 0.726789] 0x000000000000-0x000000030000 : "u-boot"
Thu Feb 27 21:05:27 2020 kern.notice kernel: [ 0.739251] 0x000000030000-0x000000040000 : "u-boot-env"
Thu Feb 27 21:05:27 2020 kern.notice kernel: [ 0.752310] 0x000000040000-0x000000050000 : "factory"
Thu Feb 27 21:05:27 2020 kern.notice kernel: [ 0.764781] 0x0000003e0000-0x000000400000 : "cimage"
Thu Feb 27 21:05:27 2020 kern.notice kernel: [ 0.777068] 0x000000050000-0x0000003e0000 : "firmware"
Thu Feb 27 21:05:27 2020 kern.notice kernel: [ 0.801261] 2 edimax-fw partitions found on MTD device firmware
Thu Feb 27 21:05:27 2020 kern.notice kernel: [ 0.813358] Creating 2 MTD partitions on "firmware":
Thu Feb 27 21:05:27 2020 kern.notice kernel: [ 0.823502] 0x000000000000-0x00000014864d : "kernel"
Thu Feb 27 21:05:27 2020 kern.notice kernel: [ 0.835926] 0x00000014864d-0x000000390000 : "rootfs"
Thu Feb 27 21:05:27 2020 kern.notice kernel: [ 0.848296] mtd: device 6 (rootfs) set to be root filesystem
Thu Feb 27 21:05:27 2020 kern.notice kernel: [ 0.859931] 1 squashfs-split partitions found on MTD device rootfs
Thu Feb 27 21:05:27 2020 kern.notice kernel: [ 0.872509] 0x000000370000-0x000000390000 : "rootfs_data"
I suppose the flash area spans to 0x3fffff on a 4MiB device, but the rootfs partition only spans to 0x390000, leaving exactly 2 erase blocks for jffs2 (which is not enough as I have learned). What about the range between 0x390000 and 0x3fffff? I'm missing out on 576KiB of jfffs2 storage which would be more than enough for my intended application.
In expectation of a smaller image size I also tested the latest version from the 18 branch (18.06.7). But because the kernel is much bigger there, the rootfs partition even spans to 0x3e0000, with the rootfs_data partition also being only 2 erase blocks in size (0x20000).
I think this kind of supports my assumption that the rootfs_data partition is only two erase blocks in size, regardless of how much flash storage is available.
I tried executing firstboot
, but that changes nothing.
The problem may have come from me installing the initramfs
image at first, but I have installed several sysupgrade
images afterwards.
How can I enlarge the rootfs partition to fill the available space?