Configure kdump memory reservation

Configure the memory reservation for kdump. The kdump-utils package provides default crashkernel= values that you can use as a reference when setting memory manually.

Before you begin

  • You have root permissions on the system.
  • You have fulfilled kdump requirements for configurations and targets. For details, see Supported kdump configurations and targets.
  • You have installed the zipl utility if it is the IBM Z system.

About this task

The automatic memory allocation for kdump varies based on the system hardware architecture and available memory size. For example, on AMD64 and Intel 64-bit architectures, the default value for the crashkernel= parameter works only when the available memory is more than 2 GB. The kdump-utils utility configures the following default memory reserves on AMD64 and Intel 64-bit architecture:

crashkernel=2G-64G:256M,64G-:512M

You can also run kdumpctl estimate to get an approximate value without triggering a crash. The estimated crashkernel= value might not be an exact one but can serve as a reference to set an appropriate crashkernel= value.

Note that the crashkernel=1G-4G:192M,4G-64G:256M,64G:512M option in the boot command line is no longer supported on RHEL 10 and later releases.

Warning

The commands to test kdump configuration cause the kernel to crash with data loss. Follow the instructions with care. Do not use an active production system to test the kdump configuration.

Procedure

  1. Configure the default value for crash kernel:
    # kdumpctl reset-crashkernel --kernel=ALL

    When configuring the crashkernel= value, test the configuration by rebooting the system with kdump enabled. If the kdump kernel fails to boot, increase the memory size gradually to set an acceptable value.

  2. To use a custom crashkernel= value
    1. Configure the required memory reserve:
      crashkernel=192M

      Optionally, you can set the amount of reserved memory to a variable depending on the total amount of installed memory by using the syntax crashkernel=<range1>:<size1>,<range2>:<size2>. For example:

      crashkernel=1G-4G:192M,2G-64G:256M

      The example reserves 192 MB of memory if the total amount of system memory is 1 GB or higher and lower than 4 GB. If the total amount of memory is more than 4 GB, 256 MB is reserved for kdump.

    2. Optional: Offset the reserved memory.

      Some systems must reserve memory at a certain fixed offset. The crashkernel reservation occurs early during the boot process, and the system uses some memory areas for special purposes. Setting a memory offset ensures that the reserved crash memory does not overlap with these areas, which helps prevent boot failures and ensures reliable crash dump capture. To offset the reserved memory, use the following syntax:

      crashkernel=192M@16M

      The example reserves 192 MB of memory starting at 16 MB (physical address 0x01000000). If you offset to 0 or do not specify a value, kdump offsets the reserved memory automatically. You can also offset memory when setting a variable memory reservation by specifying the offset as the last value. For example, crashkernel=1G-4G:192M,2G-64G:256M@16M.

    3. Update the boot loader configuration:
      # grubby --update-kernel ALL --args "crashkernel=<custom-value>"

      The <custom-value> must contain the custom crashkernel= value that you have configured for the crash kernel.

  3. Reboot for changes to take effect:
    # reboot

Results

Cause the kernel to crash by activating the sysrq key. The address-YYYY-MM-DD-HH:MM:SS/vmcore file is saved to the target location as specified in the /etc/kdump.conf file. If you select the default target location, the vmcore file is saved in the partition mounted under /var/crash/.

  1. Activate the sysrq key to boot into the kdump kernel:
    # echo c > /proc/sysrq-trigger

    The command causes kernel to crash and reboots the kernel if required.

  2. Display the /etc/kdump.conf file and check if the vmcore file is saved in the target destination.

    See the grubby(8) man page on your system for more information.