kdump

from Wikipedia, the free encyclopedia

kdump is a function of the Linux kernel that creates memory dumps in the event of a kernel crash . As soon as triggered, kdump exports a memory dump (also known as vmcore) which can be examined to determine the cause of the error. The output image of the main memory, which is exported as an ELF object, can be accessed directly via / proc / vmcore while the kernel crash is being processed. However, it can also be automatically transferred to a locally available file system , a raw formatted device or a remote system that can be reached via the network .

Internals

In a "dual kernel" layout, kdump uses kexec to start another kernel and get a memory dump.

In the event of a kernel crash, kdump maintains system consistency by booting another Linux kernel, also known as the dump-capture kernel , and using it to export and save a dump . This will start the system in a clean and reliable environment, rather than relying on an already crashed kernel which can cause various other problems, such as file system corruption while the dump file is being written. To enable this "dual kernel" state, kdump uses kexec to boot into the dump-capture kernel immediately after the original kernel crashes. With kexec's ability to start "over" the kernel that is currently running and thereby bypass the execution of a boot loader and the hardware initialization that is carried out by the system firmware ( BIOS or UEFI ). A dump-capture kernel can either be a separate Linux kernel image created specifically for this purpose, or the primary kernel image can be reused on architectures that support relocatable kernels.

The contents of the main memory ( RAM ) are preserved during the startup and execution of the dump-capture kernel. It does this by pre-allocating a small area of ​​RAM into which the dump-capture kernel is preloaded so that no area of ​​RAM used by the primary kernel is overwritten when the kernel crash is fixed. This reserved RAM area is used only by the dump capture kernel and is not used during normal system operation. Some architectures, including x86 and ppc64, require a small fixed amount of RAM to run a kernel regardless of where it is loaded from. In this case, kexec creates a copy of this RAM section so that it can also be accessed by the dump-capture kernel. The size and optional position of the reserved main memory are determined by the kernel boot parameters crashkernel and the kexec command line tool , is used after the primary kernel starts to preload a dump-capture kernel image and its associated initrd image into the reserved area of ​​the RAM.

In addition to the functionality that is part of the Linux kernel, there are tools in user space that support the kdump mechanism, including the aforementioned kexec tool. In addition to the official tools, which are supplied as a patch for the kexec suite to userspace tools, some Linux distributions provide additional tools that simplify the configuration of the kdump operation, including the setting up of the automated saving of the dump files. Generated dump files can be examined using the GNU Debugger (gdb) or Red Hat's specialized crash tool.

history

The kdump functionality, together with kexec, was included in the main Linux kernel branch in kernel version 2.6.13 and released on August 29, 2005.

See also

  • debugfs - a RAM-based Linux kernel filesystem specially designed for debugging
  • kdump (BSD) - a BSD tool for viewing trace files generated by ktrace
  • Linux kernel oops - a potentially non-fatal deviation from the correct behavior of the Linux kernel

Individual evidence

  1. Jonathan Corbet: Crash dumps with kexec . LWN.net . October 27, 2004. Retrieved August 9, 2014.
  2. 13.2 About Kdump (Chapter 13: Support Diagnostic Tools) . Oracle Corporation . Retrieved August 9, 2014.
  3. Vivek Goyal, Eric W. Biederman: Kdump: A Kexec-based Kernel Crash Dumping Mechanism (PDF) June 14, 2006. Retrieved August 9, 2014.
  4. Linux kernel documentation: Documentation / kdump / kdump.txt . kernel.org . August 12, 2013. Retrieved August 9, 2014.
  5. Takashi Iwai: Debugging using Kdump (PDF) SUSE . July 26, 2006. Retrieved August 9, 2014.
  6. 29.2.2. Using the Kernel Dump Configuration Utility (Red Hat Enterprise Linux 6 Deployment Guide) . Red hat . Retrieved August 9, 2014.
  7. kexec and kdump: Basic kdump Configuration (System Analysis and Tuning Guide) . SUSE . April 25, 2014. Retrieved August 9, 2014.
  8. How to use kdump to debug kernel crashes . Fedora . April 9, 2014. Retrieved August 9, 2014.
  9. David Anderson, White Paper: Red Hat Crash Utility . Red hat . August 27, 2010. Retrieved August 9, 2014.
  10. kexec and kdump: Analyzing the Crash Dump (System Analysis and Tuning Guide) . SUSE . April 25, 2014. Retrieved August 9, 2014.
  11. Linux kernel 2.6.13 . August 29, 2005. Retrieved August 9, 2014.

Web links