Scroll to navigation

KDUMP(5) User Manuals KDUMP(5)

NAME

kdump - Configuration of kdump

SYNOPSIS

/etc/sysconfig/kdump

DESCRIPTION

This configuration file provides various options for generating the kdump initramfs and the loading and saving process.

OPTIONS

The file format consists of shell variables (which means that the configuration file is actually parsed by a sh(1) compatible shell) that are described below. It’s recommended to use a pair of double quotes to assign values to that variables.

KDUMP_KERNELVER

Kernel Version string (such as "6.3.1-2-default") or an absolute path to a kernel image that should be used for kdump.

Default is "" which means to use the default /boot/{vmlinuz,image,Image,vmlinux} symlink

KDUMP_CPUS

If dumping is CPU-bound on your system, you can parallelize it on an SMP system. Keep in mind that this increases the stress on the I/O subsystem, so you probably don’t get the maximum speed if you set this parameter to the number of CPUs in your system.

This parameter modifies the maxcpus parameter of the kdump kernel and the number of makedumpfile(8) processes created.

If the value is zero, all available CPUs are used, i.e. the maxcpus parameter is not added to the kdump kernel command line.

Default is 1.

KDUMP_COMMANDLINE

Command line used to boot the kdump kernel. By default, the /etc/init.d/kdump script tries to build a command line automatically from the command line of the running system, preserving root partition, serial console, etc. If you manually create a command line, make sure to include:

•the root parameter,

•any console parameters (for serial console),

irqpoll,

reset_devices,

The last three parameters are special for kdump and should always be included, if you don’t have a good reason to exclude them.

If you only want to extend the kernel command line with your own parameter(s), use KDUMP_COMMANDLINE_APPEND.

Default is "".

KDUMP_COMMANDLINE_APPEND

This variable describes all command line parameters that are passed to the kdump kernel additionally to the default parameters.

For network based dumping, you may have to add a net_delay parameter to specify the extra delay in seconds that is needed for the network device to become fully operational, e.g. net_delay=20 will wait 20 seconds before continuing after the network device is configured. This parameter is used by the network setup code in the resulting initrd.

See also KDUMP_COMMANDLINE.

Default is "".

KDUMP_AUTO_RESIZE

Memory for the crash kernel is reserved at boot time. It is a large block that must be continuous in physical address space, and such allocations must be early because of memory fragmentation. However, the Linux kernel allows to shrink this reserved area later, and this is what kdump does before loading the panic kernel when this option is turned on.

The intention is that the crashkernel boot option is set to the maximum possible value (e.g. half of available RAM), which should be enough for the worst case. When the system boots, it checks the actual requirements and reduces the reservation accordingly.

Note that this option is ignored if the reservation is not done by the Linux kernel, i.e. under the Xen hypervisor, or when using FADUMP on IBM POWER.

Default is "false".

KEXEC_OPTIONS

Additional options for kexec(8).

Default is "".

MAKEDUMPFILE_OPTIONS

Additional options for makedumpfile(8). makedumpfile will be used to save the dump unless KDUMP_DUMPFORMAT is raw. You may want to set this to -X to exclude XEN DomU pages.

Default is "".

KDUMP_IMMEDIATE_REBOOT

Immediately reboot after saving the core in the kdump kernel? Use "true" or "false".

Default is "true".

KDUMP_TRANSFER

A script or command executed to process and transfer the dump image. It can read the dump image either via /proc/vmcore or /dev/oldmem. Most other variables will have no effect if you use a custom command here.

It’s important that all requirements including that script itself are included in KDUMP_REQUIRED_PROGRAMS.

It’s strongly recommended that the default mechanism is used, it should provide everything that is needed, together with KDUMP_PRESCRIPT and KDUMP_POSTSCRIPT. We can’t support problems with using that variable.

KDUMP_PRESCRIPT and KDUMP_POSTSCRIPT are not executed if KDUMP_TRANSFER is set.

Default: "".

KDUMP_SAVEDIR

