Skip to content

Instantly share code, notes, and snippets.

@markodvornik
Created November 29, 2025 20:29
Show Gist options
  • Select an option

  • Save markodvornik/ba624997377e287ccf334c6cc6570133 to your computer and use it in GitHub Desktop.

Select an option

Save markodvornik/ba624997377e287ccf334c6cc6570133 to your computer and use it in GitHub Desktop.
OpenWRT - generic x86 flash disk - install and upgrade notes

Overview

Cavetas when using generic install or upgrade of OpenWRT on x86 with disk flashing:

  1. small root partition size (default size from img)
  2. conflicting or missing configs between major versions

A. Install the base system - disk flashing

For most x86 systems (with removable internal storage) generic install of OpenWRT means flashing img to the drive (with Rufus, dd or similar tool).

  1. download latest release img for targets / x86 / 64 from downloads.openwrt.org (and verify fingerprint)
  2. attach HDD from the device to your PC
  3. flash it:
sudo dd if=./openwrt-....img of=/dev/rdisk2 bs=4m status=progress

Note: image flavours

  • Default: generic-squashfs-combined-efi.img.gz → Read-only root filesystem + overlay. Harder to utilize all storage.
  • Recomended: generic-ext4-combined-efi.img.gz → Full read-write ext4 root filesystem. / is ext4 and writable from the start.

B. Fixes

1. Partition resize (with default image used)

Assuming loop0 is on partition 2:

  • opkg update && opkg install parted blockdev lsblk - Install needed packages
  • losetup -a - This shows what file/device backs /dev/loop0
  • parted -s /dev/sda resizepart 2 100% - Expand partition 2 to full disk
  • reboot - Let the system recreate loop0 with new size
  • blockdev --getsize64 /dev/loop0 - Check loop device size in bytes
  • resize2fs -f /dev/loop0 - Expanded the ext4 filesystem
  • df -h - Verify end results

2. Post install quirks

Potential issiues when doing a system upgrade with sysupgrade or when migrating /etc/config to the fresh install.

2.1 (Migration) Can't log in to the ssh shell

→ Upgraded system doesn't have root user customized shell installed.

Solution: Log in to the LuCi web administration and install the shell. See migration backup /etc/passwd for hint, like:

root:x:0:0:root:/root:/bin/bash

2.2 (Clean install) Network devices can't surf the web

Likely issues: IPv6 routing, unconfigured WAN gateway

2.2.1 disable IPv6 Source Routing for the local network

Use LuCi:

  • Network → Interfaces → (WAN6) Edit → Advanced Settings → IPv6 source routing (Uncheck) → Apply/Save
  • Uncheck Enable IPv6 in the br-lan bridge device settings to get rid of IPv6 link local as well

Use ifconfig to show all the network devices and note which ones have IPv6 addresses. Then navigate through the graphical OpenWRT interface to Network->Interfaces, and select the Devices tab. For each device that had an IPv6 address, select "configure" for that device and uncheck "enable IPv6".

2.2.2 WAN config

When using static public IP WAN network must be completely configured.

Use LuCi:

  • Network → Interfaces → (WAN6) Edit: enter IPv4 address, IPv4 gateway (T-2: 93.103.0.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment