OpenWrt Forum Archive

Topic: [howto] Failsafe mode with WhiteRussian RC6+

The content of this topic has been archived on 25 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Failsafe mode with WhiteRussian RC6+

The new diag driver in RC6+ make it very easy to enter failsafe mode. You do not need the crappy recvudp program anymore.

1. boot into failsafe mode (confirmed to be working on a Asus WL-500g Deluxe router, should work the same way on any other Linksys (Broadcom) router)

    - boot it, wait for the power LED to switch off
    - then press any button a few times
    - power LED goes fast-blinking (about 1 time per second)

2. set your PC you connected the router via LAN to 192.168.1.2 (gateway and DNS is not required)

3. you should be able telnet into the router at 192.168.1.1 now (telnet no username and no password)

NOTE: The root in failsafe mode is the SquashFS partition mounted in readonly mode. To switch to the normal writable root run 'mount_root' and make any changes.



What to do in failsafe mode?

1. forgot/lost your password and you like to set a new one
    passwd

2. forgot the routers IP address
    nvram get lan_ipaddress

3. you accidentally run 'ipkg upgrade' or filled up the flash by installing to big packages (clean the JFFS2 partition and start over)
    mtd erase OpenWrt; reboot


If you have more ideas reply here.

(Last edited by forum2006 on 21 Dec 2006, 13:34)

Open question:

Will I be able to fix wrong VLAN settings with failsafe mode? Or is still a serial console required to fix this?

forum2006 wrote:

Open question:

Will I be able to fix wrong VLAN settings with failsafe mode? Or is still a serial console required to fix this?

yes you can with NVRAM

nvram set ....

doc

forum2006 wrote:

3. you accidentally run 'ipkg upgrade' or filled up the flash by installing to big packages (clean the JFFS2 partition and start over)
    mtd erase OpenWrt; reboot

I thought the official way to do that was to type 'firstboot' ?

Getting this error when trying to reset the password, after i type passwd then the password twice:

root@(none):/# passwd
Changing password for root
Enter the new password (minimum of 5 characters)
Please use a combination of upper and lower case letters and numbers.
Enter new password:
Re-enter new password:
passwd: An error occurred updating the password file.

root@(none):/#

mount_root; passwd

I'm running RC6 on a WRT54GL. I tried to upgrade from dd-wrt via the web interface but now I can't set the root password either in the webadmin or command line. I tried the "mount_root" command as above and got this response:

root@OpenWrt:/# df
Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/root                  896       896         0 100% /rom
none                      7148        20      7128   0% /tmp
/jffs                      896       896         0 100% /

root@OpenWrt:/# mount_root; passwd
Unlocking linux ...
switching to jffs2
mount: Mounting /dev/mtdblock/4 on /jffs failed: Invalid argument
mount: Mounting /proc on /jffs/proc failed: No such file or directory
jffs2 not ready yet; using ramdisk

I've reflashed with a fresh copy of OpenWRT but to no avail. I've even reset the NVRAM. I can install the original Linksys firmware via tftp but not either dd-wrt (just hangs while copying) or OpenWRT (installs but can't set password).

glenmo wrote:

root@OpenWrt:/# mount_root; passwd
Unlocking linux ...
switching to jffs2
mount: Mounting /dev/mtdblock/4 on /jffs failed: Invalid argument
mount: Mounting /proc on /jffs/proc failed: No such file or directory
jffs2 not ready yet; using ramdisk

These are normal messages and simply mean that firstboot hasn't been run (or hasn't been given a chance to finish) before. The actual process of formatting the flash is done in the background and a ramdisk is used as a temporary substitute until the flash is ready.

Procedure has been (for WRT54GL) using RC6 squashfs bin file:

tftp -i 192.168.1.1 PUT openwrt-wrt54g-squashfs.bin

firmware install completes. System reboots OK.

I've tried running firstboot many times but it just hangs with:

# firstboot
Unlocking OpenWrt ...
Erasing OpenWrt ...
Could not erase MTD device: OpenWrt
mount: Mounting /dev/mtdblock/4 on /jffs failed: Invalid argument
creating directories...

Strange thing is if I go back to a jffs2 version of RC5 then it works ok. I can set the root password, change settings etc. but once I upgrade to RC6 it just won't let me change anything.

(Last edited by glenmo on 24 Jan 2007, 07:33)

