Creating disc space on a small router : TPlink RE650

Hi,

My router only has a tiny amount of disc space, and I want to install python3-speedtest-cli.

  1. I saw that this directory takes up a lot of space.
root@tplink650:/var/opkg-lists# du -hs .
924.0K	.
root@tplink650:/var/opkg-lists# ls
openwrt_base           openwrt_core.sig       openwrt_packages       openwrt_routing.sig
openwrt_base.sig       openwrt_luci           openwrt_packages.sig   openwrt_telephony
openwrt_core           openwrt_luci.sig       openwrt_routing        openwrt_telephony.sig

Can I removed these files?

Also /tmp

# du -hs /tmp
1020.0K	/tmp
  1. Where are the opkg packages downloaded to? I suspect some might need clearing up.

  2. Although I flash the latest openwrt 23 onto this TPLink RE650, I know realise that it is does not have enough disc space to do any upgrades. What packages could I remove. Luci is an option, but I prefer to keep something for when I forget what I need to type :slight_smile: I seem to recall the last opkg update && opkg upgrade ended up in zero disc space and failure.

Removing files from ramdisk will not free flas space, nor removing files from /overlay.
What have you upgraded to run out of space?

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
df -k
1 Like
root@tplink650:/# ubus call system board
{
	"kernel": "5.15.162",
	"hostname": "tplink650",
	"system": "MediaTek MT7621 ver:1 eco:3",
	"model": "TP-Link RE650 v2",
	"board_name": "tplink,re650-v2",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "23.05.4",
		"revision": "r24012-d8dd03c46f",
		"target": "ramips/mt7621",
		"description": "OpenWrt 23.05.4 r24012-d8dd03c46f"
	}
}
root@tplink650:/# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 4096      4096         0 100% /rom
tmpfs                    60244      1024     59220   2% /tmp
/dev/mtdblock4             960       748       212  78% /overlay
overlayfs:/overlay         960       748       212  78% /
tmpfs                      512         0       512   0% /dev
root@tplink650:/#

Your device does not seem to have USB support, so I guess you cannot use extroot. I think that your only option is to create your own image, and include only the essential packages.

1 Like

Do you know why I could download the packages when I tried to do an upgrade, but it then ran out of space during the upgrade? Because I wondered if there were some pkgs left behind.

All I need to install is python3-speedtest-cli or something else that I can run speedtest on.

I have got this installed:

