All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Schmitt" <scdbackup@gmx.net>
To: grub-devel@gnu.org
Subject: Re: grub-mkrescue: Problem with MBR partition table at start of EFI partition
Date: Sat, 11 May 2019 21:42:26 +0200	[thread overview]
Message-ID: <16655678563486501500@scdbackup.webframe.org> (raw)
In-Reply-To: <ba42d1e3-4e98-93a4-69b8-e51951f92c2b@gmx.de>

Hi,

> On the other hand, in the Windows world this rarely causes any confusion
> since no Windows version I've encountered so far contains native tools
> to write an ISO (or any other image file) to a USB stick as Unix' "dd"
> command would.

A Wallace Line for ISO-zooa. This explains a lot.


> that "just dd it to a USB key" feature of isohybrid is
> mainly useful to people who already have some kind of Unix running.

Rufus has a "DD" mode, meanwhile with auto-detection of worthy ISOs:
  https://github.com/pbatard/rufus/issues/1148


> [Disk Management GUI refusal ...]
> That may be another reason that dd-able ISOhybrid files are mostly
> used for Linux installs (since Linux does not have that restriction) and
> not used for Windows install media.

Actually in GNU/Linux and similar systems it is darn dangerous to dd
an ISO onto a USB stick. You normally need privileges which suffice to
overwrite your system disk.

I wonder whether it was Vladimir Serbinenko or H. Peter Anvin who
first had the idea to let MBR x86 boot code hop onto the El Torito
no-emulation boot image. I guess the term "isohybrid" is by hpa.


> On the other hand, all 64-bit EFI firmware versions I encountered so far
> (to be honest, I believe all of them were "designed to run Windows"), do
> EFI boot from the *first* MBR-style partition of an *external* drive
> (e.g. USB), if the partition type is either 0x0B or 0x0C, the partition
> is marked bootable, and it contains a FAT32 filesystem with an
> /EFI/BOOT/BOOTX64.EFI file on it.

This is quite what the rumors say, if i replace their riddling details
by yours.
It also matches what Florian reports about his USB stick's partitioning.

In contrast, UEFI 2.4, 5.2.1 Legacy Master Boot Record (MBR):

  "Table 14. Legacy MBR Partition Record
   [...]
   BootIndicator : Byte Offset 0 :
   0x80 indicates that this is the bootable legacy partition. Other
   values indicate that this is not a bootable legacy partition.
   This field shall not be used by UEFI firmware.
   [...]
   If an MBR partition has an OSType field of 0xEF (i.e., UEFI System
   Partition), then the firmware must add the UEFI System Partition GUID
   to the handle for the MBR partition using InstallProtocolInterface().
   This allows drivers and applications, including OS loaders,
   to easily search for handles that represent UEFI System Partitions."


> if it did not work, people would complain quickly.

Yeah. This is the reason why i care to learn. Big truck slipstream.
(Even if i afterwards need to get hot water and iodine ...)


> On the other hand, if I partitioned the USB stick in GPT
> mode and used an EFI System Partition as primary partition, Windows
> would not assign a drive letter to it when I attach it, and older OSes
> would not be able to read the stick at all.

I am a big fan of MBR partition table with partition of type 0xEF.
Therefore i provide a script-in-the-middle for grub-mkrescue to be
submitted as option --xorriso=
  https://dev.lovelyhq.com/libburnia/libisoburn/raw/master/frontend/grub-mkrescue-sed.sh
It can let grub-mkrescue produce a partition layout like:

  Device                     Boot Start   End Sectors  Size Id Type
  grub-mkrescue-offst16.iso1 *       64 24171   24108 11.8M 83 Linux
  grub-mkrescue-offst16.iso2      24172 29931    5760  2.8M ef EFI (FAT

(Made with xorriso options -partition_offset 16 -iso_mbr_part_type 0x83)
Partition 1 is mountable as ISO 9660. The whole device too. The latter
claims the full image size including EFI partition as its filesystem size.

------------------------------------------------------------------------

Many thanks for sharing this info. It will help me a lot when next time
i see optimistic proposals about how to make ISOs bootable from USB stick.

If anybody knows a public document where the tolerant firmware habit is
adopted by some standards entity (or market power), then i would be glad
to learn.


Have a nice day :)

Thomas



  reply	other threads:[~2019-05-11 19:44 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-11 18:15 grub-mkrescue: Problem with MBR partition table at start of EFI partition Michael Schierl
2019-05-11 19:42 ` Thomas Schmitt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-04-21 13:43 Thomas Schmitt
2019-04-21 17:30 ` Vladimir 'phcoder' Serbinenko
2019-04-21 19:29   ` Thomas Schmitt
2019-04-24 20:32 ` Daniel Kiper
2019-04-25  6:00   ` pelzflorian (Florian Pelz)
2019-04-25  8:18   ` Thomas Schmitt
2019-04-25  9:36     ` pelzflorian (Florian Pelz)
2019-04-30 23:42     ` Vladimir 'phcoder' Serbinenko
2019-05-01  7:33       ` Thomas Schmitt
2019-05-09 20:21         ` Chris Murphy
2019-05-09 21:21           ` Thomas Schmitt
2019-05-10  6:21             ` Thomas Schmitt
2019-05-10  7:09               ` Thomas Schmitt
2019-05-10 12:12                 ` pelzflorian (Florian Pelz)
2019-05-10 13:46                   ` Thomas Schmitt
2019-05-10 16:12                     ` pelzflorian (Florian Pelz)
2019-05-10 16:27                       ` Thomas Schmitt
2019-05-11 10:51                         ` pelzflorian (Florian Pelz)
2019-05-11 12:05                           ` Thomas Schmitt
2019-05-11 14:20                             ` pelzflorian (Florian Pelz)
2019-05-11 17:31                               ` Thomas Schmitt
2019-05-11 19:13                                 ` pelzflorian (Florian Pelz)
2019-05-11 20:39                                   ` Thomas Schmitt
2019-05-13 21:04                                     ` Daniel Kiper
2019-05-13 21:55                                       ` Thomas Schmitt
2019-05-14  6:04                                       ` Thomas Schmitt
2019-05-15  9:45                                         ` Daniel Kiper
2019-05-15 10:57                                           ` Thomas Schmitt
2019-05-16 10:29                                             ` Daniel Kiper
2019-05-16 12:18                                               ` Thomas Schmitt
2019-05-20 12:35                                                 ` Daniel Kiper
2019-05-20 14:37                                                   ` Thomas Schmitt
2019-06-15  0:15                                                     ` Chris Murphy
2019-06-15  6:01                                                       ` pelzflorian (Florian Pelz)
2019-05-09 19:51       ` Chris Murphy
2019-05-09 21:06         ` Thomas Schmitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16655678563486501500@scdbackup.webframe.org \
    --to=scdbackup@gmx.net \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.