No persistent overlay on tl-wa850re-v2 but works on tl-wa850re-v1

Hi! I'm still using two tp-link wa850re devices, one hardware version 1.2, one hardware version 2.0.

Recently flashed OpenWrt 18.06.2 (factory) on the hardware v1.2 and was very happy to get it working as a wifi relay, even with luci. Thanks to everyone who helped revive this device when it looked like nothing could be done! :smile:

Now I tried to do the same on the hardware v2.0 device (first with OpenWrt 18.06.4 sysupgrade and then with OpenWrt 18.06.2 sysupgrade) - but it has amnesia, unfortunately. Configuration changes don't survive reboot / power loss. Sure enough, the overlay fs is mounted to RAM (as far as I can see).
Might be that this is because there isn't enough space in flash to create the overlay - but it sounds weird to me that the v1.2 with 4MB flash has no size issues but a v2.0 with 4MB does, especially when sysupgrade.bin images for both have the same size.

This is df on the working 1.2

Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.3M      2.3M         0 100% /rom
tmpfs                    13.6M     96.0K     13.5M   1% /tmp
/dev/mtdblock3          320.0K    260.0K     60.0K  81% /overlay
overlayfs:/overlay      320.0K    260.0K     60.0K  81% /
tmpfs                   512.0K         0    512.0K   0% /dev

This is df on the amnesic 2.0:

Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.3M      2.3M         0 100% /rom
tmpfs                    13.6M     76.0K     13.5M   1% /tmp
tmpfs                    13.6M     72.0K     13.5M   1% /tmp/root
overlayfs:/tmp/root      13.6M     72.0K     13.5M   1% /
tmpfs                   512.0K         0    512.0K   0% /dev

When flashing the v2.0, I told it to drop the config and do a factory reset - dunno if that has something to do with it.

The logs say there is something going on with /dev/mtdblock3:

logread | grep -i "mtd"
Wed Jan 30 12:21:07 2019 kern.notice kernel: [    0.000000] Kernel command line:  board=TL-WA850RE-V2 mtdparts=spi0.0:128k(u-boot)ro,1344k(kernel),2304k(rootfs),256k(config)ro,64k(art)ro,3648k@0x20000(firmware) console=ttyS0,115200 rootfstype=squashfs noinitrd
Wed Jan 30 12:21:07 2019 kern.notice kernel: [    0.575020] 6 cmdlinepart partitions found on MTD device spi0.0
Wed Jan 30 12:21:07 2019 kern.notice kernel: [    0.581157] Creating 6 MTD partitions on "spi0.0":
Wed Jan 30 12:21:07 2019 kern.notice kernel: [    0.608169] mtd: device 2 (rootfs) set to be root filesystem
Wed Jan 30 12:21:07 2019 kern.notice kernel: [    0.614165] 1 squashfs-split partitions found on MTD device rootfs
Wed Jan 30 12:21:19 2019 daemon.err mount_root: failed - mount -t jffs2 /dev/mtdblock3 /rom/overlay: Invalid argument

I'm not familiar with OpenWRT mounting/partitioning scheme, so I wasn't able to get to the bottom of this myself. Can someone give me some hints on what to try, what links to read, what keywords to Google - or even how to fix this?

The devices don't have enough flash for what you have loaded on them.

You either need to remove packages that you've installed after flashing (you don't gain any space by "removing" ones in the ROM), build a custom image with fewer packages (LuCI is often what needs to go first), or purchase new devices.

You need roughly 200 kB free space in the flash to run reliably.

I don't understand how a 3584.0 KB image for v1 fits into the 4MB flash with space to create an overlay but a 3584.0 KB image for v2 does NOT fit into 4MB flash.
It sounds like there must be something else beyond size here...

I'll try to compile a smaller image one I find the time to get into it - but I suspect it's not the (entire) solution.

It's pretty much the entire situation. You're so close to the edge that the slightly smaller partition puts you over. You need to get your ROM size down below ~3450 kB Below 3390 kB would be better (four erase blocks, rather than three).

define Device/tplink-4mlzma
  IMAGE_SIZE := 3904k
define Device/tl-wa850re-v1
  DEVICE_PACKAGES := rssileds
  TPLINK_HWID := 0x08500001
TARGET_DEVICES += tl-wa850re-v1

define Device/tl-wa850re-v2
  DEVICE_PACKAGES := rssileds
  TPLINK_HWID := 0x08500002
  IMAGE_SIZE := 3648k
  MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),2304k(rootfs),256k(config)ro,64k(art)ro,3648k@0x20000(firmware)
TARGET_DEVICES += tl-wa850re-v2

Not all of the 4MB is available for OpenWrt. Some of it is used by the manufacturer and needs to be left untouched for the router to function properly. v2 probably uses a little bit more than v1 for this.

Thanks for your help!

I was able to compile a smaller firmware image and with that I get persistent overlay again :smiley:

For people running into the same problem, here's what I did:

  • Used branch openwrt-18.06 from git (for me it was commit b7e7d220e7eff6ac1d73c5b97dec448704b26735).
  • After ./scripts/feeds update -a && ./scripts/feeds install -a ran make menuconfig
  • Set the following options:
    • Target system: Atheros AR7xxx/AR9xxx
    • Subtarget: devices with small flash
    • Target profile: TP-LINK TL-WA850RE v2
    • Global build settings:
      • Strip unnecessary exports from the kernel
      • Strip unnecessary exports from libraries
    • Removed package: Network -> ppp (saves ~100kB?)
    • Added package (as built-in): Network -> Routing and Redirection -> relayd (uses 9kB?)
    • Luci is deactivated by default in this profile, so this saves some space as well
    • Save
  • make

Resulting sysupgrade.bin has 3137K (factory has 3017K).

Follow-up question:
Is it possible / would it make sense to change the default config for TL-WA850RE v2 to not include luci (and possibly ppp)? It'd be less convenient but at least the hardware could still be used.


Meaningful support for 4/32 devices ends after 2019, so not worth more effort, in my opinion. I believe the previous thinking was how to explain to novice users that some releases had LuCI and others didn’t.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.