The directory where dumps are saved to - either an absolute path or a URL. The URL and must conform to the syntax described in the section "URL FORMAT" below. If the directory does not exist, it will be created, except on NFS and CIFS mounts.

Below that directory, for each dump a directory with a time stamp in the following format will be created: "YYYY-MM-DD-HH-MM". That directory contains the vmcore dump, the dmesg and a README.txt file.

Bind mounts are not supported.

Default: "/var/crash".

KDUMP_KEEP_OLD_DUMPS

Number of old dumps to keep. This variable is only honored on local directories (i.e., if KDUMP_SAVEDIR is a directory or starts with file) because we think it’s bad from a security point of view if other hosts delete stuff (that may be from another hosts) on a dump server. The deletion process takes place before the dumps are saved. So if you specify 3 here, then after the dump has been saved, 4 dumps are on disk.

Set that variable to "0" to disable the deletion of dumps entirely, and set that variable to "-1" to delete all dumps, i.e. then only the just saved dump is on disk.

Default: "0"

KDUMP_FREE_DISK_SIZE

Make sure that at least KDUMP_FREE_DISK_SIZE megabytes are free on the target partition after saving the dump file. Since the target dump file size may not be known (because of compression and/or filtering), kdump always attempts to save the dump, but checks remaining free space afterwards and deletes the dump directory again if remaining space is less than the value specified here.

This option applies only to local file systems, i.e. KDUMP_SAVEDIR must start with file.

Default: "64"

KDUMP_VERBOSE

Bit mask of several options that set the verbosity of the dump process. To apply several options, you have to add their value. The options are:

1

Print details when loading the dump kernel.

2

Progress is written to stdout while dumping.

4

(same as 1)

8

Debugging. The kdump-save script and most of the programs it runs (including makedumpfile) are run with debugging options. Generates lots of output. However, it’s very useful if something does not work.

Default: "0".

KDUMP_DUMPLEVEL

Determines the dump level. If KDUMP_DUMPLEVEL is non-zero, then makedumpfile(8) strips pages that may not be necessary for analysing. 0 means no stripping, and 31 is the maximum dump level, i.e. 0 produces the largest dump files and 31 the smallest.

The following table from makedumpfile(8) shows what each dump level means:

dump level zero page cache page cache private user data free page
0
1 X
2 X
3 X X
4 X X
5 X X X
6 X X
7 X X X
8 X
9 X X
10 X X
11 X X X
12 X X X
13 X X X X
14 X X X
15 X X X X
16 X
17 X X
18 X X
19 X X X
20 X X X
21 X X X X
22 X X X
23 X X X X
24 X X
25 X X X
26 X X X
27 X X X X
28 X X X X
29 X X X X X
30 X X X X
31 X X X X X

Default: "31"

KDUMP_DUMPFORMAT

This variable specifies the dump format.

none

Do not generate any dump file. This is useful if you only want the kernel log buffer, because it minimizes disk space requirements and also greatly reduces the time involved in waiting for the dump to complete.

ELF

ELF has the advantage that it’s a standard format and GDB can be used to analyse the dumps. The disadvantage is that the dump files are larger.

compressed

compressed is the kdump compressed format that produces small dumps, see makedumpfile(8). However, only crash(8) can analyse the dumps and makedumpfile must be installed (but you need it anyway if you set KDUMP_DUMPLEVEL to non-zero before).

lzo

lzo is similar to compressed, but it uses the LZO compression algorithm instead of gzip. This usually results in slightly bigger files, but it is much faster. You will need crash(8) version 6.0.7 or later to open the dump file.

snappy

snappy is similar to compressed, but it uses the Snappy compression algorithm. It is usually considerably faster and achieves approximately the same compression ratio. Snappy is optimized for 64-bit, little-endian architectures (e.g. x86_64).

zstd

zstd is again similar to compressed, but it uses the Zstandard compression algorithm. While slightly slower, it can produce smaller files than lzo or snapy.

raw

raw creates a verbatim copy of /proc/vmcore without any processing with makedumpfile. makedumpfile is still used to extract kernel log buffer.

Default: "compressed"

KDUMP_CONTINUE_ON_ERROR

