[Solved] Upgrade mistake on WRT1900acs

Can someone lend some insight into what may happen because of a mistake I made during an upgrade? I have a Linksys WRT1900acs, with a dual partition (and luci-app-advanced-reboot installed). I was unclear on the proper way to upgrade, so I accidentally overwrote my existing 18.06.2 installation with the 18.06.4 factory image. I was attempting to 'upgrade' via an overwrite of the remaining OEM, hence using the factory instead of sysupgrade. Everything seems to be okay and working fine, but I wonder if there are going to be any unintended consequences because I overwrote an existing OpenWrt version with a factory image and not a sysupgrade? I tried various searches but couldn't find anything about what may happen if one does this. Any insight would be greatly appreciated.

Please elaborate on this.

1 Like

@stangri Thanks for the quick reply. It's not the fault of your excellent module at all, just my not understanding how the process works, or maybe I should say understanding it and but just not following it. I originally wrote a much more detailed post, but decided not to post it thinking I might get scolded because the info was already documented. :slight_smile: I just couldn't find it. I will quote some of what I had intended to post, and see if that clears it up. If not, please ask me to additionally clarify. My post here may be clear as mud...

"I bought a WRT1900acs awhile back specifically because I liked the idea of the dual partition. This way if an upgrade goes wrong I can revert to the other partition and my previous working setup, and then work on figuring out what went wrong. This particularly appeals to me since I am not an expert in OpenWRT, as my other posts clearly show. I am also doing almost everything via the Luci interface. I can do CLI if I have sufficient step-by-step instructions, but I prefer using Luci for now.

Here's my issue. Let me describe what I have done, and what I think I have figured out from that. I started by setting up the router many months back by flashing the 18.06.2 factory image via the OEM using the browser interface. All went well with this. I configured my setup, and installed luci-app-advanced-reboot for the dual partition aspect. What I didn't realize was that this flashed the secondary partition, not the primary. I should have known this because I know it is supposed to flash the other partition on any given upgrade to create the 'leave the latest working firmware install intact' aspect. Somehow I guess I thought using the factory image, flashed from OEM on partition 1, would write over that OEM image and install it on partition 1.

So, the time comes to upgrade/install 18.06.4. I used the reboot module to switch to the remaining OEM partition (which I didn't realize was on partition 1, still intact after my initial Openwrt install), and then install another factory image (not an upgrade). I figured I was on partition 1 with OpenWRT and the other original OEM was on partition 2. I assumed it would write directly over this OEM, like I thought the first install did. I guess when they said an 'upgrade' will flash the other partition, I took that to mean an upgrade of the same firmware type, but it seems to mean any image that is flashed.

What actually happened was I flashed over my 18.06.2 install and put the 18.06.4 on partition 2, and lost my 18.06.2 install. I figured this out when I went to the advanced reboot tab and saw I was in partition 2, I had 18.06.4, and partition 1 still had OEM firmware on it. This leads to my first question. I seem to have 'upgraded' 18.06.2 by using a factory image, not an upgrade image. This is supposed to be a big no-no. It all seemed to have worked okay, and my system seems alright, and stable. But, what is the reason why this is frowned upon? What can happen when using a factory image to do an upgrade (by mistake, and I don't ever intend to do that again...)?

Now, what I want to accomplish is to get OpenWRT on partition 1, so I can do upgrades to the alternate partition going forward, where I intended to be at this point if I had done this correctly. I assume what I should have done was flash from my then existing OpenWRT setup on partition 2, 18.06.2, with a factory image, since this would then install over the OEM on partition 1? This would have preserved my 18.06.2 on partition 2? Then it would reboot me into partition 1 when done, with 18.06.4, and in the future I would flash from the current working partition with the upgrade version, and this would install on the other partition, leaving the version I am flashing from intact, and able to be rebooted to if needed?

So, my next question is, can I flash from my partition 2 18.06.4 a factory image 18.06.4, which would install over the partition 1 OEM? I can then go configure that and have basically the same OpenWRT on both partitions, ready to do upgrades from there? Or should I just wait for 18.06.6, and do what I should have done this last time? I kind of would like to get it done now so I can rest assured I have the process down."

Why doesn't it matter?

Most users flash the new firmware twice on upgrade - to ensure it's placed on partitions 1 and 2.

Just:

  • flash one
  • flash the other (with your second firmware)
  • you should be back where you want to be
1 Like

The factory image is for when you are on OEM and are flashing, so you got that correct. The terms primary and secondary are a misnomer, there are just two partitions and when you flash, you flash to the other partition, whichever one that may be. You should be safe flashing the same 18.06.4 image to both, I have not seen any issues reported, but would recommend it is somewhat safer to have different images on each (just in case).

4 Likes

Both responses above are 100% correct, but just to spell it out explicitly.

Aside from losing your previous OpenWrt configuration, you haven't really done anything wrong (just not what you originally intended to accomplish), nor damaged anything.

The factory images are for whenever the OEM firmware is in charge (upgrading from the OEM webinterface or tftp recovery from the OEM bootloader), as it's made compatible to what the OEM firmware expects. Obviously this can't translate configurations from the OEM firmware to OpenWrt - and the target partition (always the other, currently not booted, one) will be overwritten, starting with a clean default config.

While being booted into OpenWrt, you can only use the sysupgrade images - this will retain your current configuration (unless explicitly disabled) and preconfigure the newly installed firmware version with it; packages installed via opkg will be lost (but the configs remain), so you need to reinstall those (as needed).

In both cases new firmware versions (OEM or OpenWrt) will always install to the other, currently not-booted, partition and leave the currently booted one alone.

I would usually recommend not to micro-manage which version gets installed to which partition, just rely on the fact that your known-good and currently booted partition will remain untouched over a sysupgrade. This means you can go back to your unmodified working firmware whenever you encounter problems, which in turn is a significant safety net and a huge convenience gain for experimenting (I'm in a similar situation on my ZyXEL nbg6817 - and it's great). luci-app-advanced-reboot is a great tool, but normally you'd 'never' need/ use it - unless something has gone wrong, which makes you want to revert to the (known good) status quo ante. Yes, once you've become more familiar with OpenWrt and get into more experimental moods, luci-app-advanced-reboot can provide additional benefits, but for a start it's mostly an emergency tool only.

4 Likes

Just to re-iterate @slh's reply above, use the sysupgrade image for this, not a factory image.

4 Likes

Thanks everyone. I now understand what I didn't before, and that is that the factory image is for when you are operating within the OEM firmware, so it will accept the new firmware. Since I didn't really understand all this, I thought it meant if you are overwriting OEM, regardless of from where or how, you needed a factory image. Hence, I also thought if I was in OpenWRT but wanting to overwrite an OEM I'd need a factory image. Now I see if I'm in OpenWRT I need a sysupgrade image. It is all very clear now.

I will just flash from my current OpenWRT 18.06.4 using a sysupgrade, which will write over the remaining OEM, and then re-add my packages and restore my settings via my saved archive (since I follow the advice to uncheck the 'keep settings' box). Thanks for all the help, it was very clear advice, and now I feel I have a good handle on how all this works. I appreciate how helpful this community is for those with limited experience. Without all this help how could people like myself ever reach a higher level?

1 Like

I just wanted to follow up on this. Sorry my reply took so long. I did this as outlined above and it worked flawlessly. I'm now where I wanted to be before my mistakes sent me down the wrong path. I hope this thread can help out some other people who are also fairly new to this dual partition concept and OpenWrt so they will understand what I didn't before messing it up... Thanks again for all the help, and I'll mark this one solved.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.