b9e861
Early Kdump HOWTO
b9e861
b9e861
Introduction
b9e861
------------
b9e861
399b37
Early kdump is a mechanism to make kdump operational earlier than normal kdump
399b37
service.  The kdump service starts early enough for general crash cases, but
399b37
there are some cases where it has no chance to make kdump operational in boot
399b37
sequence, such as detecting devices and starting early services.  If you hit
399b37
such a case, early kdump may allow you to get more information of it.
399b37
399b37
Early kdump is implemented as a dracut module.  It adds a kernel (vmlinuz) and
399b37
initramfs for kdump to your system's initramfs in order to load them as early
399b37
as possible.  After that, if you provide "rd.earlykdump" in kernel command line,
399b37
then in the initramfs, early kdump will load those files like the normal kdump
399b37
service.  This 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:
399b37
b9e861
1. start kdump service to make sure kdump initramfs is created.
399b37
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
399b37
    # dracut --force --add earlykdump
b9e861
399b37
    NOTE: Recommend to backup the original system initramfs before performing
399b37
    this step to put it back if something happens during boot-up.
b9e861
399b37
3. add rd.earlykdump in grub kernel command line.
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
399b37
    # journalctl -b | grep early-kdump
399b37
399b37
Then, you will see some useful logs, for example:
399b37
399b37
- if early kdump is successful.
b9e861
399b37
Mar 09 09:57:56 localhost dracut-cmdline[190]: early-kdump is enabled.
399b37
Mar 09 09:57:56 localhost dracut-cmdline[190]: kexec: loaded early-kdump kernel
b9e861
399b37
- if early kdump is disabled.
b9e861
399b37
Mar 09 10:02:47 localhost dracut-cmdline[189]: early-kdump is disabled.
399b37
399b37
Notes
399b37
-----
399b37
399b37
- The size of early kdump initramfs will be large because it includes vmlinuz
399b37
  and kdump initramfs.
399b37
399b37
- Early kdump inherits the settings of normal kdump, so any changes that
399b37
  caused normal kdump rebuilding also require rebuilding the system initramfs
399b37
  to make sure that the changes take effect for early kdump. Therefore, after
399b37
  the rebuilding of kdump initramfs is completed, provide a prompt message to
399b37
  tell the fact.
399b37
399b37
- If you install an updated kernel and reboot the system with it, the early
399b37
  kdump will be disabled by default.  To enable it with the new kernel, you
399b37
  need to take the above steps again.
b9e861
b9e861
Limitation
b9e861
----------
b9e861
399b37
- At present, early kdump doesn't support fadump.
399b37
399b37
- Early kdump loads a crash kernel and initramfs at the beginning of the
399b37
  process in system's initramfs, so a crash at earlier than that (e.g. in
399b37
  kernel initialization) cannot be captured even with the early kdump.