If something goes wrong while saving the dump or deleting old dumps in initrd, kdump-save normally tries to execute the next action. However, it can be useful to open a shell at that point in time and fix or debug the problem. This happens when KDUMP_CONTINUE_ON_ERROR is set to "false".

Default: "true"

KDUMP_REQUIRED_PROGRAMS

This is a space-separated list of programs (full path) that are required by KDUMP_TRANSFER, KDUMP_PRESCRIPT or KDUMP_POSTSCRIPT. Dynamic libraries that are required by that programs don’t have to be included as they are resolved automatically. However, it’s necessary to include other runtime requirements because it’s not possible to resolve them automatically.

Default: ""

KDUMP_PRESCRIPT

Program or command that is executed before taking the dump. You have to include that program in KDUMP_REQUIRED_PROGRAMS.

Default: ""

KDUMP_POSTSCRIPT

Program or command that is executed after taking the dump and before the system is rebooted. You have to include that program in KDUMP_REQUIRED_PROGRAMS.

As a special case, if KDUMP_POSTSCRIPT contains /usr/lib/fence_kdump_send, this script is automatically added to the initrd, and network is configured by default.

Default: ""

KDUMP_NETCONFIG

Network configuration for kdump. Because the dump process runs in initrd, the network configuration is different from the normal network configuration. Use auto to auto-detect the network configuration (see auto mode below). The interface with the default route will be used. This is the default.

Network is configured only if needed, e.g. the dump target is on a remote machine, or an email notification should be sent. If network is needed by something else, such as a custom script used as KDUMP_PRESCRIPT or KDUMP_POSTSCRIPT, add a :force suffix to the network configuration, for example "auto:force" or "eth0:dhcp4:force".

Use a netdevice:mode string to force a specific network device to be used. A netdevice is for example "eth0". The mode can be:

static

Always re-use the current configuration of netdevice (both IPv4 and IPv6). Note that only permanent global IPv6 addresses are stored, because temporary addresses are likely to expire before the system crashes, and link-local addresses are set up automatically.

auto6

Use IPv6 autoconfiguration to get an address on the interface.

dhcp, dhcp4

Use DHCP to configure an IPv4 address on the interface.

dhcp6

Use DHCP6 to configure an IPv6 address on the interface.

auto

Select the mode depending on the current state of the interface:

•use DHCP4 if it has an IPv4 address (IPv6 not set up),

•use DHCP6 if it has a permanent IPv6 address (IPv4 not set up),

•use IPv6 auto-configuration if it has neither (IPv4 not set up).

Auto-detection cannot be used to set up dual-stack (IPv4 and IPv6) hosts because of limitations in the implementation of the ip= initrd command line option.

Note: If an ip= option is found in KDUMP_COMMANDLINE or KDUMP_COMMANDLINE_APPEND, kdump does not add any other ip= or ifname= options. In other words, the value of KDUMP_NETCONFIG is effectively ignored.

Setting KDUMP_NETCONFIG to "" disables network completely. In this case, kdump does not even add the network dracut module to the initrd.

Default: "auto"

KDUMP_NET_TIMEOUT

Number of seconds to wait for the target machine to respond to ping. Setting to "0" disables this timeout. You may need to do this if the machine does not respond to ping and KDUMP_CONTINUE_ON_ERROR is set to "false" to avoid being dropped to a debug shell.

Default: "30"

KDUMP_SMTP_SERVER

If e-mail notifications are enabled using KDUMP_NOTIFICATION_TO, you can specify an SMTP server here. It’s valid to specify a hostname, an IP address. Optionally, you can also specify a port with the usual :port syntax.

Passed to mailx using its "smtp" option.

Example: smtp.myprovider.de:25

Default: ""

KDUMP_SMTP_USER

Username used for SMTP authentication. Only use together with KDUMP_SMTP_PASSWORD and KDUMP_SMTP_SERVER.

If you provide a username and a password, then SMTP AUTH and STARTTLS will be used.

Passed to mailx using its "smtp-auth-user" option.

Default: ""

KDUMP_SMTP_PASSWORD

