Temp space in OpenWrt 22.03.0

Hello forum users owrt!
And lovers of the next crazy experiment with this wonderful project!))
I have a small office with ~35 people. For some other reason, I decided to use a PC with two physical network interfaces. But there was a small problem associated with the RAM. The current PC has 4GB of RAM, as I understand it, openwrt takes part of this memory under temp space (marked with a red frame), which eventually overflows and does not allow you to change any parameters in openwrt. Then I created a 4gb swap partition and mounted it in openwrt in hopes of avoiding this problem (highlighted in green), but it didn't work, has anyone encountered this problem or have any ideas on how to solve it?
P.S. temp space is cleared if you restart the PC, it is not possible to clear the temp in other ways

/tmp is used by variously daemons, question is, what are you running, that would fill up almost 2gb "disk"?

3 Likes

Just for a reference, you're doing something fundamentally wrong, if /tmp/ actually uses significantly more than ~10 MB (~2.2 MB for me).

3 Likes

That's not how it works. /tmp is a ramdisk used by the system and various daemons as a "scratchpad" storage of temporary information. /tmp is used to prevent wear and eventual failure of flash memory commonly found on dedicated router hardware.
Regardless of whether you actually have a big old fashioned spinning hard disk, OpenWrt still, by default, uses the /tmp ramdisk. (In fact most Linux distros do the same.)

In normal use, the contents of /tmp amounts, at worst, to a few tens of megabytes unless some package keeps logs there. If the package is well behaved it will implement some sort of log rotation.

You have not said what your actual problem is though.
Do config changes fail to survive a reboot, or is it something else?

To give us some hints, show us the output of:
df -h

3 Likes

Does the same happen with 22.03.2?

1 Like

Almost completely standard installation, except that an openvpn network is connected to it, which is also distributed by this PC to the client's office

Yes, I know that tmp space should not exceed 10Mb, in my home network I also use openwrt in a virtual machine to connect home internet, and I have not seen such a problem for at least about 6 years of continuous work in my home network

the problem is that when the tmp space is 100% full, openwrt cannot change the settings, since temporary configuration files, which is logical, are stored there, that is, in the /tmp section, after rebooting the openwrt configuration can be changed, but until the space tmp won't fill up to 100% again, this is not very convenient, since there are times when you need to change the configuration, while not violating the performance of the remote office. df -h query output, I can’t show it yet, I’ll do it as soon as I get access to this PC, I’ll show the result later.

It's hard to tell yet, haven't updated the build release yet, but I suspect the problem isn't with the openwrt build

well, you're writing something to it, a standard configuration wouldn't ...

ls -la /tmp
du -kh /tmp

2 Likes

I finally got to this pc, this is what the following commands show me:

