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/04/02 15:22] – split automated scripts to docs:guide-user:advanced:expand_root vgaetera | docs:guide-user:installation:openwrt_x86 [2023/12/12 11:24] – [Expanding root partition] optimize code vgaetera | ||
|---|---|---|---|
| Line 38: | Line 38: | ||
| NVMe SSD support is available since OpenWrt 21.02. | NVMe SSD support is available since OpenWrt 21.02. | ||
| + | |||
| + | ===== Packages to consider on x86 ===== | ||
| + | OpenWrt has a minimalist philosophy regarding packaging strategy due to limited space on embedded devices. | ||
| + | |||
| + | One strategy to identify needed modules is to boot into a live Linux distro (for example [[https:// | ||
| + | |||
| + | Another option if building your own image is to build all modules '' | ||
| + | |||
| + | Beyond the kmods, some common packages to consider installing on x86 are listed below: | ||
| + | * For CPU/APU microcode updates for AMD processors, [[: | ||
| + | * For disk monitoring, [[: | ||
| + | * For hardware monitoring, [[: | ||
| + | * For hardware watchdog support, see: [[: | ||
| + | * For kernel entropy, [[: | ||
| ===== Installation ===== | ===== Installation ===== | ||
| Line 118: | Line 132: | ||
| Any additional space in the device is unallocated. | Any additional space in the device is unallocated. | ||
| - | ===== Expanding root partition ===== | + | ===== Expanding root partition |
| + | See also: [[docs: | ||
| + | |||
| + | ==== Expanding root partition | ||
| <WRAP important> | <WRAP important> | ||
| - | When installing | + | When installing |
| </ | </ | ||
| - | ==== Expanding root partition with parted ==== | ||
| Use [[man> | Use [[man> | ||
| Line 132: | 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 141: | Line 157: | ||
| </ | </ | ||
| - | See also: [[docs: | + | ==== Expanding root filesystem ==== |
| + | <WRAP important> | ||
| + | Be sure to [[docs: | ||
| + | |||
| + | It is possible to expand the root filesystem online while OpenWrt is booted. | ||
| + | You can also perform this operation offline to reduce the chance of filesystem corruption. | ||
| + | </WRAP> | ||
| + | |||
| + | Use [[man> | ||
| + | |||
| + | <code bash> | ||
| + | # Install packages | ||
| + | opkg update | ||
| + | opkg install losetup resize2fs | ||
| + | |||
| + | # Map loop device to root partition | ||
| + | losetup /dev/loop0 /dev/sda2 2> /dev/null | ||
| + | |||
| + | # Expand root filesystem | ||
| + | resize2fs -f / | ||
| + | |||
| + | # Apply changes | ||
| + | reboot | ||
| + | </ | ||
| ==== Expanding root partition with fdisk ==== | ==== Expanding root partition with fdisk ==== | ||
| + | You can also use '' | ||
| The easiest way to do this is from the machine booted with a "live CD" distro like [[https:// | The easiest way to do this is from the machine booted with a "live CD" distro like [[https:// | ||
| Line 201: | Line 241: | ||
| </ | </ | ||
| - | ===== Updating GRUB configuration ===== | + | Be aware that deleting and recreating the root partition |
| - | If you expand your root partition | + | Make sure to update the root partition UUID in your GRUB configuration |
| <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 " | ||
| </ | </ | ||
| - | |||
| - | ===== Expanding root filesystem ===== | ||
| - | <WRAP important> | ||
| - | Before expanding the filesystem, be sure to [[docs: | ||
| - | |||
| - | While it is possible to expand the rootfs online while OpenWrt is booted, you may want to perform this operation offline to reduce the chance of filesystem corruption. | ||
| - | </ | ||
| - | |||
| - | Use [[man> | ||
| - | |||
| - | <code bash> | ||
| - | # Install packages | ||
| - | opkg update | ||
| - | opkg install losetup resize2fs | ||
| - | |||
| - | # Map loop device to root partition | ||
| - | losetup /dev/loop1 /dev/sda2 | ||
| - | |||
| - | # Expand root filesystem | ||
| - | resize2fs -f /dev/loop1 | ||
| - | |||
| - | # Apply changes | ||
| - | reboot | ||
| - | </ | ||
| - | |||
| - | See also: [[docs: | ||
| ===== Adding extra partitions ===== | ===== Adding extra partitions ===== | ||