Resizing OpenWrt file space on boot device

I'm starting this topic because I had a hard time finding this answer to my question about how to resize a squashfs file system on a microSD card (in this case, for a Banana Pi R2-Pro).

This worked for me:

It had worked. Now not so much.

You mean the script isn't producing any error messages at all ?

Correct. Didn't work with squashfs. No error messages.
Mucking around revealed that the partition was resized, but the filesystem was not. Attempts to manually resize it didn't work; superblock issues.

Just retried with a fresh ext4 image. That did work.

Made another attempt at using the script with a SquashFS image. No bueno (didn't work).

Again, the script properly resized the partition but not the filesystem. No errors reported by the script.

I was able to resize it manually by booting the board off a different device (microSD in this case) and using the tools onboard to fsck and resize.

losetup -o XXYYZZ /dev/loop0 /dev/mmcblk1p2

fsck.f2fs /dev/loop0
resizefs /dev/loop0

Where XXYYZZ is the offset reported earlier by running losetup on /dev/loop0 when OpenWrt was running off it.

Then I did this for SquashFS:

They had changed to ext4 journaling I think can not be resized.

ext4 (journalling or not) can be resized, you can even grow it online (shrinking only offline).

1 Like