Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #200675

Re: And yet another UEFI/BIOS question: Work on both.

From Pascal Hambourg <pascal@plouf.fr.eu.org>
Newsgroups linux.debian.user
Subject Re: And yet another UEFI/BIOS question: Work on both.
Date 2018-09-27 15:10 +0200
Message-ID <wCEdj-3KR-7@gated-at.bofh.it> (permalink)
References (3 earlier) <wAbSa-6CR-7@gated-at.bofh.it> <wAngC-4Xl-9@gated-at.bofh.it> <wAylH-32Y-3@gated-at.bofh.it> <wBe1z-24L-11@gated-at.bofh.it> <wBfgZ-2YD-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Le 23/09/2018 à 18:18, Patrick Bartek a écrit :
> On Sun, 23 Sep 2018 10:58:54 -0400
> Wayne Sallee <Wayne@WayneSallee.com> wrote:
> 
>> What do you recommend for setting up a system that will boot in
>> either UEFI or BIOS mode, so if it is moved back and forth between
>> UEFI and BIOS, it will boot every time?
> 
> I recommend you learn how to use Google or DuckDuckGo, etc. searches for
> such basic queries.

This is not a basic query. I have spend quite some time doing 
experiments and have not come up with a perfect universal solution yet.

If you want your system to work with old 32-bit CPUs, you must install 
the i386 architecture. After the installation you can add the amd64 
architecture with dpkg and install a 64-bit kernel. Note that a 32-bit 
kernel can work with a 64-bit UEFI firmware but EFI variables will be 
available only with a 64-bit kernel. A 64-bit kernel can work with a 
32-bit UEFI firmware (if the CPU is 64-bit of course) and EFI variables 
will be available.

You must choose the partition table format between GPT and DOS/MBR.
I read that some broken BIOS may not boot a disk with a GPT partition 
table, although I haven't seen any yet.
I also read that some broken UEFI implementations may force boot in 
native EFI mode when a GPT partition table is present, and in 
BIOS/legacy mode when a DOS/MBR partition table is present, although I 
haven't see any either yet.

However I have observed that quite many BIOS or UEFI implementations 
operating in legacy mode won't boot a disk (either GPT or DOS/MBR) if no 
partition in the DOS partition table/protective MBR has the boot flag 
set. But setting the boot flag on the protective GPT partition is 
against the GPT specification, and I have one example of a UEFI 
implementation which will not boot such a disk in native EFI mode.

So I guess you get a better chance with a DOS/MBR partition table. Note 
that this is what the Debian installer/live ISO-hybrid images use.

If you choose GPT anyway, it is recommended to create a 1 MiB 
unformatted "BIOS boot" partition for GRUB BIOS.

Create a 10 to 100 MB EFI system partition formatted as FAT and mount it 
on /boot/efi.

In order to boot either in BIOS or EFI mode, you have to install both 
BIOS and EFI boot loaders. If you choose GRUB for both, the packages are
- grub-pc to install GRUB for PC with BIOS
- grub-efi-amd64 to install GRUB for PC with 64-bit UEFI firmware
- grub-efi-ia32 to install GRUB for PC with 32-bit UEFI firmware

But these packages conflict with one another so are mutually exclusive. 
You could install one and run grub-install, then uninstall it, install 
the next one and run grub-install again and so on. But I suggest to 
install one, say grub-pc, and install grub-efi-{amd64,ia32}-bin instead, 
which do not conflict with each other.

Now you can install the different GRUB boot loaders for each platform :
# BIOS
grub-install --target=i386-pc /dev/sda
# EFI 32 bit
grub-install --target=i386-efi --removable
# EFI 64 bit
grub-install --target=x86_64-efi --removable

These commands work regardless of whether the system was booted in EFI 
or BIOS mode or EFI variables are available.
The --removable option will install the boot loader in the "removable 
device" path /boot/efi/EFI/BOOT/boot{arch}.efi.

> The following was the first result in the list of my
> search. Total time spent: about 15 seconds.
> 
> https://truthseekers.io/everything-you-need-to-know-to-dual-boot-uefi-gpt-bios-mbr-partitions-swap-space-and-more/
> 
> Also, read up on "chainloading."

Dual boot and chainloading have nothing to do with Wayne's query.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Yet another UEFI/BIOS question steve <dlist@bluewin.ch> - 2018-09-19 17:00 +0200
  Re: Yet another UEFI/BIOS question Darac Marjal <mailinglist@darac.org.uk> - 2018-09-19 17:30 +0200
    Re: Yet another UEFI/BIOS question steve <dlist@bluewin.ch> - 2018-09-19 18:00 +0200
  Re: Yet another UEFI/BIOS question Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-09-19 23:40 +0200
    Re: Yet another UEFI/BIOS question steve <dlist@bluewin.ch> - 2018-09-20 09:00 +0200
      Re: Yet another UEFI/BIOS question Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-09-20 20:30 +0200
        [SOLVED] Re: Yet another UEFI/BIOS question steve <dlist@bluewin.ch> - 2018-09-21 08:40 +0200
          Re: [SOLVED] Re: Yet another UEFI/BIOS question Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-09-21 20:30 +0200
            Re: [SOLVED] Re: Yet another UEFI/BIOS question steve <dlist@bluewin.ch> - 2018-09-22 07:00 +0200
              Re: [SOLVED] Re: Yet another UEFI/BIOS question Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-09-22 10:10 +0200
                Re: [SOLVED] Re: Yet another UEFI/BIOS question steve <dlist@bluewin.ch> - 2018-09-22 10:50 +0200
            And yet another UEFI/BIOS question: Work on both. Wayne Sallee <Wayne@WayneSallee.com> - 2018-09-23 17:00 +0200
              Re: And yet another UEFI/BIOS question: Work on both. Patrick Bartek <nemommxiv@gmail.com> - 2018-09-23 18:20 +0200
                Re: And yet another UEFI/BIOS question: Work on both. Wayne Sallee <Wayne@WayneSallee.com> - 2018-09-23 23:30 +0200
                Re: And yet another UEFI/BIOS question: Work on both. Patrick Bartek <nemommxiv@gmail.com> - 2018-09-24 03:00 +0200
                Re: And yet another UEFI/BIOS question: Work on both. David Wright <deblis@lionunicorn.co.uk> - 2018-09-24 21:20 +0200
                Re: And yet another UEFI/BIOS question: Work on both. Michael Stone <mstone@debian.org> - 2018-09-24 21:30 +0200
                Re: And yet another UEFI/BIOS question: Work on both. Pascal Hambourg <pascal@plouf.fr.eu.org> - 2018-09-27 15:10 +0200
              Re: And yet another UEFI/BIOS question: Work on both. David Wright <deblis@lionunicorn.co.uk> - 2018-09-23 20:40 +0200

csiph-web