I installed OpenWRT on my x86 mini PC countless times. After each installation, I tried to add the remaining part of the disk to the sda2 partition. Despite getting help from AI, I failed every time when trying to extend the sda2 partition. I tried different methods to extend sda2. I don't have much knowledge about this, but it seems that every time I tried to extend sda2, OpenWRT couldn't boot after a restart. I watched videos, looked at examples. I couldn't succeed in this process, to be honest. I know that I have done this partition extension before. I can't understand why I can't do it now. I don't think I'm missing any detail. After installing OpenWRT, the sda disk is partitioned into: sda128, sda1, sda2. I make the remaining part of the disk as squashfs, like sda2. I extend sda2 using gparted or from the terminal. After the first restart, OpenWRT can't complete the installation. When I restart without editing sda2, I can access the OpenWRT terminal. However, whenever I touch the sda2 partition, it becomes impossible to reach the OpenWRT terminal. Since DHCP is not provided, it is also not possible to access the terminal via the web interface or SSH. I am performing the installation and sda2 partition extension via Finnix and Kali USB live, but it doesn't make a difference. It seems as if sda2 has declared its inviolability. Can't we extend this sda2? Backing up sda2 and restoring it to the newly created sda2 partition doesn't help either. Give me some advice, please. Thank you.
The wiki has a detailed page about this, please avoid ai hallucinations; squashfs can't be resized (and doesn't need to, anyways).
Expanding root partition and filesystem covers expanding both ext4 and squashfs filesystems on x86 hardware. It will also work on some arm sbc as well.
I knew this address. I tried again and it worked. Thank you.
opkg update
opkg install kmod-fs-ext4
opkg install kmod-usb-storage
opkg install kmod-usb-ohci
opkg install kmod-usb-storage-extras
wget -O /tmp/expand_root_script.sh "https://openwrt.org/_export/code/docs/guide-user/advanced/expand_root?codeblock=0"
chmod +x /tmp/expand_root_script.sh
/tmp/expand_root_script.sh
reboot
or
curl -o /tmp/expand_root_script.sh "https://openwrt.org/_export/code/docs/guide-user/advanced/expand_root?codeblock=0"
chmod +x /tmp/expand_root_script.sh
/tmp/expand_root_script.sh
reboot
After rebooting, OpenWrt restarts 3 times or 2 times consecutively, if I'm not mistaken. The process completes successfully afterward.