UEFI boot failed

Well, as far as I know, anything equal age of the X230* from Lenovo is UEFI capable for sure, since we have installed Windows 10 1709 on them at work and the install scripts automatically changes Legacy to EUFI in the settings.
X220 Might be, but it is too old to run Windows 10.

*Released May 2012.

I boot from LiveCD using UEFI, in "detect EFI bootloaders".
Two options in "detect EFI bootloaders":

/refind/refind_x64.efi
/GRUB/grubx64.efi

And strangely they both work fine.

I have already set CSM off.

1 Like

Oh sorry I missed them.Full output is

BootCurrent: 0004
Timeout: 0 seconds
BootOrder: 0004,0002,0003
Boot0002* refind	VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0003* GRUB	VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0004* UEFI: IC25N030ATCS04-0 CA3O	PciRoot(0x0)/Pci(0x12,0x2)/USB(3,0)/HD(1,MBR,0x82569132,0x1231e0,0x2000)AMBO

"IC25N030ATCS04-0 CA3O" is my Mobile Hard disk, I used it for install Manjaro.

Alright, understand. From your output, it is clear you have booted into the installed Manjaro OS.
That means your installation other than the bootloader, is good. And that also means you will just need to fix your bootloader and not your OS installation. Good.

Boot Manjaro up (your way) and at terminal, do...

sudo refind-install
sudo cp /boot/efi/efi/refind/refind_x64.efi /boot/efi/EFI/boot/bootx64.efi

If there is error message 'no /boot/efi/efi/boot directory' create directory 'mkdir /boot/efi/efi/boot'
and repeat command.

notes:
o if there is still any issue with booting, print '/boot/efi/refind_linux.conf'
it may not be correct causing the problem. Provide 'blikid' for this instance as well.
o when there's any kernel update, recheck '/boot/efi/refind_linux.conf' that it has new kernel in it.
I understand @Chrysostomus and @dalto has made that automatic now, but just in case, recheck.
(my refind system is not automatic due to my 'own' way I use refind)
o above is for your intention to use refind, as I understand it. If you want grub as main default, let us know, the above is not catered to grub but can be easily done for it.

3 Likes

Thanks! It does solve the problem.
But how does it work? Is it the computer cannot detect the bootloader unless the bootloader is put in specify path?
BTW, the path here may be supposed to be
sudo refind-install sudo cp /boot/efi/EFI/refind/refind_x64.efi /boot/efi/EFI/boot/bootx64.efi

1 Like

Your boot4 is set first in the boot order. Set refind or grub first and it should work. Boot into your system and run

 sudo refind-mkdefault

Or use efibootmgr. Rerunning refind-install also sets it as default bootloader.

