Bug#984426: Another broken grub upgrade

Bob Proulx bob at proulx.com
Thu Mar 11 01:22:40 GMT 2021


I also hit this today with the latest upgrade.  On a system that has
been upgraded many times in the past.  It's 2.02+dfsg1-20+deb10u4
upgrade this week caused it to fail to boot.  It's was installed in
2014 and upgraded continuously since then.

    root at euphoria:~# ll /var/log/installer/syslog
    -rw------- 1 root root 281561 Jan  6  2014 /var/log/installer/syslog

    root at euphoria:~# grep 'Installing grub on' /var/log/installer/syslog
    Jan  6 21:12:29 grub-installer: info: Installing grub on '/dev/sda'

Initially installed with one disk in degraded RAID mode and then
subsequently additional disks were added.  grub-install was used to
install grub to the new disks.

There are two ways to use the debian-installer in rescue mode.  One is
to execute a chroot to the installed system and then install grub from
there.  In that mode there are two ways to update grub.

Boot rescue mode.  Using the debian-installer directly:

1. Reinstall GRUB bootloader
2. Execute a shell in /dev/sdX
    2.1. grub-install /dev/sdX
    2.2. dpkg-reconfigure grub-pc

The first way updates the disk grub image okay but does not update the
debconf settings.

The second way updates the disk grub image okay but does not update the
debconf settings.

Only the third way updates the disk grub image okay and also updates
the debconf settings.

Due to the use of /dev/disk/by-id/... I can also imagine that
replacing a failed disk would also create another situation where grub
bits are updated but debconf is not kept in sync.  I am sure that
accounts for several failures I have experienced in the past but did
not understand the root cause of why at the time.

The root cause of this bug appears to be the abuse of debconf as a
registry.  I always thought that was explicitly forbidden.  It's clear
from this bug that debconf is required to be up to date and in sync or
upgrades will fail.  At the least it should be strongly documented
that grub-install does not update debconf and the package relies upon
the debconf configuration for operation.  I was completely unaware of
this requirement before today.

I really think the grub package should declare a config file (that is
not debconf) for what devices need updates.  Then it would be plain
and simple to the local admins what files need to be updated to allow
grub to automatically upgrade.

Bob



More information about the Pkg-grub-devel mailing list