================================================================ Documentation for Kdump - The kexec-based Crash Dumping Solution ================================================================ This document includes overview, setup and installation, and analysis information. Overview ======== Kdump uses kexec to quickly boot to a dump-capture kernel whenever a dump of the system kernel's memory needs to be taken (for example, when the system panics). The system kernel's memory image is preserved across the reboot and is accessible to the dump-capture kernel. You can use common commands, such as cp and scp, to copy the memory image to a dump file on the local disk, or across the network to a remote system. Kdump and kexec are currently supported on the x86, x86_64, ppc64, ia64, s390x and arm architectures. When the system kernel boots, it reserves a small section of memory for the dump-capture kernel. This ensures that ongoing Direct Memory Access (DMA) from the system kernel does not corrupt the dump-capture kernel. The kexec -p command loads the dump-capture kernel into this reserved memory. On x86 machines, the first 640 KB of physical memory is needed to boot, regardless of where the kernel loads. Therefore, kexec backs up this region just before rebooting into the dump-capture kernel. Similarly on PPC64 machines first 32KB of physical memory is needed for booting regardless of where the kernel is loaded and to support 64K page size kexec backs up the first 64KB memory. For s390x, when kdump is triggered, the crashkernel region is exchanged with the region [0, crashkernel region size] and then the kdump kernel runs in [0, crashkernel region size]. Therefore no relocatable kernel is needed for s390x. All of the necessary information about the system kernel's core image is encoded in the ELF format, and stored in a reserved area of memory before a crash. The physical address of the start of the ELF header is passed to the dump-capture kernel through the elfcorehdr= boot parameter. Optionally the size of the ELF header can also be passed when using the elfcorehdr=[size[KMG]@]offset[KMG] syntax. With the dump-capture kernel, you can access the memory image through /proc/vmcore. This exports the dump as an ELF-format file that you can write out using file copy commands such as cp or scp. Further, you can use analysis tools such as the GNU Debugger (GDB) and the Crash tool to debug the dump file. This method ensures that the dump pages are correctly ordered. Setup and Installation ====================== Install kexec-tools ------------------- 1) Login as the root user. 2) Download the kexec-tools user-space package from the following URL: http://kernel.org/pub/linux/utils/kernel/kexec/kexec-tools.tar.gz This is a symlink to the latest version. The latest kexec-tools git tree is available at: git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git and http://www.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git There is also a gitweb interface available at http://www.kernel.org/git/?p=utils/kernel/kexec/kexec-tools.git More information about kexec-tools can be found at http://horms.net/projects/kexec/ 3) Unpack the tarball with the tar command, as follows: tar xvpzf kexec-tools.tar.gz 4) Change to the kexec-tools directory, as follows: cd kexec-tools-VERSION 5) Configure the package, as follows: ./configure 6) Compile the package, as follows: make 7) Install the package, as follows: make install Build the system and dump-capture kernels ----------------------------------------- There are two possible methods of using Kdump. 1) Build a separate custom dump-capture kernel for capturing the kernel core dump. 2) Or use the system kernel binary itself as dump-capture kernel and there is no need to build a separate dump-capture kernel. This is possible only with the architectures which support a relocatable kernel. As of today, i386, x86_64, ppc64, ia64 and arm architectures support relocatable kernel. Building a relocatable kernel is advantageous from the point of view that one does not have to build a second kernel for capturing the dump. But at the same time one might want to build a custom dump capture kernel suitable to his needs. Following are the configuration setting required for system and dump-capture kernels for enabling kdump support. System kernel config options ---------------------------- 1) Enable "kexec system call" in "Processor type and features." CONFIG_KEXEC=y 2) Enable "sysfs file system support" in "Filesystem" -> "Pseudo filesystems." This is usually enabled by default. CONFIG_SYSFS=y Note that "sysfs file system support" might not appear in the "Pseudo filesystems" menu if "Configure standard kernel features (for small systems)" is not enabled in "General Setup." In this case, check the .config file itself to ensure that sysfs is turned on, as follows: grep 'CONFIG_SYSFS' .config 3) Enable "Compile the kernel with debug info" in "Kernel hacking." CONFIG_DEBUG_INFO=Y This causes the kernel to be built with debug symbols. The dump analysis tools require a vmlinux with debug symbols in order to read and analyze a dump file. Dump-capture kernel config options (Arch Independent) ----------------------------------------------------- 1) Enable "kernel crash dumps" support under "Processor type and features": CONFIG_CRASH_DUMP=y 2) Enable "/proc/vmcore support" under "Filesystems" -> "Pseudo filesystems". CONFIG_PROC_VMCORE=y (CONFIG_PROC_VMCORE is set by default when CONFIG_CRASH_DUMP is selected.) Dump-capture kernel config options (Arch Dependent, i386 and x86_64) -------------------------------------------------------------------- 1) On i386, enable high memory support under "Processor type and features": CONFIG_HIGHMEM64G=y or CONFIG_HIGHMEM4G 2) On i386 and x86_64, disable symmetric multi-processing support under "Processor type and features": CONFIG_SMP=n (If CONFIG_SMP=y, then specify maxcpus=1 on the kernel command line when loading the dump-capture kernel, see section "Load the Dump-capture Kernel".) 3) If one wants to build and use a relocatable kernel, Enable "Build a relocatable kernel" support under "Processor type and features" CONFIG_RELOCATABLE=y 4) Use a suitable value for "Physical address where the kernel is loaded" (under "Processor type and features"). This only appears when "kernel crash dumps" is enabled. A suitable value depends upon whether kernel is relocatable or not. If you are using a relocatable kernel use CONFIG_PHYSICAL_START=0x100000 This will compile the kernel for physical address 1MB, but given the fact kernel is relocatable, it can be run from any physical address hence kexec boot loader will load it in memory region reserved for dump-capture kernel. Otherwise it should be the start of memory region reserved for second kernel using boot parameter "crashkernel=Y@X". Here X is start of memory region reserved for dump-capture kernel. Generally X is 16MB (0x1000000). So you can set CONFIG_PHYSICAL_START=0x1000000 5) Make and install the kernel and its modules. DO NOT add this kernel to the boot loader configuration files. Dump-capture kernel config options (Arch Dependent, ppc64) ---------------------------------------------------------- 1) Enable "Build a kdump crash kernel" support under "Kernel" options: CONFIG_CRASH_DUMP=y 2) Enable "Build a relocatable kernel" support C
{
"id": 15,
"title": "Yardstick-TC021",
"originalTitle": "Yardstick-TC021",
"tags": [
"yardstick-tc"
],
"style": "dark",
"timezone": "browser",
"editable": true,
"hideControls": false,
"sharedCrosshair": false,
"rows": [
{
"collapse": false,
"editable": true,
"height": "25px",
"panels": [
{
"content": "",
"editable"