Kdump is the Linux kernel crash dumping mechanism. In the event of a system crash, Kdump provides a memory dump (vmcore) image. This image can assist in determining the cause of the crash. It is highly recommended that you enable the Kdump feature.
Kexec and Kdump together ensure faster bootup and the creation of reliable kernel vmcores for diagnostic purposes. Kexec is a fast-boot mechanism that allows booting a Linux kernel from the context of an already running kernel without going through BIOS. Kdump uses Kexec to boot into a second kernel whenever the system crashes. The crash dump is captured from the context of a freshly booted kernel and not from the context of the crashed kernel. This second kernel boots with very little memory and captures the dump image.
To enable and use Kdump, install the following package:
# yum install kexec-tools
You can also enable Kdump from a GUI. Make sure you have the system-config-kdump package installed to use the kernel crash dumping configuration GUI.
# yum install system-config-kdump
Enter the following command to use the Kernel Dump Configuration GUI:
The GUI appears as shown in the picture below. Click the Enable button to configure the kdump daemon to start at boot time.
Four tabs appear on the left side of the GUI.
1. Basic Settings tab
The Basic Settings tab allows you to select the amount of memory to reserve for Kdump.
2. Target Settings tab
Use the Target Settings tab to specify the target location for the vmcore dump.
You can store the dump image in a local file system or store it remotely using NFS or SSH. The default is to store the vmcore file in the /var/crash directory of the local file system. The following targets are supported:
Raw device: All locally attached raw disks and partitions
Local file system: Any ext2, ext3, ext4, btrfs, or xfs file system on directly attached disk drives, hardware RAID logical drives, LVM devices, and mdraid arrays
Remote directory: Remote directories accessed by using NFS or SSH over IPv4 and remote directories accessed using iSCSI over software initiators
Unsupported targets include:
- Remote directories on the rootfs file system accessed using NFS
- Remote directories accessed using iSCSI over hardware initiators
- Remote directories accessed over IPv6
- Remote directories accessed using SMB/CIFS or FCoE (Fibre Channel over Ethernet)
- Remote directories accessed using wireless NICs
- Multipath-based storage
3. Filtering Settings tab
The Filtering Settings tab allows you to select the filtering level for the vmcore dump.
You can choose to exclude any or all of the following from the dump:
4. Expert Settings tab
The Expert Settings tab allows you to choose which kernel and initial RAM disk to use. From this tab you can also customize the options that are passed to the kernel and the core collector program. You can choose what to do when dumping to the intended target fails.
The following options are available:
reboot: Reboot the system and lose the core that you are trying to retrieve. This is the default action.
halt: Halt the system after attempting to capture a vmcore, regardless of success or failure.
poweroff: Power the system off.
shell: Drop to an interactive shell session inside initramfs from where you can try to record the core manually. Exiting the shell reboots the system.
dump to rootfs and reboot: Dump vmcore to rootfs from initramfs context and reboot.
Click Apply to save any changes.