Scrolling up the failed screen with kernel panic

2

From time to time, Linux booting failed on very early stage (like initrd loading). Then, the kernel panic message is showing up in text mode. Since the screen height limit, all I can see is around 40 lines of text-based kernel panic message. For diagnosing the panic reason, I would like to see the above message (like scrolling up the messages) but I don't know how to do this. Is there any good trick for this?

jaeyong

Posted 2014-12-04T10:03:05.317

Reputation: 227

Answers

0

Serial port

The serial port is an old and reliable communication protocol hardware that the Linux kernel supports and most emulators emulate.

You can stream the kernel messages to a host file or console through it:

Serial alternatives

There are even fancier methods mentioned at: Determining cause of Linux kernel panic | Unix & Linux Stack Exchange

  • netdump: sends trace over network.

    Supposes panic didn't break networking, which is more likely than the serial.

    The advantages over serial are:

    • works for systems that don't have serial exposed such as modern laptops

    • serial cables have quite limited maximum wire lengths, which is problematic if you want to have all the boards of your company on a remote room to share resources across developers.

      There are however serial connectors with an Ethernet server which I would recommend instead if your target exposes serial, e.g. this one:

  • kdump: boots a secondary Linux kernel that inspects the panicked kernel. What could possibly go wrong?

Those methods are more flexible, but less reliable.

See also: https://unix.stackexchange.com/questions/208260/how-to-scroll-up-after-a-kernel-panic/364966#364966

Ciro Santilli 新疆改造中心法轮功六四事件

Posted 2014-12-04T10:03:05.317

Reputation: 5 621

0

You should try using kexec kernel feature. Kexec is a feature of a secondary kernel that is stored in the RAM, especially for this kind of cases (not only), where you want to investigate the dump of another Kernel, in case of kernel panics for example. You should find quite enough info about that in google, as it can be used for different purposes. Basically you will only need to enable Kexec in the kernel config file, then add CRASHKERNEL=XXXM into your kernel arguments (passed by the bootloader). Then edit some config files, and continue with experiencing and googling till you get it working....

Good Luck :D

MoonDrop legacy

Posted 2014-12-04T10:03:05.317

Reputation: 21

2You should have written more about the "edit some config files" thing... – peterh - Reinstate Monica – 2016-06-17T14:45:12.533

-2

You should be able to scroll up and down using Shift+PageUp and Shift+PageUp.

mtak

Posted 2014-12-04T10:03:05.317

Reputation: 11 805

1After kernel panic it is impossible. – peterh - Reinstate Monica – 2016-06-17T14:43:19.103

@peterhsaysreinstateMonica Is this still true? – inf3rno – 2019-12-19T18:19:56.913

@inf3rno Last time it had the "luck" to test it around a month ago with an about 5.0.x kernel. I had an usb keyboard, possible but unlikely that it could work with a ps2 one. – peterh - Reinstate Monica – 2019-12-19T18:49:49.240

@peterhsaysreinstateMonica Ohh, so you cannot do it, because the keyboard does not work at all. That explains things. – inf3rno – 2019-12-19T19:37:02.480

@inf3rno Afaik panic blocks all interrupts and puts the CPU in HLT. – peterh - Reinstate Monica – 2019-12-19T20:22:45.143