Problem: Error updateing grub-pc during univention-upgrade (wrong grub boot device)

Problem

The univention-upgrade fails with following message in /var/log/univention/updater.log

Setting up grub-pc (2.06-3~deb10u4) ...
/dev/sda does not exist, so cannot grub-install to it!
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):

Errors were encountered while processing:
 grub-pc
E: Sub-process /usr/bin/dpkg returned an error code (1)
exitcode of univention-updater: 1

This indicates that the configured boot device for grub does no longer match the physical reality.

Answer

You can check what device is configured with:

$ echo get grub-pc/install_devices | debconf-communicate
0 /dev/sda

What device grub is actually installed on you can check with:

$ /usr/sbin/grub-probe -t disk /boot/grub
/dev/xvda

The reason for the error above is that grub wants to install itself into sda during the update, which fails because the device has changed and is now xvda.

You can update the configured boot device with:

# change /dev/xvda to whatever grub-probe returns
echo set grub-pc/install_devices /dev/xvda | debconf-communicate  

or by selecting the device in the dialog which shows up after this command:

DEBIAN_FRONTEND=dialog dpkg --configure grub-pc

After that you have to fix the package status with:

$ dpkg --configure  -a

Now you can continue with the UCS update.

1 Like
Mastodon