Web lists-archives.com

Re: Installing Debian on a Minnowboard Turbot with installer on USB stick?




Hi,

didier gaumet wrote:
> > https://minnowboard.org/tutorials/best-practice-boot-media-selection

Rick Thomas wrote:
> [...] when I dd that same .iso
> onto a USB stick, then plug the stick into the USB slot on the Turbot, will
> not be recognized as a bootable medium.

Point 4 of that tutorial says:

  "NOTE: If your USB device is not listed in the Boot Manager list,
   confirm that it’s GPT formatted and contains a valid EFI boot
   partition."

The Debian ISOs are not recognizably GPT formatted, although they contain
nearly all the bytes of a valid GPT. Their MBR partition table is not
"protective" to indicate the presence of a GPT.

Needed would be a MBR partition table with only one partition of type 0xEE
and no other partitions, deletion of GPT partition 2 because it overlaps
with the EFI partition, and the specs compliant Type GUID for the EFI
partition.


Rick Thomas wrote:
> > > It seems odd that the exact same bits should be seen as bootable when
> > > presented on a DVD, but not when presented on a USB stick…

Pascal Hambourg wrote:
> > The expected boot structures on a DVD and a
> > USB stick (or floppy, hard disk...) are completely different.

> So the UEFI firmware is more forgiving of a partition table that is “invalid
> from a strict point of view” when it’s coming from a physical DVD, than it
> is when it’s coming from a USB stick?

No. A standards compliant firmware ignores any partition table when the
medium is CD, DVD, or BD. It then rather interprets the El Torito boot
record and the boot catalog to find a suitable boot image. In case of EFI
the selected image is then used as EFI System Partition with FAT filesystem
and startup program.

The Debian ISOs for amd64 mark their EFI System Partition by MBR partition
table and by El Torito.


> Can you suggest any way to get around the problem?

Repacking the ISO by grub-mkrescue would produce a GPT.
But the GRUB part of that job is out of my scope.


As said, Debian ISOs are not very far from a real GPT.

Normally i would not trust any partition editor not to go mad on the job.
But changing stuff by hand in GPT means re-computing the CPT checksum.
This would become tricky.

So lets try gdisk. Regrettably partition 1 of the nearly-GPT is ill
beyond repair (at least by gdisk's means). So it has to be deleted.
To our luck it should not be expected by any part of the booting system.

  $ cp debian-9.3.0-amd64-netinst.iso test.iso
  $ /sbin/gdisk test.iso
  GPT fdisk (gdisk) version 0.8.10

  Partition table scan:
    MBR: MBR only
    BSD: not present
    APM: not present
    GPT: present

  Found valid MBR and GPT. Which do you want to use?
   1 - MBR
   2 - GPT
   3 - Create blank GPT

  Your answer: 2
  Using GPT and creating fresh protective MBR.
  Warning! Main partition table overlaps the first partition by 64 blocks!
  You will need to delete this partition or resize it in another utility.

  Command (? for help): d
  Partition number (1-2): 1

  Command (? for help): t
  Using 2
  Current type is 'Microsoft basic data'
  Hex code or GUID (L to show codes, Enter = 8300): ef00
  Changed type of partition to 'EFI System'

  Command (? for help): p
  Disk test.iso: 593920 sectors, 290.0 MiB
  Logical sector size: 512 bytes
  Disk identifier (GUID): 52A61562-549F-43BB-805F-66F9583C139F
  Partition table holds up to 208 entries
  First usable sector is 64, last usable sector is 593866
  Partitions will be aligned on 16-sector boundaries
  Total free space is 592971 sectors (289.5 MiB)

  Number  Start (sector)    End (sector)  Size       Code  Name
     2            3760            4591   416.0 KiB   EF00  ISOHybrid1

  Command (? for help): w

  Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
  PARTITIONS!!

  Do you want to proceed? (Y/N): y
  OK; writing new GUID partition table (GPT) to test.iso.
  Warning: The kernel is still using the old partition table.
  The new table will be used at the next reboot.
  The operation has completed successfully.
  $

Now the ISO should have a GPT which marks the EFI System Partition.
Put it onto the USB stick and see what happens.

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

If this does not work, we could try to erase all partition tables and
set up a new one from info which we learned from the old one.


Have a nice day :)

Thomas