Like to have specific modules like SELinux in your Linode server ?
An easy option here is to install Linode custom kernel.
Often, wrong steps in the custom kernel install in Linode can mess up the server.
At Bobcares, we help customers to setup custom kernel in Linode servers as part of our Managed Cloud Services.
Today, we’ll see how our Support Engineers safely setup custom kernel in Linode and fix common errors with it.
Why go for custom kernels?
Before proceeding further, let’s have a look at the typical uses of having custom kernel in your Linode server. Linode owners usually enable custom kernel when they need to have specific modules in their kernel. For example, some may prefer to have kernel security modules like SELinux, or may need custom modules for R1soft backup utility, etc.
Similarly, some Linode owners would like to handle kernel upgrade on their own.
In all these cases, setting custom kernel in Linode server may become an inevitable task.
How to setup custom kernel in Linode?
Now, let’s see how our Support Engineers enable custom kernel for the Linode server.
1. Preparing the Linode
As the first step, we need to prepare the Linode server before adding additional kernel module or using custom kernel. In either case, it is worthwhile to take additional precaution to avoid down time. That’s why, our Dedicated Engineers clone the Linode and make changes in the cloned Linode.
Here, we upgrade the existing packages on the server. For example, in an Ubuntu server we use the command:
apt-get update && apt-get upgrade
After this, we remove the kernel packages from the /boot directory.
2. Compiling custom kernel
Further, we compile and install the kernel from the source. In this step, we ensure that all the necessary modules are enabled in the kernel using the menuconfig command. For example, to enable SELinux support, we check the option “NSA SELinux Support” in Security Options.
Then, we compile the kernel and edit the boot loader file at /etc/default/grub. We finish this process by updating the grub.
3. Changes at Linode Manager
To make use of the custom kernel that we just built, we have to make changes in the Linode configuration profile from the Linode Manager. Here, we set the kernel option as Grub2 as shown in the picture.
Nowadays, on new server creation from Linode Manager, the kernel is already set to Grub2. In that case, there is no need to make further changes.
After doing a reboot, the server will be running on custom kernel. We monitor the boot process via the Lish console.
Common usability issues with custom kernel
Although there are clear steps to install custom kernel in Linode, we often see Linode server owners having problems with their new kernels. Let’s now have a look on how our Dedicated Engineers fix them.
1. Problem with kernel headers
Recently, one of our customers reported problems with kernel headers in an attempt to enable Idera (R1soft) linux backup agent. The error said:
Checking '/lib/modules/linux-xx.xx.8' for kernel headers
Unable to find a '.config'. This file is required to build a kernel module
Unable to find a valid source directory.
Please install the kernel headers for your operating system.
To install kernel headers execute:
apt-get install linux-headers-`uname -r`
Here, it was not possible to load the module since the server was having a shared kernel that resides outside the Linode. To fix this, our Support Engineers had to install the distribution kernel using package manager, reconfigure grub to point at the kernel. Then, we configured the profile for the Linode to boot using GRUB2. After a reboot, the backup plugin installed fine.
2. Latest kernel not booting
Similarly, there can be issues where the new custom kernel fails to boot up. Even after a reboot, the server was still showing the old kernel.
On checking, our Support Engineers found that there were incorrect entries in the Grub configuration. To fix, we had to correct the entries and set the proper GRUB_DEFAULT option in the file /boot/grub2/grub.cfg.
[Trouble with Linode custom kernel? Our experts can get custom kernel running.]
Conclusion
Enabling custom kernel in Linode involves a series of steps. But, even when there is small glitch, Linode server fail to boot in new kernel. Today, we saw how our Support Engineers set custom kernel in Linode and fix common usability problems with it.
0 Comments