You can create non-disruptive kernel dumps on a running
Linux system with the zgetdump tool.
Before you begin
- The dump directory needs enough free space (memory size + 10 MB)
to hold the system memory.
- Ensure that during the dump process no memory hotplug or CPU hotplug
is performed.
- If applicable, stop the cpuplugd service by issuing the command:
# service cpuplugd stop
- Load the crash kernel module by issuing the
command:
# modprobe crash
Procedure
- Optional: Use the -i option
to print information for the currently running Linux image:
# zgetdump -i /dev/crash
General dump info:
Dump format........: devmem
Dump method........: live
UTS node name......: mylnxsys
UTS kernel release.: 3.12.25-2-default
UTS kernel version.: #1 SMP Mon Jul 28 12:18:48 UTC 2014 (1b84426)
System arch........: s390x (64 bit)
Dump memory range..: 896 MB
Memory map:
0000000000000000 - 0000000037ffffff (896 MB)
- Create a dump from a live system by specifying /dev/crash as input dump and redirecting the
output to a dump file. Run the dump process with a high priority.
# nice -n -20 zgetdump /dev/crash > dump.elf
Optionally, you can also specify a target
dump format with the
-f option:
# zgetdump /dev/crash -f elf > dump.elf
- Optional: Print information for the live-system
dump.
Use the -i option to print information
for live-system dumps that are generated by zgetdump:
# zgetdump -i dump.elf
General dump info:
Dump format........: elf
Version............: 1
Dump method........: live
UTS node name......: mylnxsys
UTS kernel release.: 3.12.25-2-default
UTS kernel version.: #1 SMP Mon Jul 28 12:18:48 UTC 2014 (1b84426)
System arch........: s390x (64 bit)
Dump memory range..: 896 MB
Memory map:
0000000000000000 - 0000000037ffffff (896 MB)
The
value "live" in the Dump method field indicates
that this is a dump from a live system.
Example
# nice -n -20 zgetdump /dev/crash -f elf > dump.elf
Format Info:
Source: devmem
Target: elf
Copying dump:
00000000 / 00000896 MB
00000149 / 00000896 MB
...
00000747 / 00000896 MB
00000896 / 00000896 MB
Success: Dump has been copied
What to do next
After you create a dump from a live system, you can work
with crash, see Opening a live-system dump with the crash tool. After the live dump has been copied to a file system,
you can compress it with makedumpfile. Note that
the dump level must not be greater than 1 because of the dump inconsistencies.
For example:
# makedumpfile dump.elf -c -d 1 dump.kdump
Update example to newer kernel? 4.4?