[Solved] Problem wiping a router

I am trying to fully erase the flash configuration of my router, and it does not fully work.

I did "umount /overlay && jffs2reset && reboot", and have also broken it out into a set of discrete steps below.

After doing this, the set password is still in place, as are my files in the home directory. The contents of /etc/config does seem to have been erased properly, which is a good sign.

Any ideas?

root@OpenWrt:~# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /tmp/root type tmpfs (rw,noatime,mode=755)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
/dev/mtdblock4 on /overlay type jffs2 (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)

root@OpenWrt:~# umount /overlay

root@OpenWrt:~# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /tmp/root type tmpfs (rw,noatime,mode=755)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)

root@OpenWrt:~# jffs2reset
This will erase all settings and remove any installed packages. Are you sure? [N/y]
y
/dev/mtdblock4 is not mounted
/dev/mtdblock4 will be erased on next mount

root@OpenWrt:~# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
tmpfs on /tmp/root type tmpfs (rw,noatime,mode=755)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)

root@OpenWrt:~# reboot

By the way, the version is OpenWrt 18.06.4, r7808-ef686b7292

You "can't" unmount the root file system while the router is running.

Perhaps easiest is to do the wipe in failsafe mode with firstboot for a NOR-based device.

Be aware that firstboot doesn't work for NAND-based devices.

My transcript above shows /dev/mtdblock4 is no longer mounted after the command umount /overlay. Is the problem with the next line of the mount command output, namely overlayfs:/overlay ?

Interestingly I have never previously had a problem resetting like this from the normal shell command line (not failsafe mode) : Password reset and Home directory erased. To check, I just tried it on a separate TP Link WDR3600 and it worked fine.

What model is it? A NOR system like WDR3600 should not be this difficult.
Download another copy of the firmware and sysupgrade -n

2 Likes

It is a TP Link WR902ACv1 which uses NOR. I will try reflashing it tomorrow.

Reflashing has solved the problem. I now umount /overlay && jffs2reset && reboot and the password is reset and home directory files deleted.

Thanks!

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

1 Like

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