Using kdump and SysRq
The kdump mechanism is a Linux kernel feature, which allows you to create dumps if your kernel crashes. It produces an exact copy of the memory, which can be analyzed for the root cause of the crash.
SysRq is a feature supported by the Linux kernel, which allows you to send key combinations to it even when your system becomes unresponsive.
How to do it…
First, we'll set up kdump and SysRq, and afterwards, I'll show you how to use it to debug a dump.
Installing and configuring kdump and SysRq
Let's take a look at how this is installed and configured:
Install the necessary packages for kdump by executing the following command:
~]# yum install -y kexec-tools
Ensure that
crashkernel=auto
is present in theGRUB_CMDLINE_LINUX
variable declaration in the/etc/sysconfig/grub
file using this command:GRUB_CMDLINE_LINUX="rd.lvm.lv=system/usr rd.lvm.lv=system/swap vconsole.keymap=us rd.lvm.lv=system/root vconsole.font=latarcyrheb-sun16 crashkernel=auto"
Start
kdump
by running the following...