Creating a kernel dump on a live system

You can create non-disruptive kernel dumps on a running Linux® system with the zgetdump tool.

Before you begin

  • A Linux kernel image that was compiled with the common code kernel configuration option CONFIG_STRICT_DEVMEM=n.
  • 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.

Procedure

  1. Optional: Use the -i option to print information for the currently running Linux image:
    # zgetdump -i /dev/mem
    General dump info:
    	Dump format........: devmem
    	Dump method........: live
    	UTS node name......: mylnxsys
    	UTS kernel release.: 6.6.0
    	UTS kernel version.: #5 SMP Wed Oct 25 13:47:57 UTC 2023
    	System arch........: s390x (64 bit)
    	Dump memory range..: 512 MB
    
    Memory map:
    	0000000000000000 - 000000001fffffff (512 MB)
  2. Create a dump from a live system by specifying /dev/mem as input dump and redirecting the output to a dump file. Run the dump process with a high priority.
    # nice -n -20 zgetdump /dev/mem > dump.elf
  3. 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.: 6.6.0
    	UTS kernel version.: #5 SMP Wed Oct 25 13:47:57 UTC 2023
    	System arch........: s390x (64 bit)
    	Dump memory range..: 512 MB
    
    Memory map:
    	0000000000000000 - 000000001fffffff (512 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/mem > dump.elf
Format Info:
Source: devmem
Target: elf
Copying dump:
00000000 / 00000512 MB
00000110 / 00000512 MB
...
00000512 / 00000512 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.