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


Groups > linux.debian.user > #245421

Converting a BIOS (CSM) Debian installation into UEFI

From David Wright <deblis@lionunicorn.co.uk>
Newsgroups linux.debian.user
Subject Converting a BIOS (CSM) Debian installation into UEFI
Date 2022-02-15 17:20 +0100
Message-ID <DR8Ix-20ug-13@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


With the threads on "Stupid question" and "Throw an hard drive"
in d-u at the moment, this seems timely:

I have a drive which contains two Debian installations, one of which
(B) was installed for BIOS booting, and the other (E) was installed
with EFI booting. I would like to convert B into a EFI system too. ¹

Each system has its own Grub installation, and os-prober has inserted
entries for both systems into both systems. Consequently this means
that I can boot in EFI-mode and run B, and I can boot in BIOS-mode
and run E.

As far as I can tell, the process for B to EFI should just involve:
. boot B in EFI mode
. mkdir /boot/efi/
. add it to /etc/fstab
. mount the ESP onto it
. remove grub-pc, grub-pc-bin
. install (with Recommends) grub-efi-amd64, grub-efi-amd64-bin, grub-efi-amd64-signed,
  shim-signed, shim-signed-common, shim-helpers-amd64-signed, shim-unsigned
. run update-grub
. run grub-install (which should now modify /boot/efi, not the MBR).

Is anything else required for B to become a "native EFI" installation?

This conversion process will, I think, make the system boot into
the EFI-ed B by default. If I want to make E boot by default again,
should I boot E and run update-grub and grub-install?³
Or should I do this by running efibootmgr?

--

¹
More details: B was installed for dual-booting with EFI Windows,
by switching into the BIOS (CMS) for booting B. Since then,
Windows and almost all its entrails (various recovery, data and
reserved partitions) ² have been overwritten with Debian
installation E.

The disk has all the necessary components: GPT partitioning, with
a protective MBR and BIOS boot partition for B's use, and the
original ESP for E's (and B's future) use, plus shared /home
(encrypted), and a random encrypted swap.

²
The ESP still has a "fossil" EFI/Microsoft/Boot/bootmgfw.efi file
which merely causes grub-efi (through os-prober) to write a
useless (but benign) entry in grub.cfg.

³
With totally BIOS systems, if I wanted a system "A" to be the
default system when booted, I could boot A and run update-grub
and grub-install. This would preen A's grub.cfg, and make the
protective MBR boot to it.

Cheers,
David.

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


Thread

Converting a BIOS (CSM) Debian installation into UEFI David Wright <deblis@lionunicorn.co.uk> - 2022-02-15 17:20 +0100
  Re: Converting a BIOS (CSM) Debian installation into UEFI Felix Miata <mrmazda@earthlink.net> - 2022-02-15 20:30 +0100
    Re: Converting a BIOS (CSM) Debian installation into UEFI David Wright <deblis@lionunicorn.co.uk> - 2022-02-22 16:20 +0100

csiph-web