Chapter 21. Using early kdump to capture boot time crashes
Early kdump is a feature of the kdump
mechanism to capture the vmcore
file if a system or kernel crash occurs during the early phases of the boot process before the system services start. Early kdump loads the crash kernel and the crash kernel’s initramfs
in the memory much earlier.
21.1. What is early kdump
A kernel crash can sometimes occur during the early boot phase before the kdump
service starts and is able to capture and save the contents of the crashed kernel memory. Therefore, crucial information related to the crash, which is important for troubleshooting, is lost. To address this problem, you can use the early kdump
feature, which is part of the kdump
service.
21.2. Enabling early kdump
The early kdump
feature sets up the crash kernel and the initial RAM disk image (initramfs
) to load early enough to capture the vmcore
information for an early crash. This helps to eliminate the risk of losing information about the early boot kernel crashes.
Prerequisites
- An active RHEL subscription.
-
A repository containing the
kexec-tools
package for your system CPU architecture. -
Fulfilled
kdump
configuration and targets requirements. For more information see, Supported kdump configurations and targets.
Procedure
Verify that the
kdump
service is enabled and active:# systemctl is-enabled kdump.service && systemctl is-active kdump.service enabled active
If
kdump
is not enabled and running, set all required configurations and verify thatkdump
service is enabled.Rebuild the
initramfs
image of the booting kernel with theearly kdump
functionality:# dracut -f --add earlykdump
Add the
rd.earlykdump
kernel command line parameter:# grubby --update-kernel=/boot/vmlinuz-$(uname -r) --args="rd.earlykdump"
Reboot the system to reflect the changes
# reboot
Verification step
Verify that
rd.earlykdump
was successfully added andearly kdump
feature was enabled:# cat /proc/cmdline BOOT_IMAGE=(hd0,msdos1)/vmlinuz-4.18.0-187.el8.x86_64 root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet rd.earlykdump # journalctl -x | grep early-kdump Mar 20 15:44:41 redhat dracut-cmdline[304]: early-kdump is enabled. Mar 20 15:44:42 redhat dracut-cmdline[304]: kexec: loaded early-kdump kernel
Additional resources
-
The
/usr/share/doc/kexec-tools/early-kdump-howto.txt
file - What is early kdump support and how do I configure it?
- Enabling kdump