how to stop Linux from rebooting after a panic while booting

5,989

Solution 1

Use panic=0 kernel parameter in grub.

Solution 2

The kernel can control it. However the kernel normally defaults to not reboot. Either

  1. you are passing some panic= option already
  2. or the kernel is built with CONFIG_PANIC_TIMEOUT not equal to zero (see /boot/config-*)
  3. or this reboot is not by the generic kernel panic code
  4. (or if it is, it is an unintended bug. I would expect this to be hardware-specific.)

The kernel options have been mentioned in answers here: How to configure the Linux kernel to reboot on panic?

The GRUB boot code loses active control as soon as it transfers control to Linux. There are no calls going the other way around. On reboot, Linux effectively transfers control to the firmware (BIOS / EFI / whatever).

It turns out that I can not read at the speed of light

Indeed. If you cannot use a serial console, you might try e.g. boot_delay=200 to delay each kernel log line by 200ms, to give you time to read, photograph, and/or video the messages.

Share:
5,989

Related videos on Youtube

Ron
Author by

Ron

Updated on September 18, 2022

Comments

  • Ron
    Ron almost 2 years

    While trying to load the latest CentOS 7 (kernel 3.10.0-862), the system panics during the boot. It prints out what I hope is useful information then clears the screen and reboots. It turns out that I can not read at the speed of light and thus can not copy down any of the gems of knowledge that are spewing out.

    1) Who is in control of this - grub2 or the kernel?

    2) How do I make it leave the info on the screen long enough to read it?

    I can boot an older version of CentOS 7 (kernel version 3.10.0-327) so I can play with grub2 and perhaps set some kernel parameters that will be used by all versions.

    • meuh
      meuh almost 6 years
      It may not be of use in your setup, but you can also configure the kernel to broadcast console messages over the network (to a listening netcat). see netconsole