edit-icon download-icon

ECS Linux CentOS Kernel Boot Sequence Modification

Last Updated: Dec 24, 2017

Note:
Configurations and description in this document have been tested in CentOS 6.x and CentOS 7.0. Configurations for other operating systems or other CentOS versions may be different. For more information, see the documentation of the relevant operating systems.

How to change the kernel startup sequence in CentOS 7.0

CentOS 7 uses grub2 as the bootstrap program. Therefore, instead of modifying /etc/grub.conf to modify the startup items in CentOS 6, follow these steps to modify the kernel startup sequence in CentOS 7:

  1. View the number of kernels in the system:

    1. cat /boot/grub2/grub.cfg |grep menuentry

    view the number of kernels

  2. Configure the system to be started based on default kernels. Replace the kernel name in the following command with the actual kernel name in the system.

    1. grub2-set-default "CentOS Linux (3.10.0-123.9.3.el7.x86_64) 7 (Core)"
  3. Verify whether the configurations are successful.

    1. grub2-editenv list

    verify the configurations

How to change the kernel startup sequence in CentOS 6.X

Check the number of system kernels in /etc/grup.conf. The following figure shows that the system has multiple kernels.

check the number of kernels

Follow these steps to modify the configurations:

  1. The figure shows two kernel versions, which are 2.6.32-573.18.1.el6.x86_64 and 2.6.32-431.23.3.el6.x86_64, with the old version located under the new version.

  2. In the grub.conf file, the “default” parameter is used to determine the kernel version used for startup. The default value is 0, indicating that the latest kernel version is used. If the parameter is set to 1 or 2, an earlier kernel version is used.

  3. In this example, to start the system from the old kernel version, set the “default” parameter to 1, and restart the server from the new kernel.

If the problem persists, contact Alibaba Cloud After-Sales Technical Support.

Thank you! We've received your feedback.