What is auto_reset_crashkernel in /etc/kdump.conf and how does it work?
Environment
- Red Hat Enterprise Linux 9
- kexec-tools-2.0.23-9_1.el9_0 and newer version
Issue
- RHEL9 introduces
auto_reset_crashkerneloption in/etc/kdump.conf. - How does the parameter work?
Resolution
2.0.25-13.el9_2.1 and older version
auto_reset_crashkernel=yescould update the defaultcrashkernelvalue when updating thekexec-toolspackage
in the following two cases;
1.crashkernel=autois found in the kernel cmdline
2. thecrashkernelwas previously set bykexec-toolsi.e. the kernel is using the old defaultcrashkernelvalue.- If the system sets a specific
crashkernelvalue (i.e.crashkernel=256M), the option does not updatecrashkernelvalue.
2.0.26-8.el9 and newer version
auto_reset_crashkernel yescould update the defaultcrashkernelvalue when thekexec-toolspackage- Unlike the above old versions, the user-specific
crashkernelvalue will also be overwritten to1G-4G:192M,4G-64G:256M,64G-:512M. To remain the user-specific value, setauto_reset_crashkernel noor re-apply the old user-specificcrashkernelvalue by the following procedure after updatingkexec-tools.
Root Cause
- Because
crashkernel=autois deprecated in RHEL9,kexec-toolsneeds to update the old default value to the new default value1G-4G:192M,4G-64G:256M,64G-:512M. For more details about thecrashkernel=auto, please check the following KCS. - Since the following commit is applied at
kexec-tools-2.0.26-8.el9,crashkernelvalue will be set a new default value all time when updatingkexec-toolsifauto_reset_crashkernel yessets.
commit cb850aec2623b66d7361636e806ddf33e9de0eac
Author: Pingfan Liu <piliu@redhat.com>
Date: Thu Jun 15 10:11:53 2023 +0800
Simplify the management of the kernel parameter crashkernel
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2160676
Upstream: Fedora rawhide
Conflict: applied manually due to slight difference in context
commit 5b31b099ae9b40a8f832b07e8364d7b08025fdd6
Author: Coiby Xu <coxu@redhat.com>
Date: Wed Apr 26 04:48:25 2023 +0800
Simplify the management of the kernel parameter crashkernel
Currently, kexec-tools only updates the crashkernel to a new default
value only when both two conditions are met,
- auto_reset_crashkernel=yes in kdump.conf
- existing kernels or current running kernel should use the old default
value.
To address seen corner cases, the logic to tell if the second condition
is met becomes quite complex. Instead of making the logic more complex
to support aarch64-64k, this patch drops the second condition to
simplify the management of the crashkernel kernel parameter.
Another change brought by this simplification is kexec-tools will also
set up the kernel crashkernel parameter for a fresh install (previously
it's limited to osbuild).
Note
1. This patch also stop trying to update /etc/default/grub because
a) it only affects the static file /boot/grub2/grub.cfg
b) grubby is recommended to change the kernel command-line parameters
for both Fedora [1] and RHEL9 [2][3]
c) For the cases of aarch64 and POWER, different kernels could have
different default crashkernel value.
2. Starting with Fedora 37, posttrans rpm scriplet distinguish between
package install and upgrade.
[1] https://fedoraproject.org/wiki/GRUB_2
[2] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/managing_monitoring_and_updating_the_kernel/configuring-kernel-command-line-parameters_managing-monitoring-and-updating-the-kernel#changing-kernel-command-line-parameters-for-all-boot-entries_configuring-kernel-command-line-parameters
[3] https://access.redhat.com/solutions/1136173
Signed-off-by: Coiby Xu <coxu@redhat.com>
Reviewed-by: Philipp Rudo <prudo@redhat.com>
Signed-off-by: Pingfan Liu <piliu@redhat.com>
Diagnostic Steps
- The old default value is updated.
# cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt3)/vmlinuz-5.14.0-70.13.1.el9_0.x86_64
(snip) net.ifnames=0 crashkernel=auto
# cat /etc/kdump.conf |grep reset|grep -v ^#
auto_reset_crashkernel yes
# rpm -qa kexec-tools
kexec-tools-2.0.23-9_1.el9_0.x86_64
# dnf install kexec-tools -y
# reboot
# cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt3)/vmlinuz-5.14.0-70.13.1.el9_0.x86_64
(snip) net.ifnames=0 crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M
# rpm -qa kexec-tools
kexec-tools-2.0.25-13.el9_2.1.x86_64
- The
crashkernelset a specific value is not changed when updatingkexec-toolsto2.0.25-13.el9_2.1.
# cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt3)/vmlinuz-5.14.0-70.13.1.el9_0.x86_64
(snip) net.ifnames=0 crashkernel=256M
# cat /etc/kdump.conf |grep reset|grep -v ^#
auto_reset_crashkernel yes
# rpm -qa kexec-tools
kexec-tools-2.0.23-9_1.el9_0.x86_64
# dnf install kexec-tools -y
# reboot
# cat /proc/cmdline
BOOT_IMAGE=(hd0,gpt3)/vmlinuz-5.14.0-70.13.1.el9_0.x86_64
(snip) net.ifnames=0 crashkernel=256M
# rpm -qa kexec-tools
kexec-tools-2.0.25-13.el9_2.1.x86_64
- But if the
auto_reset_crashkernel yes, it will be overwritten when updating it to2.0.26-8.el9or later
# cat /proc/cmdline
(snip) crashkernel=256M
# dnf install kexec-tools-2.0.26-8.el9 -y
# reboot
# cat /proc/cmdline
(snip) net.ifnames=0 crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M
SBR
Product(s)
Components
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.