Configuring the Kdump Service
If a kernel problem occurs, you cannot use debugging tools such as GDB to directly debug the failed program. Instead, you need to generate a vmcore file and then debug the vmcore file to locate problems.
Kdump dumps memory running parameters when the system crashes or a deadlock occurs. A vmcore file can be generated only when kdump is configured. The following steps explain how to configure kdump on openEuler 22.03 LTS and CentOS 7.6 based on the Kunpeng platform.
- Install kdump.
- openEuler 22.03 LTS has built-in and enabled kdump. You do not need to install kdump separately.
- CentOS 7.6 allows you to determine whether to enable kdump during kdump installation. If kdump is not enabled, install the dependency package of kdump again.
1yum install kexec-tools -y
- (Optional) Configure the crash kernel size.
The kdump parameters for reserving memory must be added to the kernel boot parameters. The configuration file path is as follows:
- UEFI boot mode: /boot/efi/EFI/openEuler/grub.cfg
- Legacy boot mode: /boot/grub2/grub.cfg
By default, the parameters have been added in the version built in openEuler. You can adjust the values as required. After adding or modifying boot parameters, restart the system to apply the settings.
- For openEuler, the crashkernel parameter cannot be set to auto. Table 1 shows the formats of the kdump parameters for reserving memory.
Table 1 Kdump parameters for reserving memory (openEuler) Kernel Boot Parameter
Description
Default Value
Description
crashkernel=x
In physical memory address space below 4 GB, x of the memory is reserved for kdump.
The default value is 512 MB for the x86 version.
This configuration method is used only for memory address space below 4 GB. In this case, ensure that the available contiguous memory is sufficient for reservation.
crashkernel=x@y
x of the memory is reserved for kdump at the start address of y.
Not used
Ensure that x of the memory at the start address of y is not reserved for other modules.
crashkernel=x,high
In physical memory address space below 4 GB, 256 MB memory is reserved. In physical memory address space above 4 GB, x of the memory is reserved for kdump.
The default value is 1024M,high for AArch64.
Ensure that the available continuous physical memory size is greater than or equal to 256 MB in physical memory address space below 4 GB, and is greater than or equal to x in physical memory address space above 4 GB. The actual reserved memory size is 256 MB + x.
crashkernel=x,low crashkernel=y,high
In physical memory address space below 4 GB, x of the memory is reserved. In physical memory address space above 4 GB, y of the memory is reserved for kdump.
Not used
Ensure that the available continuous physical memory size is greater than or equal to x in physical memory address space below 4 GB, and is greater than or equal to y in physical memory address space above 4 GB.
- For CentOS 7.6, the crashkernel parameter can be set to auto, indicating that the crash kernel size can be configured based on the system memory.
- If the system memory is less than or equal to 8 GB, no space is reserved for the kdump kernel, which is equivalent to disabling kdump.
- If the system memory is greater than 8 GB but less than or equal to 16 GB, crashkernel=auto reserves 256 MB, which is equivalent to crashkernel=256M.
- If the system memory is greater than 16 GB, crashkernel=auto reserves 512 MB, which is equivalent to crashkernel=512M.
Generally, the crash kernel size is an integer power of 2, for example, 128 MB, 256 MB, 512 MB, 768 MB, 1024 MB, or 2048 MB. You can configure the crash kernel size in either of the following ways:
Method 1: Modify the /etc/default/grub file. This method will modify the configuration of all kernels.- Open the grub file.
vi /etc/default/grub
- Press i to enter the insert mode and add or modify the crashkernel parameter in GRUB_CMDLINE_LINUX. In this example, this parameter is set to 1024M,high.
crashkernel=1024M,high

The crash kernel size needs to be adjusted as required. If the value is too large, the kernel may fail to allocate the space required by the crash kernel. As a result, the kdump service fails to be started. If the value is too small, the capture kernel may fail to be started.
- Press Esc to exit the insert mode. Type :wq! and press Enter to save and exit the file.
- Run the grub2-mkconfig command to regenerate a grub.cfg file.
grub2-mkconfig -o /boot/efi/EFI/openEuler/grub.cfg
Method 2: Modify the grub boot command of the corresponding kernel in the grub.cfg file.
- Open the grub.cfg file.
vi /boot/efi/EFI/openEuler/grub.cfg
- Press i to enter the insert mode, find the grub boot command of the target kernel, and add or modify the crashkernel parameter.
For example, for the 'openEuler (5.10.0-60.18.0.50.oe2203.aarch64) 22.03 LTS' configuration item in the following figure, find the crashkernel parameter in the linux command. If the crashkernel parameter does not exist, add it.
crashkernel=1024M,high

- Press Esc to exit the insert mode. Type :wq! and press Enter to save and exit the file.
- Reboot the server for the configuration to take effect.
- Confirm kdump is enabled.
- Restart the server and check the kdump configuration.
1 2 3
systemctl start kdump.service systemctl enable kdump.service systemctl status kdump.service
If the error message "No memory reserved for crash kernel" is displayed, as shown in the following figure, the crash kernel configuration may be improper and the reserved space is insufficient for the crash kernel. In this case, you need to modify the crashkernel parameter.

- Run the following commands to verify kdump. The Linux kernel breaks down after the command execution, and kdump files are generated in the default directory /var/crash. If a vmcore file is generated, kdump has been enabled.
1 2
echo 1 > /proc/sys/kernel/sysrq echo c > /proc/sysrq-trigger
- Restart the server and check the kdump configuration.