DragonFly BSD

HowToCreateACoreDump

Getting a system core dump

A full system core dump (also called post-mortem dump) is sometimes needed to track down a bug in the DragonFlyBSD kernel.

Please note: A full core dump is obtained by triggering a kernel panic. Like when pulling the power plug from the wall socket, unsaved data will be lost, recently saved data might be lost, and filesystems mounted async might be destroyed.

Requirements

Setup

Setting up the dump device

Setting up /var/crash

If /var/crash is residing on a filesystem without enough room to accommodate the core dump, you can move it to a different filesystem and use a symbolic link.

# cpdup /var/crash /home/var.crash
# rm -rf /var/crash
# ln -s /home/var.crash /var/crash

Disabling sync on panic

Add this to /etc/sysctl.conf

kern.sync_on_panic=0

Getting a core dump

Hit <ctrl-alt-esc> at the desired moment. This will break into the kernel debugger. Then type:

# panic

The machine should reboot automatically. Sometimes it might require a cold reset.

If the machine has dropped to a dbb> prompt by itself you can type the following to get a useful dump:

# call dumpsys

During the following startup the core dump will be automatically saved to /var/crash.

Getting a coredump on a remote machine

Set debug.debugger_on_panic to 0 or configure your kernel with options DDB_UNATTENDED.

Useful hints