grub-pc upgrade error disk does not exist

grub-pc upgrade error disk does not exist

Intro #

Grub-pc is a package to update the boot loader of the load balancer. Several CVEs (Vulnerability advisories) were reported for grub2 packages like CVE-2022-2601, CVE-2022-3775, CVE-2022-2601 or CVE-2022-28736. In our online and offline repositories, we’re going to maintain this package up to date for security reasons.

If applying this update a warning is raised in regards to the disk that is not found, please follow these steps.

Grub-pc upgrade error #

If upgrading grub-pc an error like the following is shown, that means that the original disk (UUID) where the system was installed is not found anymore. That is because the virtual templates are installed originally in an environment, but the disk itself could be deployed in another hypervisor or virtual node.

root@noid-ee-01:~# checkupgrades -i
[...]
Executing checkupgrades -i ...

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up grub-pc (2.06-3~deb10u3) ...
/dev/disk/by-id/ata-VBOX_HARDDISK_VBb1e3885f-97b18e0f 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):
 installed grub-pc package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 grub-pc
E: Sub-process /usr/bin/dpkg returned an error code (1)
   Installing new RELIANOID Packages

If this is your case, please apply the following simple steps.

Reconfigure grub-pc #

If the grub-pc installation fails, please execute:

root@noid-ee-01:~# DEBIAN_FRONTEND=dialog dpkg --configure grub-pc

Then, inside the ncurses window that should launch, please select the first disk /dev/sda. Confirm with Yes to the installation. Then, execute:

root@noid-ee-01:~# dpkg --configure -a

Finally, execute checkupgrades -i if there is any missing package to upgrade.

root@noid-ee-01:~# checkupgrades -i
SHARE ON: #

Powered by BetterDocs