Once, I was installing some kernel patches & something went wrong on a live server where we had hundreds of clients. Only one kernel was there in the system. So, the server was down for some time, and using a live CD, we got the system up & running & did the further repairing work.Now my question: Is it a good idea to have a 2 versions of the kernel, so that if the kernel is corrupted we can always reboot with another available kernel? Please let me know.Also, is it possible to have 2 versions of the same kernel? So that I can choose the another kernel when there is kernel corruption?Edited:My Server Details:2.6.32-431.el6.x86_64CentOS release 6.5 (Final)How can I have the same copy of this kernel, so that when my kernel corrupts, I can start the the backup kernel?
Is it good to have multiple version of Linux Kernel?
linux;centos;kernel
Both RedHat and Debian-based distribution keep several versions of Kernel when you install a new one using yum or apt-get by default. That is considered a good practice and is done exactly for the case you describe: if something goes wrong with the latest kernel you can always reboot and in GRUB choose to boot using one of the previous kernels.In RedHat distros you control number of the kernels to keep in /etc/yum.conf with installonly_limit setting. On my fresh CentOS 7 install it defaults to 5.Also if on RedHat you're installing new kernel from RPM package you should use rpm -ivh, not rpm -Uvh: the former will keep the older kernel in place while the later will replace it.Debian keeps old kernels but don't automatically removes them. If you need to free up your boot partition you have to remove old kernels manually (remember to leave at least one of the previous kerneles). To list all kernel-installing and kernel-headers packages use dpkg -l | egrep linux-(im|he).Answering your question -- Also, Is it possible to have a 2 version of the same kernel ? -- Yes, it is possible. I can't check it on CentOS 6.5 right now, but on CentOS 7 I was able to yield the desired result by just duplicating kernel-related files of /boot directory and rebuilding the grub menu:cd /boot# Duplicate kernel files; # 3.10.0-123.el7 is a substring in the name of the current kernells -1 | grep 3.10.0-123.el7 | { while read i; \    do cp $i $(echo $i | sed 's/el7/el7.backup/'); done; }# Backup the grub configuration, just in casecp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.backup# Rebuild grub configurationgrub2-mkconfig -o /boot/grub2/grub.cfg# At this point you can reboot and see that a new kernel is available # for you to choose in GRUB menu