No it wont:( I have tried that way but again it set the default boot order to boot the USB first.

Well that sucks. My computer also kept resetting the boot order by itself. Then at some point it just stopped and started to obey efibootmgr. No idea why.

Welcome. Glad to hear.

Heh heh. Some computers will only use boot.efi regardless as default. Many do not need this boot.efi to be default. But some do. So I just make sure there is a boot.efi and pointing to what the user wants as default.

Not exactly. My previous statement answers. And this is a very good question and the reason I requoted it.

Oh.. I think that also answer @Chrysostomus's.
BTW, @Chrysostomus, would new kernel update update refind.conf automatically now for Nelson?
Ooops.. I mean OP.

1 Like

No, refind.conf is usually never updated and doesn't need to be. Same goes for refind_linux.conf. It just applies all the parameters in the file to all kernels it autodetects in the same partition.

I just did some experiments on my Manjaro and find the bootx64.efi doesn't really boot the OS.I tried to remove the origin rEFInd directory under /boot/efi/EFI/ and it failed to boot again.
I dont know what exactly bootx64.efi does. Maybe it just remind the Bios that "Hey there is an OS under this disk"?

/boot/efi/efi/refind refind.conf, yes. But /boot/efi/refind_linux.conf? They are separate files.

Yes, of course. You removed refind stuff needed to boot. Hope you did not remove /boot/efi. Thatr will make your OS totally unbootable and you will need to reinstall the whole OS.

Assuming you did not remove /boot/efi/ (and the kernels and initramfs files there) you can still salvage your OS this way. Yes, it will use grub to boot (grub boots alomst anything with or without bootloaders , if kernels are not missing). The only difference is that after booting up to your manjaro OS, instead of doing the grub stuff, do the refind stuff.

Even if you have refind efi file and the refind conf files are missing, it will not boot.
So that applies equally to boot.efi, which points to refind.efi. It is missing the refind stuff that you deleted. Same goes for grub.efi (and boot.efi if it points to grub) as well if there is no grub.cfg to boot; just FYI.

Hope this is clear. You're lucky you can mess around. Please don't do that. I don't have all day to look in this forum, Thanks. :joy:

3 Likes

Forgot (in my haste) to ask this in my post above. It should be the first question.

And how did you try to boot the efi file?

In grub, it is chainload.
In systemd-boot, it is the 'linux' command
In refind, you must add a manual entry in refind.conf and use command 'loader'
You used "detect efi files"?

But I think it's OK to remove /boot/efi? I have tried to remove all files under /boot/efi, and yes, it failed to boot again. Then I use LiveCD to mount the /dev/sda, chroot into manjaro.
Using the command given by you and it booted successfully.

Both. I add a new entry by efibootmgr using:
sudo efibootmgr -c -w -L "refind" -d /dev/sda -p 1 -l \\EFI\\boot\\bootx64.efi
And boot using "detect efi bootloader" with origin refind dir exists. (If boot from Bios it just flashed and boot into another bootloader)
It could get into bootx64.efi without mistakes but the only thing it could boot into is another refind bootloader.

Look at your post above. There's double slashes \

That's not a typo? It could be this forum text issue - copy and paste and convert characters thingy.
Anyway. you've got everything right? If so, good. And we'll leave it at that. {But if something's still not right, let us know}.

I really think refind is not that good (systemd-boot is better). But I won't discourage or discuss my opinion on this. As they say, it is just my opinion. And that's right {not joke - but don't ever say anything about cheesecake :crazy_face:}.

Cheers.

It doesn't matter, as far as I saw on efibootmgr -v.

Oh I won't. Just because this problem troubled me for a long time. I also got this problem on Arch, of courses.
Anyway, thank you for your reply.
And...can I close this post? Or just leave it there is ok?

Yes, just leave it. It's fine.
Oh, looking at you efiboomgr command, you have no appostrophes there. It's imporytant beiseds the error of double slashes.
The command should be

sudo efibootmgr -c -d /dev/sda -p 1 -L "refind" -l "\EFI\refind\refind_x64.efi"

And never use bootx64.efi for this efibootmgr command.

Your wrong command below..(for reference)

Catch up with you some other time. Today's really busy and I'm normally not rushed or moody.
I may just be cranky or sarcastic (in a nice way).

Cheers.

1 Like

(It's just for a experiment!:stuck_out_tongue_winking_eye:

I'm sorry because I just copied it from the Internet. But strangely...the output shows that it works fine

$ efibootmgr -v
BootCurrent: 0000
Timeout: 0 seconds
BootOrder: 0000,0001
Boot0000* rEFInd Boot Manager	HD(1,GPT,e3e78a97-3d9e-4c5d-8a58-2287c67debb2,0x800,0x100000)/File(\EFI\refind\refind_x64.efi)
Boot0001* refind	HD(1,GPT,e3e78a97-3d9e-4c5d-8a58-2287c67debb2,0x800,0x100000)/File(\EFI\boot\bootx64.efi)

Boot0001* refind HD(1,GPT,e3e78a97-3d9e-4c5d-8a58-2287c67debb2,0x800,0x100000)/File(\EFI\boot\bootx64.efi)

And ... I think you are really really friendly instead of rushed or moody. Thank you