Add new page explaining failsafe mode
[web.git] / docs / failsafe.txt
1 ---
2 ---
3 Failsafe mode
4 =============
5
6 == Failsafe mode
7
8 **Caveat:** This functionality only applies to SquashFS images, since they come
9 with a read-only root partition. To verify whether your device uses SquashFS,
10 check for "SquashFS" either in the _LEDE_ image name or perform the following
11 check on your device:
12
13 # grep squash /proc/mount
14
15 _LEDE_ allows you to boot into failsafe mode and override the configuration saved
16 on the JFFS2 overlay. It will revert to a few hard coded defaults stored in the
17 SquashFS image. If your device becomes inaccessible, e.g. after a configuration
18 error, then failsafe mode is there to help you out; it *cannot*, however, fix
19 more deeply rooted problems like faulty hardware or a broken kernel. It is
20 comparable to a reset, but not entirely the same - you will still be able to
21 access your settings and restore them if desired, whereas a reset would just
22 wipe everything.
23
24 === Entering failsafe mode
25
26 Make sure you use a wired connection, since the failsafe will disable your
27 wireless connectivity.
28
29 To enter failsafe mode, follow one of the procedures listed below:
30
31 * Wait for a flashing LED and press a button;
32 * Wait (with a packet sniffer) for a special broadcast packet and press a button;
33 * Watch for a boot message (on the serial port) and press a key ("f") on the serial keyboard.
34
35 Usually, the first procedure is the easiest one. However, do consult the available
36 documentation for your device, as there is no default button assigned as a reset
37 button and not all procedures work on every device. Whichever trigger you use,
38 the device will enter failsafe mode and you can access the command line with SSH
39 (always possible) or a serial keyboard. OpenWrt releases (15.05 and before) offer
40 a telnet connection in this state but no SSH.
41
42 === Fixing or wiping your settings
43
44 Once failsafe mode is triggered, the router will boot with a network address
45 of 192.168.1.1/24, usually on the 'eth0' network interface, with only essential
46 services running. Using SSH or a serial connection, you can then mount the
47 JFFS2 partition with the following command:
48
49 # mount_root
50
51 After that, you can start looking around and fix what's broken. The JFFS2
52 partition will be mounted to '/overlay', as under normal operation.
53
54 If you want a clean slate, there's no need to flash again; just enter the
55 following command and your device will be reset.
56
57 # firstboot
58
59 === Settings not being saved
60
61 When your device seems to save settings but loses them upon every reboot,
62 this could mean that overlayfs is corrupted. You can fix this by SSH-ing into the
63 device and issuing the following command to reset your JFSS2 partition:
64
65 # jffs2reset
66
67 While essentially doing the same thing as 'firstboot', this rewrites the flash
68 area of the JFFS2 file system instead of formatting it.
69
70 More specific instructions will be provided in the wiki.
71
72 **WIP**