update crashkernel-howto

Resolves: bz1895258
Upstream: Fedora
Conflict: None

commit 0e162120b6
Author: Coiby Xu <coxu@redhat.com>
Date:   Mon Dec 13 12:44:14 2021 +0800

    update crashkernel-howto

    Update crashkernel-howto since crashkernel.default has been removed. The
    documentation is also simplified as a result.

    Reviewed-by: Pingfan Liu <piliu@redhat.com>
    Reviewed-by: Philipp Rudo <prudo@redhat.com>
    Signed-off-by: Coiby Xu <coxu@redhat.com>

Signed-off-by: Coiby Xu <coxu@redhat.com>
This commit is contained in:
Coiby Xu 2022-01-05 11:53:22 +08:00 committed by Tao Liu
parent fc136290bf
commit 51bbe682ee

View File

@ -13,13 +13,14 @@ kdump after you updated the `crashkernel=` value or changed the dump target.
Default crashkernel value
=========================
Latest kernel packages include a `crashkernel.default` file installed in kernel
modules folder, available as:
Latest kexec-tools provides "kdumpctl get-default-crashkernel" to retrieve
the default crashkernel value,
/usr/lib/modules/<kernel>/crashkernel.default
$ echo $(kdumpctl get-default-crashkernel)
1G-4G:192M,4G-64G:256M,64G-102400T:512M
The content of the file will be taken as the default value of 'crashkernel=', or
take this file as a reference for setting crashkernel value manually.
It will be taken as the default value of 'crashkernel=', you can use
this value as a reference for setting crashkernel value manually.
New installed system
@ -27,7 +28,7 @@ New installed system
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
will use the `crashkernel.default` file as the default `crashkernel=` value on
will use the default crashkernel value as the default `crashkernel=` value on
the newly installed system.
Users can override the value during Anaconda installation manually.
@ -36,20 +37,11 @@ Users can override the value during Anaconda installation manually.
Auto update of crashkernel boot parameter
=========================================
Following context in this section assumes all kernel packages have a
`crashkernel.default` file bundled, which is true for the latest official kernel
packages. For kexec-tools behavior with a kernel that doesn't have a
`crashkernel.default` file, please refer to the “Custom Kernel” section of this
doc.
When `crashkernel=` is using the default value, kexec-tools will need to update
the `crashkernel=` value of new installed kernels, since the default value may
change in new kernel packages.
kexec-tools does so by adding a kernel installation hook, which gets triggered
every time a new kernel is installed, so kexec-tools can do necessary checks and
updates.
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 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
crashkernel, you can change auto_reset_crashkernel to no in kdump.conf.
Supported Bootloaders
---------------------
@ -59,92 +51,13 @@ on `grubby`. If other boot loaders are used, the user will have to update the
`crashkernel=` value manually.
Updating kernel package
-----------------------
When a new version of package kernel is released in the official repository, the
package will always come with a `crashkernel.default` file bundled. Kexec-tools
will act with following rules:
If current boot kernel is using the default `crashkernel=` boot param value from
its `crashkernel.default` file, then kexec-tools will update new installed
kernels `crashkernel=` boot param using the value from the new installed
kernels `crashkernel.default` file. This ensures `crashkernel=` is always using
the latest default value.
If current boot kernel's `crashkernel=` value is set to a non-default value, the
new installed kernel simply inherits this value.
On systems using GRUB2 as the bootloader, each kernel has its own boot entry,
making it possible to set different `crashkernel=` boot param values for
different kernels. So kexec-tools wont touch any already installed kernel's
boot param, only new installed kernel's `crashkernel=` boot param value will be
updated.
But some utilities like `grub2-mkconfig` and `grubby` can override all boot
entry's boot params with the boot params value from the GRUB config file
`/etc/defaults/grub`, so kexec-tools will also update the GRUB config file in
case old `crashkernel=` value overrides new installed kernels boot param.
Downgrading kernel package
--------------------------
When upgrading a kernel package, kexec-tools may update the `crashkernel=` value
in GRUB2 config file to the new value. So when downgrading the kernel package,
kexec-tools will also try to revert that update by setting GRUB2 config files
`crashkernel=` value back to the default value in the older kernel package. This
will only occur when the GRUB2 config file is using the default `crashkernel=`
value.
Custom kernel
=============
To make auto crashkernel update more robust, kexec-tools will try to keep
tracking the default 'crashkernel=` value with kernels that dont have a
`crashkernel.default` file, such kernels are referred to as “custom kernel” in
this doc. This is only a best-effort support to make it easier debugging and
testing the system.
When installing a custom kernel that doesnt have a `crashkernel.default` file,
the `crashkernel=` value will be simply inherited from the current boot kernel.
When installing a new official kernel package and current boot kernel is a
custom kernel, since the boot kernel doesnt have a `crashkernel.default` file,
kexec-tools will iterate installed kernels and check if the boot kernel
inherited the default value from any other existing kernels
`crashkernel.default` file. If a matching `crashkernel.default` file is found,
kexec-tools will update the new installed kernel `crashkernel=` boot param using
the value from the new installed kernels `crashkernel.default` file, ensures
the auto crashkernel value update wont break over one or two custom kernel
installations.
It is possible that the auto crashkernel value update will fail when custom
kernels are used. One example is a custom kernel inheriting the default
`crashkernel=` value from an older official kernel package, but later that
kernel package is uninstalled. So when booted with the custom kernel,
kexec-tools can't determine if the boot kernel is inheriting a default
`crashkernel=` value from any official build. In such a case, please refer to
the "Reset crashkernel to default value" section of this doc.
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
value or inherited from any installed kernel.
kexec-tools may fail to determine if the boot kernel is using default
crashkernel value in some use cases:
- kexec-tools package is absent during a kernel package upgrade, and the new
kernel packages `crashkernel.default` value has changed.
- Custom kernel is used and the kernel it inherits `crashkernel=` value from is
uninstalled.
So it's recommended to reset the crashkernel value if users have uninstalled
kexec-tools or using a custom kernel.
value and auto_reset_crashkernel=yes in kdump.conf. In other cases, the user
can reset the crashkernel value by themselves.
Reset using kdumpctl
--------------------
@ -152,12 +65,14 @@ Reset using kdumpctl
To make it easier to reset the `crashkernel=` kernel cmdline to this default
value properly, `kdumpctl` also provides a sub-command:
`kdumpctl reset-crashkernel [<kernel version>]`
`kdumpctl reset-crashkernel [--kernel=path_to_kernel] [--reboot]`
This command will read from the `crashkernel.default` file and reset
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.
the machine after this command to make it take effect if --reboot is not specified.
For ppc64le, an optional "[--fadump=[on|off|nocma]]" can also be specified to toggle
FADump on/off.
Reset manually
--------------
@ -166,7 +81,7 @@ 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
kernels to current boot kernel's crashkernel.default` is:
grubby --update-kernel ALL --args "$(cat /usr/lib/modules/$(uname -r)/crashkernel.default)"
grubby --update-kernel ALL --args "crashkernel=$(kdumpctl get-default-crashkernel)"
Estimate crashkernel
====================