Can't factory reset

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 :frowning:

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

1 Like

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

Try SSHing into the router and run "mtd -r erase rootfs_data"

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

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.

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)

1 Like

Thank you, I didn't knew this :slight_smile:

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

See this section in the LEDE documentation...

https://lede-project.org/docs/user-guide/failsafe_and_factory_reset?s[]=failsafe#fixing_your_settings

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

I would do this first...

Try...

firstboot

then...

reboot

Keep in mind a reset wipes out the config.

Ahhhhhh, that makes a lot of sense then.

Will firstboot restore default config?

It restores LEDE settings to factory.

Any settings you changed will need to be reconfigured.

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% /
```

/dev/mdtblock3 is not mounted.

What happens after reboot runs?

Are you able to log in to LuCI?

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

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

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 and flash in the TP-Link web GUI.

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

1 Like

Did you try running “mtd -r erase rootfs_data”

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.

@hnyman - thanks for this info...

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:
    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 or telnet 192.168.1.1