# Can't factory reset

**URL:** <https://forum.openwrt.org/t/cant-factory-reset/4644>\
**Category:** Installing and Using OpenWrt\
**Created:** [June 26, 2017, 10:55pm UTC](https://forum.openwrt.org/t/cant-factory-reset/4644 "2017-06-26T22:55:17Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![wecucho](https://forum.openwrt.org/user_avatar/forum.openwrt.org/wecucho/32/1052_2.png) [@wecucho](https://forum.openwrt.org/u/wecucho)\
**Post date:** [June 26, 2017, 10:55pm UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/1 "2017-06-26T22:55:17Z")

</div>

Hi, I'm trying to factory reset LEDE to start over with it.

I'm entering in fail safe mode, connecting via SSH and doing:

> mount\_root  
> umount /overlay && firstboot && reboot

I also tried with **jffs2reset** , but when the router reboots all my config is there, including the root password I had ☹

Is very frustrating because I'm trying to reset it due to another rare issue after configuring extroot

I'm using LEDE 17.01.2

Thanks

---

<div class="post-metadata">

**Author:** ![hnyman](https://forum.openwrt.org/user_avatar/forum.openwrt.org/hnyman/32/19_2.png) [@hnyman](https://forum.openwrt.org/u/hnyman)\
**Post date:** [June 27, 2017, 8:28am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/2 "2017-06-27T08:28:31Z")

</div>

which router? does it use the normal overlay?  
What does "df" say about your disks?

---

<div class="post-metadata">

**Author:** ![anon20279570](https://forum.openwrt.org/letter_avatar/anon20279570/32/6_449c533f586939b6e5f246632a46421f.png) [@anon20279570](https://forum.openwrt.org/u/anon20279570)\
**Post date:** [June 27, 2017, 10:50am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/3 "2017-06-27T10:50:46Z")

</div>

Try SSHing into the router and run "mtd -r erase rootfs\_data"

---

<div class="post-metadata">

**Author:** ![wecucho](https://forum.openwrt.org/user_avatar/forum.openwrt.org/wecucho/32/1052_2.png) [@wecucho](https://forum.openwrt.org/u/wecucho)\
**Post date:** [June 27, 2017, 11:32am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/4 "2017-06-27T11:32:43Z")

</div>

Hi, I'm using a TP Link WDR3600 (normal overlay at the moment)

df result right after **failsafe** mode

> root@(none):~# df -h  
> Filesystem Size Used Available Use% Mounted on  
> /dev/root 2.3M 2.3M 0 100% /  
> tmpfs 512.0K 0 512.0K 0% /dev  
> tmpfs 61.3M 24.0K 61.3M 0% /tmp

Then, after **mount\_root**

> root@(none):~# mount\_root  
> jffs2 not ready yet, using temporary tmpfs overlay
> 
> root@(none):/rom/root# df -h  
> Filesystem Size Used Available Use% Mounted on  
> /dev/root 2.3M 2.3M 0 100% /rom  
> tmpfs 512.0K 0 512.0K 0% /dev  
> tmpfs 61.3M 24.0K 61.3M 0% /tmp  
> tmpfs 61.3M 0 61.3M 0% /tmp/root  
> overlayfs:/tmp/root 61.3M 0 61.3M 0% /

When I try to erase it

> root@(none):/rom/root# umount /overlay  
> umount: can't unmount /overlay: Invalid argument
> 
> root@(none):/rom/root# firstboot  
> This will erase all settings and remove any installed packages. Are you sure? [N/y]  
> /dev/mtdblock3 is not mounted  
> /dev/mtdblock3 will be erased on next mount

Thanks for your comment

---

<div class="post-metadata">

**Author:** ![wecucho](https://forum.openwrt.org/user_avatar/forum.openwrt.org/wecucho/32/1052_2.png) [@wecucho](https://forum.openwrt.org/u/wecucho)\
**Post date:** [June 27, 2017, 11:35am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/5 "2017-06-27T11:35:49Z")

</div>

This worked, however, I don't know if this command should be included on the documentation or if is another kind of problem, with an inconsisten state of the router etc.

Thanks for your comment.

---

<div class="post-metadata">

**Author:** ![hnyman](https://forum.openwrt.org/user_avatar/forum.openwrt.org/hnyman/32/19_2.png) [@hnyman](https://forum.openwrt.org/u/hnyman)\
**Post date:** [June 27, 2017, 11:38am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/6 "2017-06-27T11:38:36Z")

</div>

Hint for future:  
With most routers you should be able to issue the firstboot command from a normally running router. No need to go to the failsafe mode.

Simply issue the command:  
firstboot  
and after its completion:  
reboot

(note that firstboot equals jffs2reset, so both commands will produce the same result)

---

<div class="post-metadata">

**Author:** ![wecucho](https://forum.openwrt.org/user_avatar/forum.openwrt.org/wecucho/32/1052_2.png) [@wecucho](https://forum.openwrt.org/u/wecucho)\
**Post date:** [June 27, 2017, 11:40am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/7 "2017-06-27T11:40:42Z")

</div>

Thank you, I didn't knew this 🙂

---

<div class="post-metadata">

**Author:** ![dalanmiller](https://forum.openwrt.org/user_avatar/forum.openwrt.org/dalanmiller/32/2967_2.png) [@dalanmiller](https://forum.openwrt.org/u/dalanmiller)\
**Post date:** [January 4, 2018, 6:53am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/8 "2018-01-04T06:53:29Z")

</div>

What exactly does this command do? I get the following after running it:

```
root@(none):/rom/root# umount /overlay
root@(none):/rom/root# firstboot
This will erase all settings and remove any installed packages. Are you sure? [N/y]
y
/dev/mtdblock3 is not mounted
/dev/mtdblock3 will be erased on next mount
root@(none):/rom/root# reboot

```

For reference, I'm running LEDE on an Archer C7 v2

---

<div class="post-metadata">

**Author:** ![anon57995562](https://forum.openwrt.org/letter_avatar/anon57995562/32/6_449c533f586939b6e5f246632a46421f.png) [@anon57995562](https://forum.openwrt.org/u/anon57995562)\
**Post date:** [January 4, 2018, 6:56am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/9 "2018-01-04T06:56:28Z")

</div>

See this section in the LEDE documentation...

[https://lede-project.org/docs/user-guide/failsafe\_and\_factory\_reset?s[]=failsafe#fixing\_your\_settings](https://lede-project.org/docs/user-guide/failsafe_and_factory_reset?s%5B%5D=failsafe#fixing_your_settings)

---

<div class="post-metadata">

**Author:** ![dalanmiller](https://forum.openwrt.org/user_avatar/forum.openwrt.org/dalanmiller/32/2967_2.png) [@dalanmiller](https://forum.openwrt.org/u/dalanmiller)\
**Post date:** [January 4, 2018, 6:59am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/10 "2018-01-04T06:59:02Z")

</div>

Are you saying I should run `mount_root` first? I've also tried doing that before running `umount /overlay && firstboot && reboot` and getting the same result.

Ultimately, no DHCP on wired, and no WiFi.

I think my next attempt will be this:

[https://wiki.openwrt.org/doc/howto/generic.failsafe#wiping\_jffs2\_file\_system\_factory\_reset\_to\_default\_config](https://wiki.openwrt.org/doc/howto/generic.failsafe#wiping_jffs2_file_system_factory_reset_to_default_config)

---

<div class="post-metadata">

**Author:** ![anon57995562](https://forum.openwrt.org/letter_avatar/anon57995562/32/6_449c533f586939b6e5f246632a46421f.png) [@anon57995562](https://forum.openwrt.org/u/anon57995562)\
**Post date:** [January 4, 2018, 7:02am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/11 "2018-01-04T07:02:51Z")

</div>

I would do this first...

Try...

_firstboot_

then...

_reboot_

> [@dalanmiller](#):
>
> Ultimately, no DHCP on wired, and no WiFi.

Keep in mind a reset wipes out the config.

---

<div class="post-metadata">

**Author:** ![dalanmiller](https://forum.openwrt.org/user_avatar/forum.openwrt.org/dalanmiller/32/2967_2.png) [@dalanmiller](https://forum.openwrt.org/u/dalanmiller)\
**Post date:** [January 4, 2018, 7:07am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/12 "2018-01-04T07:07:29Z")

</div>

Ahhhhhh, that makes a lot of sense then.

Will `firstboot` restore default config?

---

<div class="post-metadata">

**Author:** ![anon57995562](https://forum.openwrt.org/letter_avatar/anon57995562/32/6_449c533f586939b6e5f246632a46421f.png) [@anon57995562](https://forum.openwrt.org/u/anon57995562)\
**Post date:** [January 4, 2018, 7:10am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/13 "2018-01-04T07:10:42Z")

</div>

> [@dalanmiller](#):
>
> Will firstboot restore default config?

It restores LEDE settings to factory.

Any settings you changed will need to be reconfigured.

---

<div class="post-metadata">

**Author:** ![dalanmiller](https://forum.openwrt.org/user_avatar/forum.openwrt.org/dalanmiller/32/2967_2.png) [@dalanmiller](https://forum.openwrt.org/u/dalanmiller)\
**Post date:** [January 4, 2018, 7:16am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/14 "2018-01-04T07:16:55Z")

</div>

Just tried `firstboot` as first command when entering failsafe mode.

I get same as above:

```
root@(none):~# firstboot
This will erase all settings and remove any installed packages. Are you sure? [N/y]
y
/dev/mtdblock3 is not mounted
/dev/mtdblock3 will be erased on next mount

```

Then I reboot and still config is not back to first boot up of LEDE.

See anything wrong here?:

````
root@(none):/rom/root# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 2.5M 2.5M 0 100% /rom
tmpfs 512.0K 0 512.0K 0% /dev
tmpfs 61.3M 24.0K 61.3M 0% /tmp
tmpfs 61.3M 0 61.3M 0% /tmp/root
overlayfs:/tmp/root 61.3M 0 61.3M 0% /
```
````

---

<div class="post-metadata">

**Author:** ![anon57995562](https://forum.openwrt.org/letter_avatar/anon57995562/32/6_449c533f586939b6e5f246632a46421f.png) [@anon57995562](https://forum.openwrt.org/u/anon57995562)\
**Post date:** [January 4, 2018, 7:22am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/15 "2018-01-04T07:22:17Z")

</div>

/dev/mdtblock3 is not mounted.

What happens after _reboot_ runs?

Are you able to log in to LuCI?

---

<div class="post-metadata">

**Author:** ![dalanmiller](https://forum.openwrt.org/user_avatar/forum.openwrt.org/dalanmiller/32/2967_2.png) [@dalanmiller](https://forum.openwrt.org/u/dalanmiller)\
**Post date:** [January 4, 2018, 7:23am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/16 "2018-01-04T07:23:48Z")

</div>

It just returns to the `ash` prompt `root@(none):~#`

---

<div class="post-metadata">

**Author:** ![anon57995562](https://forum.openwrt.org/letter_avatar/anon57995562/32/6_449c533f586939b6e5f246632a46421f.png) [@anon57995562](https://forum.openwrt.org/u/anon57995562)\
**Post date:** [January 4, 2018, 7:42am UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/17 "2018-01-04T07:42:10Z")

</div>

Last resort would be to revert to TP-Link stock and re-install LEDE.

Even though your router is not “bricked”, this tutorial works for reverting back to stock as well…

[http://forum.tp-link.com/showthread.php?81462-How-to-recovery-the-router-when-you-bricked-it1](http://forum.tp-link.com/showthread.php?81462-How-to-recovery-the-router-when-you-bricked-it1)

Download the latest TP-Link firmware and rename it _ArcherC7v2\_tp\_recovery.bin_

Unfortunately, the newer versions of the TP-Link firmware will not allow a LEDE flash using the web GUI.

Download the stripped Archer C7 v2 firmware from [friedzombie.com](http://friedzombie.com) and flash in the TP-Link web GUI.

[http://www.friedzombie.com/tplink-stripped-firmware/](http://www.friedzombie.com/tplink-stripped-firmware/)

Then, you will be able to flash LEDE in the TP-Link web GUI. Rename the LEDE firmware file to something shorter like _factory.bin_

---

<div class="post-metadata">

**Author:** ![anon20279570](https://forum.openwrt.org/letter_avatar/anon20279570/32/6_449c533f586939b6e5f246632a46421f.png) [@anon20279570](https://forum.openwrt.org/u/anon20279570)\
**Post date:** [January 4, 2018, 7:25pm UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/18 "2018-01-04T19:25:56Z")

</div>

Did you try running “mtd -r erase rootfs\_data”

---

<div class="post-metadata">

**Author:** ![dalanmiller](https://forum.openwrt.org/user_avatar/forum.openwrt.org/dalanmiller/32/2967_2.png) [@dalanmiller](https://forum.openwrt.org/u/dalanmiller)\
**Post date:** [January 4, 2018, 7:32pm UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/19 "2018-01-04T19:32:27Z")

</div>

I was finally able to get things going when I enabled the wifi and then was able to access LUCI at 192.168.1.1.

For some reason, I was not given an IP address and then access to LUCI when using an ethernet connection after running `firstboot`, so I'm not sure what happened there.

Ultimately, I'm going to get into the weeds again because I need wifi clients to be able to access things on the WAN, as I have an EdgeRouterX in front of my LEDE device.

---

<div class="post-metadata">

**Author:** ![richb-hanover](https://forum.openwrt.org/user_avatar/forum.openwrt.org/richb-hanover/32/26_2.png) [@richb-hanover](https://forum.openwrt.org/u/richb-hanover)\
**Post date:** [March 11, 2018, 2:59pm UTC](https://forum.openwrt.org/t/cant-factory-reset/4644/20 "2018-03-11T14:59:58Z")

</div>

@hnyman - thanks for this info...

> [@hnyman](#):
>
> Hint for future:
> 
> With most routers you should be able to issue the firstboot command from a normally running router. No need to go to the failsafe mode.
> 
> Simply issue the command:
> 
> firstboot
> 
> and after its completion:
> 
> reboot

I had exactly this question. I suspected that it would be true, but couldn't find confirmation in the wiki.

I am happy to update the wiki, but want to confirm that I'm saying the right thing. Two questions:

1. Your initial note says "With most routers..." How will people know which routers this procedure applies to?
2. Is the description below correct?

Thanks!

* * *

To reset your working OpenWrt router to its initial settings (that is, to the configuration it had immediately after flashing new firmware without retaining settings):

- CONNECT TO THE ROUTER WITH ETHERNET. (Resetting the configuration disables Wi-Fi.)
- From LuCI web interface:
  - Go to System -\> Backup/Restore
  - (Optionally) Generate Archive to save the current settings
  - Click Reset to Defaults, then reboot the router.

- From a SSH command line, enter these commands:

```plaintext
firstboot
reboot

```

Your router will be back to its initial configuration. You should be able to connect to it with [http://192.168.1.1](http://192.168.1.1) or `telnet 192.168.1.1`

[Next page](https://forum.openwrt.org/t/cant-factory-reset/4644.md?page=2)
