You are not logged in.

#1 2014-10-17 14:50:47

jeffrey.angell
Member
Registered: 2014-10-17
Posts: 2

UEFI boot from usb

I recently installed Arch to an external hard drive and with grub for UEFI. I wanted to configure my UEFI bootloader to boot from USB if the device is present, and otherwise boot the native OS of the system.

I have two laptops, both HP products, and one of them works properly (when the device is connected, boot into Arch), but in the other one, I have to manually find the file on the disk to boot into it.

What exactly does UEFI do to identify bootable files on a disk? How can I modify it so that Arch will boot automatically when connected?


On perhaps an unrelated note, when running the efibootmgr command, BootCurrent isn't one of the listed boot options.

Thanks!

Offline

#2 2014-10-17 16:38:42

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: UEFI boot from usb

Copy the UEFI bootloader to its fixed default location: <EFI SYSTEM PARTITION>/EFI/BOOT/BOOTX64.EFI (for 64-bit x86 system).
That way it is loaded on any UEFI compatible computer without the need to create an entry in the firmware for it.

Offline

#3 2014-10-22 22:28:47

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: UEFI boot from usb

When you say you manually find the file to boot into what file are you finding? And are you using a bootmanager to find and boot into it? And when is it that the bootcurrent variable is missing? I would however expect more missing than that if EFI mode is turned off in the UEFI NVRAM. I don't profess to understand this yet but here is what I'm getting ready to look into on better understanding the EFI boot stub kernel capacity and it may include something that explains what EFI requirements for being bootable.
https://www.kernel.org/doc/Documentation/efi-stub.txt


Simple and Open

Offline

#4 2014-10-23 04:37:22

jeffrey.angell
Member
Registered: 2014-10-17
Posts: 2

Re: UEFI boot from usb

teateawhy wrote:

Copy the UEFI bootloader to its fixed default location: <EFI SYSTEM PARTITION>/EFI/BOOT/BOOTX64.EFI (for 64-bit x86 system).
That way it is loaded on any UEFI compatible computer without the need to create an entry in the firmware for it.

This worked for me. Any insight as to why it was working for the other machine already? Also, I've been looking in the docs for this default location to be mentioned; the only thing I can find is specific to a manufacturer, but both of my laptops have the same manufacturer.

Offline

#5 2014-10-23 21:52:34

Blasphemist
Member
From: Colorado
Registered: 2013-01-17
Posts: 160

Re: UEFI boot from usb

It may help you to learn more about how UEFI and GPT work to boot an OS. To that end let me ask a couple things. What happens during installation of Arch to change the behavior at boot? A boot loader (Grub and it's components or an alternative) and a utility to create and modify UEFI NVRAM variables (efibootmgr) are installed and used. What magic do they do?

If you look at the man file for efibootmgr you can see examples of its use and all of its options. I figured that out and now I understand how to change only NVRAM values to fix boot errors that may come up since I experiment with Arch and other distros. In most all instances installation of an OS makes no changes to existing boot files. Instead it tells UEFI to load a different bootloader or OS directly and only adds bootable options. To revert a person just needs to change the boot order back in most cases. The efibootmgr is not complicated it's just different than the old BIOS/MBR or BIOS/GPT process.

Grub changes very little for use with UEFI and GPT. A person just has to get all of the switch settings down since the paths change due to the use of an EFI system partition (ESP).

This all happens like magic when installing most distros. It gets kind of convoluted to decipher because following the Arch wiki documentation you work a maze of choices and therefor wiki pages. And it doesn't help that there is so much written about UEFI magic and unpredictability. I know you didn't ask for any further comment from me but I do hope this helps even though your system is booting as you desire now.


Simple and Open

Offline

#6 2014-10-24 13:06:51

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: UEFI boot from usb

jeffrey.angell wrote:
teateawhy wrote:

Copy the UEFI bootloader to its fixed default location ...

This worked for me.

Please mark the topic as solved.

jeffrey wrote:

Any insight as to why it was working for the other machine already?

On the other computer(#1) a boot entry was written that points to the bootloader. This happened when you installed the bootloader on the computer(#1). This boot entry is not present on the second computer(#2) therefore you couldn't boot from the second machine(#2).
Of course you could also write a boot entry on computer(#2), but this will not make the usb stick work universally across all UEFI computers, only for this computer.

Offline

Board footer

Powered by FluxBB