b9e861
Early Kdump HOWTO
b9e861
b9e861
Introduction
b9e861
------------
b9e861
b9e861
Kdump service starts too late, so early crashes will have no chance to get
b9e861
kdump kernel booting, this will cause crash information to be lost. It is
b9e861
necessary to add a dracut module in order to load crash kernel and initramfs
b9e861
as early as possible. You can provide "rd.earlykdump" in grub commandline
b9e861
to enable, then the early kdump will load those files like the normal kdump,
b9e861
which is disabled by default.
b9e861
b9e861
For the normal kdump service, it can check whether the early kdump has loaded
b9e861
the crash kernel and initramfs. It has no conflict with the early kdump.
b9e861
b9e861
How to configure early kdump
b9e861
----------------------------
b9e861
b9e861
We assume if you're reading this document, you should already have kexec-tools
b9e861
installed.
b9e861
b9e861
You can rebuild the initramfs with earlykdump support with below steps:
b9e861
1. start kdump service to make sure kdump initramfs is created.
b9e861
    # systemctl start kdump
b9e861
b9e861
    NOTE: If a crash occurs during boot process, early kdump captures a vmcore
b9e861
    and reboot the system by default, so the system might go into crash loop.
b9e861
    You can avoid such a crash loop by adding the following settings, which
b9e861
    power off the system after dump capturing, to kdump.conf in advance:
b9e861
b9e861
        final_action poweroff
b9e861
        failure_action poweroff
b9e861
b9e861
    For the failure_action, you can choose anything other than "reboot".
b9e861
b9e861
2. rebuild system initramfs with earlykdump support.
b9e861
    # dracut --add earlykdump
b9e861
b9e861
3. add rd.earlykdump in grub kernel command line.
b9e861
b9e861
Note:
b9e861
[1]. Early kdump initramfs size will be large because it includes vmlinuz and
b9e861
kdump initramfs. And for step 2 if you are sure to overwrite system initramfs
b9e861
you can backup the original initramfs and use "--force" option.
b9e861
b9e861
[2]. Early kdump inherits the settings of normal kdump, so any changes that
b9e861
caused normal kdump rebuilding also require rebuilding the system initramfs
b9e861
to make sure that the changes take effect for early kdump. Therefore, after
b9e861
the rebuilding of kdump initramfs is completed, provide a prompt message to
b9e861
tell the fact.
b9e861
b9e861
After making said changes, reboot your system to take effect. Of course, if you
b9e861
want to disable early kdump, you can simply remove "rd.earlykdump" from kernel
b9e861
boot parameters in grub, and reboot system like above.
b9e861
b9e861
Once the boot is completed, you can check the status of the early kdump support
b9e861
on the command prompt:
b9e861
b9e861
    # journalctl -x|grep early-kdump
b9e861
b9e861
Then, you will see some useful logs, for exapmle:
b9e861
b9e861
1. if early kdump is successful.
b9e861
Mar 09 09:57:56 localhost.localdomain dracut-cmdline[190]: early-kdump is enabled.
b9e861
Mar 09 09:57:56 localhost.localdomain dracut-cmdline[190]: kexec: loaded early-
b9e861
kdump kernel
b9e861
b9e861
2. if early kdump is disabled.
b9e861
Mar 09 10:02:47 localhost.localdomain dracut-cmdline[189]: early-kdump is disabled.
b9e861
b9e861
Limitation
b9e861
----------
b9e861
b9e861
At present, early kdump doesn't support fadump.