You are not logged in.

#1 2024-07-29 05:18:54

teika
Member
From: Japan
Registered: 2011-05-23
Posts: 48
Website

Can your UEFI boot an iso image in partition?

(Originally posted at the Gentoo forum, but have got no answer. ;)

Suppose you have the iso image of a bootable medium in a partition, copied with dd:
  $ dd if=<iso image> of=/dev/disk/by-foo/bar bs=1M

I found at least in two PCs the UEFI boot option menu shows this iso as a choice, and in fact it is possible to boot it. (One does not even has an optical drive.) No bootloader is necessary.

Question: Can your PC boot one? You can get the Arch installation medium from the "download" link at the top-right of this page.

In fact I prepared two Gentoo isos, the minimal (amd64) CD and the LiveGUI image, put in an external USB drive. (So you need *two* partitions in this case.) In one PC, they are shown as:
  USB Hard Drive (UEFI) - Generic External
  USB Hard Drive (UEFI) - Generic External
In the other device, the menu reads:
  DVD1-1 (<hdd id>)
  DVD2-1 (<hdd id>)
The order did not necessarily coincide with the partition order, so if you have two, there's no guess which is which.

If this is the common case, this should be known much more. At least it is worth trying rather than dedicating an entire drive for installation.

# In my PC without the optical drive, its dmidecode says boot from cd is supported. (Did you know that many PCs still support boot from a floppy.? ;-)

Personally I always want to have a live medium at hand for a rescue purpose, and I have been struggling for years preparing one using grub. It's really cumbersome. To my both joy and disappointment, such effort was a waste, at least for me; dd and you're done.

According to the sole answer in the Gentoo forum, PC manufacturers do what they want, resulting in a wide variety of UEFI.


Easy Shift / Ctrl / AltGr ... hack; save your pinkies, type without drudgery.
YYYY-MM-DD, period. (Have you ever used the Internet?)

Offline

#2 2024-07-29 05:58:09

cryptearth
Member
Registered: 2024-02-03
Posts: 654

Re: Can your UEFI boot an iso image in partition?

although you got a rather precise answer answer with "one can only rely on the fallback path", here're my two cents:
it can vary from one version to the next one even on the very same system - and due to bugs can even vary with the same bios version but different attached hardware
even the most recent specs give the implementors quite some freedom about which features are supported and how they're to be used

as for your specific question:
for uefi a bootable medium is defined as any gpt partitioned storage with at least one partition set to Efi System Partition and formatted with FAT32
if no entry for that partition exists in the nvram there's the architecture specific fallback path of either EFI\BOOT\BOOTIA32.EFI for 32bit systems and EFI\BOOT\BOOTX64.EFI for 64bit systems
I'm also not aware if there's any requirement about one drive is allowed to only have one ESP - but from many posts this should be avoided as it often does cause issues

how you setup this bootable medium - either partition and format and extract or use DD an image or any other method shouldn't matter as long as the result meets the spec

but even then it depends on the implementation - recently we had a couple topics which turned out to be caused by uefi implementations not following the spec - either due to bugs or on purpose - so just because your boot medium meets the spec doesn't mean your uefi does as well

Offline

#3 2024-07-29 06:49:32

Head_on_a_Stick
Member
From: Belsize Park
Registered: 2014-02-20
Posts: 8,120
Website

Re: Can your UEFI boot an iso image in partition?

You could pack a rescue system into a UKI and leave that on the ESP:

https://hub.zhovner.com/geek/one-file-linux/


"Austerity is the idea that the global financial crash of 2008 was caused by there being too many libraries in Wolverhampton."
   — Alexei Sayle

Online

Board footer

Powered by FluxBB