Followed x86 installation guide, boot is failed

Hi all,

So I am following this guide - https://openwrt.org/docs/guide-user/installation/openwrt_x86 and trying to install OpenWrt to an x86_64 mini PC. Image is combined efi.

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.

losetup /dev/loop0 /dev/sda2 2> /dev/null
resize2fs -f /dev/loop0

At that time system all looked good.

However after reboot, the system is down, and it seems the ext4 filesystem is corrupted.

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.

Any help is much appreciated in advance !

a bit annoying that new user can only post 1 media.

here is another screenshot taken before last reboot, in which system looks good.

Let's see...

  • You used a loop device as a trick, instead of resizing the real filesystem.
  • You sent the possible error messages to "/dev/null".
  • You forced the resizing of the filesystem.
  • The filesystem is corrupted now.
5 Likes

Did you expand the root partition also, per the instructions?

I was gonna suggest a LiveUSB with gparted installed.

1 Like

could also do the automatic resize using https://openwrt.org/docs/guide-user/advanced/expand_root

2 Likes

I was exactly following the same steps as per the guide:


These steps went through prefectly on my Proxmox VM of a 30G disk space.

1 Like

if you want to start from scratch

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.

3 Likes

Boot into grub in failsafe mode and run the command fsck.ext4 -y /dev/sda2. It helped me

3 Likes

Yes I did both as per the guide.

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.

Yes.

Any one with gparted?

https://gparted.org/liveusb.php

1 Like

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!

Cheers

1 Like

Although my problem is resolved by another post, still many thanks for your time and effort posting the wonderful codes and detailed steps!

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

1 Like

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!

1 Like

In my humble opinion, those instructions must be reviewed...

3 Likes

Didn't realize there was a installer for this use case that's pretty decent.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.