# opkg list-installed
base-files - 1559-r24012-d8dd03c46f
busybox - 1.36.1-1
ca-bundle - 20230311-1
cgi-io - 2022-08-10-901b0f04-21
dnsmasq - 2.90-2
dropbear - 2022.82-6
firewall4 - 2023-09-01-598d9fbb-1
fstools - 2023-02-28-bfe882d5-1
fwtool - 2019-11-12-8f7fe925-1
getrandom - 2022-08-13-4c7b720b-2
hostapd-common - 2023-09-08-e5ccbfc6-7
iw - 5.19-1
iwinfo - 2023-07-01-ca79f641-1
jansson4 - 2.14-3
jshn - 2023-05-23-75a3b870-1
jsonfilter - 2024-01-23-594cfa86-1
kernel - 5.15.162-1-144de9e5c1a8813b724b14faa054d9f0
kmod-cfg80211 - 5.15.162+6.1.97-1-1
kmod-crypto-acompress - 5.15.162-1
kmod-crypto-aead - 5.15.162-1
kmod-crypto-ccm - 5.15.162-1
kmod-crypto-cmac - 5.15.162-1
kmod-crypto-crc32c - 5.15.162-1
kmod-crypto-ctr - 5.15.162-1
kmod-crypto-gcm - 5.15.162-1
kmod-crypto-gf128 - 5.15.162-1
kmod-crypto-ghash - 5.15.162-1
kmod-crypto-hash - 5.15.162-1
kmod-crypto-hmac - 5.15.162-1
kmod-crypto-manager - 5.15.162-1
kmod-crypto-null - 5.15.162-1
kmod-crypto-rng - 5.15.162-1
kmod-crypto-seqiv - 5.15.162-1
kmod-crypto-sha512 - 5.15.162-1
kmod-gpio-button-hotplug - 5.15.162-3
kmod-hwmon-core - 5.15.162-1
kmod-leds-gpio - 5.15.162-1
kmod-lib-crc-ccitt - 5.15.162-1
kmod-lib-crc32c - 5.15.162-1
kmod-lib-lzo - 5.15.162-1
kmod-mac80211 - 5.15.162+6.1.97-1-1
kmod-mt76-connac - 5.15.162+2024-04-03-1e336a85-1
kmod-mt76-core - 5.15.162+2024-04-03-1e336a85-1
kmod-mt7615-common - 5.15.162+2024-04-03-1e336a85-1
kmod-mt7615-firmware - 5.15.162+2024-04-03-1e336a85-1
kmod-mt7615e - 5.15.162+2024-04-03-1e336a85-1
kmod-nf-conntrack - 5.15.162-1
kmod-nf-conntrack6 - 5.15.162-1
kmod-nf-flow - 5.15.162-1
kmod-nf-log - 5.15.162-1
kmod-nf-log6 - 5.15.162-1
kmod-nf-nat - 5.15.162-1
kmod-nf-reject - 5.15.162-1
kmod-nf-reject6 - 5.15.162-1
kmod-nfnetlink - 5.15.162-1
kmod-nft-core - 5.15.162-1
kmod-nft-fib - 5.15.162-1
kmod-nft-nat - 5.15.162-1
kmod-nft-offload - 5.15.162-1
kmod-ppp - 5.15.162-1
kmod-pppoe - 5.15.162-1
kmod-pppox - 5.15.162-1
kmod-slhc - 5.15.162-1
libblobmsg-json20230523 - 2023-05-23-75a3b870-1
libc - 1.2.4-4
libgcc1 - 12.3.0-4
libiwinfo-data - 2023-07-01-ca79f641-1
libiwinfo20230701 - 2023-07-01-ca79f641-1
libjson-c5 - 0.16-3
libjson-script20230523 - 2023-05-23-75a3b870-1
liblucihttp-ucode - 2023-03-15-9b5b683f-1
liblucihttp0 - 2023-03-15-9b5b683f-1
libmbedtls12 - 2.28.8-1
libmnl0 - 1.0.5-1
libncurses6 - 6.4-2
libnftnl11 - 1.2.6-1
libnl-tiny1 - 2023-07-27-bc92a280-1
libpthread - 1.2.4-4
libubox20230523 - 2023-05-23-75a3b870-1
libubus20230605 - 2023-06-05-f787c97b-1
libuci20130104 - 2023-08-10-5781664d-1
libuclient20201210 - 2023-04-13-007d9454-1
libucode20230711 - 2024-07-11-1a8a0bcf-1
libustream-mbedtls20201210 - 2023-02-25-498f6e26-1
logd - 2022-08-13-4c7b720b-2
luci - git-23.051.66410-a505bb1
luci-app-firewall - git-24.067.01746-69867db
luci-app-opkg - git-24.148.43905-2891ca4
luci-base - git-24.086.45142-09d5a38
luci-light - git-23.024.33244-34dee82
luci-mod-admin-full - git-19.253.48496-3f93650
luci-mod-network - git-24.111.76511-ff6b275
luci-mod-status - git-24.141.29354-5cfe7a7
luci-mod-system - git-24.067.01860-7a82b2f
luci-proto-ipv6 - git-24.086.45108-51aee90
luci-proto-ppp - git-24.135.44542-f1ec9c2
luci-ssl - git-23.035.26083-7550ad6
luci-theme-bootstrap - git-24.086.46634-1ffe078
mtd - 26
netifd - 2024-01-04-c18cc79d-2
nftables-json - 1.0.8-1
odhcp6c - 2023-05-12-bcd28363-20
odhcpd-ipv6only - 2023-10-24-d8118f6e-1
openwrt-keyring - 2022-03-25-62471e69-2
opkg - 2022-02-24-d038e5b6-2
ppp - 2.4.9.git-2021-01-04-4
ppp-mod-pppoe - 2.4.9.git-2021-01-04-4
procd - 2023-06-25-2db83655-2
procd-seccomp - 2023-06-25-2db83655-2
procd-ujail - 2023-06-25-2db83655-2
px5g-mbedtls - 10
rpcd - 2023-07-01-c07ab2f9-1
rpcd-mod-file - 2023-07-01-c07ab2f9-1
rpcd-mod-iwinfo - 2023-07-01-c07ab2f9-1
rpcd-mod-luci - 20240305-1
rpcd-mod-rrdns - 20170710
rpcd-mod-ucode - 2023-07-01-c07ab2f9-1
terminfo - 6.4-2
ubi-utils - 2.1.5-1
ubox - 2022-08-13-4c7b720b-2
ubus - 2023-06-05-f787c97b-1
ubusd - 2023-06-05-f787c97b-1
uci - 2023-08-10-5781664d-1
uclient-fetch - 2023-04-13-007d9454-1
ucode - 2024-07-11-1a8a0bcf-1
ucode-mod-fs - 2024-07-11-1a8a0bcf-1
ucode-mod-html - 1
ucode-mod-math - 2024-07-11-1a8a0bcf-1
ucode-mod-nl80211 - 2024-07-11-1a8a0bcf-1
ucode-mod-rtnl - 2024-07-11-1a8a0bcf-1
ucode-mod-ubus - 2024-07-11-1a8a0bcf-1
ucode-mod-uci - 2024-07-11-1a8a0bcf-1
ucode-mod-uloop - 2024-07-11-1a8a0bcf-1
uhttpd - 2023-06-25-34a8a74d-2
uhttpd-mod-ubus - 2023-06-25-34a8a74d-2
urandom-seed - 3
urngd - 2023-11-01-44365eb1-1
usign - 2020-05-23-f1f65026-1
wireless-regdb - 2024.07.04-1
wpad-basic-mbedtls - 2023-09-08-e5ccbfc6-7

