Now Reading: How to configure kdump for CentOS/RHEL 9 – Ranjan.info

Loading
svg
Open

How to configure kdump for CentOS/RHEL 9 – Ranjan.info

February 8, 20243 min read

The Kdump utility in RHEL provides a crash dumping mechanism that captures diagnostic information when a kernel crashes. Kdump works by using the kexec system call to boot into a captured kernel without rebooting the system. This capture preserves part of the kernel system memory and saves the contents of the crashed kernel's memory as a vmcore dump file. Analyzing this vmcore file helps determine the cause of a kernel failure.

Enabling Kdump is highly recommended for mission-critical environments as the vmcore file may be the only information available after a system failure. However, Kdump needs to permanently reserve part of the system memory for the capture kernel, thereby reducing the memory available to the main kernel. Carefully ensure that the system meets Kdump's memory requirements before enabling this important feature. See Working with kernel dumps for more information.

This post explains how to configure kdump on CentOS/RHEL 9 systems.

installing kdump

1. Use dnf to install the kdump package (kexec-tools) as root:

# dnf install kexec-tools

2. To reserve memory for the kdump kernel, edit the /etc/default/grub file and set the crashkernel= option to the desired amount. For example, set crashkernel=64M to reserve 64 MB.

# cat /etc/default/grub
GRUB_CMDLINE_LINUX="crashkernel=64M"

3. You can also configure the amount of reserved memory as a variable using this syntax: crashkernel=range1:size1,range2:size2. For example, you can set memory as a variable like this:

# cat /etc/default/grub
GRUB_CMDLINE_LINUX="crashkernel=512M-2G:64M,2G-:128M"

4. Consider defining an offset value for reserved memory (optional). To reserve memory with CrashKernel, some systems need to specify a fixed offset, as this reservation occurs very early in the boot process. With a fixed offset, the reserved memory starts at the specified point. For example, to reserve 128 MB starting at 16 MB, you would specify:

# cat /etc/default/grub
GRUB_CMDLINE_LINUX="crashkernel=128M@16M"

If no offset value is set, Kdump automatically offsets the reserved memory.

5. Refresh the Grub configuration to apply the changes:

# grub2-mkconfig -o /boot/grub2/grub.cfg

6. For systems configured to use UEFI-based, run the following command to rebuild grub.cfg:

# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

7. Enable kdump service:

# $ sudo systemctl enable --now kdump.service

8. Reboot the system and finish configuring Kdump.

default kdump failure status

By default, if kdump does not successfully send crash dump data to the configured output locations, it reboots the server, deleting any collected dump data. To avoid losing dump data, you can uncomment and edit the default setting in /etc/kdump.conf to disable automatic reboot.

How do you vote?

0 People voted this article. 0 Upvotes - 0 Downvotes.
svg

What do you think?

Show comments / Leave a comment

Leave a reply

Loading
svg