At the first time I installed it to a Proxmox VM in which I assigned about 30G disk space, it was running perfect.
Then I was going to install OpenWrt to the PC directly, in which I now have 256G disk space. Everything was OK until expanding root partition and filesystem. I executed the following commands.
I followed the same steps and the only difference is disk space (30G vs 256G) and don't understand why the second try is failed? Is there any particular limit in terms of disk space ? Google search doesn't say anything about that.
boot openwrt off an USB flash drive, in openwrt, once booted
opkg update
opkg install fdisk resize2fs
cd /tmp
wget https://downloads.openwrt.org/releases/24.10.0/targets/x86/64/openwrt-24.10.0-x86-64-generic-ext4-combined-efi.img.gz
zcat openwrt-24.10.0-x86-64-generic-ext4-combined-efi.img.gz > /dev/sda
fdisk
d
2
n
p
2
(accept defaults)
w
the next step might fail
resize2fs /dev/sda2
if it failed
wget https://downloads.openwrt.org/releases/24.10.0/targets/x86/64/openwrt-24.10.0-x86-64-generic-ext4-rootfs.img.gz
zcat openwrt-24.10.0-x86-64-generic-ext4-rootfs.img.gz > /dev/sda2
resize2fs /dev/sda2
and finally (done in both cases)
fsck /dev/sda2
reboot
in grub change the Openwrt entry, from root=UUID=... to root=/dev/sda2
make the same change permanent after you've booted, by editing /etc/grub/grub.cfg.
My second screenshot shows that partition has been done and resizing fs commands were also performed.
Tried a few times this weekend. I tired a live USB with parted too, not gparted, is that a GUI version? don't have it on hand and no idea which distribution I should go with. I have 2 4G usb. Thanks for the tips anyway.
You are a legend! The solution has least amount of workload but surprisingly fixed the problem which I thought is a serious error! The command seems is as simple as Windows' check disk operation.
Still no idea at all what has happened on my disk though! Feel that the tutorial isn't quite complete without this gorgeous and elegant command!
I ran into the problem myself after a disk expansion. (I am not an experienced OWRT user, lol) And surprisingly this command did a great job in fixing the problem. I'm glad I was able to help you
Much appreciated for the explanation and the link, might not need it for now as the issue is fixed but feel it would be benefical for my other projects!