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

Re: UEFI corner case - installer booted in UEFI mode, existing system in BIOS mode



On Sun, Sep 28, 2014 at 02:02:53AM +0100, Steve McIntyre wrote:
>Package: partman-efi
>Version: 47
>Severity: important
>Tags: d-i
>
>Ad originally described in [1], but no bug was ever filed to
>match. #695048 is related, I think. Time to file a bug about this to
>help track work to fix it...
>
>We have a machine with both UEFI and BIOS-mode boot available, with an
>existing BIOS-mode Windows installation (e.g. Windows 7 in this case)
>*but* the machine is set up to try and boot UEFI first and *then* fall
>back to BIOS (for some reason).
>
>The existing Windows installation boots via the fallback, and the user
>has no reason to ever investigate this. However, d-i will happily boot
>in UEFI mode. When we get to partitioning, there is no EFI System
>Partition (ESP), as Windows isn't using one. We then get to either of
>two potentially bad cases:
>
> (a) the user shuffles partitions around and makes an ESP, installs
>     the system OK including grub-efi. They then have a machine that
>     will boot via UEFI to grub, but maybe will not be able to boot
>     Windows. I've not tested this directly yet, but I can see this
>     happening. To get to their existing Windows installation, the
>     user will have to switch boot mode in the firmware setup - bad.
>
> (b) the user does not make an ESP, installs a system but grub-efi
>     fails to install properly for that reason. I'm seeing bug reports
>     that suggest this path does *not* necessarily give a clear error
>     to the user, maybe in some cases no error at all. They reboot
>     their newly-installed system and find it immediately goes into
>     Windows with no sign of their new Debian installation at all.
>
>[1] https://lists.debian.org/debian-boot/2014/02/msg00080.html

I'm not 100% sure that partman-efi is the right package for the bug
report, but it's as good as any. So, it's way past time to fix this
particular bug. After a fair amount of playing with systems like this
and discussing with folks, my proposed solution is:

 1. Somewhere during initial partman setup (probably partman-efi?), we
    look to see if:

    (a) we're in UEFI mode (trivially true if we're in partman-efi); and

    (b) we have an existing set of partitions that are *not* set up
        for UEFI boot (can we use os-prober to get a list at this
        stage?) Look for an existing partition setup and maybe
        bootable flags, but no detectable EFI System Partition.

 2. If the above is the case, warn the user:

    "Your computer's firmware has started the installer in UEFI mode
     but there are existing Operating Systems already installed:

     * OS 1
     * OS 2
     ...

     "These will not boot in UEFI mode. If you still wish to be able
     to boot one of these existing systems after installing Debian in
     UEFI mode, this will be difficult. Your best way forward is to
     reboot and restart the installer in 'BIOS compatibility
     mode'. You will need to reconfigure your computer's boot options
     to do this.

     "If you wish to install Debian in UEFI mode and don't care about
     keeping the ability to boot one of the existing systems,
     continue."

     <Go Back>	<Continue>

     If the user wants to continue, we could even suggest blanking the
     partition table(s) and starting again with GPT, but I don't think
     we currently have a "blank partition table" option exposed within
     d-i?

What do people think of this plan? What have I missed?

-- 
Steve McIntyre, Cambridge, UK.                                steve@einval.com
Welcome my son, welcome to the machine.


Reply to: