Hello, I am currently using FreeBSD 14.0-CURRENT and I found a bug that triggers a kernel panic. I wanted to make a kernel crash dump to further investigate the issue, but after a few tries I still did not manage to do it.
I started by following the instructions in the FreeBSD Handbook. I check that /dev/nvd0p2.eli is an active swap device and I configured it to be used as a dump device like this:
Then I booted into single user mode to extract the core dumb:
A you can see the core dump was not written to the device.
/dev/nvd0p2.eli is only 2gb in size and is an encrypted swap device, so I thought that:
1) Maybe the size of the device is to small even for a minidump.
2) /dev/nvd0p2.eli is only available after I enable it using
Because of those complications I decided to make use of an external 8gb USB drive as my dump device.
I have 8gb of RAM so an 8gb dump device should be big enough for a minidump (I guess?). I used
As you can see I still did not manage to get a kernel crash dump. Any ideas?
PS yes
I started by following the instructions in the FreeBSD Handbook. I check that /dev/nvd0p2.eli is an active swap device and I configured it to be used as a dump device like this:
Bash:
# dumpon -v /dev/nvd0p2.eli
# sysctl debug.kdb.panic=1
Bash:
# savecore -vC /dev/nvd0p2
checking for kernel dump on device /dev/nvd0p2
mediasize = 2147483648 bytes
sectorsize = 512 bytes
magic mismatch on last dump header on /dev/nvd0p2
No dump exists
/dev/nvd0p2.eli is only 2gb in size and is an encrypted swap device, so I thought that:
1) Maybe the size of the device is to small even for a minidump.
2) /dev/nvd0p2.eli is only available after I enable it using
swapon
, but the handbook states the I should first extract the dump, before I use the device as swap again.Because of those complications I decided to make use of an external 8gb USB drive as my dump device.
Bash:
# gpart create -s gpt /dev/da0
# gpart add -t freebsd-swap /dev/da0
# swapoff -a
# swapon /dev/da0p1
# dumpon -v /dev/da0p1
kernel dumps on priority: device
0: da0p1
sysctl debug.kdb.panic=1
to crash the kernel and rebooted the system. I also waited for 10 minutes to ensure the the kernel finishes writing the core dump to the device.
Bash:
# savecore -vC /dev/da0p1
checking for kernel dump on device /dev/da0p1
mediasize = 7744741376 bytes
sectorsize = 512 bytes
magic mismatch on last dump header on /dev/da0p1
No dump exists
PS yes
kern.coredump
is set to 1
.