Ok... finally figured this out. When you said use "the ext4 instead" I thought you meant the partition type rather than the image type. Utterly confused I gave up for a couple weeks.
Now that I've flashed the sd card using the combined-ext4.img instead of the combined-squashfs.img, things have progressed. Used cfdisk to resize /dev/mmcblk0p2 partition, then struggled to resize /dev/root until I found this workaround to an apparent issue with the x86_64 image on 19.07.07.
@vgaetera Is this workable from an online running OpenWRT install? I'm still sitting on 19.07 since the x86 image sizes for 21.02 are too small for my use. I was planning to just create at 3rd partition for my AdguardHome install since it uses 100mb on its own and mount it to /etc/AdguardHome for ease, but this would make things a smidge easier as AdguardHome's directory size gets larger the longer it runs (logs etc) which makes it near empty on a fresh install and restore of my settings.
I've been looking for a solution to the same problem lately, using the squashfs image for NanoPi R2S. I went through the same tutorial on the wiki as OP, which resulted in the same failed losetup command. Then i stumbled on this thread locating-config-files-on-sd-card/79648 which suggests using losetup with the -f flag instead of -d.
I know close to nothing about loop mounting, but It doesn't make sense to me to (-d = detach) the device i'm trying to mount, as suggested by the wiki. Maybe the -d flag did something else in previous versions of losetup? Hopefully someone who knows more can fill in on this.
Anyway i did the following today, which worked
# at OpenWrt device
root@OpenWrt:~# losetup > losetup-output
# at my laptop running linux i resized the ~100mb partition using cfdisk to a desired size and then did the following
scp root@<openwrt device ip>:/root/losetup-output .
cat losetup-output
sudo losetup -f -o <offset from losetup-output> /dev/sdX
# above command defaults to a loop device at /dev/loop0
# from here on it's the same as in the wiki instructions
sudo fsck.f2fs /dev/loop0
sudo resize.f2fs /dev/loop0
# i also detached all loop devices with the -D flag according to losetup help before moving the sdcard back to the NanoPi R2S
sudo losetup -D
If you can redo your setup, if you expand the root partition before first booting OpenWrt, the first boot process will automatically create a f2fs filesystem thats takes all the available space in second partition after built in read only rootfs.
can confirm this on Nanopi R4S, i just did it yesterday. interestingly if you leave with the build default of 104M root partition and don't expand the partition before first boot, it creates /dev/loop0 as an ext4 filesystem, whereas when I expanded the partition to 1G before first boot, it created /dev/loop0 as a f2fs filesystem.
I posted this on another one of these questions. To share what worked for me on OpenWRT 22.03.2 with SquashFS.
1. Flash image to SD as normal with the firmware selector (I added packages to mine)
2. ssh into router
3. "opkg update && opkg install cfdisk resize2fs"
4. "cfdisk /dev/mmcblk0"
5. Create a NEW PRIMARY partition in the free space at the end. Delete this new partition. Select /dev/mmcblk0p2 and RESIZE it. The default entries will take the whole space.
6. Reboot
7. ssh into router
8. "resize2fs /dev/loop0"
9. Success!