Two things you may want to look at:

Upgrading packages (via the CLI opkg upgrade command or the LuCI Upgrade... button) can result in major problems. It is generally highly discouraged, unless you know what you are doing or if there is specific instruction to do so.

And, if you're looking to fit more things on your device:
https://openwrt.org/faq/no_space_left_on_device

1 Like

Sysupgrade to release keeping config
Install luci-app-attendedsysupgrade for all your upgrade needs.
If you have not noticed - no space for permanent packages BUT examine sysupgrade.conf for alternative.

Unfortunately this is a chicken and egg solution.

In order to clean up the debris, one must know what packages were left behind, but I don't, because the mess was likely caused by a failed 'opkg upgrade'

Hence:

# ./opkg-rm-pkg-deps.sh 
Downloading https://downloads.openwrt.org/releases/23.05.4/targets/ramips/mt7621/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_core
Downloading https://downloads.openwrt.org/releases/23.05.4/targets/ramips/mt7621/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/base/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_base
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/base/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/luci/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_luci
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/luci/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/packages/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_packages
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/packages/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/routing/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_routing
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/routing/Packages.sig
Signature check passed.
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/telephony/Packages.gz
Updated list of available packages in /var/opkg-lists/openwrt_telephony
Downloading https://downloads.openwrt.org/releases/23.05.4/packages/mipsel_24kc/telephony/Packages.sig
Signature check passed.
opkg: the ``install'' command requires at least one argument

I don't know what the package or packages were.

Does it accept a wildcard :slight_smile:

Which is what happened.

You need to reset to defaults. You can create a backup which will just grab your config -- you can then restore that easily after the reset.

Beyond that, you can use the firmware selector to create custom images that exclude some unnecessary packages and add in the ones you are hoping to include. Typically, the dependencies will all be handled automatically.

At a high level, what are you trying to add to your device?

2 Likes

Ideally, sqm ( without luci ), and python3-speedtest-cli

Where does opkg store the downloaded packages?
Where does Luci opkgs equivalent store the downloaded packages?

It stores downloads i: /tmp ramdisk.
no you dont have space for python, unlikely even for sqm.

I don't think the processor in that device is powerful enough to give you good performance with SQM unless you already have relatively limited speeds from your ISP. What are your ISP speeds?

And typically, it's best to simply use a general purpose computer/phone for your speed tests, rather than on-device (unless you have a fast processor, the speeds measured when the traffic is generated/terminated the router itself won't be representative of the speed at which it can route traffic through the device).

in the overlay partition of the flash memory (mounted as overlay or / as a read/write partition).

They're the same. LuCI is just a front-end user-interface for the underlying command line stuff.

1 Like

Thanks.

/var/tmp/opkg-lists - ok so this won't help me.

What can I remove from Luci that is unnessecary?

# du -hs `pwd`
893.0K	/www/luci-static
root@tplink650:/www/luci-static# df -h . 
Filesystem                Size      Used Available Use% Mounted on
overlayfs:/overlay      960.0K    752.0K    208.0K  78% /

What are your ISP speeds?

150M down + 50M up.

You cannot free space removing files.
Reset router keeping configs to get rid of misguided upgrades.
Then install asu client and sysupgrade all at once.

1 Like

That is in RAM anyway... the package lists aren't relevant. It is the packages you install that matter.

There isn't that much you can remove, but look at the link I provided earlier and make your own custom image:

But this cannot work. :frowning:

It requires me to know what is broken, and I don't.

Your URL states:

" Remove partly installed packages and their dependencies if opkg runs out of space during a transaction."

There were about 100 packages that were being installed and ran out of space. How can I get a list of these packages?

You can make image in place using 30kB attended sysupgrade client, like remove pppoe if you never heard of it , or firewall on dumb ap. Dont overdo, hard to unbrick if you remove too much.

1 Like

I don't think I need a f/w because this is all done on my Ubiquiti ER-X. Same for pppoe.

Although the firewall rules are still there, so I am not too sure ...

# awk '!/^#/' firewall|awk NF
config defaults
	option syn_flood	1
	option input		REJECT
	option output		ACCEPT
	option forward		REJECT
config zone
	option name		lan
	list   network		'lan'
	option input		ACCEPT
	option output		ACCEPT
	option forward		ACCEPT
config zone
	option name		wan
	list   network		'wan'
	list   network		'wan6'
	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

You dont know yet, just avoid installing surplus after recovering flash space. You need firewall kmods for bridger ie fw offload on dumb AP.
Today recover space and do attended upgrade.

1 Like