centos2ol
centos2ol copied to clipboard
Error after reboot machine
Good afternoon,
After following your tutorial to switch from CentOS 7 to Oracle Linux, I found an error.
I do everything right and there is no problem. It turns out that when I reboot, the machine no longer starts me and gives the following errors:
- Failed to open \ EPI \ centos \ grubx64.efi - Not Found Falied to load image \ EPI \ centos \ grubx64.efi - Not Found start_image () returned Not Found
Can you help, please?
Thanks!
You might want to have a look at https://github.com/oracle/centos2ol/issues/70 There is an immediate workaround listed there. In the meanwhile i will try to find some time to implement a proper fix.
I had already tested it but without success ... I will try again.
Thanks
Well, the main idea is that you need to add an UEFI boot entry for /boot/efi/EFI/redhat/shimx64.efi relative path to ESP dir, that should be used as a parameter for efibootmgr is "\EFI\redhat\shimx64.efi" You might want to check that file is actually present at first.
But that definitely should be fixed in the script itself, my proposal here and in #70 is just a quick bandaid.
I tested the script now by creating a new VM in Oracle Cloud with CentOS 8 then running the migration script.
After rebooting, I get the following message:
System BootOrder not found. Initializing defaults. Creating boot entry "Boot0001" with label "Oracle Linux" for file "\EFI\redhat\shimx64.efi"
The system is not usable after running the script.
Right, we still need to fix the UEFI use-case. I was hoping @aburmash would submit a fix for it. :)
Yeah. Will try to do it this week. Meanwhile @lvarela could you please share some details of what exactly is unusable ? According to the log you have provided entry was re-created by fallback without issues, what is the problem after that ? Is that entry unbootable ? What is the error ?
The VM boots to the grub> prompt. The entry is unbootable.
If I try to load the kernel manually by using the following commands on the grub prompt:
set prefix=(hd0,gpt2)/boot/grub set root=(hd0,gpt2) insmod normal normal insmod linux linux /vmlinuz-5.4.17-2036.104.5.el8uek.x86_64 initrd /initramfs-5.4.17-2036.104.5.el8uek.x86_64.img
The VM just hangs.
What VM shape are you using? I want to reproduce this internally using the same config.
VM.Standard.E2.1
Do you mean VM.Standard2.1? The E(PYC) shapes are the E3.Flex and E4.Flex.
I copy/pasted from the GUI. Here is a screenshot:

