To be able to migrate your Cloud Server to VPS, the latest kernel version must be installed on your server. If you are using an old kernel version on your Cloud Server, you must install the latest kernel version on the server.

This article explains how to install the latest kernel version on a Cloud Server with CentOS and how to repair a kernel.

Note

If you have installed the latest kernel version and it is damaged, you must repair the kernel. You can find instructions on how to do this in the following article:

Cloud Server: Repairing the current kernel version (CentOS)

Back up your server data

Back up your server data before you repair the kernel. You can either use the paid Cloud Backup or save the data locally on your computer with Filezilla.

You can find more information about Cloud Backup in the following article:

Cloud Backup: Getting started

Ensure that the operating system is up to date

  • Establish an SSH connection to your Cloud Server and log in as administrator.
  • To ensure that the operating system is up to date, enter the following commands:

    root@localhost:~# yum update 
    root@localhost:~# yum upgrade

Check available storage space

To be able to migrate your Cloud Server to VPS, at least 100 MB of memory must be free in the root and boot directories of your server.

To display the free space of the entire file system, enter the following command:

[root@localhost ~]# df -h


To display the used storage space of the entire file system, use the following command:

[root@localhost ~]# du -sh /


You can find instructions on how to delete old kernels and free up memory space in the following article:

Freeing up storage space on a Cloud Server (Linux)

Install the latest kernel version

Check kernel version

To check the kernel version, enter the following command:

root@localhost:~# uname -r

Display available kernels

To display the available kernels, enter the following command:

root@localhost:~# yum --showduplicates list kernel | expand

Display kernel level packages

To display the available kernel level packages, enter the following command:

root@localhost:~# yum --showduplicates list kernel-devel | expand

Installing the latest kernel version

In the following you will learn how to install the latest kernel version.

Attention
  • Always check the release notes before updating the kernel!
  • Most distributions support the parallel installation of new and existing kernels. Do not delete the existing kernel until you have finished testing the new kernel.
  • Establish an SSH connection to your Cloud Server and log in as administrator.
  • To install the latest kernel version, enter the following commands:

    root@localhost:~# yum install kernel
    root@localhost:~# yum install kernel-devel

  • To restart the server, enter the following command:

    root@localhost:~# reboot

  • To check which kernel version is used during the boot process, enter the following command:

    root@localhost:~# uname -r

Setting the kernel version as the default

To set the kernel version as the default, proceed as follows:

  • Open the file /etc/default/grub with the vi editor. Enter the following command:

    root@localhost:~# vi /etc/default/grub

Notes

The vi editor has an insert mode and a command mode. You can call up insert mode with the [i] key. In this mode, the characters entered are immediately inserted into the text. To call up command mode, press [ESC]. If you use command mode, your keyboard input is interpreted as a command.

  • Replace the value in the GRUB_DEFAULT= entry with 0:

    GRUB_TIMEOUT=1
    GRUB_DEFAULT=0
    GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
    GRUB_DEFAULT=saved
    GRUB_DISABLE_SUBMENU=true
    GRUB_TERMINAL_OUTPUT="console"
    GRUB_CMDLINE_LINUX="no_timer_check console=tty0 console=ttyS0,115200n8 net.ifnames=0 biosdevname=0 elevator=noop crashkernel=auto"
    GRUB_DISABLE_RECOVERY="true"

  • To save the change, press the Esc key.
  • Enter :wq and press Enter.
  • Update the GRUB configuration to make the changes effective:

    root@localhost:~# grub2-mkconfig -o /boot/grub2/grub.cfg

  • Restart the server. To do this, enter the following command:

    root@localhost:~# reboot

  • After the reboot, check whether the new kernel has been loaded. To do this, enter the following command:

    root@localhost:~# uname -r