Bug#1021301: grub-pc: regression: update to 2.06-3~deb11u2 fails with gpt

Ansgar ansgar at debian.org
Wed Oct 5 17:58:49 BST 2022


Control: retitle -1 grub-pc: use persistent disk identifier stored in configuration file
Control: affects -1 - release.debian.org

[ Cc'ed -release@ to notify them it's not a regression after all ]

On Wed, 05 Oct 2022 10:27:29 +0200 Ansgar wrote:
> On Wed, 2022-10-05 at 09:48 +0200, Ansgar wrote:
> > the upgrade to grub-pc 2.06-3~deb11u2 fails:
> > 
> > +---
> > > Setting up grub-pc (2.06-3~deb11u2) ...
> > > Installing for i386-pc platform.
> > > grub-install: warning: this GPT partition label contains no BIOS
> > > Boot Partition; embedding won't be possible.
> > > grub-install: error: embedding is not possible, but this is
> > > required for cross-disk install.
> > > You must correct your GRUB install devices before proceeding:
> > > 
> > >   DEBIAN_FRONTEND=dialog dpkg --configure grub-pc
> > >   dpkg --configure -a
> > > dpkg: error processing package grub-pc (--configure):
> > >  installed grub-pc package post-installation script subprocess
> > > returned error exit status 1
> > > Errors were encountered while processing:
> > >  grub-pc
> > > Log ended: 2022-09-23  06:09:42
> > +---
> [...]
> > /dev/sda uses GPT and has one partition /dev/sda1; it was created
> > this way by d-i (though it has the setting to use gpt enabled).
> 
> Ah, but this was a distraction: /dev/sda isn't the boot device. The
> boot device is currently /dev/sdb. That still has a DOS disk label; the
> systems using GPT for the boot device as well have a small 1M partition
> for BIOS boot.
> 
> So grub-install shouldn't try to install to /dev/sda, but I find
> nothing in /etc referencing /dev/sda at all (except for a comment in
> /etc/fstab). So I'm not sure why the system tries to install grub
> there.
> 
> I now also checked /var/log/installer/syslog and when installing the
> system /dev/sda and /dev/sdb were the other way around. And it looks
> like that was the case before the previous reboot as well.
> 
> So possibly one of the race conditions I read about? (FWIW, this is a
> VM running under VMware.)

>From some more investigation and chat on IRC:

- Currently the only place where the configuration where grub should be
installed is debconf, in particular grub-pc/install_devices.
This should be moved to a configuration file in /etc.

- grub should use a persistent device identifier instead of /dev/sda
and similar. Steve McIntyre said on #-devel:

| so we go to all the effort finding out the device details in a 
| sustainable way, then don't store it :facepalm:
| we should be using a persistent device identifier here
| and each time we run grub-install that should be re-resolved to a 
| /dev/*** reference
| for added cleverness, we should also warn users that disks have moved
| if we no longer find the disk(s) we expect to install ointo
| and prompt for an update
| so we pick up on disk replacement, etc.

I think one has to check that grub doesn't get confused as well: in my
case the device can be /dev/sda or /dev/sdb for Linux, but it should
always be (hd0) for grub.

Implementing this probably also requires changes to the grub-installer
package.

Ansgar



More information about the Pkg-grub-devel mailing list