gnu

Symptoms

After I’ve upgraded the Linux kernel on my Fedora 18 server, I’ve faced a kernel panic on the next reboot. After few investigations, I found out that the new kernel version is buggy 😢

Solution

In order to get your system back as it was is to change the grub 2 configuration to point to the previous kernel version. Here’s how I fixed it

First, list all menu entries from your Grub 2 configuration (as root)

# grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2

or

grub2-mkconfig | grep ^menuentry /boot/grub2/grub.cfg | cut -d "'" -f2

You should get something like this

Fedora
Fedora GNU/Linux, with tboot 1.7.0 and Linux 3.11.4-101.fc18.x86_64
Fedora GNU/Linux, with tboot 1.7.0 and Linux 3.10.14-100.fc18.x86_64
Fedora GNU/Linux, with tboot 1.7.0 and Linux 3.6.10-4.fc18.x86_64
Fedora, with Xen hypervisor
Fedora GNU/Linux, with Xen xen, Tboot 1.7.0 and Linux 3.11.4-101.fc18.x86_64
Fedora GNU/Linux, with Xen xen, Tboot 1.7.0 and Linux 3.10.14-100.fc18.x86_64
Fedora GNU/Linux, with Xen xen, Tboot 1.7.0 and Linux 3.6.10-4.fc18.x86_64
Fedora GNU/Linux, with Xen syms-4.2.3, Tboot 1.7.0 and Linux 3.11.4-101.fc18.x86_64
Fedora GNU/Linux, with Xen syms-4.2.3, Tboot 1.7.0 and Linux 3.10.14-100.fc18.x86_64
.....

Identify the entry for the previous kernel version (the working one) and set it to default boot entry

# grub2-set</pre>

Make a backup copy of your grub.cfg file

# cp -v /boot/grub2/grub.cfg /boot/grub2/grub.cfg.bak

Set the new default boot menu entry

# grub2-set-default

Then check the default option

# grub2-editenv list
saved_entry=Fedora GNU/Linux, with Xen xen, Tboot 1.7.0 and Linux 3.10.14-100.fc18.x86_64

In order to see what’s going on during the boot process, edit the /etc/sysconfig/grub file by removing rhgb and quiet on the line starting with

GRUB_CMDLINE_LINUX

Write your new Grub2 configuration

# grub2-mkconfig -o /boot/grub2/grub.cfg

Reboot and cross your fingers 😉

After successfull reboot, check if you boot with the right kernel (as root)

# xm dmesg | head

 \ \/ /___ _ __   | || |  |___ \  |___ /  |___ /  / _| ___/ |( _ ) 
  \  // _ \ '_ \  | || |_   __) |   |_ \ __ |_ \ | |_ / __| |/ _ \ 
  /  \  __/ | | | |__   _| / __/ _ ___) |__|__) ||  _| (__| | (_) |
 /_/\_\___|_| |_|    |_|(_)_____(_)____/  |____(_)_|  \___|_|\___/ 

(XEN) Xen version 4.2.3 (mockbuild@[unknown]) (gcc (GCC) 4.7.2 20121109 (Red Hat 4.7.2-8)) Wed Oct  2 20:20:12 UTC 2013
(XEN) Latest ChangeSet: unavailable
(XEN) Bootloader: GRUB 2.00
(XEN) Command line: placeholder