Nearly magical recovery of bricked device [WRT1900ACS].. How?

I had my moment of "you either broke something and learned or you haven't done anything meaningful yet" this morning.

I was trying to remove unused software using a wild card, instead of 'opkg remove app-*' I did ' opkg remove app- *'. That difference really screwed me over by starting to remove all packages permitted without a force tag. Luci mostly broke not allowing me to flash firmware, I could not open new scp or ssh sessions as I kept getting some permission error. wget completely busted, and I could not meaningfully provide it an image. Eventually I restarted the router and it died completely, only rapidly flashing the power light.

I attempted to reset the device and see if I could connect to the boot loader using TFTP. I attempted to hold the reset button down several times, attempted to hold the button for a couple minutes. The device acted as if the reset button didn't exist, no attempt at a power cycle or any response other than the rapid power light.

I received the WRT1900ACS as a gift, and my kind mother also decided to purchase some "everything covered" warranty, which was probably for the best considering my fiddling use case. So I contacted the support line and followed along to satisfy their attempts to fix the device at home. Half way through the "reset button" process, they had me power cycle the device for the 10th time. Like a phoenix rising from ashes, the device started to light up, no longer a rapid power button, but a sudden "internet" light, then a 2.4 and 5ghz light. I was surprised, but I assumed either the device had some OEM recovery system I didn't know about or somehow I lucked out by resetting the config files.

I was shocked that the router actually came to life, I was excited to flash some software and restart from scratch. Thankfully I upgraded to the latest firmware roughly 4 hours before I thought I bricked it, so I had a complete package list and config backup. I then checked my phone to notice it connected to Wi-Fi, confused I checked my list and saw my custom SSID on the list. I thanked the support agent and disconnected the call. Ran to my laptop and noticed that I could connect to Luci. All my configs and software remained the same, like nothing ever happened. The only change I could find was that one setting for my Wi-Fi network reverted, and the firmware was back to the original version before I upgraded the firmware.

This has all really confused me, it as if a hidden backup was made of the entire system roughly 4 hours before I thought I bricked it, and it "seemingly magically" restored itself after several attempts to reset the device. As far as I could tell through the wikis and searching the forums no system like this exists, at the very least I would expect some OEM software reset, at the best I would expect an initial flash of OpenWRT, but rather it restored my software, configs, and 22mbs of other data on a 32 mb device.

How did this happen? I'm really surprised and I don't know if I need to start praying to something or if there is some explanation for this that I don't know about. If there is some internal backup and restore system during resets, how can I maintain that? How did all of the software that I removed suddenly restore back onto the device?

Thanks for reading my story! I look forward to someone explaining how this is possible. I am no way an expert of OpenWRT, and barely slightly above 'novice'.

Dual firmware ?

4 Likes

Oh wow! That's amazingly useful. Originally when I read about that feature it sounded like a system similar to "dual-boot." One of the trouble shooting steps I took was attempting to switch over to a secondary partition by triggering a boot failure counter while under the assumption that I had to specifically setup the secondary partition, and hopeful that OEM firmware was installed. I had no success in this manual swap, but I guess I somehow triggered this by accident.
Does this basically mean that OpenWRT basically copies the config files when the preservation option is selected during an upgrade?

it depends on what you've done.

theoretically the second fw location would contain the original fw, or a copy of your openwrt fw, depending on what you did, and when you did it.

1 Like

Both OpenWrt and the OEM firmware leave the currently running partition as the fallback option. They always flash the new firmware to the other partition, copy current settings there, and then switch booting to happen from there.

This happens in a round robin fashion, so that you always overwrite the partition not currently used.

2 Likes

Thanks everyone for your answers!

That is amazingly useful, I'm excited about how well that was designed.

Does this basically mean that so long as the boot loader and hardware remains intact, that it will become extremely difficult to brick this device, so long as I only flash using software based systems, this basically protects the system from myself?

Yes. It is really hard to brick it unless you start messing with the bootloader.

2 Likes

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