v2 - apply suggestions from Philipp - add Reviewed-by tags - fix a few typos and grammar mistakes - clean up crashkernel.default in crashkernel-howto.txt
Coiby Xu (5): add man documentation for kdumpctl get-default-crashkernel update crashkernel-howto update kexec-kdump-howto update fadump-howto remove the upper bound of default crashkernel value example
crashkernel-howto.txt | 25 ++++++++++++------------- fadump-howto.txt | 24 ++++++++++++++---------- kdumpctl.8 | 21 ++++++++++++--------- kexec-kdump-howto.txt | 32 ++++++++++++++++++++------------ 4 files changed, 58 insertions(+), 44 deletions(-)
A few typos and grammar issues are fixed as well.
Signed-off-by: Coiby Xu coxu@redhat.com --- kdumpctl.8 | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/kdumpctl.8 b/kdumpctl.8 index 067117b..33c1115 100644 --- a/kdumpctl.8 +++ b/kdumpctl.8 @@ -14,7 +14,7 @@ In most cases, you should use .B systemctl to start / stop / enable kdump service instead. However, .B kdumpctl -provides more details for debug and a helper to setup ssh key authentication. +provides more details for debugging and a helper to set up ssh key authentication.
.SH COMMANDS .TP @@ -26,14 +26,14 @@ Stop the service. .TP .I status Prints the current status of kdump service. -It returns non-zero value if kdump is not operational. +It returns a non-zero value if kdump is not operational. .TP .I restart Is equal to .I start; stop .TP .I reload -reload crash kernel image and initramfs without triggering a rebuild. +reload the crash kernel image and initramfs without triggering a rebuild. .TP .I rebuild rebuild the crash kernel initramfs. @@ -43,20 +43,23 @@ Helps to setup key authentication for ssh storage since it's impossible to use password authentication during kdump. .TP .I showmem -Prints the size of reserved memory for crash kernel in megabytes. +Prints the size of reserved memory for the crash kernel in megabytes. .TP .I estimate -Estimate a suitable crashkernel value for current machine. This is a -best-effort estimate. It will print a recommanded crashkernel value -based on current kdump setup, and list some details of memory usage. +Estimate a suitable crashkernel value for the current machine. This is a +best-effort estimate. It will print a recommended crashkernel value +based on the current kdump setup, and list some details of memory usage. +.TP +.I get-default-crashkernel +Return the default crashkernel value provided by kexec-tools. .TP .I reset-crashkernel [--kernel=path_to_kernel] [--reboot] Reset crashkernel to default value recommended by kexec-tools. If no kernel is specified, will reset KDUMP_KERNELVER if it's defined in /etc/sysconfig/kdump -or current running kernel's crashkernel value if KDUMP_KERNELVER is empty. You can +or the current running kernel's crashkernel value if KDUMP_KERNELVER is empty. You can also specify --kernel=ALL and --kernel=DEFAULT which have the same meaning as grubby's kernel-path=ALL and kernel-path=DEFAULT. ppc64le supports FADump and -supports an additonal [--fadump=[on|off|nocma]] parameter to toggle FADump +supports an additional [--fadump=[on|off|nocma]] parameter to toggle FADump on/off.
Note: The memory requirements for kdump varies heavily depending on the
1. clean up left crashkernel.default 2. fix a few typos and grammar mistakes 3. ask the users to refer to `man kdumpctl` for reset-crashkernel
Signed-off-by: Coiby Xu coxu@redhat.com --- crashkernel-howto.txt | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/crashkernel-howto.txt b/crashkernel-howto.txt index 1ba79ab..94f4e52 100644 --- a/crashkernel-howto.txt +++ b/crashkernel-howto.txt @@ -37,10 +37,10 @@ Users can override the value during Anaconda installation manually. Auto update of crashkernel boot parameter =========================================
-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 +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 crashkernel, you can change auto_reset_crashkernel to no in kdump.conf.
Supported Bootloaders @@ -67,19 +67,18 @@ value properly, `kdumpctl` also provides a sub-command:
`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 if --reboot is not specified. -For ppc64le, an optional "[--fadump=[on|off|nocma]]" can also be specified to toggle -FADump on/off. +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`.
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 -kernels to current boot kernel's crashkernel.default` is: +kernels to the default value is:
grubby --update-kernel ALL --args "crashkernel=$(kdumpctl get-default-crashkernel)"
@@ -98,7 +97,7 @@ triggering kdump: The output will be like this:
``` - Encrypted kdump target requires extra memory, assuming using the keyslot with minimun memory requirement + Encrypted kdump target requires extra memory, assuming using the keyslot with minimum memory requirement
Reserved crashkernel: 256M Recommended crashkernel: 655M
1. yum is deprecated so use dnf instead 2. use the "kdumpctl reset-crashkernel" API 3. ask the users to refer to crashkernel-howto.txt for setting custom crashkernel value 4. fix a typo
Signed-off-by: Coiby Xu coxu@redhat.com --- kexec-kdump-howto.txt | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt index 1aeffc7..6741faf 100644 --- a/kexec-kdump-howto.txt +++ b/kexec-kdump-howto.txt @@ -44,7 +44,7 @@ ia64 and ppc64. If you're reading this document, you should already have kexec-tools installed. If not, you install it via the following command:
- # yum install kexec-tools + # dnf install kexec-tools
Now load a kernel with kexec:
@@ -66,23 +66,31 @@ How to configure kdump Again, we assume if you're reading this document, you should already have kexec-tools installed. If not, you install it via the following command:
- # yum install kexec-tools + # dnf install kexec-tools
To be able to do much of anything interesting in the way of debug analysis, you'll also need to install the kernel-debuginfo package, of the same arch as your running kernel, and the crash utility:
- # yum --enablerepo=*debuginfo install kernel-debuginfo.$(uname -m) crash + # dnf --enablerepo=*debuginfo install kernel-debuginfo.$(uname -m) crash
-Next up, we need to modify some boot parameters to reserve a chunk of memory for -the capture kernel. With the help of grubby, it's very easy to append -"crashkernel=128M" to the end of your kernel boot parameters. Note that the X -values are such that X = the amount of memory to reserve for the capture kernel. -And based on arch and system configuration, one might require more than 128M to -be reserved for kdump. One need to experiment and test kdump, if 128M is not -sufficient, try reserving more memory. +Next up, we need to reserve a chunk of memory for the capture kernel. To use +the default crashkernel value, you can kdumpctl:
- # grubby --args="crashkernel=128M" --update-kernel=/boot/vmlinuz-`uname -r` + # kdumpctl reset-crashkernel --kernel=/boot/vmlinuz-`uname -r` + +If the default value does not work for your setup you can use + + # grubby --args="crashkernel=256M" --update-kernel=/boot/vmlinuz-`uname -r` + +to specify a larger value, in this case 256M. You need to experiment to +find the best value that works for your setup. To begin with + + # kdumpctl estimate + +gives you an estimation for the crashkernel value based on the currently +running kernel. For more details, please refer to the "Estimate crashkernel" +section in /usr/share/doc/kexec-tools/crashkernel-howto.txt.
Note that there is an alternative form in which to specify a crashkernel memory reservation, in the event that more control is needed over the size and @@ -135,7 +143,7 @@ in /var/crash/YYYY-MM-DD-HH:MM/vmcore), then the system rebooted back into your normal kernel.
Once back to your normal kernel, you can use the previously installed crash -kernel in conjunction with the previously installed kernel-debuginfo to +utility in conjunction with the previously installed kernel-debuginfo to perform postmortem analysis:
# crash /usr/lib/debug/lib/modules/2.6.17-1.2621.el5/vmlinux
1. yum is deprecated so use dnf instead 2. use the "kdumpctl reset-crashkernel --fadump=on" API
Reviewed-by: Philipp Rudo prudo@redhat.com Signed-off-by: Coiby Xu coxu@redhat.com --- fadump-howto.txt | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/fadump-howto.txt b/fadump-howto.txt index bc87644..9773f78 100644 --- a/fadump-howto.txt +++ b/fadump-howto.txt @@ -39,7 +39,7 @@ kernel are one and the same on ppc64. If you're reading this document, you should already have kexec-tools installed. If not, you install it via the following command:
- # yum install kexec-tools + # dnf install kexec-tools
Fadump Operational Flow:
@@ -82,7 +82,7 @@ How to configure fadump: Again, we assume if you're reading this document, you should already have kexec-tools installed. If not, you install it via the following command:
- # yum install kexec-tools + # dnf install kexec-tools
Make the kernel to be configured with FADump as the default boot entry, if it isn't already: @@ -94,20 +94,24 @@ anything interesting in the way of debug analysis, you'll also need to install the kernel-debuginfo package, of the same arch as your running kernel, and the crash utility:
- # yum --enablerepo=*debuginfo install kernel-debuginfo.$(uname -m) crash + # dnf --enablerepo=*debuginfo install kernel-debuginfo.$(uname -m) crash
-Next up, we need to modify some boot parameters to enable firmware assisted -dump. With the help of grubby, it's very easy to append "fadump=on" to the end -of your kernel boot parameters. To reserve the appropriate amount of memory -for boot memory preservation, pass 'crashkernel=X' kernel cmdline parameter. -For the recommended value of X, see 'FADump Memory Requirements' section. +Next up, we can enable firmware assisted dump and reserve the memory for boot +memory preservation as specified in in the table of 'FADump Memory Requirements' +section: + + # kdumpctl reset-crashkernel --fadump=on + +Alternatively, you can use grubby to reserve custom amount of memory:
# grubby --args="fadump=on crashkernel=6G" --update-kernel=/boot/vmlinuz-`uname -r`
By default, FADump reserved memory will be initialized as CMA area to make the memory available through CMA allocator on the production kernel. We can opt out of this, making reserved memory unavailable to production kernel, by booting the -linux kernel with 'fadump=nocma' instead of 'fadump=on'. +linux kernel with 'fadump=nocma' instead of 'fadump=on': + + # kdumpctl reset-crashkernel --fadump=nocma
The term 'boot memory' means size of the low memory chunk that is required for a kernel to boot successfully when booted with restricted memory. By default, @@ -350,6 +354,6 @@ Remove "crashkernel=" from kernel cmdline parameters:
If KDump is to be used as the dump capturing mechanism, reset the crashkernel parameter:
- # kdumpctl reset-crashkernel `uname -r` + # kdumpctl reset-crashkernel --fadump=off
Reboot the system for the settings to take effect.
Reviewed-by: Philipp Rudo prudo@redhat.com Signed-off-by: Coiby Xu coxu@redhat.com --- crashkernel-howto.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/crashkernel-howto.txt b/crashkernel-howto.txt index 94f4e52..6573847 100644 --- a/crashkernel-howto.txt +++ b/crashkernel-howto.txt @@ -17,7 +17,7 @@ Latest kexec-tools provides "kdumpctl get-default-crashkernel" to retrieve the default crashkernel value,
$ echo $(kdumpctl get-default-crashkernel) - 1G-4G:192M,4G-64G:256M,64G-102400T:512M + 1G-4G:192M,4G-64G:256M,64G-:512M
It will be taken as the default value of 'crashkernel=', you can use this value as a reference for setting crashkernel value manually.
On Mon, 18 Apr 2022 16:14:40 +0800 Coiby Xu coxu@redhat.com wrote:
v2
- apply suggestions from Philipp
- add Reviewed-by tags
- fix a few typos and grammar mistakes
- clean up crashkernel.default in crashkernel-howto.txt
for the (rest of the) series
Reviewed-by: Philipp Rudo prudo@redhat.com
Thanks!
Coiby Xu (5): add man documentation for kdumpctl get-default-crashkernel update crashkernel-howto update kexec-kdump-howto update fadump-howto remove the upper bound of default crashkernel value example
crashkernel-howto.txt | 25 ++++++++++++------------- fadump-howto.txt | 24 ++++++++++++++---------- kdumpctl.8 | 21 ++++++++++++--------- kexec-kdump-howto.txt | 32 ++++++++++++++++++++------------ 4 files changed, 58 insertions(+), 44 deletions(-)
On Thu, Apr 21, 2022 at 03:27:31PM +0200, Philipp Rudo wrote:
On Mon, 18 Apr 2022 16:14:40 +0800 Coiby Xu coxu@redhat.com wrote:
v2
- apply suggestions from Philipp
- add Reviewed-by tags
- fix a few typos and grammar mistakes
- clean up crashkernel.default in crashkernel-howto.txt
for the (rest of the) series
Reviewed-by: Philipp Rudo prudo@redhat.com
Patches merged, thanks for the review!
Thanks!
Coiby Xu (5): add man documentation for kdumpctl get-default-crashkernel update crashkernel-howto update kexec-kdump-howto update fadump-howto remove the upper bound of default crashkernel value example
crashkernel-howto.txt | 25 ++++++++++++------------- fadump-howto.txt | 24 ++++++++++++++---------- kdumpctl.8 | 21 ++++++++++++--------- kexec-kdump-howto.txt | 32 ++++++++++++++++++++------------ 4 files changed, 58 insertions(+), 44 deletions(-)