Password used for SMTP authentication. Only use together with KDUMP_SMTP_USER and KDUMP_SMTP_SERVER.

Passed to mailx using its "smtp-auth-password" option.

Default: ""

KDUMP_NOTIFICATION_TO

Email address where notification mails should be sent to. Notifications are sent via a kdump-notify systemd service during boot and only work when KDUMP_SAVEDIR points to a local directory.

The service scans for new dumps present in KDUMP_SAVEDIR and sends an e-mail notification using the mailx program, concatenating all README.txt files from newly found dumps.

You either need to configure mailx using /etc/mail.rc or specify KDUMP_SMTP_SERVER and optionally KDUMP_SMTP_USER and KDUMP_SMTP_PASSWORD. When KDUMP_SMTP_SERVER is specified the kdump-notify service will wait some time for the server to become reachable. Otherwise this is the responsibility of the local mailx / MTA configuration.

Example: john@myprovider.de

Default: ""

KDUMP_NOTIFICATION_CC

Space-separated list of email addresses where notification mails should be sent to via Cc. KDUMP_NOTIFICATION_TO needs to be configured (you can’t send notifications only to Cc: addresses without a To:).

Don’t specify real names here, only email addresses.

Example: "john@myprovider.de doe@myprovider.de"

Default: ""

KDUMP_HOST_KEY

Target host key and type encoded with base64, i.e. as found in ~/.ssh/known_hosts. This is used for the SFTP transfer protocol to verify the authenticity of the remote host. If this field is left empty, the setup scripts will try to get it automatically using ssh-keygen -F $target_host.

If you want to disable host key checking, set this variable to "*".

Example (broken into lines for readability):

ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAxIJIeuVX0F0u53wMgH22fdl62ifLXRwaPAXPsCr
vyerMEb5DXHnIv1sYdzlJ1g/2Iw+ppjGDh1En/P12Dpl2uLBZh0MOrM71spTjvTwV2M
KZtXrYjZUIPIZdd9vrI+/LEI0nw7LSdnKKgkAIXMhaRrq9N6uoZWe41ilU4NpnL/k=

Default: ""

KDUMP_SSH_IDENTITY

List of SSH identity files for public key authentication. If empty, kdump will copy all standard OpenSSH identities for the root user (rsa, dsa, ecdsa, ed25519). The path to every identity file is relative to ~root/.ssh, or an absolute path can be given.

Example: "/root/.ssh/id_kdump_rsa"

Default: ""

URL FORMAT

In general, the URL format is

protocol://specification

where protocol is one of:

file,

ftp,

sftp (alias is scp),

ssh

nfs

cifs (alias is smb).

The specification varies for each protocol.

Local files (file)

This type describes a local path.

