2016-03-06

Kdump is a kernel feature which is used to capture crash dumps when the system or kernel crash. For enabling kdump we have to reserve some portion of physical RAM which will be used to execute kdump kernel in the event of kernel panic or crash.

When a kernel crash or kernel panic occurs then running kernel runs ‘kexec(kdump kernel)‘ and it loads kdump kernel from reserve memory and then contents of RAM and Swap is copied to vmcore file either on local disk or on remote disk and finally reboot the box.

By analyzing the crash dumps we can find the reason or the root case of system failure. If you have OS support then you can share the crash dumps to the vendor for analysis.

In this article we will demonstrate how to enable kdump on RHEL 7 and CentOS 7

Step:1 Install ‘kexec-tools’ using yum command

Use the below yum command to install ‘kexec-tools’ package in case it is not installed.

Step:2 Update the GRUB2 file to Reserve Memory for Kdump kernel.

Edit the GRUB2 file (/etc/default/grub), add the parameter ‘crashkernel=<Reserved_size_of_RAM>‘ in the line beginning with ‘GRUB_CMDLINE_LINUX‘



Execute the below command to regenerate grub2 configuration.

In case of UEFI firmware, use the below command

Above command will inform bootlaoder to reserve 128 MB RAM after reboot.

Reboot the box now using below command :

Step:3 Update the dump location & default action in the file (/etc/kdump.conf).

To store crash dump or vmcore file on a local file system, edit the file ‘/etc/kdump.conf‘ and specify the location as per your setup. In my case i am using a separate local file system ( /var/crash). It is recommended that size of file system should be equivalent to the size of your system’s RAM or file system should have free space equivalent to the size of RAM. Kdump allows to compress the dump data using ‘core collector’ option (core_collector makedumpfile -c ) where -c is used for compression.

In case if kdump fails to store the dump file to specified location then default action will be performed which is mention in the default directive. In my case default action is reboot.

Update the below three directives in kdump.conf file.

Different Options to store dump :



Step:4 Start and enable kdump service.

Step:5 Now Test Kdump by manually crashing the system.

Before crashing your system , please verify whether the kdump service is running or not using below command.

To test our kdump configuration we will manually crash our system with below commands.

This will create a crash dump file (vmcore ) under ‘/var/crash‘ file system.

Step:6 Use ‘crash’ command to analyze and debug crash dumps.

Crash is the utility or command to debug and analyze the crash dump or vmcore file.

To use the crash, make sure two packages are installed : ‘crash & kernel-debuginfo‘

To install ‘kernel-debuginfo’ package , first enable debug repo. Edit the repo file /etc/yum.repos.d/CentOS-Debuginfo.repo

change ‘enbled=0’ to ‘enabled=1’

Once the kernel-debuginfo is installed , then try to execute below crash command, it will give us a crash prompt where we can run commands to find process info , list of open files when the system got crashed.

Type ‘ps‘ command to list the Process which were running when the system got crashed.



To view the files that were open when system got crashed , type ‘files’ command at crash prompt.

Type ‘sys’ command to list the system info when it got crashed.

To get help of any command on crash prompt , type ‘help <command>‘ , example is shown below.

That’s conclude the article, Please don’t hesitate to share it if you have enjoyed.

Show more