So I found that while the BPI-R64 has a 7.2GB eMMC, only 900MB are allocated for OpenWrt in the default sdcard image (from downloads.openwrt.org/snapshots).
It turns out this is hard-coded in the makefile, but you can patch it:
/target/linux/mediatek/image/mt7622.mk
If someone is familiar with submitting patches to OpenWrt, it would be great to get this mainlined for BPI-R64 since the stock image just throws away all that eMMC space otherwise…
Hi,thanks for the patch.but maybe its better to use the additional space for a separate data partition,so that this is not overwritten on reflash an image. Currently only the entry in partition table needs to be restored as it got overwritten by flashing the image. Idk if there is a way to leave image size at 900MB,but including the partition entry…of course on first flash you have to create a filesystem,but on further updates you can simply flash the new image without touching the data partition
True, maybe it would be better to include another data partition, but my particular case I needed the larger overlay space (to install docker + images).
Having overlay larger than RAM doesn’t make sense as what ever you store there then won’t survive sysupgrade. Better use an additional partition for data, if you are looking for an easy automated way to make use of extra space take a look at the autopart package in OpenWrt (and uvol as a wrapper around LVM2 or UBI to manage additional storage volumes).
Ah, I wasn’t aware of this limitation. I think it will be better to create a new partition then and redirect docker to use that for its storage (ie, /opt/docker)
Does OpenWRT silently truncate the image if overlay is larger than RAM, or does it fail the update?
No, you are just limited in what survives sysupgrade. Basically only /etc/config and things listed in /etc/sysuprgade.conf get carried over, all the rest is gone as rootfs_overlay is formatted after sysupgrade and repopulated with the backup files.
In order to restore the backup on the first boot after sysupgrade, the backup archive needs to fit into tmpfs, ie. limit is the size of RAM.
Having additional partition for persistent data is hence in any case a good idea. And overlayfs cannot be used for Docker, as it cannot serve as the lowerdir of another overlayfs…