Hi,
how to get in failsafe from WAP54G v.1.0 ?

Have a wrong iptables config on my device sad
so i can not enter sshd or httpd service...

only found an outdated HowTo in german:

# buildroot/build_mipsel/busybox/miscutils/resetmon.c change: instead #define RESET (1<<6) it has to be #define RESET (1<<0).
# Than "cd buildroot/build_mipsel/busybox" and after that "make clean"

Any suggestions on how to get rid of this? already reflashed it with flash-pin trick -> No effect...
also set the nvram to default (used FREDA firmware which includes telnetd service)..
but i can not delete the files on rom.. ;(

Tyran

Thank much for the instruction. I think it would be helpful for others to add it to the WIKI, too (i was unable to register there). It took me very long time recovering my device from misconfiguration. According present info there, I was trying to enter the failsafe mode by pressing the reset button DURING the power on - power LED started blinking, so I realy thought I was in failsafe mode, but I wasn't (PWR led blinking cca 0.5 Hz, IP addres was not 192.168.1.1, but taken from NVRAM, telnet not running). Using this correct way, PRW LED is flashing faster (cca 6 Hz), IP 192.168.1.1 - real failsafe mode, telnet works. (Unfortunately, this way does not work for me every time.. second time I was unable to reach telnet.. it was successful in 2 of 7 cases, for now.)

(WL-500g deluxe)

Hello!
I have the following problem:
as I connect my Linksys WRT54GL v1.1 router to a power source, the power led keeps flashing, and there is doesn't want to boot up. I entered to failsafe mode, the DMZ led flashes as well, PC IP is 192.168.1.2, i can ping the router (192.168.1.1) from the PC, but no telnet, no ssh, no http available. How can I reset the firmware? I wish I could telnet to the router, but it doesn't answer. What to do now?

thanks,
julyus

With a serial console you have always access to the router...

yes, but I have no pc with serial port smile
but the problem has been solved with tftp now. thx for the response.

(Last edited by julyus on 3 May 2007, 15:52)

Dear friends,
I definitely have had "a full success" upgrading my wireless router. Now it is useless piece of metal and plastic.
What I've done :
1. Downloaded :linux_prep_wrt54g.bin, linux_upgrade_wrt54g.bin, dd-wrt.v23_micro_generic.bin and tftp.exe
2. Applied inux_prep_wrt54g.bin, linux_upgrade_wrt54g.bin
3. I used tftp.exe for applying  dd-wrt.v23_micro_generic.bin
So I had a fully operational device up and running ...
4. Using the web based internal software I've made a Firmware upgrade using openwrt-wrt54g-squashfs.bin file from your Newest section ...
Now I can rich my device on address 192.168.1.1 even using my web browser or telnetting but this is all.
command "help" in a telnet mode works, but I don't know how and what else commands I can use.
When I tried to choose whatever section from system console, device wants me to change password. When I tried to change the password device stopped to respond to web interface as well as to telnet, but I continue to have ping to 192.168.1.1...
I tried to use tftp.exe to upload other .bin file but probably tftp client on my router doesn't work too. How can I check it? How can get my router working again?

Please help me to recover my router !!!
I'll be very thankful if somebody can give me instructions what to do...

hi guys,

when I'm in failsafe mode how can I reboot to get back in normal mode?

a reboot gives me: register_vlan_device: ALREADY had VLAN registered

=> EDIT this comes from  ifdown wan
/etc/profiles
reboot() { ifdown wan 2>&1 >/dev/null ; /sbin/reboot; }

root@(none):/# /sbin/reboot
root@(none):/#

doesn't do anything sad
Thanks

(Last edited by migube on 17 May 2007, 14:24)

When you add a password it possibly disabled the telnet interface and enabled the SSH interface..
so you can try SSH to the routers ip

I don't know why you can't reboot. However if you're in failsafe mode, and you don't mind losing your customisations, you should be able to recover.

* you can wipe all your changes by typing 'firstboot', and then reboot or power cycle. This should take you back to the state when you first installed OpenWrt.

* or, you can use wget and mtd to write a completely new image.

I have a wrtg54gl, and when it powers on the power light never goes off, as described in the first step above.  Don't notice anything happening when I hit the reset button.

i have used to install my motherboard cd, but y mouth speaker is unable to use

The discussion might have continued from here.