db7d74
Early Kdump HOWTO
db7d74
db7d74
Introduction
db7d74
------------
db7d74
db7d74
Early kdump is a mechanism to make kdump operational earlier than normal kdump
db7d74
service.  The kdump service starts early enough for general crash cases, but
db7d74
there are some cases where it has no chance to make kdump operational in boot
db7d74
sequence, such as detecting devices and starting early services.  If you hit
db7d74
such a case, early kdump may allow you to get more information of it.
db7d74
db7d74
Early kdump is implemented as a dracut module.  It adds a kernel (vmlinuz) and
db7d74
initramfs for kdump to your system's initramfs in order to load them as early
db7d74
as possible.  After that, if you provide "rd.earlykdump" in kernel command line,
db7d74
then in the initramfs, early kdump will load those files like the normal kdump
db7d74
service.  This is disabled by default.
db7d74
db7d74
For the normal kdump service, it can check whether the early kdump has loaded
db7d74
the crash kernel and initramfs. It has no conflict with the early kdump.
db7d74
db7d74
How to configure early kdump
db7d74
----------------------------
db7d74
db7d74
We assume if you're reading this document, you should already have kexec-tools
db7d74
installed.
db7d74
db7d74
You can rebuild the initramfs with earlykdump support with below steps:
db7d74
db7d74
1. start kdump service to make sure kdump initramfs is created.
db7d74
db7d74
    # systemctl start kdump
db7d74
db7d74
    NOTE: If a crash occurs during boot process, early kdump captures a vmcore
db7d74
    and reboot the system by default, so the system might go into crash loop.
db7d74
    You can avoid such a crash loop by adding the following settings, which
db7d74
    power off the system after dump capturing, to kdump.conf in advance:
db7d74
db7d74
        final_action poweroff
db7d74
        failure_action poweroff
db7d74
db7d74
    For the failure_action, you can choose anything other than "reboot".
db7d74
db7d74
2. rebuild system initramfs with earlykdump support.
db7d74
db7d74
    # dracut --force --add earlykdump
db7d74
db7d74
    NOTE: Recommend to backup the original system initramfs before performing
db7d74
    this step to put it back if something happens during boot-up.
db7d74
db7d74
3. add rd.earlykdump in grub kernel command line.
db7d74
db7d74
After making said changes, reboot your system to take effect. Of course, if you
db7d74
want to disable early kdump, you can simply remove "rd.earlykdump" from kernel
db7d74
boot parameters in grub, and reboot system like above.
db7d74
db7d74
Once the boot is completed, you can check the status of the early kdump support
db7d74
on the command prompt:
db7d74
db7d74
    # journalctl -b | grep early-kdump
db7d74
db7d74
Then, you will see some useful logs, for example:
db7d74
db7d74
- if early kdump is successful.
db7d74
db7d74
Mar 09 09:57:56 localhost dracut-cmdline[190]: early-kdump is enabled.
db7d74
Mar 09 09:57:56 localhost dracut-cmdline[190]: kexec: loaded early-kdump kernel
db7d74
db7d74
- if early kdump is disabled.
db7d74
db7d74
Mar 09 10:02:47 localhost dracut-cmdline[189]: early-kdump is disabled.
db7d74
db7d74
Notes
db7d74
-----
db7d74
db7d74
- The size of early kdump initramfs will be large because it includes vmlinuz
db7d74
  and kdump initramfs.
db7d74
db7d74
- Early kdump inherits the settings of normal kdump, so any changes that
db7d74
  caused normal kdump rebuilding also require rebuilding the system initramfs
db7d74
  to make sure that the changes take effect for early kdump. Therefore, after
db7d74
  the rebuilding of kdump initramfs is completed, provide a prompt message to
db7d74
  tell the fact.
db7d74
db7d74
- If you install an updated kernel and reboot the system with it, the early
db7d74
  kdump will be disabled by default.  To enable it with the new kernel, you
db7d74
  need to take the above steps again.
db7d74
db7d74
Limitation
db7d74
----------
db7d74
db7d74
- At present, early kdump doesn't support fadump.
db7d74
db7d74
- Early kdump loads a crash kernel and initramfs at the beginning of the
db7d74
  process in system's initramfs, so a crash at earlier than that (e.g. in
db7d74
  kernel initialization) cannot be captured even with the early kdump.