# [TrueNAS] Problems with getting a crash dump



## Krautmaster (Apr 15, 2022)

hi there, my truenas freebsd 13.1 based system seem to crash and im on to debug the same together with the freeBSD support. Any how im not able to grab a real good dump on my crashing system.
root@freenas[~]# uname -a

```
FreeBSD freenas.local 13.1-BETA3 FreeBSD 13.1-BETA3 truenas/13-stable-4832c07ef TRUENAS amd64
```
What I tried so far:

-> Attached a 50GB blank disk to dump on
-> I run "dumpon /dev/da2" after boot to set it as dump device

After crash I get this:


```
root@freenas[~]# savecore -vC /dev/da2
checking for kernel dump on device /dev/da2
mediasize = 53687091200 bytes
sectorsize = 512 bytes
magic mismatch on last dump header on /dev/da2
No dump exists
```


```
root@freenas[~]# savecore -vC /dev/da15p1
checking for kernel dump on device /dev/da15p1
mediasize = 2147483648 bytes
sectorsize = 512 bytes
textdump magic on last dump header on /dev/da15p1
```

if I try to save the dump

```
root@freenas[~]# savecore -fkvz -m 1 /mnt/Path /dev/da15p1
checking for kernel dump on device /dev/da15p1
mediasize = 2147483648 bytes
sectorsize = 512 bytes
textdump magic on last dump header on /dev/da15p1
Checking for available free space
bounds number: 1
Dump header from device: /dev/da15p1
  Architecture: amd64
  Architecture Version: 4
  Dump Length: 0
  Blocksize: 512
  Compression: none
  Dumptime: 2022-04-15 15:50:45 +0200
  Hostname: freenas.local
  Magic: FreeBSD Text Dump
  Version String: FreeBSD 13.1-BETA3 truenas/13-stable-4832c07ef TRUENAS
  Panic String: Bad link elm 0xfffff804c0d8a000 next->prev != elm
  Dump Parity: 1041631048
  Bounds: 0
  Dump Status: bad

dump saved
```

but its empty.

Any ideas?

Thanks!

Edit: for reference PR 262894


----------



## Crivens (Apr 16, 2022)

If memory serves me right(corrections welcome), the usb drivers are not able to create dumps from a kernel. Please try with a disk directly connected to a host port.


----------



## Krautmaster (Apr 16, 2022)

It's a virtual machine on a hyper V host with a HBA passed though. No USB devices. The new disk for the dump was created regular as a hyper v disk and directly attached to the VM. I can also try dumping to a 8TB Samsung disk which is unused and connected on the HBA as well.

Edit:
I tired it with the 8Tb disk and forced to crash with "sysctl debug.kdb.panic=1"

View attachment 13636

If i set debug.debugger_on_panic=0 its a bit different as it seems

View attachment 13637

even so the saving was done almost instantly (would have thought it may have 32Gb as memory size) it says it was successfully saved


```
root@freenas[~]# savecore -fkvz -m 1 /mnt/path /dev/da2
checking for kernel dump on device /dev/da2
mediasize = 53687091200 bytes
sectorsize = 512 bytes
textdump magic on last dump header on /dev/da2
Checking for available free space
bounds number: 1
Dump header from device: /dev/da2
  Architecture: amd64
  Architecture Version: 4
  Dump Length: 531968
  Blocksize: 512
  Compression: none
  Dumptime: 2022-04-16 10:23:48 +0200
  Hostname: freenas.local
  Magic: FreeBSD Text Dump
  Version String: FreeBSD 13.1-BETA3 truenas/13-stable-4832c07ef TRUENAS
  Panic String: kdb_sysctl_panic
  Dump Parity: 2134722883
  Bounds: 0
  Dump Status: good
531968
dump saved
root@freenas[~]#
```

but it still seems to be only a textdump, no real memory dump


----------



## grahamperrin@ (Apr 16, 2022)

Crivens said:


> If memory serves me right (corrections welcome), …



I suspect that USB storage _can_ be valid for dumpon(8).



T-Daemon said:


> … e.g. USB device, and point the storage location for the dump in /etc/rc.conf with `dumpdir=` .



– that, and comparable suggestions elsewhere (maybe in Reddit).

I'm almost certain that USB is OK for savecore(8).


----------



## Krautmaster (Apr 17, 2022)

so in detail, no matter if usb or not (its not), what will I have to push to console "set variables after boot" to grab a full dump in the next crash? thx


----------

