All Products
Search
Document Center

:Set Startup from Alibaba Cloud Default Kernel in Linux ECS Instances

Last Updated:Apr 27, 2022

Disclaimer: This topic may contain information about third-party products. The information is for reference only. Alibaba Cloud does not make a guarantee in any form of the performance and reliability of the third-party products, and potential impacts of operations on these products.

Issue

In Linux ECS instances, the operation of updating the system is easy to upgrade the kernel of the system by mistake. After the kernel is upgraded by mistake, the ECS instance will be unstable, such as service, network interface controller, or module loading failure, or even the system cannot start normally.

Cause

The kernel of the Linux ECS instance is specially compiled and compatible with the underlying virtualization drivers. If the kernel is upgraded by mistake, unpredictable problems will occur.

Solution

Take note of the following items:

  • Before you perform high-risk operations such as modifying the specifications or data of an Alibaba Cloud instance, we recommend that you check the disaster recovery and fault tolerance capabilities of the instance to ensure data security.
  • Before you modify the specifications or data of an Alibaba Cloud instance, such as an Elastic Compute Service (ECS) instance or an ApsaraDB RDS instance, we recommend that you create snapshots or enable backups for the instance. For example, you can enable log backups for an ApsaraDB RDS instance.
  • If you have granted specific users the permissions on sensitive information, such as usernames and passwords, or submitted sensitive information in the Alibaba Cloud Management Console, we recommend that you modify the sensitive information at the earliest opportunity.

It is recommended to deal with it in the following way.

Note: The configurations and descriptions in this topic have been tested in CentOS 6.5 and 7.0 operating systems. The configurations of other Linux distributions may vary. For more information, see the official documentation of the corresponding distribution.

  1. Log on to the server by using SSH or Management Terminal. Make sure that the current logon user is root.
  2. Run the following command to edit the GRUB configuration file:  
    vim /etc/grub.cfg
    Note: The GRUB configuration file location may vary slightly for different Linux distributions and is generally located in the /etc, /boot, or /etc/grub directory.
  3. Adjust the kernel startup sequence and change the value of the default parameter to "1", that is, enable the old kernel. Exit after saving.
    Note: "1" means to start the "2" kernel, that is, the old kernel, if there are multiple cores to push it.
     
  4. Restart the ECS instance.

Note: We do not recommend that you upgrade the kernel or operating system version. For more information about how to upgrade the kernel, see How do I prevent Linux instances from failing to start after upgrading the kernel.

Applicable scope

  • Elastic Compute Service (ECS)