The post describes how to setup kdump on SuSE Linux Enterprise System (SLES) 10 and 11 to capture core dumps from Kernel panics and crashes. Kdump (kernel dump) provides a memory dump into a file named vmcore when the kernel has critical issue. Vmcore is often required to investigate the issue. The crash dump is captured from the context of a freshly-booted kernel, not from the context of the crashed kernel. Kdump uses kexec to boot into a second kernel whenever the system crashes. Kexec is a fast-boot mechanism which allows rebooting a new Linux kernel from the context of a running kernel without going through any firmware or warm start.
Steps to Follow
Since Version SLES 10, Suse uses kdump as the default crash dump capturing method. The kernel core dumps are stored under “/var”, so you need to take care that the partition “/var” has enough space to store this information, at least the slightly bigger than the physical amount of systems memory. As the system try to store up to 5 core dumps the disk space should be optimal be able to save all this information.
1. Install necessary packages
You need to install the packages “kdump” and “kexec-tools” which match the Service Pack of your installed product. The easiest Way is to use the YaST application to install this package. Start the command “yast2” from the console with the command:
# yast2 -i kdump # yast2 -i kexec-tools
This will install the necessary packages or you may use the graphical system installer YaST to install the appropriate packages.
2. Configure Kdump to capture the dump
First of all, you need to reserve memory to the capture kernel. This will pass to the system’s kernel at the boot command line. SuSE recommended the following settings for x86 and x86_64 architecture: crashkernel=64M@16M
To change this you can start YaST, under System, select Boot Loader. On the tab Section Management, select the default section and press Edit. Add the settings to the field labeled Other Kernel Parameters, then press Ok and Finish to save the settings.
Next, you need to activate Kdump to startup a system boot by
# chkconfig kdump on
Finally, you need to restart the system to active the changes of the kernel command line. Some more information on the configuration of Kdump can be found in “/usr/share/doc/packages/kexec-tools/README.SUSE”
In later versions of SLES there is also a module (yast2-kdump-*.rpm) for the YaST2, which assist you in configuring and activating kdump on your system. Simply run
# yast2 kdump
3. Checking the configuration
To make sure that the configuration is working, you can test this by using the magic SysRq feature of the kernel.
First you need to enable it with the following command:
# echo 1 > /proc/sys/kerne/sysrq
Next you should sync the data of your hard disks to minimize the risk of lost data by
# echo s > /proc/sysrq-trigger
and finally you can force the system to “crash” by
# echo c > /proc/sysrq-trigger
The system will save crash dump data. This will take some time depending on the amount of memory of your system and the speed of the device the dump is written to. After the dump is finished the system will reboot back to the normal service. You should find the core dump in the directory “/var/log/dump/[YYYY-MM-DD-HH:MM]/vmcore” when the coredump is generated successfully.
CentOS / RHEL 6 : How to configure kdump
CentOS / RHEL 7 : How to configure kdump