[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#821341: debian-installer: unbootable, no gpt partition for uefi install



Hey Josh,

On Mon, Apr 18, 2016 at 10:33:31PM +0200, josh wrote:
>Hi Steve,
>
>thanks for your reply.
>
>> It depends very much on the machine involved, to be honest - many will
>> boot UEFI from appropriately partitioned MBR-partitioned disks. It
>> depends very much on the firmware of the machine here.
>
>hmmm...I didn't wade through the 1000+ page UEFI specs myself, but this
>entry on superuser.com cites them and claims that according to the
>specs, a UEFI boot partition /must/ reside on a gpt disk (this makes
>some sense since gpt is part of the UEFI specs afaik...):
>
>http://superuser.com/questions/563074/do-hard-drives-need-a-guid-partition-table-gpt-to-boot-in-uefi-mode
>
>This MSDN article states the same
>(https://msdn.microsoft.com/en-us/library/windows/hardware/dn640535%28v=vs.85%29.aspx#gpt_faq_mixed_gpt_mbr):
>
>"Systems that support UEFI require that boot partition must reside on a
>GPT disk. Other hard disks can be either MBR or GPT."

That's just for Windows booting - see further down the same page

"Do only GPT Disks have ESPs?

No, MBR disks can also have ESPs. UEFI specifies booting from either
GPT or MBR. The ESP on an MBR disk is identified by partition type
0xEF. However, Windows does not support booting UEFI from MBR disks or
0xEF partitions."

Section 5.2 in UEFI 2.5
(http://www.uefi.org/sites/default/files/resources/UEFI%202_5.pdf)
deals with UEFI and MBR, and specifcally lists supporting an ESP with
partition type 0xEF.

The superuser.com answer may sound authoritative, but I believe it to
be incorrect.

>> This is clearly difficult to do in some cases, e.g. if
>> other OSes are on the system already.
>
>I agree that if somebody's installing to drive that already has
>something installed on it, than you can't just go and change the mbr to
>a gpt without asking. I was doing a virgin install of a new machine
>originally partitioning and formatting a new blank disk. In this case
>you should definitely have at least the option of having a gpt and
>probably a notification that this would be preferable.

If your disk was blank and you've booted the installer in UEFI mode,
it will choose GPT by default. That's the standard flow. If you choose
to "use entire disk", it will deliberately choose to switch from MBR
partitioning to GPT partitioning at that point. I've just tested
exactly this with the 8.4.0 amd64 netinst. Are you totally sure that
your disk was blank up-front? I'm wondering why you've not had the
same experience I've had developing and using this code!

>As far as I remember, I /did/ select expert install and I didn't find an
>option for choosing gpt. Are you saying there is one, and I missed it?
>If so, it doesn't seem easily findable (or I'm blind, or didn't select
>expert install after all...).

There is a question available, at priority=low which is what the
expert installer uses, yes. If you select the disk itself in the
partitioning menu, it will ask you if you want to create a new blank
partition table and then it will ask you what partition format to
use. It's not the most obvious, admittedly. :-)

>If it is the case that the UEFI specs actually require a gpt for efi
>boot, than a gpt should be the *default* for an UEFI install imho. If
>d-i detects another OS and the disk is mbr, than d-i should display a
>message either asking whether the disk should be converted to mbr
>stating the risks and/or state that the system likely won't be UEFI
>bootable if a gpt is not selected. All this should be available even in
>a non-expert install, again imho.
>
>Also, if it is the case that the UEFI specs require a gpt for efi boot,
>and some systems are uefi booting from mbrs, than those are the buggy
>ones, and whether one hopes it or not, one might expect that more and
>more mainboard chipsets will implement the specs correctly and not uefi
>boot from non-gpt disks. I have an MSI mainboard, which I think are
>pretty good, and it definitely refused to boot from an mbr disk with an
>efi partition.

We *do* default to GPT for most UEFI installations right now, but even
so I'm fairly convinced that MBR should work on most machines (both
from experience and from reading the specifications). It's not
uncommon that edge conditions bite people, though - various UEFI
implementations in the wild are notoriously buggy and ignore parts of
the specification in favour of "just do what Windows works with, and
test that only." :-( See

  http://wiki.osdev.org/Broken_UEFI_implementations 

for a table of known bugs that the Linux distro developers have put
together to share our experiences in this area. It might be worth
mentioning that your MSI mainboard doesn't like MBR UEFI boot there.

In terms of improving d-i, we *can* add a warning message that some
machines may not boot UEFI on MBR. I'll try to get to that before the
stretch release, but I'll be honest and say that it's not going to be
a high priority for me. Patches welcome if you'd like to help here!
:-)

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
"I can't ever sleep on planes ... call it irrational if you like, but I'm
 afraid I'll miss my stop" -- Vivek Das Mohapatra


Reply to: