As title says, I was following this guide to configure a VPN on my router.
While installing the required packages, I ran out of space.
I was then following this guide to uninstall and remove the installed and partially installed packages.
I inspected some of the packages and they installed files in the /usr/lib directory which is a read-only directory. When I try to delete those files, it gave me an error saying that it cannot remove those files because they are read-only.
I had some question in regarding to cleaning them up:
Can I delete these files using sudo without any problems although they are in a read-only directory?
I have 8MB of space on my router. Is this enough to configure an OpenVPN service on it?
Do I need to use Exroot to get more space?
Are there any default packages that can be uninstalled to save space?
You need to understand that you can't delete any files from the firmware itself.
The firmware is read-only squashfs partition /rom
All your additions, changes, removals, configs go to read-write jffs2 overlay partition /overlay.
Normally you sees these combined as /rom + /overlay = / and you do not need to care about that at all.
But if you try to delete a files that was in the flashed firmware, you in reality only add a delete-marker to /overlay and the original file stays in /rom (and you consumed a few more bytes of flash space)
In general, 8 MB is rather little space. You probably can get things in if you cook your own firmware containing the packages as then the files get compressed.
I checked out the link and it has a pretty good explanation (thanks for that - although I still can't understand the diagrams very well). Correct me if I am wrong but what I understood from that is that I cannot brick the router by just deleting files using ssh because failsafe mode will always be available.
I am too much of a noob to cook my own firmware right now, and too afraid considering I bricked a router just trying to reinstall the original firmware.
Luckily, the VPN package is the only thing I need so hopefully everything fits in using that.
Question:
So why are the files that I just installed read-only? I am unable to delete them.
Pretty much so (as long as you know how to reach the failsafe
And you can even use "firstboot" command to easily wipe the whole /overlay and revert the router to a situation just like after a clean flash with just the default settings.
That safety and easy resettability is the beauty of the rom+overlay scheme
Probably they are meant to be protected from malicious scripts etc., so the package has installed them as read-only. Just "chmod" them to be writable. Basic Linux stuff.
(If they were installed by a package in the running, they can be modified)
@openwrt_newbie999, In general, if you are not aware, you should also consult the OpenWrt wiki pages. There is a lot of material there, albeit older, that is of value. https://wiki.openwrt.org/start
Without having to create a new topic, thought I'd just ask here.
Was playing around with the settings and wanted to wipe them again so I did a soft reset. Surprisingly, my password remained the same and the previously installed packages did not get removed either. So I tried again, same result.
Then I did a hard reset, again the same result.
Any idea what is going on?
It did give me this message after I confirmed the wipe, if that helps:
/dev/mtdblock3 is not mounted
/dev/mtdblock3 will be erased on next mount
By soft reset I mean that I sshed into 192.168.1.1 and performed:
umount /overlay && firstboot && reboot
But did not seem to work to erase my passwords / previously installed packages.
I solved this by going to 'System > Backup / Flash Firmware > Perform reset'. Now it reset my password and I have my space back.
However, just to help me understand, could you explain why the previous ssh command did not work for the reset? It worked the first time and then stopped working after that.
Good question...not sure. I do know '&&' only works if the previous command completed "successfully" (perhaps because /overlay was already mounted). But...if you were booted normally into LEDE, all you needed to run was firstboot then reboot, since the proper devices were already mounted.
That looks like a 4MB flash chip. There is very little space left in those. Custom builds with the packages you want and some of the standard ones omitted may be necessary.
Then you should think of buying a device with sufficient flash MB.
Once you have 8MB or more to work with, all your troubles with too little space will be gone. $20 well spent.
I have the same exact device with luci_git-15.363.78009-956be55 installed and it works fine - What I did was 'updated' to openwrt from the D-Link software/gui, had problems, was able to get into busybox, and so on.
What I think I might want to look at is to flash it somehow, but I do not know how to do that.