Using SD card for Openwrt but want to increase root partition size

Hi,

I'm very new to Openwrt and this stuff in general. I recently purchased a NanoPi R4S and I am running Openwrt from an SD card. I've installed Adguard Home but whenever I add block lists / filters it says there isn't enough storage available and bricks my router leaving me to re-flash and start from scratch.

I've looked at the guides to expand the storage of the root partition and honestly, I'm very confused, a lot of the guides refer to using an external USB whereas other say just create a partition and mount it. I've tried manually resizing the partition with parted and it doesn't work...

Honestly, I'm clueless and would appreciate anyone help / guidance!

Add a partition like gigabyte after openwrt and use it as "usb storage"

So I have created a new partition using fdisk shown below;

image

How can I use that as "USB storage"?

I formatted the partition as ext4 and mounted it as below;

Is this correct or am I missing something?

Mount it anywhere else? Like default /mnt/mmcblk0p9

Use cfdisk to resize the last partition?

The script on the page Expanding root partition and filesystem mentions that it is for x86 target. However, I have used it on various other targets that use an SD card image with success. Your mileage may vary. I would recommend making a copy of your SD card and trying it that way if it doesn't work you haven't lost anything.

I will try this when I finish work today.

When I did this with Parted it resized the partition but Openwrt didn't see it as any bigger...

Thank you, I will give this a go if I can get no where with the others. Is the process literally SSH in and copy and paste the 3 scripts?

Quite literally yes. For an even easier installation, the one line Automated method accomplishes the same thing.

I used this method to expand a 4GB Bootable USB to preserve my internal 512GB SSD when I first experimented with an X86/64 platform.

I had the same problem on BPI-R4; cfdisk worked. If it doesn't work, "dd" the image to your SD card and try again. The expanding root they were talking about applies to ext4, not overlayfs.