X86 long term strategy (upgradability with expanded storage)

this is my setup, if this is good for you or being future proof i don't know ... anyhow:

i am using ext4 image. which i built with imagebuilder to have a 512MB root partition instead of the default 106MB. i have two ( ! ) root partitions as you can see below

# lsblk
NAME     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda        8:0    0 119.2G  0 disk
├─sda1     8:1    0    16M  0 part /boot
│                                  /boot
├─sda2     8:2    0   512M  0 part /   # <- active root partition
├─sda3     8:3    0   512M  0 part     # <- inactive root partition
├─sda4     8:4    0 118.2G  0 part /storage/opt/docker # <- this is fixed partition
│                                  /storage            # <- mounted as /storage and also used by docker, but it is preserved between switching root or upgrade
└─sda128 259:0    0   239K  0 part

the first root partition is created when i dd the ext4-combined image, and i create the 2nd root partition manual afterwards and format to ext4 as well. then i can install the rootfs image onto it.

this way i can easily do upgrades with fallback option as rootfs image can be for different version, only have to copy the related kernel to /boot and modify the /boot/grub/grub.cfg accordingly. i also immediately change grub.cfg after install to use partition numbering instead of UUID. e.g.

menuentry "OpenWrt - 23.05.2 - sda2" {
        linux /boot/openwrt-23.05.2-x86-64-generic-kernel.bin root=/dev/sda2 rootwait   console=tty0 console=ttyS0,115200n8 noinitrd
}
menuentry "OpenWrt - 23.05.0 - sda3" {
        linux /boot/openwrt-23.05.0-x86-64-generic-kernel.bin root=/dev/sda3 rootwait   console=tty0 console=ttyS0,115200n8 noinitrd
}
5 Likes