问题
I am having troubles with a Linux kernel panic which I need to investigate further. When it happens, the kernel panic output always goes to the display adapter only and is shown on the monitor. I need to have the kernel panic output to a serial USB console, not only on the display adapter. In the situation where the panic happens there is no monitor available.
I have a serial USB console working, can log in from there and I also see some kernel messages there sometimes. However when I provoke a kernel panic with echo c > /proc/sysrq-trigger
the kernel panic output is just on the display adapter visible, not on USB console.
I am using Debian 8 with kernel 4.14. ttyUSB0 is running with systemd.
Kernel cmdline contains ... console=tty0 console=ttyUSB0,9600n8
What I can do to get the kernel panic logged to USB serial port?
回答1:
I don't think that it is possible in Linux to dump any message after kernel panic on USB console. You may try to configure ethernet console but in this case I also doubt if it will dump anything during panic. If I'm not wrong you will be successful only with serial UART console.
回答2:
I guess you only need access to the kernel dump information somehow, without having a monitor attached. You can set up kdump to automatically save a kernel dump image to disk which you can then later have look at. Here's a tutorial on how to setup this on Debian: https://www.linuxjournal.com/content/oops-debugging-kernel-panics-0
来源:https://stackoverflow.com/questions/50281034/how-to-get-a-linux-panic-output-to-a-usb-serial-console-when-system-has-also-a-d