Unable to Get Kernel Crash Dump on Kernel Panic
1
vote
1
answer
2271
views
I'm using kexec-tools to get a crash dump of kernel on kernel panic. However, when I trigger the panic using sysrq-trigger, the system freezes. I have to power off and then power on to restore the system. There is no automatic reboot and no crash dump is available in /var/crash.
The following are the configurations and details:
- Linux Distro - Debian Buster arm64
- Linux Kernel - 4.19.35
- kexec-tools v2.0.22 (Built from source)
- All Kernel Configs specifed here for arm64 enabled: https://www.kernel.org/doc/Documentation/kdump/kdump.txt
Both the main kernel and crash kernel are exactly the same. (Although using uncompressed Image as crash kernel)
/proc/cmdline = crashkernel=512M nokaslr # Along with other arguments
The crash kernel space gets reserved (verified by dmesg)
Loading crashkernel to kick-in on a kernel panic:
$ sudo kexec -p ./Image --append=" root=/dev/sda1 console=same_as_main_kernel earlycon=same_as_main_kernel rootwait rw 1 max_cpus=1 reset_devices
The root fs is same as that used for main kernel.
Trigerring Kernel Panic:
$ echo c | sudo tee /proc/sysrq-triggger
The serial console freezes with standard kernel panic stacktrace. One of the logs specific to Kdump is:
[14645.1099571] CPU: 2 PID: 20518 Comm: tee Kdump: loaded Not tainted 4.19.35-g9e41bb234b42 #2
The system however does not reboot.
One thing to note is that I can boot into the crash kernel if I want to explicitly:
$ sudo kexec -l ./Image --append=" root=/dev/sda1 console=same_as_main_kernel earlycon=same_as_main_kernel rootwait rw 1 max_cpus=1 reset_devices
$ sudo kexec -e
This boots into the specified kernel.
How can I resolve/debug this issue further in which the crash kernel does not seem to kick-in in the event of a kernel panic.
Asked by Harsh
(165 rep)
Oct 4, 2021, 02:52 PM
Last activity: Jun 30, 2024, 07:08 AM
Last activity: Jun 30, 2024, 07:08 AM