root@OpenWrt-Kompros:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root               102.3M     72.3M     27.9M  72% /
tmpfs                     1.9G      1.9G         0 100% /tmp
/dev/sda1                16.0M      5.7M     10.2M  36% /boot
/dev/sda1                16.0M      5.7M     10.2M  36% /boot
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/sda4                68.8G      5.1G     60.1G   8% /home
root@OpenWrt-Kompros:~# ls -la /tmp
drwxrwxrwt   19 root     root           520 Oct 21 14:08 .
drwxr-xr-x   19 root     root          4096 Oct 13 10:14 ..
drwx------    2 root     root            40 Oct 13 11:57 .uci
----------    1 root     root             0 Oct 13 11:57 .ujailnoafile
-rw-r--r--    1 root     root             8 Oct 21 14:08 TZ
-rw-r--r--    1 root     root           168 Oct 13 11:57 board.json
drwxr-xr-x    3 root     root            60 Oct 13 11:57 cache
-rw-r--r--    1 root     root             0 Nov 14 09:35 dhcp.leases
drwxr-xr-x    2 root     root            40 Oct 13 11:57 dnsmasq.d
drwxr-xr-x    4 root     root           120 Oct 21 14:08 etc
drwxr-xr-x    2 root     root            40 Oct 13 11:57 extroot
drwxr-xr-x    2 root     root            80 Nov 14 09:34 hosts
drwxr-xr-x    7 root     root           140 Oct 13 11:58 lib
drwxr-xr-x    4 root     root           760 Oct 13 12:05 lock
drwxr-xr-x    4 root     root           200 Oct 13 11:57 log
-rw-------    1 root     root          9114 Oct 13 11:58 luci-indexcache.0XQ5az0FW6YjHrKamXLSf..json
-rw-------    1 root     root            88 Oct 13 11:58 luci-indexcache.lfaA7bLaVutVs58F38rP1..lua
drwxr-xr-x    2 root     root           260 Oct 13 11:58 luci-modulecache
-rw-r--r--    1 root     root            47 Oct 21 14:08 resolv.conf
drwxr-xr-x    2 root     root            60 Oct 21 14:08 resolv.conf.d
drwxr-xr-x    8 root     root           440 Oct 14 11:20 run
drwxrwxrwt    2 root     root            40 Oct 13 11:57 shm
drwxr-xr-x    3 root     root            60 Oct 13 11:57 spool
drwxr-xr-x    2 root     root            80 Oct 13 11:57 state
drwxr-xr-x    2 root     root            80 Oct 13 11:57 sysinfo
drwxr-xr-x    2 root     root            40 Oct 13 11:57 tmp
root@OpenWrt-Kompros:~# du -kh /tmp
152.0K  /tmp/luci-modulecache
0       /tmp/cache/samba
0       /tmp/cache
0       /tmp/spool/cron
0       /tmp/spool
0       /tmp/dnsmasq.d
16.0K   /tmp/lib/luci-bwc/if
24.0K   /tmp/lib/luci-bwc
1.3M    /tmp/lib/samba
0       /tmp/lib/nginx/fastcgi
0       /tmp/lib/nginx/proxy
0       /tmp/lib/nginx/body
20.0K   /tmp/lib/nginx
4.0K    /tmp/lib/dbus
0       /tmp/lib/misc
1.4M    /tmp/lib
4.0K    /tmp/hosts
0       /tmp/etc/uhttpd
4.0K    /tmp/etc/ssl
16.0K   /tmp/etc
4.0K    /tmp/resolv.conf.d
0       /tmp/.uci
0       /tmp/tmp
0       /tmp/log/samba
0       /tmp/log/nginx
1.9G    /tmp/log
0       /tmp/extroot
8.0K    /tmp/sysinfo
8.0K    /tmp/state
0       /tmp/lock/msg.sock
16.0K   /tmp/lock/msg.lock
1.5M    /tmp/lock
0       /tmp/run/samba/ncalrpc/np
0       /tmp/run/samba/ncalrpc
0       /tmp/run/samba/nmbd
0       /tmp/run/samba
4.0K    /tmp/run/avahi-daemon
0       /tmp/run/dbus
4.0K    /tmp/run/dnsmasq
0       /tmp/run/rpcd
0       /tmp/run/ubus
48.0K   /tmp/run
0       /tmp/shm
1.9G    /tmp

and a list of packages that are installed on this pc

