Generating Kernel Crashdump

  1. add lines like the following in rc.conf:
    dumpdev="/dev/amrd0s1b"
    dumpdir="/storage1/crashdumps"

    dumpdev is your swap partition, which must be larger than your RAM, dumpdir is where the crash dumps will be saved, also needs to be larger than RAM

  2. add these lines to sysctl.conf:

    debug.debugger_on_panic=0
    debug.trace_on_panic=1
    These will cause the panic message and backtrace to be automatically recorded in the message buffer saved to the kernel crash dump. If not told otherwise, the machine will then reboot and at the next boot generate a crash dump in your dumpdir. When you get the kernel crash

    dump, run kgdb vmcore.0 /boot/kernel/kernel as root and then you can inspect the trace, core dump, etc. You don't need any special knowledge of (k)gdb for this. The one useful command to you may be bt - generate a backtrace.

FreeBSD (last edited 2009-08-24 13:01:57 by dz)