Solved

Need to roll back kernel via script

Posted on 2016-09-20
4
118 Views
Last Modified: 2016-10-21
Hi all ,

Is there any way if our new kernel patch failed then I can roll back to previous via script on 100 servers as in this case we need to make sure that last good kernel need to be active no matter how many there are
0
Comment
Question by:The Rock
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 79

Expert Comment

by:arnold
ID: 41808004
You need to update grub.conf to use the prior kernel to boot.
Usually the default will be 0, change it to 1 provided you have not deleted the old kernel.
the other option provided you have two kernels, delete the newest one.

Since you have 100, presumably you have a RedHat based linux distro?
do you have grub-set-default
do you have grubby (command/tool) that can determine which bootloader you are using .....?

did you compile and push your own kernel? I.e. missing module/driver for a device?
0
 

Author Comment

by:The Rock
ID: 41817382
Thanks for your feedback but in our enviroment we are using almost all old and new version of rhel and centos like 4,5,6,7. So i need to build a script to work on all and grubby not work on all.

Cant we do one thing like before upgrade capture the old kernel and then after upgrade capture new kernel and then accordingly user can choose from which kernel they want to boot.
something like this?
0
 
LVL 79

Accepted Solution

by:
arnold earned 500 total points
ID: 41817801
Make sure your yum.conf update conf to make sure an update of kernel does not remove all old ones,  I think you can set a number of prior kernel versions that remain.
Perl scripting San change the number after
Default=0
To one or two, but you have to know which kernel you want set.
I.e. You gave kernel X.y-1
Since one need not reboot after an update unless the kernel has to be patched, there could be several updates be gore a reboot such that the current X.y-1 is no longer 1 it can be 2,3 or 4 depending  on how many prior kernels you keep.
0
 

Author Closing Comment

by:The Rock
ID: 41854802
Thanks Arnold .

Got the logic
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question