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.
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:
View the number of kernels in the system:
cat /boot/grub2/grub.cfg |grep menuentry
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.
grub2-set-default "CentOS Linux (3.10.0-123.9.3.el7.x86_64) 7 (Core)"
Verify whether the configurations are successful.
Check the number of system kernels in /etc/grup.conf. The following figure shows that the system has multiple kernels.
Follow these steps to modify the configurations:
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.
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.
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.