Article ID: 120767, created on Mar 27, 2014, last review on Jun 17, 2016

  • Applies to:
  • Virtuozzo
  • Virtuozzo containers for Linux
  • Virtuozzo hypervisor

Question

I am rebooting the hardware node after updating the kernel.

How can I make sure the node reverts to the previous kernel in case the new one does not boot?

Answer

Parallels Virtuozzo containers

Instructions on keeping a PVC installation up-to-date can be found here.

In case --loader-autoconfig option is used, /etc/grub.conf will be automatically reconfigured to include the new kernel.

Parallels Cloud Server

Updating Parallels Cloud server (# yum update) will automatically modify /etc/grub.conf

In the both above mentioned cases, after updating the node to, for example, kernel version 2.6.32-042stab081.5, /etc/grub.conf will look like similar to this:

~# head -n25 /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You do not have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /, eg.
#          root (hd0,0)
#          kernel /boot/vmlinuz-version ro root=/dev/sda1
#          initrd /boot/initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title Parallels (2.6.32-042stab081.5)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.32-042stab081.5 ro root=UUID=ec4ed555-a0a2-413e-9c95-678543c465ce rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM debug
        initrd /boot/initramfs-2.6.32-042stab081.5.img
title Virtuozzo (2.6.32-042stab081.3)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.32-042stab081.3 ro root=UUID=ec4ed555-a0a2-413e-9c95-678543c465ce rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM debug
        initrd /boot/initrd-2.6.32-042stab081.3.img
title Virtuozzo (2.6.32-042stab057.1)
        root (hd0,0)
        kernel /boot/vmlinuz-2.6.32-042stab057.1 ro root=UUID=ec4ed555-a0a2-413e-9c95-678543c465ce rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM debug
        initrd /boot/initrd-2.6.32-042stab057.1.img

The new kernel is automatically configured to be the default one (numeration starts from the top of the list, and from 0).

To try a newly installed kernel once, the following should be done:

  1. check and correct if necessary what kernel is configured to boot by default - the default option in /etc/grub.conf should point to the currently loaded kernel;
  2. modify options for the newly installed kernek - add panic=15 to the corresponding kernel line:

    • before:

      kernel /boot/vmlinuz-2.6.32-042stab081.5 ro root=UUID=ec4ed555-a0a2-413e-9c95-678543c465ce rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM debug

    • after:

      kernel /boot/vmlinuz-2.6.32-042stab081.5 ro root=UUID=ec4ed555-a0a2-413e-9c95-678543c465ce rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM debug panic=15

  3. configure Grub to boot the new kernel once:

    ~# grub
    Probing devices to guess BIOS drives. This may take a long time.
        GNU GRUB  version 0.97  (640K lower / 3072K upper memory)
    
     [ Minimal BASH-like line editing is supported.  For the first word, TAB
       lists possible command completions.  Anywhere else TAB lists the possible
       completions of a device/filename.]
    grub> savedefault --default=0 --once
    savedefault --default=0 --once
    grub>
    

With thes modifications, in the unlikely case the new kernel crashes, the server will automatically try to boot the kernel next in the list.

Should the new kernel work properly, update the default value to point to this kernel in /etc/grub.conf.

Search Words

savedefault

Virtuozzo restart automatic

revert back to the previous kernel

a26b38f94253cdfbf1028d72cf3a498b 2897d76d56d2010f4e3a28f864d69223 d02f9caf3e11b191a38179103495106f e8e50b42231236b82df27684e7ec0beb 0dd5b9380c7d4884d77587f3eb0fa8ef

Email subscription for changes to this article
Save as PDF