Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] Does grub still install to the first EFI it finds? Dual boot with 2 disks,

Ask for help with issues regarding the Installations of the Debian O/S.
Post Reply
Message
Author
User avatar
thatguychuck
Posts: 52
Joined: 2013-03-25 00:49
Been thanked: 2 times

[Solved] Does grub still install to the first EFI it finds? Dual boot with 2 disks,

#1 Post by thatguychuck »

I'm going to be installing a 2 disk, dual boot laptop soon, and it's been a while. Last time I went this route, grub dropped it's files into the windows EFI. I ended up having to remove one drive during each install to keep things completely segregated. This go round it's nvme drives that aren't as easily removed.

The closest debian bug I can find this mentioned on is here:https://bugs.debian.org/cgi-bin/bugrepo ... bug=765740

Ubuntu has a report going back quite a while: https://bugs.launchpad.net/ubuntu/+sour ... ug/1396379

In the Ubuntu thread they recommend either removing one drive, or booting to a live image and using gparted to remove the efi and boot flags from the windows side of things for install. Placing them back after. This actually sounds reasonable and easier than removing the nvme drives from the laptop.

The wiki seems to confirm that this behavior should be expected: https://wiki.debian.org/UEFI#debian-installer_support

Has anyone had this recently? Or tried removing the flags for install?
Last edited by thatguychuck on 2021-10-21 23:54, edited 1 time in total.

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Does grub still install to the first EFI it finds? Dual boot with 2 disks,

#2 Post by p.H »

In my experience :
- In manual partitioning, partman (Debian installer partitioning tool) marks all detected EFI partitions on all disks "use as: EFI system partition" and eventually uses one (seems to be the first one, but assume random for safety).
- In guided partitioning using the larger available space, partman uses an existing EFI partition on the selected disk (seems to be the last one, but assume random for safety) or creates a new one if none exists.
- In guided partitioning using an entire disk, partman creates a new EFI partition on the disk.

grub-installer just installs GRUB in whatever EFI partition was selected and mounted on /target/boot/efi.

Bottom line : if you want a specific EFI partition to be used, make sure all the other ones ar marked "do not use". It won't remove the ESP flag in the partition table.

User avatar
thatguychuck
Posts: 52
Joined: 2013-03-25 00:49
Been thanked: 2 times

Re: Does grub still install to the first EFI it finds? Dual boot with 2 disks,

#3 Post by thatguychuck »

Thank you for that input. I ended up with guided partitioning > use entire disk > encrypted LVM. Partman did indeed create a new EFI partition. I marked the windows one as "do not use" even though it may not have been needed. While it was installing the base system I switched to a different console and ran

Code: Select all

mount
just to see which drive was currently mounted to /target/boot/efi, and it was correct.

Post Reply