Solved

Need to roll back kernel via script

Posted on 2016-09-20
4
106 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 78

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 78

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Apache module 5 87
Post Clonezilla image restore issue 6 89
WMIC Output Formatting 1 84
CentOS Backup Options 3 66
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

734 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