How to use a partition for kernel dumps, but not swap?

Hi forums!

My setup is a FreeBSD 9.1-RELEASE with a ZFS mirror pool on fast disks and a UFS partition on a slow disk (2/5", 5400 RPM). I want to enable kernel dumps. I can't repartition the fast drives to make a dump partition there, because that would require moving too much data. I really should have thought of this before creating the pool :) But if I create the dump partition on the slow drive, it will also act as swap and slow down my system :(

Handbook says that I should call swapon before calling dumpon. But maybe it's possible to somehow prevent swapping on this device?
 
vadipp said:
But if I create the dump partition on the slow drive, it will also act as swap and slow down my system :(
Your system will only slow down if there is excessive swapping. When that happens you usually just need to add more memory to the system. Just having swap will not slow down the system. Modern operating systems will actually run better if there is some swap, even if it's not really needed.
 
Thanks @SirDice for the reply. I already have a swap ZVOL on my ZFS pool and I'm happy with that :) I would rather not add a new swap, if that's possible.
 
Last edited by a moderator:
@jem, your advice will help me make the slow disk the dump device, but as far as I understand, will not prevent it from being used as swap, which is the crucial part of my question. Am I wrong?
 
Last edited by a moderator:
Is there any possibility for you to repartition the slow drive and have separate partitions for swap and dump?
 
@fonz, yes, but why are you asking? I don't want to have swap on the slow drive, I only want to have a "dump device" there.
 
Last edited by a moderator:
vadipp said:
I don't want to have swap on the slow drive, I only want to have a "dump device" there.
In that case, see @jem's post #4. The dump device doesn't necessarily have to be a swap partition. So either follow @jem's suggestion or create a partition on the slow disk, create a UFS filesystem on it and have it mounted under /var/crash.
 
Last edited by a moderator:
@fonz, thanks.

For history, I've now done the following:
  1. Created /var/crash directory with permissions drwxr-x--- root wheel.
  2. Created partition /dev/ada3s1a of size 8 GB (= size of my RAM) and type freebsd-swap on my slow disk.
  3. Added these lines dumpdev="/dev/ada3s1a" and dumpdir="/var/crash" to /etc/rc.conf.
  4. Executed dumpon /dev/ada3s1a to apply the change without reboot.

I'll see if it works after the next crash :)

Actually the kernel debugging handbook page confused me. It says:
The dumpon(8)() program must be called after the swap partition has been configured with swapon(8)().

But it turns out that it's not strictly true.
 
Last edited by a moderator:
Back
Top