[HOWTO] Resizing root partition on x86 (March 2023 edition)

Found a few issues while expanding my partition so I'm sharing my experience in case anybody else came across the same issues.

I'm installing the snapshot build for Raspberry Pi 5 (May 7, 2024)

I went the easy route by putting the SD card with the OpenWRT OS into my linux machine, then I ran Gparted and expanded the "rootfs" partition.

The partition's UUID remained the same, however the other value called "PARTUUID" was changed to a new value. Gparted does not report on the PARTUUID value. I had to use the "blkid" command to see the PARTUUID values.

After resizing, if I tried booting the system, it will just get stuck waiting to load rootfs. I tried changing the PARTUUID to the original value, but the program complained that the Partition UUID is too short.

Luckily the renamed PARTUUID still adhere to the format which ends with "-01" and "-02" for the first and second partition. I mount the first partition named "boot", then edit two files inside:


If your PARTUUID is "abcdefgh-01" for the boot partition, then just replace content inside partuuid.txt with "abcdefgh" without the "-01".

For cmdline.txt look for "root=PARTUUID=" and supply the PARTUUID of the rootfs partition. It should be the full ID ending with "-02".

Hope this helps!

1 Like

At the Resize the Root File System step, I encountered this:
root@OpenWrt:~# LOOP="$(losetup -f)"
-ash: losetup: not found
if someone know what's going on here i would appreciate that, thanks!

Add the package?

1 Like