Linux – How should I capture Linux kernel panic stack traces

kernel-paniclinuxtrace

What's current best practice to capture full kernel stack traces on a Linux system (RHEL 5.x, kernel 2.6.18) that occasionally panics in a device driver?

I'm used to the "old" SunOS way of doing things – crash dumps get written to swap, and on reboot the dump gets retrieved in the local file system. man 8 crash refers to diskdump, but that appears to be unsupported. and/or deprecated.

I've played with kdump, but it's unclear whether I can get a stack trace from that. Triggering a panic via Magic SysRq didn't create one. It also seems wasteful to reserve so much memory (128MB) just for a kexec crash recovery kernel.

Best Answer

If you are looking to log output in case of a kernel panic with Linux, kdump is the way to go. This is what Red Hat trains people to use and what I have known to be the standard approach.

Related Topic