Format: [file://]/path

As shown, the file:// prefix is optional, i.e. a simple path is still valid. The path must start with a leading slash (/), i.e. only absolute paths are allowed.

Examples:

•/var/crash

•file:///var/crash

File Transfer Protocol (ftp)

This URL type is used to specify paths on a remote FTP server.

Format: ftp://[user[:password]@]hostname[:port]/path

The remote user is optional, if no user is specified, anonymous FTP is assumed. Even if a username is specified, the password is optional, if no password is specified, an empty password is used. When the username is "anonymous", then "$USER@$HOSTNAME" is used as password because some FTP servers deny anonymous FTP with empty passwords.

hostname can be either a (DNS-)resolvable hostname, with or without a domain name, or an IP address in dotted decimal format. port can be used to specify the remote port, if no port is specified in the URL, the default FTP port is used. Finally, path must conform to the same rules as for local files (see above).

Examples:

•ftp://neptunium/var/crash

•ftp://bwalle@neptunium.suse.de/var/crash

•ftp://bwalle:dontsay@strauss.suse.de:123/var/crash

•ftp://192.168.0.70/var/crash

Secure File Transfer Protocol (sftp)

This URL type is used to specify paths on a remote server that is reachable via SFTP. It’s important that an SFTP server must be running (which is the default on SUSE).

Format: sftp://\[user[:password]@]hostname[:port]/path

It’s possible to use "scp" as an alias for "sftp" (for backward compatibility), but it is a misnomer; kdump does not implement the SCP protocol and it will use SFTP instead.

See the description of FTP for an explanation of the hostname and port elements.

Server Identification

Since system dumps may contain sensitive information, kdump uses strict host key checking for the target server by default. The SSH client must have a copy of the public part of the target server’s host key. The copy is kept in a known_hosts file on the client. Kdump will use the key found in ~root/.ssh/known_hosts when the kdump initrd is generated. KDUMP_SSH_IDENTITY may be used to either disable host key checking (not recommended) or specify an alternative host key.

Client Authentication

The crashed system uses root’s private SSH key to login to the target system by default. The public part of that key must be copied to the target user’s ~/.ssh/authorized_keys on the target host. This should be preferred to setting the password in the URL.

Example Setup

To set up crasher for saving dumps over SFTP to dump@collector, follow these steps:

1.Add the target host public key to ~root/.ssh/known_hosts on crasher, e.g.:

root@crasher:~# ssh-keyscan -t rsa,ecdsa,ed25519 collector \

>> ~/.ssh/known_hosts

WARNING: Note that the above command accepts the identity of collector without any checking that it is genuine. This is a security risk unless the network connection between crasher and collector can be fully trusted when you run this command.

2.Generate a private/public key pair for the root user on crasher, e.g. to make a 4096-bit RSA key, run this as root:

root@crasher:~# ssh-keygen -t rsa -b 4096 -N "" -f ~/.ssh/id_rsa

Do not use any password to encrypt the key - kdump is designed to be used non-interactively.

3.Append the content of ~.ssh/id_rsa.pub to ~dump/.ssh/authorized_keys on collector:

root@crasher:~# ssh-copy-id dump@collector

Examples:

•sftp://dump@collector:22/var/crash

•sftp://neptunium/var/crash

Secure Shell Protocol (ssh)

Unlike the sftp URL type, this protocol does not use SFTP, but rather transfers the data to a remote cat command.

Format: ssh://[user@]hostname[:port]/path

Most of the notes for SFTP also apply to SSH, except:

•SFTP need not be configured on the target host.

•Shell access must be granted to the dump user.

•The shell must allow execution of mkdir and cat.

Examples:

•ssh://kdump@crashdump/srv/www/dump/incoming

Network File System (nfs)

NFS is used to specify remote hosts that export their file system via NFS. NFS doesn’t use username and password. Also, the URL format cannot be used to specify options. As default, the nolock option is used.

Format: nfs://host/path

host is the hostname. path specifies the path that is exported via NFS in /etc/exports (or a subdirectory of a path that is exported; the subdirectory must exist before the crash is triggered).

Examples:

•nfs://neptunium/var/crash

•nfs://10.10.2.120/var/crash

Common Internet File System (cifs)

CIFS is used to specify remote hosts that export a file system via CIFS, also known as SMB (although they are technically different, CIFS is the successor of SMB). This could be a Microsoft Windows server, or a Samba Server running on Unix or MacOS.

Format: cifs://[user[:password]@]host/path

Although it’s technically not 100 % correct, smb is used as an alias for cifs.

The parts of the URL are described in the FTP section above. path must exist before the crash is triggered.

Note: You have to use the slash as path separator, not the backslash as on Microsoft Windows.

Examples:

•cifs://neptunium/var/crash

•cifs://bwalle:dontsay@neptunium/var/crash

•smb://bwalle@192.168.0.70/var/log

BUGS

Please report bugs and enhancement requests at https://bugzilla.suse.com.

COPYING

Copyright (c) 2008 Bernhard Walle <bwalle@suse.de>. Free use of this software is granted under the terms of the GNU General Public License (GPL), version 2 or later.

SEE ALSO

kexec(8), kdump(5), makedumpfile(8), mkdumprd(8), The Kexec and Kdump chapter in the SUSE System Analysis and Tuning Guide

AUTHOR

Bernhard Walle <bwalle@suse.de>

Author.
01/18/2024 kdump 1.0.2