Righto. I'll have to find another tenancy that still has access to those shapes. I'm busy testing a VM.Standard2.1 now.
Ok, it works fine with a VM.Standard2.1. I'll test the E3/E4 Flex shapes as well. I'm still trying to find access to a Standard.E2.1 instance. I think that's a legacy shape that was replaced by the E3 and E4 Flex. If you have access to those shapes, can you see if those reboot successfully?
That shape was located in "Specialty and Previous Generation" I am currently on a trial mode, it could be that.
I don't have access to the E3/E4s but I will test tomorrow on a VM.Standard2.1
E3/E4 shapes work for me too. Let me know how you go.
The VM boots to the grub> prompt. The entry is unbootable.
This indicates that grub did not load the grub config Which is actually a different problem. If that VM is still recoverable check if grub.cfg is present in /boot/efi/EFI/redhat/
Good, I tested the migration script again but without success.
I did what aburmash said and created the UEFI boot entry for Oracle Linux but when the system reboots, it still doesn't work.
I execute the commands in the following order:
1.-curl https://raw.githubusercontent.com/oracle/centos2ol/main/centos2ol.sh
-
sudo bash centos2ol.sh
-
rpm -e shim-x64
-
yum install shim-x64 (does not work)
-
efibootmgr -c -d / dev / sda1 -p 1 -L "Oracle Linux" -l "\ EFI \ redhat \ shimx64.efi"
When rebooting, I lose the machine, and it is necessary to restore a backup.
@nameeeeeek
efibootmgr -c -d /dev/sda1 -p 1 -L "Oracle Linux" -l "\EFI\redhat\shimx64.efi"
Here is the problem. There should be no 1 there. You should be providing device ( which is /dev/sda ) and later partition which is 1. With -d /dev/sda1 -p1 you essentially provide device sda1 and partition 1, which does not exist.
Overall, just do not reboot immediately after running efibootmgr. You can run efibootmgr -v and check if output matches expectations.
For example here is my test system:
efibootmgr -c -d /dev/vda -p 1 -L "test" -l "\EFI\redhat\shimx64.efi"
[root@localhost ~]# efibootmgr -v
BootCurrent: 0003
Timeout: 3 seconds
BootOrder: 0004,0003,0002,0001,0000
Boot0000* UiApp FvVol(7cb8bdc9-f8eb-4f34-aaea-3ee4af6516a1)/FvFile(462caa21-7614-4503-836e-8ab6f4662331)
Boot0001* UEFI QEMU DVD-ROM QM00005 PciRoot(0x0)/Pci(0x1f,0x2)/Sata(2,65535,0)N.....YM....R,Y.
Boot0002* UEFI Misc Device PciRoot(0x0)/Pci(0x3,0x0)N.....YM....R,Y.
Boot0003* Oracle LinuZ HD(1,GPT,88f20717-7ccd-4cff-b5c7-1098ac0b2d47,0x800,0x12c000)/File(\EFI\redhat\shimx64.efi)
Boot0004* test HD(1,GPT,88f20717-7ccd-4cff-b5c7-1098ac0b2d47,0x800,0x12c000)/File(\EFI\redhat\shimx64.efi)
So you can easily check by this output:
- If disk in efibootmgr output matches your ESP partition
[root@localhost ~]# blkid |grep EFI
/dev/vda1: UUID="A4E3-577B" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="88f20717-7ccd-4cff-b5c7-1098ac0b2d47"
PARTUUID from blkid output matches what i see in efibootmgr output.
- Check if boot file actually file exists. \EFI\redhat\shimx64.efi == /boot/efi/EFI/redhat/shimx64.efi
@nameeeeeek
yum install shim-x64 (does not work)
well, that explains the failure of boot. If you remove shim and do not install a new one you do not have even a single shimx64.efi binary to boot. What is the error with shim-x64 installation ?
Thanks for the answers.
Ah ok, I understand ...
I did it all over again but now I didn't run rpm -e shim-x64. And I ran the command efibootmgr -c -d / dev / sda -p 1 -L "Oracle Linux" -l "\ EFI \ redhat \ shimx64.efi after run script.
When checking through efibootmgr -v, the Oracle Linux line appears there but when rebooting, it gives the error attached below.
BootCurrent: 0003 BootOrder: 0006,0003,0000,0001,0002,0000,0001,0002,0004,0000,0001,0002,0003,0000,0001,0002,0005,0000,0001,0002,0003,0000,0001,0002,0004,0000,0001,0002,0003,0000,0001,0002 Boot0000* EFI SCSI Device AcpiEx(VMBus,,)/VenHw(9b17e5a2-0891-42dd-b653-80b5c22809ba,d96361baa104294db60572e2ffb1dc7f00eff7d9741a9d4c85772655f5f508c3)/SCSI(0,0) Boot0001* EFI SCSI Device AcpiEx(VMBus,,)/VenHw(9b17e5a2-0891-42dd-b653-80b5c22809ba,d96361baa104294db60572e2ffb1dc7f00eff7d9741a9d4c85772655f5f508c3)/SCSI(0,1) Boot0002* EFI Network AcpiEx(VMBus,,)/VenHw(9b17e5a2-0891-42dd-b653-80b5c22809ba,635161f83edfc546913ff2d2f965ed0e25cbb88ca5da9f48a4854cf485549d3f)/MAC(000000000000,0) Boot0003* CentOS Linux HD(1,GPT,2004b5aa-4426-46d0-9531-a40e30d69be3,0x800,0x64000)/File(\EFI\centos\shim.efi) Boot0004* CentOS Linux HD(1,GPT,2004b5aa-4426-46d0-9531-a40e30d69be3,0x800,0x64000)/File(\EFI\centos\shim.efi) Boot0005* CentOS Linux HD(1,GPT,2004b5aa-4426-46d0-9531-a40e30d69be3,0x800,0x64000)/File(\EFI\centos\shim.efi) Boot0006* Oracle Linux HD(1,GPT,2004b5aa-4426-46d0-9531-a40e30d69be3,0x800,0x64000)/File(\EFI\redhat\shimx64.efi)
Now there is no error in yum install shim-x64
Sorry to be boring but I wanted to solve this
No, you are not boring, in fact i am gathering feedback from you for the fix on our side. And i am really grateful you are going through this, this helps A LOT!
OK, i can understand that error. You actually kept centos shim ( which is clearly seen by the fact that fallback restores the centos entry for you ), but it can't boot grub, because you have grub in redhat dir. and centos shim expects it in centos dir.
So it all comes down to inability to install an new ( oracle ) shim. Could you please share what is the error on installation of Oracle shim instead of Centos one ?
BTW, do not reboot the box while all pieces are not in place. You need:
-
Oracle shim
-
Oracle grub2
-
Oracle grub2 config ( grub2-mkconfig > /boot/efi/EFI/redhat/grub.cfg )
-
do ls /boot/efi/EFI/redhat/ you should see at least grubx64.efi, shimx64.efi and grub.cfg there
-
efibootmgr command to actually add Oracle shim
Boot0006* Oracle Linux HD(1,GPT,2004b5aa-4426-46d0-9531-a40e30d69be3,0x800,0x64000)/File(\EFI\redhat\shimx64.efi)
if you have everything of that on place, you should be fine.
When you talk about
Could you please share what is the error on installation of Oracle shim instead of Centos one?
, are you referring to the errors after running the script?
Well, if you have them during the script - yes.
But i was referring to this:
rpm -e shim-x64
yum install shim-x64 (does not work)
Now i don't have errors when install shim...
Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Package matching shim-x64-15-2.0.9.el7.x86_64 already installed. Checking for update. Nothing to do
How i can install Grub2 ?
yes. so you need:
Oracle shim
Oracle grub2
Oracle grub2 config ( grub2-mkconfig > /boot/efi/EFI/redhat/grub.cfg )
do ls /boot/efi/EFI/redhat/
you should see at least grubx64.efi, shimx64.efi and grub.cfg there
efibootmgr command to actually add Oracle shim
How i can install that ? (oracle shim and oracle grub2)
if you have run migration script and see no errors: do
[root@localhost ~]# rpm -qi grub2-efi-x64 |grep Vendor
Vendor : Oracle America
[root@localhost ~]# rpm -qi shim-x64 |grep Vendor
Vendor : Oracle America
If that matches - you have oracle shim and grub2
You can double check that everything is fine with
find /boot/efi/EFI/redhat/
if you see shimx64.efi , grubx64.efi and grub.cfg there - you are good to go.
// do not forget about efibootmgr entry
[root@localhost ~]# rpm -qi grub2-efi-x64 |grep Vendor Vendor : Oracle America
[root@localhost ~]# rpm -qi shim-x64 |grep Vendor Vendor : CentOS
[root@localhost ~]# find /boot/efi/EFI/redhat/
/boot/efi/EFI/redhat/
/boot/efi/EFI/redhat/fonts
/boot/efi/EFI/redhat/fonts/unicode.pf2
/boot/efi/EFI/redhat/grubx64.efi
I've seen that I can't even migrate
Yeah, you have Centos shim. Ok, let's use heavy artillery. is your system OL/CENTOS 7 ?
- check your current shim version I assume it is shim-x64-15-8.el7.x86_64.rpm ?
http://mirror.centos.org/centos/7/os/x86_64/Packages/shim-x64-15-8.el7.x86_64.rpm
-
rpm -e shim-x64 --nodeps -
yum install http://public-yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/shim-x64-15-2.0.9.el7.x86_64.rpm
and surely
grub2-mkconfig > /boot/efi/EFI/redhat/grub.cfg