root@OpenWrt-Kompros:~# opkg list
attr - 2.5.1-1
avahi-dbus-daemon - 0.8-7
base-files - 1490-r19685-512e76967f
block-mount - 2022-06-02-93369be0-2
bnx2-firmware - 20220411-1
busybox - 1.35.0-3
ca-bundle - 20211016-1
cfdisk - 2.37.3-3
cgi-io - 2022-08-10-901b0f04-21
dbus - 1.13.18-12
dnsmasq - 2.86-14
dropbear - 2022.82-2
e2fsprogs - 1.46.5-1
ethtool-full - 5.16-1
firewall4 - 2022-09-01-f5fcdcf2-1
fstools - 2022-06-02-93369be0-2
fwtool - 2019-11-12-8f7fe925-1
getrandom - 2021-08-03-205defb5-2
glib2 - 2.70.5-4
grub2 - 2.06-3
grub2-bios-setup - 2.06-3
grub2-efi - 2.06-3
iperf3 - 3.11-1
jansson4 - 2.13.1-2
jshn - 2022-05-15-d2223ef9-1
jsonfilter - 2018-02-04-c7e938d6-1
kernel - 5.10.138-1-789565457d2f287975d7d943ddbe4eeb
kmod-amazon-ena - 5.10.138-1
kmod-amd-xgbe - 5.10.138-1
kmod-ata-ahci - 5.10.138-1
kmod-ata-core - 5.10.138-1
kmod-bnx2 - 5.10.138-1
kmod-button-hotplug - 5.10.138-3
kmod-crypto-crc32c - 5.10.138-1
kmod-crypto-hash - 5.10.138-1
kmod-e1000 - 5.10.138-1
kmod-e1000e - 5.10.138-1
kmod-forcedeth - 5.10.138-1
kmod-fs-vfat - 5.10.138-1
kmod-hwmon-core - 5.10.138-1
kmod-i2c-algo-bit - 5.10.138-1
kmod-i2c-core - 5.10.138-1
kmod-igb - 5.10.138-1
kmod-igc - 5.10.138-1
kmod-input-core - 5.10.138-1
kmod-ixgbe - 5.10.138-1
kmod-lib-crc-ccitt - 5.10.138-1
kmod-lib-crc32c - 5.10.138-1
kmod-libphy - 5.10.138-1
kmod-mdio - 5.10.138-1
kmod-mdio-devres - 5.10.138-1
kmod-mii - 5.10.138-1
kmod-nf-conntrack - 5.10.138-1
kmod-nf-conntrack6 - 5.10.138-1
kmod-nf-flow - 5.10.138-1
kmod-nf-log - 5.10.138-1
kmod-nf-log6 - 5.10.138-1
kmod-nf-nat - 5.10.138-1
kmod-nf-reject - 5.10.138-1
kmod-nf-reject6 - 5.10.138-1
kmod-nfnetlink - 5.10.138-1
kmod-nft-core - 5.10.138-1
kmod-nft-fib - 5.10.138-1
kmod-nft-nat - 5.10.138-1
kmod-nft-offload - 5.10.138-1
kmod-nls-base - 5.10.138-1
kmod-nls-cp437 - 5.10.138-1
kmod-nls-iso8859-1 - 5.10.138-1
kmod-nls-utf8 - 5.10.138-1
kmod-phy-realtek - 5.10.138-1
kmod-ppp - 5.10.138-1
kmod-pppoe - 5.10.138-1
kmod-pppox - 5.10.138-1
kmod-pps - 5.10.138-1
kmod-ptp - 5.10.138-1
kmod-r8169 - 5.10.138-1
kmod-scsi-core - 5.10.138-1
kmod-slhc - 5.10.138-1
kmod-tg3 - 5.10.138-1
kmod-tun - 5.10.138-1
libatomic1 - 11.2.0-4
libattr - 2.5.1-1
libavahi-client - 0.8-7
libavahi-dbus-support - 0.8-7
libblkid1 - 2.37.3-3
libblobmsg-json20220515 - 2022-05-15-d2223ef9-1
libc - 1.2.3-4
libcap - 2.63-1
libcomerr0 - 1.46.5-1
libdaemon - 0.14-5
libdbus - 1.13.18-12
libexpat - 2.4.7-2
libext2fs2 - 1.46.5-1
libf2fs6 - 1.14.0-3
libfdisk1 - 2.37.3-3
libffi - 3.4.2-2
libgcc1 - 11.2.0-4
libgmp10 - 6.2.1-1
libgnutls - 3.7.1-2
libiwinfo-data - 2022-08-19-0dad3e66-1
libiwinfo-lua - 2022-08-19-0dad3e66-1
libiwinfo20210430 - 2022-08-19-0dad3e66-1
libjson-c5 - 0.15-2
libjson-script20220515 - 2022-05-15-d2223ef9-1
liblua5.1.5 - 5.1.5-10
liblucihttp-lua - 2022-07-08-6e68a106-1
liblucihttp0 - 2022-07-08-6e68a106-1
liblzo2 - 2.10-4
libmnl0 - 1.0.5-1
libmount1 - 2.37.3-3
libncurses6 - 6.3-1
libnettle8 - 3.7.3-2
libnftnl11 - 1.2.1-1
libnl-tiny1 - 2021-11-21-8e0555fb-1
libopenssl-conf - 1.1.1q-1
libopenssl1.1 - 1.1.1q-1
libpam - 1.5.1-1
libpcre - 8.45-3
libpopt0 - 1.16-2
libpthread - 1.2.3-4
libreadline8 - 8.1-1
librt - 1.2.3-4
libsmartcols1 - 2.37.3-3
libss2 - 1.46.5-1
libssh2-1 - 1.9.0-2
libstdcpp6 - 11.2.0-4
libtasn1 - 4.16.0-2
libtirpc - 1.3.2-1
libubox20220515 - 2022-05-15-d2223ef9-1
libubus-lua - 2022-06-01-2bebf93c-1
libubus20220601 - 2022-06-01-2bebf93c-1
libuci20130104 - 2021-10-22-f84f49f0-6
libuclient20201210 - 2021-05-14-6a6011df-1
libucode20220812 - 2022-08-29-344fa9e6-1
liburing - 2.1-2
libustream-wolfssl20201210 - 2022-01-16-868fd881-1
libuuid1 - 2.37.3-3
libwolfssl5.4.0.ee39414e - 5.4.0-stable-5
logd - 2021-08-03-205defb5-2
lua - 5.1.5-10
luci - git-20.074.84698-ead5e81
luci-app-firewall - git-22.089.67563-7e3c1b4
luci-app-opkg - git-22.154.41881-28e92e3
luci-app-samba4 - git-21.223.80587-f533f9d
luci-base - git-22.245.77528-487e58a
luci-i18n-base-ru - git-22.240.57888-17fde96
luci-i18n-samba4-ru - git-22.240.57888-17fde96
luci-lib-base - git-20.232.39649-1f6dc29
luci-lib-ip - git-20.250.76529-62505bd
luci-lib-jsonc - git-22.097.61921-7513345
luci-lib-nixio - git-20.234.06894-c4a4e43
luci-mod-admin-full - git-19.253.48496-3f93650
luci-mod-network - git-22.244.54818-b13d8c7
luci-mod-status - git-22.189.48501-6731190
luci-mod-system - git-22.140.66206-02913be
luci-nginx - git-20.161.73418-219f0ce
luci-proto-ipv6 - git-21.148.48881-79947af
luci-proto-ppp - git-21.158.38888-88b9d84
luci-ssl - git-20.244.36115-e10f954
luci-theme-bootstrap - git-22.141.59265-d8ecf48
luci-theme-material - git-21.279.05595-c8d9819
luci-theme-openwrt - git-21.285.74425-1c3b32d
luci-theme-openwrt-2020 - git-21.343.57805-13949cb
mc - 4.8.27-3
mkf2fs - 1.14.0-3
mtd - 26
nano - 6.4-1
netifd - 2022-08-25-76d2d41b-1
nftables-json - 1.0.2-2.1
nginx - 1.21.3-1
nginx-mod-luci - 1.21.3-1
nginx-ssl - 1.21.3-1
nginx-ssl-util - 1.6-14
nginx-util - 1.6-14
odhcp6c - 2022-08-05-7d21e8d8-18
odhcpd-ipv6only - 2022-03-22-860ca900-1
openssl-util - 1.1.1q-1
openvpn-openssl - 2.5.5-1
openwrt-keyring - 2022-03-25-62471e69-3
opkg - 2022-02-24-d038e5b6-1
partx-utils - 2.37.3-3
ppp - 2.4.9.git-2021-01-04-3
ppp-mod-pppoe - 2.4.9.git-2021-01-04-3
procd - 2022-06-01-7a009685-1
procd-seccomp - 2022-06-01-7a009685-1
procd-ujail - 2022-06-01-7a009685-1
px5g-wolfssl - 4
r8169-firmware - 20220411-1
rpcd - 2022-08-24-82904bd4-1
rpcd-mod-file - 2022-08-24-82904bd4-1
rpcd-mod-iwinfo - 2022-08-24-82904bd4-1
rpcd-mod-luci - 20210614
rpcd-mod-rrdns - 20170710
samba4-libs - 4.14.12-2
samba4-server - 4.14.12-2
terminfo - 6.3-1
ubox - 2021-08-03-205defb5-2
ubus - 2022-06-01-2bebf93c-1
ubusd - 2022-06-01-2bebf93c-1
uci - 2021-10-22-f84f49f0-6
uclient-fetch - 2021-05-14-6a6011df-1
ucode - 2022-08-29-344fa9e6-1
ucode-mod-fs - 2022-08-29-344fa9e6-1
ucode-mod-ubus - 2022-08-29-344fa9e6-1
ucode-mod-uci - 2022-08-29-344fa9e6-1
uhttpd - 2022-08-12-e3395cd9-1
uhttpd-mod-ubus - 2022-08-12-e3395cd9-1
urandom-seed - 3
urngd - 2020-01-21-c7f7b6b6-1
usign - 2020-05-23-f1f65026-1
uwsgi - 2.0.20-1
uwsgi-cgi-plugin - 2.0.20-1
uwsgi-luci-support - 2.0.20-1
uwsgi-syslog-plugin - 2.0.20-1
zlib - 1.2.11-6

What are you logging?

hm... looked at all the files stored in the logs, and it looks really strange. I don't know if openvpn is supposed to create such a huge log, but it looks like the problem is in this package

root@OpenWrt-Kompros:/tmp/log# ls
lastlog             log.smbd            openvpn-status.log  samba
log.nmbd            nginx               openvpn.log         wtmp

Ummm...I assume you know this because of the size?

So can you show the output of - du -kh /tmp/log

Did you change any log settings/debug levels in the software?

1 Like

yes, I know that and that was the original problem...

I already deleted those log files, but they looked something like this:
1

no, no changes were made to the settings, installed from the repository as is. It looks like the place is clogging the openvpn logs, I see the solution to this problem is to change the openvpn logging to critical errors or slightly improved ie. the solution would be to add verb 0 or maximum verb 1 to the openvpn config...

Oh....Ok...

1 Like

Logrotate FTW.

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