How to scroll up after a kernel panic?

11,094

Solution 1

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: Scrolling up the failed screen with kernel panic | Super User

Solution 2

What hypervisor are you working with?

Shift + Pg Up is correct for almost all situations but might not work if the virtual machine hangs or does not boot up completely.

In case of a Mac: "Shift+Fn D-pad UP or DOWN on a Macbook will allow you to scroll". This is from How do you scroll up/down on linux server (terminal)? | Stack Overflow

Share:
11,094

Related videos on Youtube

Minix
Author by

Minix

Coming from Germany, identifiable by my love, of, commas.

Updated on September 18, 2022

Comments

  • Minix
    Minix almost 2 years

    While tinkering with a Linux VM I regularly get kernel panics, that push up all the helpful output with stuff I don't understand and that is probably not helpful to me.

    The panics mostly occur during the initramfs phase. I'm using VirtualBox.

    The normal Shift+Pg Up does not work (in my case).

    Is there another way to scroll back up and look at the output of whatever came before?

    • Ben Creasy
      Ben Creasy over 5 years
      Another helpful way to get access to helpful info: you can pass the "break=something kernel parameter (where valid arguments for something are: top, modules, premount, mount, mountroot, bottom, init)" - wiki.debian.org/InitramfsDebug
  • Minix
    Minix about 9 years
    I updated the question. Didn't think it would matter, but maybe it does.
  • telcoM
    telcoM over 5 years
    That is simply a dumb connector adapter that converts a DB-9 serial port to a RJ-45 form factor, or vice versa. It does not allow you to pass serial traffic in an Ethernet network, but allows you to e.g. repurpose an existing network cable for serial port use. Some network switches and the like may also have a serial port in RJ-45 form simply because a smaller connector is easier to fit in the faceplate of an 1U rack device.
  • Ciro Santilli Путлер Капут 六四事
    Ciro Santilli Путлер Капут 六四事 over 5 years
    @telcoM OK, let me know if you have a link to a product that does it. What I mean is an IP server that converts to serial.
  • telcoM
    telcoM over 5 years
    You're thinking about serial device servers, also known as port servers or device servers. Many of those are designed for industrial automation purposes, and so might be needlessly rugged/expensive for hobbyist use. Here's the cheapest one I could find quickly.
  • NH.
    NH. over 5 years
    Any cable manufacturer which uses blue for a serial cable is just confusing people. Blue is for VGA (which has a very similar form factor).