Este conteúdo não está disponível no idioma selecionado.
Chapter 18. Enabling kdump
Enable or disable kdump functionality on a specific kernel or all installed kernels in Red Hat Enterprise Linux. Test and validate the kdump functionality regularly to ensure it works correctly.
18.1. Enabling kdump for all installed kernels Copiar o linkLink copiado para a área de transferência!
To enable the kdump service for all kernels installed on the machine, enable kdump.service after the kdump-utils package is installed.
Prerequisites
- You have root permissions on the system.
Procedure
Add the
crashkernel=command-line parameter to all installed kernels:# grubby --update-kernel=ALL --args="crashkernel=xxM"xxMis the required memory in megabytes.-
In terms of UKI, add the
crashkernel=command-line parameter to all installed UKIs by copying an add-on associated with the required argument from/lib/modules/$(uname -r)/vmlinuz-virt.efi.extra.d/to/boot/efi/loader/addons/. Reboot the system:
# rebootEnable the
kdumpservice:# systemctl enable --now kdump.service
Verification
Check that the
kdumpservice is running:# systemctl status kdump.servicekdump.service - Crash recovery kernel arming Loaded: loaded (/usr/lib/systemd/system/kdump.service; enabled; vendor preset: disabled) Active: active (live)
18.2. Enabling kdump for a specific installed kernel Copiar o linkLink copiado para a área de transferência!
To enable the kdump service for a specific installed kernel, configure the crashkernel parameter in GRUB for the selected kernel and enable the service to capture crash dumps.
Prerequisites
- You have root permissions on the system.
Procedure
List the kernels installed on the machine:
# ls -a /boot/vmlinuz-*/boot/vmlinuz-0-rescue-2930657cd0dc43c2b75db480e5e5b4a9 /boot/vmlinuz-6.12.0-55.9.1.el10_0.x86_64 /boot/vmlinuz-6.12.0-55.9.1.el10_0.x86_64Add a specific
kdumpkernel to the system’s Grand Unified Boot Loader (GRUB) configuration:For example:
# grubby --update-kernel=vmlinuz-6.12.0-55.9.1.el10_0.x86_64 --args="crashkernel=xxM"xxMis the required memory reserve in megabytes.-
In terms of UKI, add the
crashkernel=command-line parameter to a specific UKI by copying an add-on associated with the required argument from/lib/modules/$(uname -r)/vmlinuz-virt.efi.extra.d/to/boot/efi/EFI/Linux/<machine-id>-<kernel-version>.efi.extra.d/. Enable the
kdumpservice:# systemctl enable --now kdump.service
Verification
Check that the
kdumpservice is running:# systemctl status kdump.servicekdump.service - Crash recovery kernel arming Loaded: loaded (/usr/lib/systemd/system/kdump.service; enabled; vendor preset: disabled) Active: active (live)
18.3. Disabling the kdump service Copiar o linkLink copiado para a área de transferência!
You can stop the kdump service and disable the service from starting on your Red Hat Enterprise Linux systems.
Prerequisites
-
Fulfilled requirements for
kdumpconfigurations and targets. For details, see Supported kdump configurations and targets.
Procedure
To stop the
kdumpservice in the current session:# systemctl stop kdump.serviceTo disable the
kdumpservice:# systemctl disable kdump.serviceWarningYou must set
kptr_restrict=1as default. Whenkptr_restrictis set to (1) as default, thekdumpctlservice loads the crash kernel regardless of whether the Kernel Address Space Layout (KASLR) is enabled.If
kptr_restrictis not set to1andKASLRis enabled, the contents of/proc/korefile are generated as all zeros. Thekdumpctlservice fails to access the/proc/kcorefile and load the crash kernel. Thekexec-kdump-howto.txtfile displays a warning message, which suggest you to setkptr_restrict=1. Verify for the following in thesysctl.conffile to ensure thatkdumpctlservice loads the crash kernel:-
Kernel
kptr_restrict=1in thesysctl.conffile.
-
Kernel