# Remote Kernel Upgrade

## folderman

Hi All,

I have used Gentoo for around 6-7 years, mainly for my desktop. I am thinking to use Gentoo on my server farm. However, I have a quick question.

For other distribution, I can update the kernel easily by upgrade and reboot, usually, the server can reboot without problem.

But for Gentoo, as the kernel is compiled from source, there maybe chance for the server not bootable. Is there any way to minimize this problem? Of course, upgrading kernel should be done locally, just see whether there is a way to solve. Is kexec a solution?

Thanks a lot!

Rgds,

Kenneth

----------

## Jaglover

First hit in a search engine:

http://www.linuxscrew.com/2012/04/24/grub-fallback-boot-good-kernel-if-new-one-crashes/

----------

## Ant P.

If you control the hardware you could give them kernels via DHCP/PXE. If it fails to boot you just correct the error and remote reset.

----------

## s4e8

You should setup IPMI network to control servers remotely: power on/off/reset, and access boot/VGA console.

----------

## eccerr0r

The main difference between Gentoo and binary distributions is that usually those binaries are tested before you get it.  Tested on another machine.

The only way for you to get better confidence is to have a local machine that you can make an identical change with the exact same command sequence that you can execute remotely.  Then this will reduce the chance of a fsckup.

Note that you have to have an virtually identical setup - if your initial attempt at upgrading your local test machine failed, you have to revert it before trying again and not just try again...

The remote console/IPMI/Management engine solutions would be "last resort" as other distributions don't need it...why does Gentoo need it?  Gentoo doesn't have a hardcoded boot/kernel solution as there are too many choices.

And yes, I always screw up a remote upgrade (I upgrade other peoples' machines remotely).  Sigh... Very dangerous indeed.  Then again I end up doing these things blindly as there's no way for me to get an "identical setup" - mostly due to video and network hardware differences.

The thing that scares me the most: fscking up grub.conf or reinstalling grub.  I have to be very careful editing the config file and completely against reinstalling the bootloader.  Next is network driver fsckups (including possibly wifi)...  Very Dangerous Indeed!

----------

## folderman

Hi all,

Thanks for the reply.

I think I would try grub fallback. 

Kenneth

----------

## eccerr0r

Be careful with the grub fallback, if the kernel boots but not completely due to missing kernel drivers, you'll still end up with a dead machine that will require console access to "fix".  At least you can simply switch to the old kernel, as long as you can actually switch it.

Grub fallback is basically only good for file not found, corrupt kernel (wrong file?), or disk not found situations - versus missing drivers.

----------

## folderman

Hi eccerr0r,

I realize this potential problem too, but I think grub fallback is better than hardcoding to boot with single kernel. Of course, if grub can handle driver missing scenario would be great. but seems not logically possible.

Thanks!

Kenneth

----------

