Michał Brzozowski

OpenWrt - how to factory reset when firstboot fails

Posted on

Recently I dusted off a TP-Link Archer C5 v1.20 to make a Wi-Fi extender. But as luck would have it I couldn't connect to its admin interface due to my previous tinkering. Thankfully OpenWrt offers a failsafe mode which runs with known settings and allows one to SSH into the box. To nuke all user configuration, you're supposed to run firstboot. The idea is that all mutable configuration is stored as an "overlay" JFFS2 partition over the read-only SquashFS image. But in my case, firstboot did not format the JFFS2 partition. There was no output at all! The solution is to do it manually:

cd /overlay/
rm -rf *
reboot

This will bring your router to a factory config.