#1033678 installation-reports: Unbootable install: MBR partition unusable with UEFI

#1033678#5
Date:
2023-03-29 23:21:03 UTC
From:
To:
Hi. I just installed a bookworm candidate. This worked OK through
partitioning and reboot, but I cannot boot into the system.

This is an amd64 recent-ish laptop. The disk is a PCIe SSD, not SATA.

I'm installing from a USB drive. To make this work, I had to turn off
secure-boot and UEFI in the BIOS. I believe that the result of this is
the Debian partitioner defaulted to an MBR partition, not a GPT
partition.

The BIOS of this laptop only allows booting from the PCIe SSD in UEFI
mode (so I need to change the BIOS setting before even trying). But even
after that, the machine doesn't let me boot off that disk. Some
searching tells me this is because GPT partitions are required for UEFI
booting, but Debian made an MBR partition.

I'm not 100% sure of the exact cause. But I suspect strongly is that
booting the install media without UEFI broke installing to an UEFI-only
disk.

Thanks.

#1033678#10
Date:
2023-03-30 00:00:08 UTC
From:
To:
Just to confirm - you were not able to configure the USB Drive for EFI boot?
#1033678#15
Date:
2023-03-30 00:14:57 UTC
From:
To:
Hi Dima,

Dima Kogan <dkogan@debian.org> (2023-03-29):

Also, which image did you use?

You have not given a single detail about that machine.

Why did you need that in the first place? How did you put the
installation image onto that USB drive?

In a nutshell, BIOS means MBR, UEFI means GPT. (This is a very gross
oversimplification though.)

I'm not sure why the firmware would allow running an installer in BIOS
mode and not boot off from the installed system… in BIOS mode too.


Cheers,

#1033678#22
Date:
2023-03-30 04:43:10 UTC
From:
To:
Hi. Thank you both for replying.


Tim Bell <raekuul@gmail.com> writes:

Correct. For whatever reason this wasn't possible in this BIOS, at least
not in any way I could figure out. Possibly I created the install media
incorrectly? I downloaded this:

  debian-bookworm-DI-alpha2-amd64-netinst.iso

from here:

https://cdimage.debian.org/cdimage/bookworm_di_alpha2/amd64/iso-cd/

and I wrote that .iso to /dev/sde. There was no obvious "usb image", but
just using the CD image appeared to work. I could boot and run the
installer, at least with UEFI turned off.



Cyril Brulebois <kibi@debian.org> writes:

Alpha 2. The link is above.

I'm trying to give relevant detail. This is a Dell Latitude 5420 rugged.
What else do you want to know?

See above. Even if I didn't do this properly, installing an unbootable
OS is not very nice.

OK. Sorry, I managed to be blissfully ignorant for decades, and this is
the first time I'm touching GPT or UEFI. So I'm not well-versed in this
at all.

You would expect the Debian installer to write an MBR partition and then
you would expect the machine (running with UEFI disabled) to be able to
use this MBR partition? I would expect this too, I think.

I'm reading Dell's notes a bit. This suggests that PICe SSD devices are
UEFI-only:

https://www.dell.com/support/kbdoc/en-us/000132410/what-are-pcie-ssds-and-how-to-use-them-as-a-boot-drive-for-a-dell-pc

This makes me think that installing to an MBR on the SSD on this machine
is never correct. It also makes me think that creating my install media
in a way that would make UEFI boot with it would have avoided this. But
this failure mode isn't great. Can we detect these UEFI-only drives in
any way? Can I ask the installer create a GPT instead of an MBR somehow?

Thanks

#1033678#27
Date:
2023-03-30 06:30:04 UTC
From:
To:
Hello,

Why ? What happens if UEFI boot is enabled ?
How did you prepare the USB drive ?
What installation image did you use (full file name and URL please) ?

There is no such requirement in the UEFI specification. UEFI boot
supports either GPT or MSDOS.

If the installer was booted in BIOS/legacy mode, it installed GRUB for
legacy boot.

#1033678#32
Date:
2023-03-30 06:30:04 UTC
From:
To:
Hello,

Why ? What happens if UEFI boot is enabled ?
How did you prepare the USB drive ?
What installation image did you use (full file name and URL please) ?

There is no such requirement in the UEFI specification. UEFI boot
supports either GPT or MSDOS.

If the installer was booted in BIOS/legacy mode, it installed GRUB for
legacy boot.

#1033678#37
Date:
2023-03-30 16:12:05 UTC
From:
To:
Pascal Hambourg <pascal@plouf.fr.eu.org> writes:

If UEFI was enabled, the USB device isn't seen by the machine in its
list of valid boot devices

From yesterday's email:

  I downloaded this:

    debian-bookworm-DI-alpha2-amd64-netinst.iso

  from here:

https://cdimage.debian.org/cdimage/bookworm_di_alpha2/amd64/iso-cd/

  and I wrote that .iso to /dev/sde

