Resize the FS on QEMU Guest

I created a 300MiB partition for the "/" I am following: https://openwrt.org/docs/guide-user/installation/openwrt_x86?s[]=resize2fs
I am running it as a guest in QEMU. I can mount the drive on my host..
This is the EXT4 Combined image. It is raw image in Qemu

But I am not sure how to resize the root FS.
I read the Resizing Ext4 rootfs section but I don't know which file I should put the variables, perhaps cron?
I did install resize2fs,lsblk & losetup but I am not sure how to make it to create a larger /dev/root

You need to use resize2fs which you'll probably have to install with opkg first

Hello, I did install resize2fs,lsblk & losetup but I am not sure how to make it to create a larger /dev/root. I have rebooted several times and the same shows up.

On a regular host you need resize the partition 1st, then resize the FS.

1 Like

@frollic Hello, If understand your answer correctly, /boot needs to be resized? I resized sda2 with fdisk installed on opnwrt.

I know nothing about QEMU, but ...

If you use a regular x86 install, and dd the whole image, it'll will wipe the partition table you
had created. The partition have to be resized, and FS reextended afterwards.

gparted is a good tool for doing it, assuming it's compatible with qemu.

another option is to create the partitions, and manually write the root FS to sda2, and the kernel to sda1
It'd be as adding a 2nd install, as I've described in Sysupgrade help for x86_64 - #14 by frollic

and no, you don't need to resize /boot, since it only contains the kernel, it's the / you're after (I'd assume).

I will give it a try. Thanks. I can wipe the slate clean easily as I wish with QEMU.

if you do follow the guide you linked it states:

Be sure to resize partitions before resizing filesystem.