Manually Setting EFI Boot

The place to discuss Linux and Unix Operating Systems
Forum rules
Behave
Post Reply
User avatar
Zema Bus
Your Co-Host
Posts: 240
Joined: Sun Feb 04, 2024 1:25 am

Manually Setting EFI Boot

Post by Zema Bus »

Previously my new Arch install wasn't seen by the motherboard's UEFI, so the only way I could boot into it was via another distro's bootloader. Here's how I fixed EFI boot for both Arch and for Slackware, with the efi-directory adjusted to where the efi partition is mounted (/boot in Arch), and the bootloader-id set to the distro name you want to use.

Code: Select all

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Slackware-Current --recheck
Followed by the usual command to update Grub after making changes.

Code: Select all

grub-mkconfig -o /boot/grub/grub.cfg
User avatar
Grogan
Your Host
Posts: 485
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Manually Setting EFI Boot

Post by Grogan »

That's essentially the command I used for Arch. It's the efibootmgr back end that caused me the problem. I only had one bootloader too, so there was no confusion.
User avatar
Grogan
Your Host
Posts: 485
Joined: Sat Aug 21, 2021 10:04 am
Location: Ontario, Canada

Re: Manually Setting EFI Boot

Post by Grogan »

So, to use the default/fallback it's just this (with it mounted at /boot but it wouldn't have to be that)

Code: Select all

grub-install --target=x86_64-efi --efi-directory=/boot --removable
That will generate EFI/BOOT/BOOTX64.EFI which a UEFI bios will just go for, bypassing EFI boot vars in NVRAM (the switch seems like it's a misnomer, but this is also how you'd set up a removable drive to boot). I actually think this is more reliable (and damn easy to fix for that matter), just inflexible for booting from other fixed drives (at least on my board). That's what a bootloader is for anyway, though. It's how I would have done it with legacy too... not by changing the boot drive in the BIOS. If I wanted some other 'dozy OS I'd add it to my bootloader too. Hell, I still haven't forgotten the concept of Master/Slave and "Primary boot drive" (e.g. ide0)
Post Reply