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

Re: UEFI grub install fails



On Tue 19 Aug 2025 at 16:15:09 (-0700), Van Snyder wrote:

> So I tried to run it but now Windoze 10 doesn't boot after the
> struggles I went through to "repair" the drive after updating the Dell
> Latitude E5470 BIOS from 1.19.3 to 1.34.3 so it would boot Debian 13.
> And it doesn't appear in the grub menu even though I set
> "DISABLE_OS_PROBER=false before running update-grub. I think that's
> because the disk is MBR, Debian is nonetheless booted as UEFI, and
> Windoze 10 wasn't installed UEFI (it was installed when I got the
> computer).  Apparently, if grub boots UEFI it can't boot a legacy
> partition, and vice versa.

I'm assuming: you haven't yet converted your disk from MBR to GPT;
you can boot in BIOS mode or UEFI mode; Windows ran on this computer
when booted in BIOS mode; you can boot Linux now that the EFI
partition is more favourably placed.

When you boot in UEFI mode, the EFI partition is read and Grubᵁ
(which was installed with grub-efi-*) runs and boots up Linux—correct?

To boot Windows, you need an MBR that finds and runs Grubᴮ (which
has been installed by grub-pc) and whose grub.cfg has a menuentry
that chain loads the Windows boot loader. (I can't help with knowing
where Windows put its boot loader.)

To do this, AIUI, you need to boot a system in BIOS mode, and the
obvious way to do this is, say, the debian-installer on a USB stick.
You then need a small partition in the PC disk that you can mount as
/boot¹, into which grub-pc, when run, will place its /boot/grub
subdirectory containing all the necessary files that Grubᴮ needs to run.
A bit of handwaving here—I haven't run grub-pc from the d-i in rescue
mode, but only as the last step when installing a system.

I'll just point out that grub-efi/Grubᵁ and grub-pc/Grubᴮ are unaware
of each other's existence, the former being inside the EFI partition
and /boot mounted in the PC's Linux; the latter being inside the MBR,
the "Gap" after the partition table, and the ephemeral rescue system.

("Grub" stands for the code that runs at boot time, and "grub-foo"
for the appropriate collection of packages that contain binaries like
grub-mkconfig and grub-install.)

My own experience of this style of dual-booting has been the mirror
image of yours: ie, a Windows system booted from the EFI partition;
and a Linux system booted from the MBR, where Grubᴮ had to use
block-lists because there was no BIOS Boot Partition, something you
shouldn't need.

Others might comment on things I've missed out.

¹ This /boot partition is separate from, and has nothing to do with,
  your /boot directory (or partition) on your Linux system. It does
  nothing but hold all the files installed by grub-pc and used by Grubᴮ.

Cheers,
David.


Reply to: