Managing dual partition (linksys wrt1200ac) routers

I have a Linksys WRT1200AC router, and I installed OpenWRT awhile back. I noticed in the notes about this router, that it has dual partitions, which alternatively get written to when you flash it. I don't think my question is specific to just this router, but any router which uses this dual partition scheme.

So, I had installed OpenWRT originally maybe about a year ago, 18.06.2. I installed the package luci-app-advanced-reboot, and confirmed that partition 1 had Linksys firmware installed, and was marked as the 'alternative' partition, and that part 2 had OpenWRT 18.06.2 and was marked current.

I then did a sysupgrade to flash the firmware to 18.06.5 (figured it was time to update anyhow). As expected, this installed the upgrade to partition 1 and marked it as current, and now partition 2 still has 18.06.2.

Now that I'm satisfied that 18.06.5 is working well, how can I clone my upgraded 18.06.5 partition 1 to partition 2, with all installed/upgrade opkgs and configuration changes, so they are identical?

Because, the way I want to use the 2 partitions (and the way I presume is the intention of this dual partition system) is, when I've got the system working well, sync up the 2 partitions. Then, when I want to test system config changes or upgrade the firmware, those changes will be made to the current partition, and the alternate partition can be used for system rescue, if I bork something in the current partition.

But, I can't find any instructions anywhere for cloning one partition to the other?

That is not the designed way. Just remember that you can't install add-on packages to the OEM firmware...

The design has been that when sysupgrading to a new firmware, the current one stays as the fallback system rescue. The same goes for OpenWrt.

Config changes are taken along in sysupgrade, so you only need to install the same add-on packages after a sysupgrade.

The best way would be

  • to compile your own firmware with all the needed packages either with the full toolchain or with the imagebuilder. Flash the firmware.
  • Then tweak the config until you are happy
  • When you have a properly running config, a sysupgrade to the same firmware version would do the "cloning": the same firmware would be flashed to the alternate and your current settings would be copied there, too.

(I have not seen actual cloning advice anywhere.)

1 Like

I think it would be easier to install 18.06.5 on the other partition, boot into it, and install / configure all needed packages.

For dual-firmware devices, it's usually best to ignore the fact that you have two firmwares installed and to use them as if they were normal single-firmware ones. The reasoning for this advice is simple, the dual-firmware is your safety net, only to be used whenever there's a critical failure condition - some of which might be a potential problem making future sysupgrades hard(er), not becoming obvious until you actually try to attempt the next upgrade. Unless you have a very unreliable power grid, the default won't suddenly/ unexpectedly toggle around - so whatever is on the alternative partition set doesn't matter (until you need it for recovery purposes).

--
Yes, there may be advanced use cases where you might want to toggle between two different configuration sets for testing purposes or similar, but those are just that, advanced possibilities.

2 Likes