kdump
kernel, as root
, edit the /etc/default/grub
file and add the crashkernel=<size>M
(or crashkernel=auto
) parameter to the list of kernel options (the GRUB_CMDLINE_LINUX
line). For example, to reserve 128 MB of memory, use:
GRUB_CMDLINE_LINUX="crashkernel=128M
quiet rhgb"
root
:
grub2-mkconfig
-o
/boot/grub2/grub.cfg
Make sure the system has enough memory
kdump
crash recovery is enabled, the minimum memory requirements increase by the amount of memory reserved for it. This value is determined by the user, and defaults to 128 MB plus 64 MB for each TB of physical memory (that is, a total of 192 MB for a system with 1 TB of physical memory).
Using the crashkernel=auto parameter
crashkernel=auto
only reserves memory if the system has 4 GB of physical memory or more.
vmcore
file in the /var/crash/
directory of the local file system. To change this, as root
, open the /etc/kdump.conf
configuration file in a text editor and edit the options as described below.
#path /var/crash
line, and replace the value with a desired directory path. Optionally, if you wish to write the file to a different partition, follow the same procedure with the #ext4 /dev/sda3
line as well, and change both the file system type and the device (a device name, a file system label, and UUID are all supported) accordingly. For example:
ext3 /dev/sda4 path /usr/local/cores
#raw /dev/sda5
line, and replace the value with a desired device name. For example:
raw /dev/sdb1
#net my.server.com:/export/tmp
line, and replace the value with a valid hostname and directory path. For example:
net penguin.example.com:/export/cores
#net user@my.server.com
line, and replace the value with a valid username and hostname. For example:
net john@penguin.example.com
vmcore
dump file, kdump
allows you to specify an external application (that is, a core collector) to compress the data, and optionally leave out all irrelevant information. Currently, the only fully supported core collector is makedumpfile
.
root
, open the /etc/kdump.conf
configuration file in a text editor, remove the hash sign (“#”) from the beginning of the #core_collector makedumpfile -c --message-level 1 -d 31
line, and edit the command line options as described below.
-c
parameter. For example:
core_collector makedumpfile -c
-d value
parameter, where value is a sum of values of pages you want to omit as described in Table 22.2, “Supported filtering levels”. For example, to remove both zero and free pages, use the following:
core_collector makedumpfile -d 17 -c
makedumpfile
for a complete list of available options.
Table 22.2. Supported filtering levels
Option | Description |
---|---|
1 | Zero pages |
2 | Cache pages |
4 | Cache private |
8 | User pages |
16 | Free pages |
kdump
fails to create a core dump, the root file system is mounted and /sbin/init
is run. To change this behavior, as root
, open the /etc/kdump.conf
configuration file in a text editor, remove the hash sign (“#”) from the beginning of the #default shell
line, and replace the value with a desired action as described in Table 22.3, “Supported actions”.
Table 22.3. Supported actions
Option | Description |
---|---|
reboot | Reboot the system, losing the core in the process. |
halt | Halt the system. |
poweroff | Power off the system. |
shell | Run the msh session from within the initramfs, allowing a user to record the core manually. |
default halt
kdump
daemon at boot time, type the following at a shell prompt as root
:
systemctl
enable
kdump.service
systemctl disable kdump.service
will disable it. To start the service in the current session, use the following command as root
:
systemctl
start
kdump.service