Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:installation:openwrt_x86 [2023/09/16 18:16] – [Expanding root partition] vgaetera | docs:guide-user:installation:openwrt_x86 [2023/12/12 11:24] – [Expanding root partition] optimize code vgaetera | ||
|---|---|---|---|
| Line 47: | Line 47: | ||
| Beyond the kmods, some common packages to consider installing on x86 are listed below: | Beyond the kmods, some common packages to consider installing on x86 are listed below: | ||
| - | * For CPU/APU microcode updates for AMD processors, [[: | + | * For CPU/APU microcode updates for AMD processors, [[: |
| * For disk monitoring, [[: | * For disk monitoring, [[: | ||
| * For hardware monitoring, [[: | * For hardware monitoring, [[: | ||
| Line 133: | Line 133: | ||
| ===== Expanding root partition and filesystem ===== | ===== Expanding root partition and filesystem ===== | ||
| - | See also: [[docs: | + | See also: [[docs: |
| ==== Expanding root partition ==== | ==== Expanding root partition ==== | ||
| Line 148: | Line 148: | ||
| # Identify disk name and partition number | # Identify disk name and partition number | ||
| - | echo -e " | + | parted -l -s |
| # Expand root partition | # Expand root partition | ||
| - | parted -s /dev/sda resizepart 2 100% | + | parted |
| # Apply changes | # Apply changes | ||
| Line 173: | Line 173: | ||
| # Map loop device to root partition | # Map loop device to root partition | ||
| - | losetup /dev/loop1 /dev/sda2 | + | losetup /dev/loop0 / |
| # Expand root filesystem | # Expand root filesystem | ||
| - | resize2fs -f /dev/loop1 | + | resize2fs -f /dev/loop0 |
| # Apply changes | # Apply changes | ||
| Line 245: | Line 245: | ||
| <code bash> | <code bash> | ||
| - | # Install packages | ||
| - | opkg update | ||
| - | opkg install lsblk | ||
| - | |||
| # Update GRUB configuration | # Update GRUB configuration | ||
| - | BOOT_DEV="$(sed -n -e "\|\s/ | + | ROOT_BLK="$(readlink |
| - | BOOT_PART="${BOOT_DEV## | + | '$9=="/dev/root"{print $3}' |
| - | DISK_DEV="${BOOT_DEV%${BOOT_PART}}" | + | ROOT_DISK="/dev/$(basename |
| - | ROOT_DEV=" | + | ROOT_DEV=" |
| - | ROOT_UUID=" | + | ROOT_UUID=" |
| sed -i -r -e " | sed -i -r -e " | ||
| </ | </ | ||