Openwrt rc.local: Read-only issue

i have tryed to lunch my script at starup but its not saved(

i have check file permission for rc.local and its read only and i can not change it or remove or etc...
root@OpenWrt:/etc# chmod 755 rc.local
chmod: rc.local: Read-only file system

how i can fix it?

Was is the output of mount; df -h

Please use the "Preformatted text </>" button for logs, scripts, configs and general console output.

Which device and which OpenWrt release are we talking about?

Model|TP-Link TL-WR740N/ND v5
Firmware Version|OpenWrt Chaos Calmer r46133 / LuCI (git-15.176.44391-0ef5f3c)

root@OpenWrt:~# mount; df -h
rootfs on / type rootfs (rw)
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,noatime)
sysfs on /sys type sysfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/mtdblock3 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlay (ro,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
Filesystem                Size      Used Available Use% Mounted on
rootfs                  576.0K    508.0K     68.0K  88% /
/dev/root                 2.3M      2.3M         0 100% /rom
tmpfs                    13.9M    624.0K     13.3M   4% /tmp
/dev/mtdblock3          576.0K    508.0K     68.0K  88% /overlay
overlayfs:/overlay      576.0K    508.0K     68.0K  88% /
tmpfs                   512.0K         0    512.0K   0% /dev

Time for a new device. Your router only has 4MB flash and 32MB RAM. It looks like it is out of space (or nearly so), so it is probably not able to save new files. But it also looks like your overlay is mounted as RO, so maybe that is part of it.

This is very old, unsupported, and has multiple known security vulnerabilities that are actively exploited. Please do not use this version any more.


this is my lovely device new for 9,99 Euro. Do you know some beter until 15 Euros?
and how i can fix this issue with read only?


  1. read
  2. ask that question in the Hardware Questions and Recommendations section of this forum.



I'm actually not sure how to fix the overlay RO issue (or if it matters, since the rootfs is RW), but someone else might be able to chime in about that.

At least upgrade to LEDE 17, or better yet OpenWrt 18.06.8 to have better security. but those will have a hard time running on your system.

ok, thank you.

Do you have any idea how i can fix this issue with read only?

on this version i have installed curl, on OpenWrt 18.06.8 there is no space for it...

which is why it would be best to get a newer router. Have you tried LEDE 17 (which is still very much unsupported, obsolete, and insecure)? It may still be able to fit in the necessary footprint, but at least it has a bunch of security patches relative to ChaosCalmer.

thanks, i will check it. Maybe do you know what is a smallest openddr for TP-Link TL-WR740N/ND v5?

and do you think i have issue with RO couse of no more free space?

I'm not sure what you mean here.... but, if you are asking about the smallest OpenWrt installation for this device, there is only one official release. You can build your own image to save some space (and you can even pre-install packages like curl and include other configuration details in the base image).

I honestly don't know offhand if the issue is out of space or the overlay mounted as RO. But either way, I wouldn't spend a lot of time on this version -- at least try upgrading to 17 and go from there.

1 Like

i try to bild my own bild and see this error:

user@userv:~/Downloads/lede-imagebuilder-17.01.7-ar71xx-generic.Linux-x86_64$ make image PROFILE=tl-wr740n-v5 PACKAGES='curl uhttpd uhttpd-mod-ubus libiwinfo-lua luci-base luci-app-firewall luci-mod-admin-full luci-theme-bootstrap -ppp -ppp-mod-pppoe -ip6tables -odhcp6c -kmod-ipv6 -kmod-ip6tables -odhcpd-ipv6only -opkg'
Building images for ar71xx - TP-LINK TL-WR740N/ND v5
Packages: curl uhttpd uhttpd-mod-ubus libiwinfo-lua luci-base luci-app-firewall luci-mod-admin-full luci-theme-bootstrap base-files busybox dnsmasq dropbear firewall fstools iptables kernel kmod-ath9k kmod-gpio-button-hotplug libc libgcc logd mtd netifd odhcpd swconfig uboot-envtools uci uclient-fetch wpad-mini

/home/user/Downloads/lede-imagebuilder-17.01.7-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/find: line 5: /home/user/Downloads/lede-imagebuilder-17.01.7-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/../lib/ cannot execute binary file: Exec format error
/home/user/Downloads/lede-imagebuilder-17.01.7-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/find: line 5: /home/user/Downloads/lede-imagebuilder-17.01.7-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/../lib/ Success
/home/user/Downloads/lede-imagebuilder-17.01.7-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/opkg: line 5: /home/user/Downloads/lede-imagebuilder-17.01.7-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/../lib/ cannot execute binary file: Exec format error
/home/user/Downloads/lede-imagebuilder-17.01.7-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/opkg: line 5: /home/user/Downloads/lede-imagebuilder-17.01.7-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/../lib/ Success

Installing packages...
/home/user/Downloads/lede-imagebuilder-17.01.7-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/opkg: line 5: /home/user/Downloads/lede-imagebuilder-17.01.7-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/../lib/ cannot execute binary file: Exec format error
/home/user/Downloads/lede-imagebuilder-17.01.7-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/opkg: line 5: /home/user/Downloads/lede-imagebuilder-17.01.7-ar71xx-generic.Linux-x86_64/staging_dir/host/bin/../lib/ Success
Makefile:147: recipe for target 'package_install' failed
make[2]: *** [package_install] Error 126
Makefile:110: recipe for target '_call_image' failed
make[1]: *** [_call_image] Error 2
Makefile:203: recipe for target 'image' failed
make: *** [image] Error 2

could you help to fix it?

Sure it matters, as the rootfs is in practice the RO /rom + RW /overlay, seen together as combined fs thanks to overlayfs. When overlayfs seen too little working space, it mounts as RO, and the whole rootfs is RO in practice.

Like said above by @psherman , overlay is too full, it is mounted as read-only.

The solution is to go to /overlay directory directly (as the dev/mtdblock3 is still RW), and delete enough files that there are 4-5 of 64 kb eraseblocks free in /overlay, and then reboot. The the overlayfs can again mount itself as RW.

In practice you need some 256-320 kB as free space always.


I don't remember what might cause these errors. I'd say try first building the image without modifying the default package list.

Also, you should use Ubuntu 16.04 -- anything newer may fail because the LEDE 17.01 toolchain wouldn't have been setup to detect the differences.

+1 for that.
If you want to compile ancient releases, you need to use contemporary build tools from that release's perspective.

thank you for answer.

one more question, after deleting some packges, like ppp or opkg i become lower spase as before deliting ( how i can fix it?

I'm not entirely sure what you are asking... but I'll try to answer:

  • if you attempt to delete any of the default/included packages from normal running installation, it will actually take more space. This is because the packages are confined in ROM, therefore they cannot actually be erased. But, when you use the delete function, it 'marks' the package as deleted, which means it has to write a file to the RW flash storage space to indicate the deleted status. This actually takes up more space than would be expected due to the size of the erase blocks in the flash memory.
  • If you build your own image and remove/omit a package from the image, it will save space (see the link I posted earlier). The image as a whole will get smaller, which means you will have more available/usable space for installing packages.
  • If you attempt to put too much stuff into the image and it exceeds the available flash storage size, it may fail to complete the image building process. However, if there is 'just enough' room, you may find that an image can be built and installed, but you may not have enough space remaining to store your configuration (the symptom of this situation is that the configuration appears to work fine until a reboot, at which point it goes back to the default state).