sudo apt install linux-crashdump
Verification
cat /proc/cmdline
dmesg | grep -i crash
kdump-config show
cat /proc/sys/kernel/sysrq
Active kdump
kdump-config load
Enabling various types of panics
To make Linux kernel to panic on different situations please use:
echo 1 > /proc/sys/kernel/hung_task_panic # panic when hung task is detected
echo 1 > /proc/sys/kernel/panic_on_io_nmi # panic on NMIs from I/O
echo 1 > /proc/sys/kernel/panic_on_oops # panic on oops or kernel bug detection
echo 1 > /proc/sys/kernel/panic_on_unrecovered_nmi # panic on NMIs from memory or unknown
echo 1 > /proc/sys/kernel/softlockup_panic # panic when soft lockups are detected
echo 1 > /proc/sys/vm/panic_on_oom # panic when out-of-memory happens
Test Crash kernel
sudo -s
echo c > /proc/sysrq-trigger
Get vmlinux with debug symbol
sudo tee /etc/apt/sources.list.d/ddebs.list << EOF
deb http://ddebs.ubuntu.com/ $(lsb_release -cs) main restricted universe multiverse
deb http://ddebs.ubuntu.com/ $(lsb_release -cs)-security main restricted universe multiverse
deb http://ddebs.ubuntu.com/ $(lsb_release -cs)-updates main restricted universe multiverse
deb http://ddebs.ubuntu.com/ $(lsb_release -cs)-proposed main restricted universe multiverse
EOF
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ECDCAD72428D7C01
sudo apt-get update
sudo apt-get install linux-image-$(uname -r)-dbgsym
Inspecting the crash dump using crash
Debug kernel: /usr/lib/debug/boot/
Crash dump: /var/crash/
crash <debug kernel> <crash dump>
Kernel/CrashdumpRecipe - Ubuntu Wikihttps://wiki.ubuntu.com/Kernel/CrashdumpRecipe
Kernel Crash Dump
https://help.ubuntu.com/lts/serverguide/kernel-crash-dump.html
沒有留言:
張貼留言