![]() | Availability |
|---|---|
This feature is only available since SLES 11 (not openSUSE 11.1). It is not available on the zSeries (s390x) architecture. |
With kdump the system is able to create crashdump files if the whole system (i.e., the kernel) crashes. Crash dump files contain the memory contents while the system crashed. Such core files can be analyzed later by support or a (kernel) developer to find the reason for the system crash. Kdump is mostly useful for servers where you cannot easily reproduce such crashes but it is important to get the problem fixed.
The only downside: enabling kdump costs you between 64 MiB and 128 MiB of system RAM (on "normal" sized systems), reserved for kdump in case the system crashes and the dump needs to be generated.
This section only describes how to set up kdump with AutoYaST. It does not describe how kdump works. For details, refer to the kdump(7) manual page, contained in the kdump package, or to openSUSE Kdump documentation.
The following example shows a general kdump configuration.
Example 4.36. Kdump configuration
<kdump>
<!-- memory reservation -->
<add_crash_kernel config:type="boolean">true</add_crash_kernel>
<crash_kernel>256M-:64M</crash_kernel>
<general>
<!-- dump target settings -->
<KDUMP_SAVEDIR>ftp://stravinsky.suse.de/incoming/dumps</KDUMP_SAVEDIR>
<KDUMP_COPY_KERNEL>true</KDUMP_COPY_KERNEL>
<KDUMP_FREE_DISK_SIZE>64</KDUMP_FREE_DISK_SIZE>
<KDUMP_KEEP_OLD_DUMPS>5</KDUMP_KEEP_OLD_DUMPS>
<!-- filtering and compression -->
<KDUMP_DUMPFORMAT>compressed</KDUMP_DUMPFORMAT>
<KDUMP_DUMPLEVEL>1</KDUMP_DUMPLEVEL>
<!-- notification -->
<KDUMP_NOTIFICATION_TO>bwalle@suse.de</KDUMP_NOTIFICATION_TO>
<KDUMP_NOTIFICATION_CC></KDUMP_NOTIFICATION_CC>
<KDUMP_SMTP_SERVER>mail.suse.de</KDUMP_SMTP_SERVER>
<KDUMP_SMTP_USER></KDUMP_SMTP_USER>
<KDUMP_SMTP_PASSWORD></KDUMP_SMTP_PASSWORD>
<!-- kdump kernel -->
<KDUMP_KERNELVER></KDUMP_KERNELVER>
<KDUMP_COMMANDLINE></KDUMP_COMMANDLINE>
<KDUMP_COMMANDLINE_APPEND></KDUMP_COMMANDLINE_APPEND>
<!-- expert settings -->
<KDUMP_IMMEDIATE_REBOOT>yes</KDUMP_IMMEDIATE_REBOOT>
<KDUMP_VERBOSE>15</KDUMP_VERBOSE>
<KEXEC_OPTIONS></KEXEC_OPTIONS>
</general>
</kdump>
The first step is to reserve memory for kdump at boot-up. Because the
memory must be reserved very early during the boot process, the
configuration is done via a kernel command line parameter called
crashkernel. The reserved memory will be used to
load a second kernel which will be executed without rebooting if the
first kernel crashes. This second kernel has a special initrd, which
contains all programs necessary to save the dump over the network or
to disk, send a notification e-mail, and finally reboot.
Enable or disable that the crashkernel
parameter is written for the default boot kernel with the
add_crash_kernel tag. You can specify the value
of the crashkernel parameter using the
crash_kernel tag.
To reserve memory for kdump, specify the amount
(such as 64M to reserve 64 MiB of memory from
the RAM) and the offset. The syntax is
crashkernel=AMOUNT@OFFSET. The kernel can auto-detect the
right offset (with the exception of the Xen hypervisor, where you have to
specify 16M as offset).
Simply specify <crash_kernel>crashkernel=64M</crash_kernel>
and the right thing will happen.
For the amount of memory, the following values are recommended:
Table 4.9. Recommended values for the reserved memory amount
|
Platform |
Recommended values |
|---|---|
|
i386 and x86-64 |
|
|
PPC64 |
|
|
IA64 |
|
You can also use the extended command line syntax to specify the amount of reserved memory depending on the System RAM. That is useful if you share one AutoYaST profile for multiple installations or if you often remove or install memory on one machine. The syntax is:
BEGIN_RANGE_1-END_RANGE_1:AMOUNT_1,BEGIN_RANGE_2-END_RANGE_2:AMOUNT_2@OFFSET
BEGIN_RANGE_1 is the start of the first
memory range (for example: 0M) and END_RANGE_1
is the end of the first memory range (can be empty in case "infinity" should
be assumed) and so on. For example
256M-2G:64M,2G-:128M means to reserve 64 MiB of crashkernel
memory if the system has between 256 MiB and 2 GiB RAM and to reserve
128 MiB of crashkernel memory if the system has more than 2 GiB RAM.
The following table shows the settings necessary to reserve memory:
Table 4.10. XML Representation of the Memory Reservation Settings
|
Element |
Description |
Comment |
|---|---|---|
|
add_crash_kernel |
Set to "true" if memory should be reserved and kdump enabled. <add_crash_kernel config:type="boolean">true</add_crash_kernel> |
required |
|
crash_kernel |
Use the syntax of the crashkernel command line as discussed above. <crash_kernel>256M:64M</crash_kernel> |
required |
The element KDUMP_SAVEDIR specifies the URL to
where the dump is saved. The following methods are possible:
file to save to the local disk,
ftp to save to an FTP server (without encryption),
sftp to save to an SSH2 SFTP server,
nfs to save to a NFS location and
cifs to save the dump to a CIFS/SMP export from Samba or Microsoft Windows.
For details see the kdump(5) manual page. Two examples are:
file:///var/crash (which is the default location
according to FHS) and ftp://user:password@host:port/incoming/dumps.
A subdirectory, with the time stamp contained in the name, will be created and the dumps saved there.
When the dump is saved to the local disk,
KDUMP_KEEP_OLD_DUMPS can be used to delete old
dumps automatically. Set it to the number of old dumps that should
be kept. If the target partition would end up with less free disk
space than specified in KDUMP_FREE_DISK_SIZE, the
dump is not saved.
If you want to save the whole kernel and the debug
information (if installed) to the same directory, set
KDUMP_COPY_KERNEL to true.
You'll have everything you need to analyze the dump in one directory
(except kernel modules and their debugging information).
The kernel dump is uncompressed and unfiltered. It can get as large as your system RAM. To get smaller files, compress the dump file afterwards. The dump has to be decompressed before opening.
To use page compression, which compresses every page and allows dynamic decompression
with the crash(8) debugging tool, set KDUMP_DUMPFORMAT to
compressed (default).
You may not want to save all memory pages, for example those filled
with zeroes. To filter the dump, set the
KDUMP_DUMPLEVEL. 0 produces a full dump and 31 is
the smallest dump. The manual pages kdump(5) and makedumpfile(8)
list for each value which pages will be saved.
Table 4.11. XML Representation of the Dump Target Settings
|
Element |
Description |
Comment |
|---|---|---|
|
KDUMP_SAVEDIR |
An URL that specifies the target to which the dump and related files will be saved. <KDUMP_SAVEDRIR >file:///var/crash/</KDUMP_SAVEDIR> |
required |
|
KDUMP_COPY_KERNEL |
Set to "true", if not only the dump should be saved to <KDUMP_COPY_KERNEL >false</KDUMP_COPY_KERNEL> |
optional |
|
KDUMP_FREE_DISK_SIZE |
Disk space in megabytes that must remain free after saving the dump. If not enough space is available to write the dump and keep the required disk space free, the dump will not be saved. <KDUMP_FREE_DISK_SIZE >64</KDUMP_FREE_DISK_SIZE> |
optional |
|
KDUMP_KEEP_OLD_DUMPS |
The number of dumps that are kept (i.e., not deleted) if <KDUMP_KEEP_OLD_DUMPS >4</KDUMP_KEEP_OLD_DUMPS> |
optional |
Configure email notification, if you want to be informed when a machine crashes and a dump is saved.
Because kdump runs in the initrd, a local mail server cannot send the notification email. An SMTP server needs to be specified (see below).
You have to provide exactly one address in
KDUMP_NOTIFICATION_TO. More addresses can be specified in
in KDUMP_NOTIFICATION_CC. Only
use email addresses in both cases, not a real name.
Specify KDUMP_SMTP_SERVER and
(if the server needs authentication) KDUMP_SMTP_USER and
KDUMP_SMTP_PASSWORD. Support for TSL or SSL is not available but may be added in the future.
Table 4.12. XML Representation of the Email Notification Settings
|
Element |
Description |
Comment |
|---|---|---|
|
KDUMP_NOTIFICATION_TO |
Exactly one email address to which the email
should be sent. Additional recipients can be specified in
<KDUMP_NOTIFICATION_TO >tux@example.com</KDUMP_NOTIFICATION_TO> |
optional (notification disabled if empty) |
|
KDUMP_NOTIFICATION_CC |
Zero, one or more recipients that are in the cc line of the notification email. <KDUMP_NOTIFICATION_CC >spam@suse.de devnull@suse.de</KDUMP_NOTIFICATION_CC> |
optional |
|
KDUMP_SMTP_SERVER |
Host name of the SMTP server used for mail delivery. SMTP authentication is supported (see <KDUMP_SMTP_SERVER >email.suse.de</KDUMP_SMTP_SERVER> |
optional (notification disabled if empty) |
|
KDUMP_SMTP_USER |
User name used together with <KDUMP_SMTP_USER >bwalle</KDUMP_SMTP_USER> |
optional |
|
KDUMP_SMTP_PASSWORD |
Password used together with <KDUMP_SMTP_PASSWORD >geheim</KDUMP_SMTP_PASSWORD> |
optional |
As already mentioned, a special kernel is booted to save the dump.
If you don't want to use the auto-detection mechanism to find out which kernel
is used (see the kdump(5) manual page that describes the algorithm which
is used to find the kernel), you can specify the version of a custom kernel
in KDUMP_KERNELVER. If you set it to
foo, then the kernel located in
/boot/vmlinuz-foo or /boot/vmlinux-foo
(in that order on platforms that have a vmlinuz file)
will be used.
You can specify the command line used to boot the kdump kernel.
Normally the boot command line is used minus some settings that make no sense with kdump (like the crashkernel parameter) plus
some settings needed by kdump (see the manual page kdump(5)).
If you just want some additional parameters like a overwritten console setting
then use KDUMP_COMMANDLINE_APPEND. If you know what you're doing
and you want to specify the whole command line, set KDUMP_COMMANDLINE.
Table 4.13. XML Representation of the Kernel Settings
|
Element |
Description |
Comment |
|---|---|---|
|
KDUMP_KERNELVER |
Version string for the kernel used for kdump. Leave it empty to use the auto-detection mechanism (strongly recommended). <KDUMP_KERNELVER >2.6.27-default</KDUMP_KERNELVER> |
optional (auto-detection if empty) |
|
KDUMP_COMMANDLINE_APPEND |
Additional command line parameters for the kdump kernel. <KDUMP_COMMANDLINE_APPEND >console=ttyS0,57600</KDUMP_COMMANDLINE_APPEND> |
optional |
|
KDUMP_COMMANDLINE |
Overwrite the automatically generated kdump command line. Use with care.
In most cases, <KDUMP_COMMANDLINE_APPEND >root=/dev/sda5 maxcpus=1 irqpoll</KDUMP_COMMANDLINE> |
optional |
Table 4.14. XML Representation of the Expert Settings
|
Element |
Description |
Comment |
|---|---|---|
|
KDUMP_IMMEDIATE_REBOOT |
<KDUMP_IMMEDIATE_REBOOT >true</KDUMP_IMMEDIATE_REBOOT> |
optional |
|
KDUMP_VERBOSE |
Bitmask that specifies how verbose the kdump process should be. Read kdump(5) for details. <KDUMP_VERBOSE>3</KDUMP_VERBOSE> |
optional |
|
KEXEC_OPTIONS |
Additional options that are passed to kexec when loading the kdump kernel. Normally empty. <KEXEC_OPTIONS>--noio</KEXEC_OPTIONS> |
optional |