User Tools

Site Tools


Failsafe Mode, Factory Reset, and Recovery Mode

OpenWrt offers several ways to “start over” with your router.

  • Failsafe Mode is useful if you have lost control of your device, and it has become inaccessible, perhaps through a configuration error. It allows you to reboot the router into a basic operating state, retaining all your packages and (most) settings. (see Failsafe Mode)
  • Factory Reset erases all your packages and settings, returning the router to its initial state after installing OpenWrt. (see Factory Reset)
  • Recovery Mode allows you to install new firmware on a router that has become corrupted. (see Recovery Mode)

Failsafe Mode

OpenWrt allows you to boot into a failsafe mode that overrides its current configuration. If your device becomes inaccessible, e.g. after a configuration error, then failsafe mode is there to help you out. When you reboot in failsafe mode, the device starts up in a basic operating state, with a few hard coded defaults, and you can begin to fix the problem manually.

Failsafe mode cannot, however, fix more deeply rooted problems like faulty hardware or a broken kernel. It is similar to a reset, however with failsafe, you can to access your device and restore settings if desired, whereas a reset would just wipe everything.

Caveat: Failsafe mode is only available if you have installed firmware from a SquashFS image, that includes the required read-only root partition. To verify whether your device has the SquashFS root partition, check for “squashfs” either in the OpenWrt image name or perform the following check on your device:

grep squash /proc/mounts

The terminal should return something similar to this:

/dev/root /rom squashfs ro,relatime 0 0

Entering failsafe mode

Make sure you use a wired connection, since the failsafe will disable your wireless connectivity.

On most routers, OpenWrt will blink a LED (usually “Power”, may be other) during the boot process after it gets control from the initial bootloader (like u-boot). OpenWrt will rather early in the boot cycle check if the user wants to enter the failsafe mode instead of a normal boot. It listens for a button press inside a specific two second window, which is indicated with LEDs and by transmitting an UDP package.

There are three different (power) LED blinking speeds during boot for most of the routers:

  • first a moderate 0.1 second blinking rhythm during those two seconds, when router waits for user to trigger the failsafe mode
  • then either
    • a slow 0.2 second blink continuing to the end of boot, if the failsafe was not triggered and the normal boot continues
    • a rapid 0.05 second blink if the user pressed a button and failsafe mode was triggered

To enter failsafe mode, follow one of the procedures listed below:

  • Wait for a flashing LED and press a button. This is usually the easiest method once you figure out the correct moment.
  • Wait (with a packet sniffer) for a special broadcast packet and press a button. The packet will be sent to destination address port UDP 4919. The packet contains the text “Please press button now to enter failsafe”. So for example, in a terminal and using tcpdump, with the router connected to port eth0, you would enter the command
    tcpdump -Ani eth0 port 4919 and udp
  • Watch for a boot message on the serial console and press a key (“f”) on the serial keyboard. This requires that you have attached a serial cable to the device. The message shown in the console is “Press the [f] key and hit [enter] to enter failsafe mode

Usually, it is easiest to watch the LEDs. However, do consult the available documentation for your device, as there is no default button assigned as a reset button and not all procedures work on every device. Whichever trigger you use, the device will enter failsafe mode and you can access the command line with SSH (always possible) or a serial keyboard.

Note that modern OpenWrt uses always SSH, but early OpenWrt releases (15.05 and before) offered a telnet connection in this state but no SSH.

Note: old OpenWrt wiki page offer more details, most of them still valid:

Fixing your settings

Once failsafe mode is triggered, the router will boot with a network address of, usually on the eth0 network interface, with only essential services running. Using SSH or a serial connection, you can then mount the JFFS2 partition with the following command:


After that, you can start looking around and fix what’s broken. The JFFS2 partition will be mounted to /overlay, as under normal operation.

Factory Reset

A factory reset returns your router to the configuration it had just after flashing. This works on any install with a squashfs / overlayfs setup (the norm for most installations), since it is based on erasing and reformatting the overlayfs. Note: X86 builds with an ext4 read-write rootfs cannot be reset this way.

With a large NOR chip, it can take 3 to 5 minutes for the overlayfs to be formatted in the flash. During this time, changes cannot be saved.

Soft Factory Reset

If you want a clean slate, there’s no need to flash again; just enter the following commands. Your device's settings will be reset to defaults like when OpenWrt was first installed.

umount /overlay && firstboot && reboot

Note: for most routers, “firstboot” actually just issues a “jffs2reset” command, so there is no difference compared to the “hard reset” advice below.

Note: If

umount /overlay && firstboot && reboot

does not work, try those commands on separate lines in the terminal.

Hard Factory Reset

This command will erase and reformat the whole jffs2 partition and create it again:

umount /overlay && jffs2reset && reboot

While essentially doing the same thing as firstboot, this actually rewrites the whole flash area of the JFFS2 (read-write) partition instead of just re-formatting it.

Recovery Mode

If neither Failsafe Mode nor Factory Reset returns control of your router, you can often replace the firmware of your device using one of the procedures described on the Recovery Mode page.

docs/guide-user/troubleshooting/failsafe_and_factory_reset.txt · Last modified: 2018/11/04 18:27 by jow