On Sat, 25 May 2019 13:08:14 +0100 Colin Watson <cjwat...@debian.org> wrote:
Control: reassign -1 grub-installer
On Mon, May 13, 2019 at 12:10:07AM +0200, Adam Borowski wrote:
> Just did a d-i bare-metal test run; installing to another disk, with the
> obvious requirement of not damaging the primary system. Thus, I explicitly
> marked all relevant partitions (EFI, sys, and swap) as "do not use".
>
> Yet the newly installed system overwrote the ESP anyway. It also did so in
> a way that neither the old nor new system could be booted (no entries for
> any of the existing two systems were created, and I did not succeed booting
> manually).
>
> Disks present in the system:
> * NVME-SSD:
> [all "do not use"] ESP (fat), sys (btrfs), swap
> * 4x NVME-Optane:
> MD RAID0 <- new system (d-i test) was installed here
How was the md RAID0 array partitioned ? The provided information does
not show any partitions on /dev/md127. Anyway, grub-install cannot
create an EFI boot entry when /boot/efi is on md RAID or any other
abstraction layer, it must be a plain partition on a physical disk so
that the UEFI firmware can read it.
> It can be argued that the setup above may be a bit overcomplicated (thus
> the installer being confused might be understandable).
> But I insist that disregarding the explicit "do not use" and scribbling
> over anyway is a severe bug.
This seems as though it can only reasonably be fixed in grub-installer,
since it's what explicitly calls grub-install here.
grub-installer does not select nor format the EFI partition. It just
runs grub-install, and grub-install writes into whatever was mounted on
/target/boot/efi by partman-efi. partman-efi and partman-auto-lvm have
glitches which may cancel the user's choice to not use an EFI partition.
I am working on fixes.
When installing in grub-efi* mode, I think it would probably be
reasonable for grub-installer to only call grub-install if
$ROOT/boot/efi is a mountpoint.
Before committing the partitioning changes, partman-efi warns the user
if no EFI partition is found and offers to resume partitioning.