Log a Crash

The crashlog feature is used to log crashes. In order to use the crashlog feature, your hardware must have an AIO firmware build installed.
VPN firmware build files do not include crashlog. (You can also create a custom image with CRASH_LOG=y)
Note that builds that include crashlog are only available for ARM model routers.

Here are the steps involved:


1. Check partitions for your router

Example:

root@RT-AC56U:/tmp/home/root# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00020000 "boot"
mtd1: 00180000 00020000 "nvram"
mtd2: 01e00000 00020000 "linux"
mtd3: 01c52be0 00020000 "rootfs"
mtd4: 06000000 00020000 "brcmnand"
mtd5: 03fe0000 00020000 "jffs2"
mtd6: 00020000 00020000 "crash"
root@RT-AC56U:/tmp/home/root#

⇒ mtd6 (“crash”) is what we need for RT-AC56U (in this case)



2. Prepare the crashlog (needs to be done each time a new crashlog file is generated)

Example:

root@RT-AC56U:/tmp/home/root# mtd-erase2 crash
Erase MTD crash
Erase MTD crash OK!
root@RT-AC56U:/tmp/home/root#


3. let the router crash


4. Get/save the crashlog file

Example:

root@RT-AC56U:/tmp/home/root# cat /dev/mtd6 > /tmp/crashlog.bin


Get the crashlog.bin file from the /tmp directory with FTP, SFTP or SCP (using for example, WinSCP)

For example, the following will save to a USB storage device:

root@RT-AC56U:/tmp/home/root# cat /dev/mtd6 > /tmp/mnt/ROUTER_USB_NAME/crashlog.bin