I did "cp debian-bookworm-DI-alpha2-amd64-netinst.iso /dev/sde"

Was this a choice the installer made, or was it the only option? I don't
actually have a workaround yet. And if the installer had a check box to
ask for a GPT even though the install media was booted without UEFI,
then I could at least get this working after some fiddling.

#1033678#42
Date:
2023-03-30 16:12:05 UTC
From:
To:
Pascal Hambourg <pascal@plouf.fr.eu.org> writes:

If UEFI was enabled, the USB device isn't seen by the machine in its
list of valid boot devices

From yesterday's email:

  I downloaded this:

    debian-bookworm-DI-alpha2-amd64-netinst.iso

  from here:

https://cdimage.debian.org/cdimage/bookworm_di_alpha2/amd64/iso-cd/

  and I wrote that .iso to /dev/sde

I did "cp debian-bookworm-DI-alpha2-amd64-netinst.iso /dev/sde"

Was this a choice the installer made, or was it the only option? I don't
actually have a workaround yet. And if the installer had a check box to
ask for a GPT even though the install media was booted without UEFI,
then I could at least get this working after some fiddling.

#1033678#47
Date:
2023-03-31 09:20:37 UTC
From:
To:
Ugh, that sounds like a *particularly* crappy firmware bug then :-(
What boot options does the firmware list in that case?

Hmm, checking:

https://www.dell.com/support/manuals/en-uk/latitude-14-5420-laptop/lati_5420_om/uefi-bios?guid=guid-892bb204-aa23-43e3-aa1f-0c2b66c0ddc3&lang=en-us

the "Important Information" section looks like it might be relevant?

OK, that all sounds fine.

This *might* help you:

 * partman:

   If the system is booted in EFI mode, partman defaults to GPT for
   disk partitioning. If not, it will default to MSDOS.

   In partman, hitting <enter> on the raw disk will allow you to
   create a new blank partition table; this will take thd default type
   normally, and you won't be asked.

   *If* you switch to expert mode from the main menu (i.e. drop
   question priority), then go back into partman, you can choose to
   use a different partition type. By all means try GPT here, and
   create an EFI system partition (ESP) too.

 * grub-installer:

   This depends on the system being booted in EFI mode to do the right
   thing. If you're not, you *might* be able to make things work by
   editing the script /usr/bin/grub-installer and replace the line
   ARCH="$(archdetect)" with ARCH="amd64/efi". I've not tested this,
   but you *might* be able to progress here.

The installer is *very* much designed to only set up EFI-relevant
stuff if you're booted in EFI mode.

#1033678#52
Date:
2023-03-31 22:41:00 UTC
From:
To:
Hi all. Thanks for the replies. I was just able to get it installed. And
here are some notes about what happened, and about how we can do better.

I got it running by using a friend's usb installer. HIS usb disk was a
valid UEFI boot disk, so I could boot in UEFI mode, and do the normal
install, which completed successfully.

As stated earlier, I made my USB install disk like this:

This worked, but apparently this was not a valid UEFI thing. Which I
didn't know. Maybe some clearer instructions on the website would help.
I was here:

https://www.debian.org/devel/debian-installer/

Clicking on "amd64" under "other images (netboot, USB stick, etc.)"
gives me listings of files that I don't know what to do with. I ended up
getting the "CD" image, which gave me an .iso file that I did know what
to do with. The iso-cd page:

https://cdimage.debian.org/cdimage/bookworm_di_alpha2/amd64/iso-cd/

has some quick instructions which maybe would be helpful for those that
don't know what to do with an .iso. It does mention UEFI, but only when
describing the "mac" image. So better UEFI notes on the iso-cd page. And
any kind of notes on the USB page would be good.


Next. Steve McIntyre suggested installing in "expert mode", and then
explicitly creating a GPT partition table. This worked, but I didn't
read his suggestion closely enough, and didn't add an ESP partition.
Because I didn't know anything about it. The installer allowed me to do
that, and once again, created an unbootable installation. Should the
installer have yelled at me? Just because I was in "expert mode" doesn't
mean I know what I'm doing :)

I guess that's it. In the default path where the installer just picks
the partition kind (MBR, GPT, ....) I don't think it ever said anything
about that being a choice at all. If it at least had text somewhere
about creating an "MBR", or something, that would probably be good.

Thanks.

#1033678#57
Date:
2023-03-31 23:20:09 UTC
From:
To:
Hello,

Le 01/04/2023 at 00:41, Dima Kogan wrote:

How was this "usb installer" created ?

It is bootable in EFI mode on all UEFI PCs I tested.

Anyway the installer partitioner (partman) would not allow to create an
EFI system partition when booted in BIOS/legacy mode, and the boot
loader installer (grub-installer) would not allow to install GRUB for
EFI boot (even though some UEFI firmware accept to boot from a regular
FAT partition, or you may create an EFI partition with fdisk-udeb or
parted-udeb in an installer shell, and you may install grub-efi-amd64
with apt-install in an installer shell).