I have tried the automated script at: https://openwrt.org/docs/guide-user/advanced/expand_root
but it doesn't appear to work.
(I have installed parted, losetup and resize2fs and also cfdisk though I only used that to look and made no changes)
expanding root is not for mtd filrsystems, they are at their maximum size.
swuashfs is composed once for sysupgrade image, add more files it will be bigger and vice versa, on top of that /overlay in remaining space tracks changes you add on top of readonly squash fs
If I was building an image using the firmware selector, how could I include 70-rootpt-resize and 80-rootfs-resize? There is a box for uci-defaults scripts.
in the Script to run on first boot (uci-defaults) section, provided I have added wget, losetup, parted and resize2fs in the Installed Packages section?
Was nearly there though, it created the first script 70-rootpt-resize, whic I've just realised is actually empty, so I guess the fireware builder doesn't like the syntax.
I just use the normal backups and if anything goes wrong I restore an image from the online image builder then restore my backup file. This brings me back to before I broke anything!
I also added losetup, parted and resize2fs to the Installed Packages section.
It did not take after the first reboot, but did after the second (perhaps I could have added sh /etc/uci-defaults/70-rootpt-resize to make it run for the first reboot)
I managed to grow my overlay on the R5S running the new stock OpenWRT 24.10 squashfs. It took me a while to figure out that the overlay is actually an f2fs, not ext2/3/4, so resize2fs won't work. Use resize.f2fs instead.
Essentially, you can (nearly) follow these instructions.
Directly resizing /dev/loop0 doesn't work, as this is already mounted. The script above picks the next available loop device (likely /dev/loop1), maps that to /mnt/mmcblk1p2 (which also contains the RO squashfs, but then a f2fs for the overlay at an offset). After reboot, we see the expanded overlay. Note that I have the bigger R5S with 32GB eMMC and 4GB RAM.
root@friendly:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 28.8G 0 loop /overlay
mmcblk1 179:0 0 28.9G 0 disk
├─mmcblk1p1 179:1 0 16M 0 part
└─mmcblk1p2 179:2 0 28.8G 0 part /rom
mmcblk1boot0 179:32 0 4M 1 disk
mmcblk1boot1 179:64 0 4M 1 disk
root@friendly:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 3.5M 3.5M 0 100% /rom
tmpfs 1.9G 352.0K 1.9G 0% /tmp
/dev/loop0 28.8G 458.0M 28.4G 2% /overlay
overlayfs:/overlay 28.8G 458.0M 28.4G 2% /
tmpfs 512.0K 0 512.0K 0% /dev
Compared to the FriendlyWRT image (with docker) I used before, the OpenWRT build doesn't come with lots of pre-installed clutter you may not need. Also, with the new image, podman seems to work, whereas docker on the FriendlyWRT had some config issues with firewall and network.
Sadly, I have so far not managed to get the SSD I stuck into the R5S to work again. It did work with FriendlyWRT. Perhaps some device tree changes are needed.
I had trouble getting a WD/Sandisk SSD to work with Debian 12 on the R5S.
I had to add pcie_aspm=off to the boot options
It worked with Arch though, ISTR (or one of the other flavours anyway)