Solved

Need to roll back kernel via script

Posted on 2016-09-20
4
43 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
  • 2
  • 2
4 Comments
 
LVL 76

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 76

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now