Why is my Linux instance not booting after I changed its type to C5 or M5?
Last updated: 2019-04-15
I changed my Linux instance type to C5 or M5 and now it won't boot. How do I fix that?
Your Linux instance might not boot after you change its type to C5 or M5 for the following reasons:
1. The Elastic Network Adapter (ENA) enaSupport attribute is disabled for the instance.
2. The ENA module isn't installed on the instance.
3. The NVMe module isn't installed on the instance, or, if installed, the NVMe module isn't loaded in the initramfs image of the instance.
4. You are trying to mount the file systems at boot time in the "/etc/fstab" file using a device name. Amazon Elastic Block Store (Amazon EBS) volumes are exposed as NVMe devices to these instance types, and the device names are changed. To avoid this, mount the file systems using UUID/Label. For more information, see Amazon EBS and NVMe.
You can resolve these issues by taking steps to be sure that ENA is enabled, and that your Linux instance meets the C5 or M5 module and file system mounting requirements.
Be sure that ENA is enabled
To be sure that ENA is enabled, see Instance Attribute (enaSupport) under Testing Whether Enhanced Networking Is Enabled. If ENA is disabled, use the modify-instance-attribute action to enable ENA support. For detailed steps, see To enable enhanced networking on Amazon Linux AMI under Enabling Enhanced Networking on the Amazon Linux AMI.
Run the c5_m5_checks_script
The c5_m5_checks_script checks your instance and provides a pass/fail status of these requirements:
- Verifies if the NVMe module is installed on your instance. If yes, then the script verifies that the module is loaded in the initramfs image.
- Verifies if the ENA module is installed on your instance.
- Analyzes the "/etc/fstab" and looks for block devices being mounted using device names.
This script is supported on the following OS versions:
- Red Hat derivatives: Red Hat Linux, Red Hat Enterprise Linux, CentOS
- Amazon Linux, Amazon Linux 2
- Debian derivatives: Debian, Ubuntu
To run the c5_m5_checks_script:
1. Take a snapshot of your volume or create an Amazon Machine Image (AMI) of an instance before making any changes so that you have a backup.
2. Change your instance type to its original type.
3. Place the script on your instance and make it executable:
# chmod +x c5_m5_checks_script.sh
4. Run the script as a "root" user or "sudo":
# sudo ./c5_m5_checks_script.sh
5. At the prompt, type y or n (or No) to regenerate and modify your current "/etc/fstab" file to replace the device name of each partition with its UUID.
Type y if you want the script to rewrite the current "/etc/fstab" file. The original fstab file is saved as /etc/fstab.backup.$(date +%F-%H:%M:%S). For example, /etc/fstab.backup.2018-05-01-22:06:05
Type n or No to print the correct /etc/fstab file in the output, but not replace it.
If everything is fine, you receive the following output:
------------------------------------------------ OK NVMe Module is installed and available on your instance OK ENA Module is installed and available on your instance OK fstab file looks fine and does not contain any device names. ------------------------------------------------
6. After all the requirements are met, change the instance type to C5 or M5.