Skip to content

Change type ec2

0

Hi team. i have AMIs create from ec2 type t2.micro . I create a new ec2 from AMIs but start have issue . "error: ../../grub-core/fs/fshelp.c:257:file `/EFI/amzn/grubenv' not found."

asked 2 years ago279 views
1 Answer
0

Check AMI Compatibility

Ensure that the AMI you created from the t2.micro instance is compatible with the instance type you're trying to launch. Some instance types might have different hardware requirements.

2. Recreate the AMI

Recreate the AMI ensuring all files are properly included. Follow these steps:

Stop the original t2.micro instance. Create an image (AMI) from this instance. Use this new AMI to launch the new instance.

3. Check Instance Configuration

Make sure that the instance configuration, such as the root device type (EBS or instance store) and the block device mapping, is correctly set up. The error might indicate an issue with the boot partition.

4. Manually Fix GRUB

If you have access to the instance, you can try to manually fix the GRUB configuration:

Launch a Temporary Instance: Launch another instance in the same availability zone. Attach Root Volume: Detach the root volume of the problematic instance and attach it to the temporary instance as a secondary volume. Mount and Chroot: SSH into the temporary instance and mount the attached volume. Chroot into it to access the file system.

sudo mkdir /mnt/temp_volume
sudo mount /dev/xvdf1 /mnt/temp_volume # replace /dev/xvdf1 with your volume's device name
sudo chroot /mnt/temp_volume

Update GRUB: Reinstall or update GRUB

sudo grub2-install /dev/xvda # replace /dev/xvda with the root device
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Unmount and Reattach: Exit the chroot environment, unmount the volume, and reattach it to the original instance.

exit
sudo umount /mnt/temp_volume

Restart the Instance: Try to start the original instance again.

EXPERT
answered 2 years ago
EXPERT
reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.