Missing flash storage on WDR3600?

I have a WDR3600 and according to the device page it should have 8MB of flash.

{
	"kernel": "5.15.167",
	"hostname": "black.box",
	"system": "Atheros AR9344 rev 2",
	"model": "TP-Link TL-WDR3600 v1",
	"board_name": "tplink,tl-wdr3600-v1",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "23.05.5",
		"revision": "r24106-10cc5fcd00",
		"target": "ath79/generic",
		"description": "OpenWrt 23.05.5 r24106-10cc5fcd00"
	}
}

but it appears it only has 2MB (although I'm not sure I'm reading the below correctly, the /dev/root at '3.8M' seems to contradict what I see in the Luci GUI):

root@black:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.8M      3.8M         0 100% /rom
tmpfs                    59.6M     76.0K     59.5M   0% /tmp
/dev/mtdblock4            2.0M    524.0K      1.5M  26% /overlay
overlayfs:/overlay        2.0M    524.0K      1.5M  26% /
tmpfs                   512.0K         0    512.0K   0% /dev

I got this router originally via samknows.com, which at the time was offering a free device to monitor latency/jitter of home internet connection. When Cisco acquired samknows and unceremoniously killed the service, I flashed it with openwrt, but I don't remember how I managed to fit openwrt in 2MB.

Could it be that some partitioning is corrupted? Or is it more likely that samknows ordered a modified version of the WDR3600 from TP-link at the time and decided to save on flash storage?

Overall, I can't understand how to upgrade to 24.10 with this amount of storage. Bit frustrating, since it seems I already did it in the past.

ok, looking into it using cat /proc/mtd, the 8MB seem to be here. I probably need to make space and build a smaller image.

I'm sure I can remove a bunch of things but:

  1. if I only have 1.5MB left in /dev/mtdblock4 does it mean the image has to be below that or am I missing something?
  2. which packages do I absolutely need if I only use it as an unmanaged switch? no DHCP server, no firewall needed. GUI I'd like to keep if possible, IPv6 I need. I don't use VLAN on this switch. (it does have to be able to pass along tagged packets though, just does not need to untag/tag anything)

This is what the ImageBuilder has by default:

base-files ca-bundle dnsmasq dropbear firewall4 fstools kmod-ath9k kmod-gpio-button-hotplug kmod-nft-offload libc libgcc libustream-mbedtls logd mtd netifd nftables odhcp6c odhcpd-ipv6only opkg ppp ppp-mod-pppoe procd-ujail swconfig uboot-envtools uci uclient-fetch urandom-seed urngd wpad-basic-mbedtls kmod-usb2 kmod-usb-ledtrig-usbport luci

You are correct that you are seeing 2MB of space in overlay. That is what remains out of the total 8MB of flash storage. The other 6MB is for OpenWrt itself -- that is, the firmware that you flashed onto the device is stored in a read-only partition that takes up 6MB.

24.10 still fits within the 8MB footprint, but things are getting tight. This is the last version of OpenWrt that will support 8MB flash devices.

You can upgrade just as you've done in the past. The firmware image will be loaded into the flash memory, and what remains will be available for overlay (which is the read/write partition that is used for your configuration files as well as any packages you might install post-flash).

2 Likes

I had forgotten one important bit of information, which probably made my entire post unclear: I have tried flashing using the GUI and in simply reloaded the web GUI and I was still on 23.05.

I had assumed the problem was the lack of storage but that assumption was wrong, on second try it worked.

Thanks

I have the tplink 4300 with 8mb and when I build the firmware I do not install luci this gives me enough room to install all the packages needed for Extroot. then SSH in and copy all the overlay into a USB drive. Then install luci after a reboot and making sure extroot works

Here is what I remove
-luci

here are the packages I add to the build
block-mount e2fsprogs fdisk kmod-fs-ext4 kmod-usb-ohci kmod-usb-storage kmod-usb-uhci nano

Nice, I was looking to put together a simple procedure to do upgrade on my WDR3600 with extroot enabled. The hassle with extroot is, every time I need to unplug everything, connect my laptop, image, then disable DHCP server, and then replug everything, otherwise the openwrt becomes unreachable. So I'm trying to see if I can build a custom image that will restore the config as well, or at list the basics (enable DHCPv4 client, disable DHCP server).

What do you need "fdisk kmod-usb-ohci kmod-usb-uhci" for? I don't these mentioned in the wiki.

I also see a "script to run on first boot" in the online image builder, can I restore my (very basic) config with this? I have a simple switch, acting as DHCPv4 and DHCPv6 client, that's it. Single firewall zone.

From the sounds of it, you may not need extroot....

to clarify...

Is the device you're talking about in the quoted section above the WDR3600? Unless you're installing additional packages for other purposes, 8MB is sufficient for installing OpenWrt and storing the configs.

Yes, sorry, I should have mentioned: I would like to install a couple of additional packages on it. Otherwise, you are correct, since it's 8MB, the 24.10 fits (actually it's already successfully installed) but that leaves only 1.5MB free for packages. As you said, it's tight.

Hence, my idea to build a custom image (without luci) with a uci-defaults script, something like this (completely untested, first draft):

uci set network.lan.proto='dhcp'
uci set dhcp.lan.ignore=1

uci set system.@system[0].hostname='blackbox'

