2021-06-24 20:01:45 +00:00
|
|
|
Introduction
|
|
|
|
============
|
|
|
|
|
|
|
|
This document describes features the kexec-tools package provides for setting
|
|
|
|
and estimating the crashkernel value.
|
|
|
|
|
|
|
|
Kdump lives in a pre-reserved chunk of memory, and the size of the reserved
|
|
|
|
memory is specified by the `crashkernel=` kernel parameter. It's hard to
|
|
|
|
estimate an accurate `crashkernel=` value, so it's always recommended to test
|
|
|
|
kdump after you updated the `crashkernel=` value or changed the dump target.
|
|
|
|
|
|
|
|
|
|
|
|
Default crashkernel value
|
|
|
|
=========================
|
|
|
|
|
2022-01-05 03:53:22 +00:00
|
|
|
Latest kexec-tools provides "kdumpctl get-default-crashkernel" to retrieve
|
|
|
|
the default crashkernel value,
|
2021-06-24 20:01:45 +00:00
|
|
|
|
2022-01-05 03:53:22 +00:00
|
|
|
$ echo $(kdumpctl get-default-crashkernel)
|
|
|
|
1G-4G:192M,4G-64G:256M,64G-102400T:512M
|
2021-06-24 20:01:45 +00:00
|
|
|
|
2022-01-05 03:53:22 +00:00
|
|
|
It will be taken as the default value of 'crashkernel=', you can use
|
|
|
|
this value as a reference for setting crashkernel value manually.
|
2021-06-24 20:01:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
New installed system
|
|
|
|
====================
|
|
|
|
|
2021-12-07 12:41:28 +00:00
|
|
|
Anaconda is the OS installer which sets all the kernel boot cmdline on a newly
|
|
|
|
installed system. If kdump is enabled during Anaconda installation, Anaconda
|
2022-01-05 03:53:22 +00:00
|
|
|
will use the default crashkernel value as the default `crashkernel=` value on
|
2021-12-07 12:41:28 +00:00
|
|
|
the newly installed system.
|
2021-06-24 20:01:45 +00:00
|
|
|
|
2021-12-07 12:41:28 +00:00
|
|
|
Users can override the value during Anaconda installation manually.
|
2021-06-24 20:01:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
Auto update of crashkernel boot parameter
|
|
|
|
=========================================
|
|
|
|
|
2022-05-11 02:25:56 +00:00
|
|
|
A new release of kexec-tools could update the default crashkernel value. By
|
|
|
|
default, kexec-tools would reset crashkernel to the new default value if it
|
|
|
|
detects the old default crashkernel value is used by installed kernels. If you
|
|
|
|
don't want kexec-tools to update the old default crashkernel to the new default
|
2022-01-05 03:53:22 +00:00
|
|
|
crashkernel, you can change auto_reset_crashkernel to no in kdump.conf.
|
2021-06-24 20:01:45 +00:00
|
|
|
|
|
|
|
Supported Bootloaders
|
|
|
|
---------------------
|
|
|
|
|
|
|
|
This auto update only works with GRUB2 and ZIPL, as kexec-tools heavily depends
|
|
|
|
on `grubby`. If other boot loaders are used, the user will have to update the
|
|
|
|
`crashkernel=` value manually.
|
|
|
|
|
|
|
|
|
|
|
|
Reset crashkernel to default value
|
|
|
|
==================================
|
|
|
|
|
|
|
|
kexec-tools only perform the auto update of crashkernel value when it can
|
|
|
|
confirm the boot kernel's crashkernel value is using its corresponding default
|
2022-01-05 03:53:22 +00:00
|
|
|
value and auto_reset_crashkernel=yes in kdump.conf. In other cases, the user
|
|
|
|
can reset the crashkernel value by themselves.
|
2021-06-24 20:01:45 +00:00
|
|
|
|
|
|
|
Reset using kdumpctl
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
To make it easier to reset the `crashkernel=` kernel cmdline to this default
|
|
|
|
value properly, `kdumpctl` also provides a sub-command:
|
|
|
|
|
2022-01-05 03:53:22 +00:00
|
|
|
`kdumpctl reset-crashkernel [--kernel=path_to_kernel] [--reboot]`
|
2021-06-24 20:01:45 +00:00
|
|
|
|
2022-05-11 02:25:56 +00:00
|
|
|
This command will reset the bootloader's kernel cmdline to the default value.
|
|
|
|
It will also update bootloader config if the bootloader has a standalone config
|
|
|
|
file. User will have to reboot the machine after this command to make it take
|
|
|
|
effect if --reboot is not specified. For more details, please refer to the
|
|
|
|
reset-crashkernel command in `man kdumpctl`.
|
2021-06-24 20:01:45 +00:00
|
|
|
|
|
|
|
Reset manually
|
|
|
|
--------------
|
|
|
|
|
|
|
|
To reset the crashkernel value manually, it's recommended to use utils like
|
|
|
|
`grubby`. A one liner script for resetting `crashkernel=` value of all installed
|
2022-05-11 02:25:56 +00:00
|
|
|
kernels to the default value is:
|
2021-06-24 20:01:45 +00:00
|
|
|
|
2022-01-05 03:53:22 +00:00
|
|
|
grubby --update-kernel ALL --args "crashkernel=$(kdumpctl get-default-crashkernel)"
|
2021-06-24 20:01:45 +00:00
|
|
|
|
|
|
|
Estimate crashkernel
|
|
|
|
====================
|
|
|
|
|
|
|
|
The best way to estimate a usable crashkernel value is by testing kdump
|
|
|
|
manually. And you can set crashkernel to a large value, then adjust the
|
|
|
|
crashkernel value to an acceptable value gradually.
|
|
|
|
|
|
|
|
`kdumpctl` also provides a sub-command for doing rough estimating without
|
|
|
|
triggering kdump:
|
|
|
|
|
|
|
|
`kdumpctl estimate`
|
|
|
|
|
|
|
|
The output will be like this:
|
|
|
|
|
|
|
|
```
|
2022-05-11 02:25:56 +00:00
|
|
|
Encrypted kdump target requires extra memory, assuming using the keyslot with minimum memory requirement
|
2021-06-24 20:01:45 +00:00
|
|
|
|
|
|
|
Reserved crashkernel: 256M
|
|
|
|
Recommended crashkernel: 655M
|
|
|
|
|
|
|
|
Kernel image size: 47M
|
|
|
|
Kernel modules size: 12M
|
|
|
|
Initramfs size: 19M
|
|
|
|
Runtime reservation: 64M
|
|
|
|
LUKS required size: 512M
|
|
|
|
Large modules:
|
|
|
|
xfs: 1892352
|
|
|
|
nouveau: 2318336
|
|
|
|
WARNING: Current crashkernel size is lower than recommended size 655M.
|
|
|
|
```
|
|
|
|
|
|
|
|
It will generate a summary report about the estimated memory consumption
|
|
|
|
of each component of kdump. The value may not be accurate enough, but
|
|
|
|
would be a good start for finding a suitable crashkernel value.
|