[GTALUG] war story: mixing up UEFI and Legacy Booting
D. Hugh Redelmeier
hugh at mimosa.com
Fri Sep 15 15:09:10 EDT 2017
==== background (feel free to skip)
"Legacy Booting" means the old fashioned way that PCs booted:
- read the first sector of a disk into RAM ("the Master Boot Record"
AKA MBR)
- jump to that RAM copy: start executing 8086 instruction there.
(This is the same way the original IBM PC operated and completely
ignores memory management, 32-bit mode, and 64-bit mode.
- the BIOS provides routines for crude I/O (but they only work in 8086
mode)
- by convention, the MBR "understands" the traditional kind of
partitioning, in part because the partition table is within the MBR
itself (but only the four primary partitions). Thus it can chain to the
boot record on the "active" partition.
UEFI booting is more, uh, sophisticated. The UEFI firmware (it should not
be called BIOS since it isn't a BIOS) understands GPT partitioning and it
understands the FAT32 filesystem. There is a distinguished partition
called the EFI System Partition that is FAT32. Or multiple such
partitions, but that confuses at least Windows. The firmware can run
programs from that partition in a fairly rich environment.
Stupid regression: 32-bit UEFI can only run 32-bit programs; 64-bit UEFI
can only run 64-bit programs. Why is that a regression? Because good old
16-bit BIOS never got in the way of 32-bit or 64-bit modes. But the
64-bit Linux now can run on a 32-bit UEFI system if the underlying
processor supports 64-bit mode.
Most modern PC processors can handle 64-bit mode. The exceptions seem to
be dying (Intel's Edison comes to mind). For market-segmentation reasons
there are a number of 32-bit UEFI systems at the low end but those have
64-bit processors (eg. low-end notebooks and tablets).
Generally UEFI mode is better:
+ supported by all modern PC systems
+ naturally supports GPT partitioning and large drives
+ supports Secure Boot
Why would you want to use Legacy mode?
+ you want to run MS-DOS or FreeDOS or BeOS or some other ancient
system.
Really: this is sometimes necessary if you want to flash new
firmware and you cannot or don't want to use Windows for this.
(But some systems allow flashing from the UEFI firmware itself.)
+ you don't want to learn about the new world of UEFI
+ you want to port an old installed system directly to new hardware
(using old disks or at least old disk images).
+ you want to dual-boot with a system already installed in Legacy
Mode.
==== foreground
There is another use case for Legacy Mode: you accidentally install
Linux in Legacy mode. This is especially unfortunate if you wish to
dual boot with Windows that has been installed with UEFI booting.
This is probably a big mistake, and I don't know a better fix than
re-installing.
This happened to my son. Why?
>From a certain amount of experience, I've found that too many systems
have firmware that is coy about exposing the UEFI / Legacy boot
option.
- some systems just plain don't offer Legacy Mode (eg. most Windows
tablets). Problem solved.
- on my son's Asus notebook, there is a firmware configuration choice
"Launch CSM". That really means "Legacy Mode Booting". This
confused me since I have several systems that have a similar choice
that doesn't cause Legacy Mode Booting.
- on my MSI Cubi's firmware the undocumented option is called
something like "Windows 8/8.1" mode.
- other systems I have allow more flexibility. The boot menu offers
to boot a device either way if it looks as if it could be booted
either way.
- if you can enable or disable CSM, you must enable it for Legacy
Booting but on most systems it doesn't force Legacy Mode booting.
When Fedora installation medium is booted in Legacy Mode, it will
install a Legacy Mode system; when booted in UEFI Mode, it will
install a UEFI Mode system. It doesn't wave flags about this
decision.
It would be nice if Fedora noticed that it was installing a Legacy
system on a disk with a EFI System partition and warned about this.
More information about the talk
mailing list