Instructions for Kernel Upgrade

The following steps were employed to manually update the Alation EC2 kernel. These instructions can be repurposed for similar scenarios.

Kernel Upgrade Steps:

These steps have been provided by AWS Support. For more info please check the support case. Step 1: Take note of the steps suggested by AWS to obtain a list of available kernels on your EC2:

sudo yum list available kernel
#or
sudo yum --showduplicates list kernel

Step 2: To install the latest kernel, use this command:

sudo yum update kernel

For a specific kernel version, use:

sudo yum update kernel-

Step 3: Execute the following command to check the installed kernel versions:

rpm -q kernel
# output example: kernel-4.14.330-250.540.amzn2.x86_64

Step 4: Before rebooting the instance for it to run the latest kernel version, ensure that the initramfs/initrd file corresponding to the new kernel version exists in /boot .

ls /boot | grep -i <kernel version from the previous step>

ex: ls /boot | grep -i  "4.14.330-250.540"

System.map-4.14.330-250.540.amzn2.x86_64
config-4.14.330-250.540.amzn2.x86_64
initramfs-4.14.330-250.540.amzn2.x86_64.img
symvers-4.14.330-250.540.amzn2.x86_64.gz
vmlinuz-4.14.330-250.540.amzn2.x86_64

Important: If initramfs- is not found in /boot, refrain from rebooting the instance as it could lead to booting issues. Step 5: To generate initramfs for the kernel version, use the following commands:

# Load module
sudo depmod 4.14.330-250.540.amzn2.x86_64

# Get List of all modules 
sudo depmod -a

# Generate a new initramfs for the specified kernel version and overwrite the existing initramfs image file with verbose output.
sudo dracut -fv /boot/initramfs-4.14.330-250.540.amzn2.x86_64.img 4.14.330-250.540.amzn2.x86_64

Step 6: Generate a new GRUB2 configuration file based on the currently installed kernels and configuration files in /etc/default/grub and custom files within /etc/grub.d/.

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Step 7: Reboot the instance:

sudo reboot

Step 8: After the reboot, verify the kernel version by running :

uname -r

Additionally, ensure that your /etc/fstab entries are correct and that the disks mentioned in the fstab file are attached to the instance. If not, either remove the entries or attach the disks as needed since this can lead to issues after the reboot.

Finally, if the EC2 instance belongs to an autoscaling group, please temporarily remove it from the ASG.