ZFS question

Jeremy Chadwick jdc at koitsu.org
Thu Mar 21 06:06:40 UTC 2013

On Wed, Mar 20, 2013 at 10:10:20PM -0700, Reed A. Cartwright wrote:
> {snipped stuff about CAM and mps and ZFS deadman}
> Jeremy, I have a question about enabling kernel dumps based on my
> current swap config.
> I currently have a 1TB drive split into 4 geli encrypted swap
> partitions (Freebsd doesn't like swap partitions over ~250 GB and I
> have lots of RAM).
> These partitions are UFS-swap partitions and are
> not backed by any mirroing or ZFSing.
> So, how do I best enable crash dumps?  If I need to remove encryption,
> I can do that.

I have zero familiarity with geli(8), gbde(8), and file-based swap.

My gut feeling is that you cannot use this to achieve a proper kernel
panic dump, but I have not tried it.

You can force a kernel panic via "sysctl debug.kdb.panic=1".  I'm not
sure if an automatic memory dump to swap happens with the stock GENERIC
kernel however.  I can talk more about that if needed (it involves
adding some options to your kernel config, and one rc.conf variable).

Regarding "enabling crash dumps" as a general concept:

In rc.conf you need to have dumpdev="auto" (or point it to a specific
disk slice, but auto works just fine assuming you have a "swap" or
"dump" device defines in /etc/fstab -- see savecore(8) man page).  Full
details are in rc.conf(5).  How this works:

After a system reboots, during rc script startup, rc.d/savecore runs
savecore which examines the configured dumpdev for headers + tries to
detect if there was previously a kernel panic.  If it finds one, it
begins pulling the data out of swap and writing the results directly to
/var/crash in a series of files (again, see savecore(8)).  It does this
***before*** swapon(8) is run (reason why should be obvious) via
rc.d/swapon.  After it finishes, swapon is run (meaning anything
previously written to the swap slice is effectively lost), and the
system continues through the rest of the rc scripts.

Purely for educational purposes: to examine system rc script order, see
rcorder(8) or run "rcorder /etc/rc.d/*".

| Jeremy Chadwick                                   jdc at koitsu.org |
| UNIX Systems Administrator                http://jdc.koitsu.org/ |
| Mountain View, CA, US                                            |
| Making life hard for others since 1977.             PGP 4BD6C0CB |

More information about the freebsd-questions mailing list