I have a zyxel_nbg6817 which has a preposterous amount of on-board flash (4GB). However, after flashing OpenWRT and using for a few weeks my free space looks like:
How can I get this free space into my root? I see things around about "extroot" if I want to use a USB stick, but I don't really want to replace the overlap system, I think I just want one layer of the overlay to be a folder on this partition instead of whatever tiny partition it is using now?
I don't think I've answered myself, since I don't know how to do that
extroot docs always seem to get rid of the overlay entirely and just mount root from outside. That doesn't seem necessary here, the squashfs is fine, and honestly even the 60MB partition is fine if I could have three layers (but I doubt overlayfs will let me get that fancy...) -- but I don't know where the configuration for what gets mounted at /overlay/... lives, since extroot docs just tell you to remove that instead of how to change it.
Also, the extroot docs smell wrong for this device in general, since:
sed -n -e "/\s\/overlay\s.*$/s///p" /etc/mtab prints /dev/loop0 which seems very unlikely to be the actual place the 60MB partition is mounted from?
You have two problems (and a third lingering, should you decide to go forward nevertheless):
the overlay is version specific by definition, you can't share one overlay for two firmware installations
potential reverting to stock, I don't know how the OEM firmware will cope without streamboost data (if that can be re-initialized)
if you still decide to go ahead, you will have to change the nbg6817 device support on the source level - and quite substantially at multiple layers. it means diverging from the (OpenWrt- and OEM-) defaults, with zero sysupgrade compatibility - you will have to keep building your custom OpenWrt(-fork) forever.
64 MB dedicated to the rootfs is already quite plenty, do you really need more than that?
the overlay is version specific by definition, you can't share one overlay for two firmware installations
Not sure what this means. I only have one firmware, the OpenWRT install?
potential reverting to stock, I don't know how the OEM firmware will cope without streamboost data (if that can be re-initialized)
Are you saying the big partition is not empty even though it appears to be, but contains some invisible data? And that that data might be required if I ever stop using OpenWRT? So long as it won't break OpenWRT to lose any phantom data, I'm never going back to OEM. I bought the router specifically to run OpenWRT on it.
if you still decide to go ahead, you will have to change the nbg6817 device support on the source level - and quite substantially at multiple layers. it means diverging from the (OpenWrt- and OEM-) defaults, with zero sysupgrade compatibility - you will have to keep building your custom OpenWrt(-fork) forever.
Why? I just want to change one part of the OverlayFS to store in a different partition than currently. If the extroot instructions on the wiki didn't show me a loop device I could probably just use that without issue. I may be able to even so, or figure out what is behind that loop device (though if anyone knows and can tell me it would be a lot easier ) -- shouldn't need to do anything so extreme as forking since extroot style setups are supported? Just this one isn't external so I felt there should be a simpler way since I don't need anything to happen when the partition is "removed" since it cannot be removed.
64 MB dedicated to the rootfs is already quite plenty, do you really need more than that?
64 MB is pretty small. I've filled it already in just two weeks, and I don't feel like I've installed that much software. I could poke around and free up some space (already uninstalled curl just to make room to play with still) but since the device has mountains of space sitting empty it seems odd to act like I have a tight budget when I don't need to...
The root partition has always the same size to be able to reflash manufacturer firmware at any time (this is a design decission! the 64MiB is a fixed size fitting to your device).
In this partition is written a squashfs image file (read only; size will change with every update). The part which is left after writing squashfs is used as data partition (size will change accordingly with every upgrade). All in all it will never be larger then 64 MiB.
You would need to change this behaviour in installation/upgrade routine of OpenWrt and/or you have to change the definition of that what Overlayfs is in OpenWrt source. Exactly that what @slh has written already.
EDIT:
A possible approach would be using the 3,2 GiB partition as an extroot. You can format it (did that already in the past; but made an image before). Data will be rewritten from Zyxel firmware. But you will have all side-effects using an extroot.