Thursday, November 30, 2006

 

Forcing a Solaris x86 kernel core dump

With a SPARC system, it's easy to force a kernel core dump: drop the system to the ok prompt and type 'sync'. Solaris x86 servers don't give you that, so you have to do something else.

The Solaris x86 FAQ suggests booting the server under kadb so that you can run this to get a core dump
$<systemdump
This information is a little bit outdated, as kadb has been replaced by kmdb, which is actually much nicer, 'cause you can load kmdb at run-time instead of having been lucky enough to have booted under kadb. But the above command will still force a dump of the system.

Of course, you could always do it with DTrace, too, if you like:
dtrace -w -n 'BEGIN{panic();}'

(The panic() function is provided as one of the destructive functions, which is why you need the -w flag.)

(And I was in full paranoid mode while testing this, first to make sure I was on the correct server when I tried it, but also while I had the command in my mouse buffer to copy it here. It's not something you want to accidentally paste into some random window.)


Comments:
Doh! And of course, there's always "halt -d".
 
Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?