Chapter 17. Dumping a crashed kernel for later analysis
To analyze why a system crashed, you can use the kdump
service to save the contents of the system’s memory for later analysis. This section provides a brief introduction to kdump
, and information about configuring kdump
using the RHEL web console or using the corresponding RHEL system role.
17.1. What is kdump
kdump
is a service which provides a crash dumping mechanism and generates a dump file, known as crash dump or a vmcore
file. The vmcore
file has the contents of the system memory that helps in analysis and troubleshooting. kdump
uses the kexec
system call to boot into the second kernel, a capture kernel without a reboot and then captures the contents of the crashed kernel’s memory and saves it into a file. The second kernel is available in a reserved part of the system memory.
A kernel crash dump can be the only information available if a system failure occur. Therefore, operational kdump
is important in mission-critical environments. Red Hat advises to regularly update and test kexec-tools
in your normal kernel update cycle. This is especially important when you install new kernel features.
You can enable kdump
for all installed kernels on a machine or only for specified kernels. This is useful when there are multiple kernels used on a machine, some of which are stable enough that there is no concern that they could crash. When you install kdump
, a default /etc/kdump.conf
file is created. The /etc/kdump.conf
file includes the default minimum kdump
configuration, which you can edit to customize the kdump
configuration.
17.2. Configuring kdump memory usage and target location in web console
You can configure the memory reserve for the kdump
kernel and also specify the target location to capture the vmcore
dump file with the RHEL web console interface.
Prerequisites
The web console must be installed and accessible.
For details, see Installing the web console.
Procedure
-
In the web console, open the tab and start the
kdump
service by setting the Kernel crash dump switch to on. Configure the
kdump
memory usage in the terminal, for example:$ sudo grubby --update-kernel ALL --args crashkernel=512M
Restart the system to apply the changes.
In the Kernel dump tab, click at the end of the Crash dump location field.
Specify the target directory for saving the
vmcore
dump file:For a local filesystem, select Local Filesystem from the drop-down menu.
For a remote system by using the SSH protocol, select Remote over SSH from the drop-down menu and specify the following fields:
- In the Server field, enter the remote server address.
- In the SSH key field, enter the SSH key location.
- In the Directory field, enter the target directory.
For a remote system by using the NFS protocol, select Remote over NFS from the drop-down menu and specify the following fields:
- In the Server field, enter the remote server address.
- In the Export field, enter the location of the shared folder of an NFS server.
In the Directory field, enter the target directory.
NoteYou can reduce the size of the
vmcore
file by selecting the Compression checkbox.
Optional: Display the automation script by clicking
.A window with the generated script opens. You can navigate between a shell script and an Ansible playbook generation options tab.
Optional: Copy the script by clicking
.You can use this script to apply the same configuration on multiple machines.
Verification
Click
.Click Test kdump settings.
underWarningWhen you initiate the system crash, the kernel operation stops and results in a system crash with data loss.
Additional resources
17.3. kdump using RHEL system roles
RHEL system roles is a collection of Ansible roles and modules that provide a consistent configuration interface to remotely manage multiple RHEL systems. The kdump
role enables you to set basic kernel dump parameters on multiple systems.
The kdump
role replaces the kdump
configuration of the managed hosts entirely by replacing the /etc/kdump.conf
file. Additionally, if the kdump
role is applied, all previous kdump
settings are also replaced, even if they are not specified by the role variables, by replacing the /etc/sysconfig/kdump
file.
The following example playbook shows how to apply the kdump
system role to set the location of the crash dump files:
--- - hosts: kdump-test vars: kdump_path: /var/crash roles: - rhel-system-roles.kdump
For a detailed reference on kdump
role variables, install the rhel-system-roles
package, and see the README.md
or README.html
files in the /usr/share/doc/rhel-system-roles/kdump
directory.
Additional resources