uci set network.lan6=interface
uci set network.lan6.proto='dhcpv6'
uci set network.lan6.device='@lan'

uci set dhcp.lan6=dhcp
uci set dhcp.lan6.interface='lan6'
uci set dhcp.lan6.ignore='1'

uci add_list firewall.@zone[0].network='lan6'

uci commit firewall
uci commit network
uci commit dhcp
uci commit system

opkg update
opkg install block-mount kmod-fs-ext4 e2fsprogs parted kmod-usb-storage block-mount fdisk kmod-usb-ohci kmod-usb-uhci nano

/etc/init.d/firewall restart
/etc/init.d/system restart
/etc/init.d/network restart
/etc/init.d/dnsmasq restart

Input welcome. (I suspect for example if I do a "system restart" I don't need to restart the other services individually, do I?)

Here is the current config on the openwrt WDR3600, which I am trying to replicate with the above commands. A lot of things are defaults I don't really need and can be ignored: it's just an unmanaged switch. I don't need WAN, I don't need VLANs...

/etc/config/dhcp
config dnsmasq
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option cachesize '1000'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	option localservice '1'
	option ednspacket_max '1232'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'
	option dhcpv6 'server'
	option ra 'server'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'
/etc/config/network
config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fd06:643d:c23b::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0.1'

config interface 'lan'
	option device 'br-lan'
	option proto 'dhcp'

config device
	option name 'eth0.2'
	option macaddr 'e8:94:f6:06:25:c7'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '0t 2 3 4 5'
	option vid '1'

config interface 'lan6'
	option proto 'dhcpv6'
	option device '@lan'
	option reqaddress 'try'
	option reqprefix 'auto'
/etc/config/firewall
config defaults
	option syn_flood '1'
	option input 'REJECT'
	option output 'ACCEPT'
	option forward 'REJECT'

config zone
	option name 'lan'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'
	list network 'lan'
	list network 'lan6'

config zone
	option name 'wan'
	option input 'REJECT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option masq '1'
	option mtu_fix '1'

config forwarding
	option src 'lan'
	option dest 'wan'

config rule
	option name 'Allow-DHCP-Renew'
	option src 'wan'
	option proto 'udp'
	option dest_port '68'
	option target 'ACCEPT'
	option family 'ipv4'

config rule
	option name 'Allow-Ping'
	option src 'wan'
	option proto 'icmp'
	option icmp_type 'echo-request'
	option family 'ipv4'
	option target 'ACCEPT'

config rule
	option name 'Allow-IGMP'
	option src 'wan'
	option proto 'igmp'
	option family 'ipv4'
	option target 'ACCEPT'

config rule
	option name 'Allow-DHCPv6'
	option src 'wan'
	option proto 'udp'
	option dest_port '546'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-MLD'
	option src 'wan'
	option proto 'icmp'
	option src_ip 'fe80::/10'
	list icmp_type '130/0'
	list icmp_type '131/0'
	list icmp_type '132/0'
	list icmp_type '143/0'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-ICMPv6-Input'
	option src 'wan'
	option proto 'icmp'
	list icmp_type 'echo-request'
	list icmp_type 'echo-reply'
	list icmp_type 'destination-unreachable'
	list icmp_type 'packet-too-big'
	list icmp_type 'time-exceeded'
	list icmp_type 'bad-header'
	list icmp_type 'unknown-header-type'
	list icmp_type 'router-solicitation'
	list icmp_type 'neighbour-solicitation'
	list icmp_type 'router-advertisement'
	list icmp_type 'neighbour-advertisement'
	option limit '1000/sec'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-ICMPv6-Forward'
	option src 'wan'
	option dest '*'
	option proto 'icmp'
	list icmp_type 'echo-request'
	list icmp_type 'echo-reply'
	list icmp_type 'destination-unreachable'
	list icmp_type 'packet-too-big'
	list icmp_type 'time-exceeded'
	list icmp_type 'bad-header'
	list icmp_type 'unknown-header-type'
	option limit '1000/sec'
	option family 'ipv6'
	option target 'ACCEPT'

config rule
	option name 'Allow-IPSec-ESP'
	option src 'wan'
	option dest 'lan'
	option proto 'esp'
	option target 'ACCEPT'

config rule
	option name 'Allow-ISAKMP'
	option src 'wan'
	option dest 'lan'
	option dest_port '500'
	option proto 'udp'
	option target 'ACCEPT'

(I probably could remove WAN completely, including all associated fw rules and make it instead a port in the lan bridge, but I don't need the port for now, so I figured, why bother. Same with VLANs, don't need them, but they are here by default.)

Subsidiary question: is it ok to make lan6 an alias of lan, rather than being its own device? I just noticed I had done this here.

Maybe I can even configure extroot directly in this script, I'll test this when I have time. The USB drive is always the same, thus I expect the device name will also not change.

What packages are you planning to use on device?

acme, it needs 2MB.

I just started doing that for ver 23.x,

After installing the minimal firmware I setup everything that I can, DHCP/DNS/Static IP and probably a few other things

then to upgrade I shut down the router and pull out the USB extroot and that way I'm back to my minimal firmware then start doing the upgrade and then do the extroot setup

I came up with a plan for the next time I do this, I am going to try and install owut (if there is enough room) and hopefully it will keep my minimal install without luci and keep all the usb stuff and DHCP/DNS/Static IP and hopefully make life a little easier on me.

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