I can't install software because root directory is very small

I recently installed OpenWrt, but when I tried to install additional software, I realized that the directory was too small and I needed to make it larger. I tried to build image with image builder, but the ROOTFS_PARTSIZE flag had no effect at all. I would like to know if it is possible to increase the root directory without a USB drive or not?

What type of device are you working with? Is it an embedded device like an all-in-one WiFi router device? Or x86 or a Pi or similar?

ubus call system board
df -h
{
	"kernel": "5.15.167",
	"hostname": "Swomp_Home",
	"system": "Qualcomm Atheros QCA956X ver 1 rev 0",
	"model": "TP-Link Archer C6 v2 (EU/RU/JP)",
	"board_name": "tplink,archer-c6-v2",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "23.05.5",
		"revision": "r24106-10cc5fcd00",
		"target": "ath79/generic",
		"description": "OpenWrt 23.05.5 r24106-10cc5fcd00"
	}
}
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 4.3M      4.3M         0 100% /rom
tmpfs                    59.6M      1.0M     58.6M   2% /tmp
/dev/mtdblock5            1.3M    368.0K    976.0K  27% /overlay
overlayfs:/overlay        1.3M    368.0K    976.0K  27% /
tmpfs                   512.0K         0    512.0K   0% /dev

That is inherent limitation of small space.
You can use luci-app-attendedsysupgrade or auc command to upgrade or replace packages in squashfs.
You can temporarily install some package like gdb using opkg install -d ram gdb using ramdisk. Small /root/.profile adjustment needed.

Is there really no way I can turn a free megabyte into 20 free megabytes? tmpfs is too big

This device has only 8MB of flash storage. Most of that is taken up by the default OpenWrt installation.

You do not have a USB port, so extroot is not an option for you.

You may be able to install a few packages by using the firmware selector to pre-install them into the image (this saves space relative to installing after flashing). And you may be able to remove packages you do not need using the firmware selector as well.

https://openwrt.org/docs/guide-user/additional-software/saving_space

That said, it will be a tight squeeze, if possible at all, so it depends on what you are trying to do and what compromises you are willing to make.

2 Likes

Okay, thank you

... and /tmp is located in RAM.

1 Like

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