Sysupgrade memory(?) problem

I have Asus AC51U router with custom-built OpenWrt on it. But I have problem sysupgrading it. When I issue "df" I see 27MiB free in /tmp and "free" gives me about 15MiB, and sysupgrade image is less than 14MiB, but it is not copied to /tmp (of course, upgrade do not work from LuCi also, if it worked there would be no question). Somehow I can't copy even 12MiB file into /tmp (from USB stick or via "dd" from /dev/random), the router hangs and then reboots.

What could be wrong and how to diagnose and mitigate it? For now I tried sysupgradjng via WiFi, should try via LAN connection. (Existing installed version works good, apart from upgrade problem.)

not sure but /tmp might be compressed, and space will vary depending on what you copy there.

copy the sysupgrade file to /tmp (if it fits), then run sysupgrade /tmp/yourfile.img via ssh ...

I am trying via ssh. And after I put "cp" command to execute it hangs and then reboots. :man_shrugging:t2:

No compression should be activated. May be some trouble with shm which is in /tmp?

then I guess your image's too big.

try sysupgrading it with the vanilla sysupgrade image, then sysupgrade it again using your customized image.


But why it shows 27MiB free? Image is less than 14MiB (currently working was even a couple KiBs larger).

try generating a 20+MB file with only AAAAA... see if it'll fit.

Max size of /tmp is limited. You might need to re-mount tmpfs with larger max size.
mount tmpfs /tmp -t tmpfs -o remount,size=24000k,nosuid,nodev


Unfortunately, this also did not help. It only made size of /tmp to be shown smaller.

Should I watch for "available" in "free" output or "free" (and why they differ substantially)?

root@OpenWrt:~# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                11776     11776         0 100% /rom
tmpfs                    28584       108     28476   0% /tmp
/dev/mtdblock6            2112       304      1808  14% /overlay
overlayfs:/overlay        2112       304      1808  14% /
tmpfs                      512         0       512   0% /dev
root@OpenWrt:~# free
              total        used        free      shared  buff/cache
Mem:          57168       29912       15476         108       11780
Swap:             0           0           0

Try mounting a USB flash to /tmp.

Reduce size of your custom openwrt significantly. I.e. by dropping LuCI in the build.

Well, it is possible, although not desirable. Since working now build was even a bit bigger, and I don't see why it shows free unavailable for some reason space.
And I am not used to make packages yet

But /tmp is mounted and says it's busy in unmount attempt.

I still can't get it, how "available" is less than "free" in free(1) output?!

Just mount above it, no need to unmount.

Didn't know it is an option. Shall try the first time I'll be in the presence on the device )

1 Like