Installing stock kernel on Kimsufi Centos 7

So, I’ve got a dedicated server with Kimsufi. It’s a great value for money, low end server but out of the box it comes with Kimsufi’s own kernel and I wanted the stock Centos 7 kernel.

All the instructions I found online didn’t seem to work with Centos 7 so here are the steps I took.

Warning : Fiddling with kernels is a damn good way of leaving yourself with an unbootable machine. If you’re not 100% confident in what you’re doing, don’t do it.

First, make sure you have the kernel RPM installed

yum install kernel

Now, check what version is installed. You’re looking for the files beginning vmlinuz and initram-fs with the highest version numbers

ls -la /boot

In my case this was

-rwxr-xr-x  1 root root  5157936 Oct 11 01:18 vmlinuz-3.10.0-327.36.2.el7.x86_64

-rw-------  1 root root 12103619 Oct 19 11:59 initramfs-3.10.0-327.36.2.el7.x86_64.img

Now, add the boot entry to your grub2 config

grubby --add-kernel=/boot/vmlinuz-3.10.0-327.36.2.el7.x86_64 --title="Centos Default" --args="ro net.ifnames=0 root=/dev/sda1" --initrd=/boot/initramfs-3.10.0-327.36.2.el7.x86_64.img --make-default

You’ll need to change the filenames as appropriate to the ones you found in the previous step

Check that you now have an entry labelled 0 which matches your new config

grubby --info=ALL

index=0
kernel=/boot/vmlinuz-3.10.0-327.36.2.el7.x86_64
args="ro net.ifnames=0 "
root=/dev/sda1
initrd=/boot/initramfs-3.10.0-327.36.2.el7.x86_64.img
title=Centos Default

index=1
kernel=/boot/bzImage-3.14.32-xxxx-grs-ipv6-64
args="ro net.ifnames=0"
root=/dev/sda1
title=GNU/Linux with OVH Kernel, OVH kernel 3.14.32-xxxx-grs-ipv6-64

index=2
non linux entry

Cross your fingers, pray to the deity of your choice and reboot

reboot

With a bit of luck your server will come back up in a minute or so and you can check the newly installed kernel is in use

uname -a

Linux xxx.xxx.eu 3.10.0-327.36.2.el7.x86_64 #1 SMP Mon Oct 10 23:08:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

If it all goes pear-shaped and your server won’t boot, log in to your Kimsufi control panel, click Netboot and change it to boot from the network. This should enable your server to boot by using a kernel image stored on Kimsufi’s servers. You can then log in and back out your changes with

grubby --remove-kernel=/boot/vmlinuz-3.10.0-327.36.2.el7.x86_64

UPDATE (January 2017) : I found that my kimsufi box died a death after I’d used yum to update the kernel. The only way I could resuscitate it was to return to the stock Kimsufi kernel. I also found that ipv6 only worked properly using the Kimsufi kernel.

photo credit: Alen Djuderija Photography Nuts in Bokeh via photopin (license)