[Spce-user] Upgrade from 7.5.4 to 8.5.4 fails on grub

Alexander Griesser AGriesser at anexia-it.com
Tue May 11 18:40:41 EDT 2021


Hey there,

I stumbled upon this problem with the grub updater today too, here are my findings + a potential fix (upgrading from 8.5.2 to 8.5.4 in that case) for a slightly different edge case.
For reasons only known to the person who did that in the past, we’re currently having two physical volumes in the volumegroup ngcp:

root at spce:~# pvs
  PV         VG   Fmt  Attr PSize    PFree
  /dev/sdb1  ngcp lvm2 a--  <128.00g     0
  /dev/sdb2  ngcp lvm2 a--   <12.00g <2.00g

This causes the script /usr/share/ngcp-upgrade/steps/mr7.5/run_grub_install to fail after the upgrade from 8.5.2 to 8.5.4 with the following error message:

2021-05-11 23:29:34: [38/63] 'spce' Running: /usr/share/ngcp-upgrade/steps/mr7.5/run_grub_install
Debconf configuration install_devices for grub-pc currently set to '/dev/sda,/dev/sdb'.
Debconf configuration install_devices_disks_changed for grub-pc seems to be unset.
NGCP system running with LVM detected.
Unknown device "/dev/sdb1
/dev/sdb2": No such file or directory
ERROR: the step 'mr7.5/run_grub_install' failed, upgrade aborted!
Please fix the root of the issue and restart 'ngcp-upgrade'
(see error details in log file /var/log/ngcp-upgrade-mr8.5.4-1620768567-failed-38-of-63.log ).

The script assumes, that only one physical volume is present when running the following part in the script:

++ pvs --noheadings --separator :
++ awk -F: '/:ngcp:/ {print $1}'
++ tr -d ' '
+ BOOT_DISK='/dev/sdb1
/dev/sdb2'

I did quickfix that for our installation like that:

--- /usr/share/ngcp-upgrade/steps/mr7.5/run_grub_install.orig   2021-05-11 23:47:41.144053246 +0200
+++ /usr/share/ngcp-upgrade/steps/mr7.5/run_grub_install        2021-05-11 23:46:32.252057533 +0200
@@ -41,7 +41,7 @@
if grep -q 'root=/dev/mapper/ngcp-root' /proc/cmdline ; then
   echo "NGCP system running with LVM detected."
   LVM=true
-  BOOT_DISK="$(pvs --noheadings --separator : | awk -F: '/:ngcp:/ {print $1}' | tr -d ' ')" # e.g. "/dev/sda1"
+  BOOT_DISK="$(pvs --noheadings --separator : | awk -F: '/:ngcp:/ {print $1}' | tr -d ' ' | head -1)" # e.g. "/dev/sda1"
   PART_INFO="$(udevadm info -n "${BOOT_DISK}" -q path)" # e.g. "/devices/pci0000:00/0000:00:0d.0/ata3/host2/target2:0:0/2:0:0:0/block/sda/sda1"
   DISK="${PART_INFO%/*}"                                # e.g. "/devices/pci0000:00/0000:00:0d.0/ata3/host2/target2:0:0/2:0:0:0/block/sda"
   GRUB_DISK="/dev/${DISK##*/}"                          # e.g. "/dev/sda"

It’s not pretty, but I think it’s safe to assume that we’re looking for the disk on which the first PV resides to install the bootloader, so there shouldn’t be any situation where this fix would cause problems AFAICS.

Best,

Alexander Griesser
Head of Systems Operations

ANEXIA Internetdienstleistungs GmbH

E-Mail: AGriesser at anexia-it.com<mailto:AGriesser at anexia-it.com>
Web: http://www.anexia-it.com<http://www.anexia-it.com/>

Anschrift Hauptsitz Klagenfurt: Feldkirchnerstraße 140, 9020 Klagenfurt
Geschäftsführer: Alexander Windbichler
Firmenbuch: FN 289918a | Gerichtsstand: Klagenfurt | UID-Nummer: AT U63216601

Von: Walter Klomp via Spce-user <spce-user at lists.sipwise.com>
Gesendet: Mittwoch, 28. April 2021 03:02
An: Manuel Montecelo <mmontecelo at sipwise.com>
Cc: spce-user <spce-user at lists.sipwise.com>
Betreff: [EXTERNAL] Re: [Spce-user] Upgrade from 7.5.4 to 8.5.4 fails on grub

ACHTUNG: Diese E-Mail stammt von einem externen Absender. Bitte vermeide es, Anhänge oder externe Links zu öffnen.

I fixed it already by changing /etc/defaults/grub and change the disable_uuid line from true to false, do a grub-update, reboot and ngcp-upgrade again. This time it goes through.

But yes previous updates even to 7.5.4 from 6.5 didn’t have this issue.

On Wed, 28 Apr 2021 at 03:40, Manuel Montecelo <mmontecelo at sipwise.com<mailto:mmontecelo at sipwise.com>> wrote:
Hello Walter,

2021-04-27 18:46 Walter Klomp via Spce-user:
>   Hi,
>   I am getting this error during a trial upgrade… how to fix ?
>   2021-04-28 00:38:40: [41/75] 'sipwise-5-2-test' Running:
>   /usr/share/ngcp-upgrade/steps/mr7.5/fix_grub_upgrade
>   Debconf configuration install_devices for grub-pc currently set to
>   '/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0,/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part1'.
>   Debconf configuration install_devices_disks_changed for grub-pc currently
>   set to
>   '/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0,/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-part1'.
>   ERROR: system not running from /dev/mapper/ngcp-root nor root=UUID=….
>   Please report this problem.
>   ERROR: the step 'mr7.5/fix_grub_upgrade' failed, upgrade aborted!
>   Please fix the root of the issue and restart 'ngcp-upgrade'
>   (see error details in log file
>   /var/log/ngcp-upgrade-mr8.5.4-1619541516-failed-41-of-75.log ).

Thanks for reporting this problem.

Could you please post the output of the following commands, in the system being
upgraded?

   cat /proc/cmdline
   cat /etc/sipwise_ngcp_version
   debconf-show grub-pc


In the meantime, if you want to proceed with the upgrade while we address the
problem, and assumming that the system has been running and booting fine so far
from previous installations and upgrades, and that as a last resort you have
means to restore it if something goes wrong (e.g. boot via another partition), a
workaround to this problem is to edit this file:

   /usr/share/ngcp-upgrade/steps/mr7.5/fix_grub_upgrade

and add a new line with "exit 0", after the first line of "#!/bin/bash", and
then execute "ngcp-upgrade" again with the same options (target version and so
on), to continue the upgrade at the point where it broke.

In this way this step will simply not run, and will leave the boot process the
same that it is (without attempting to reinstall it), so it should not break
anything, while assuming that it will continue to boot fine with the current
state.  And, meanwhile, this allows you to continue with the other steps of the
upgrade.


Hope that helps, and please report back with the info requested so we can try to
improve the step to allow for your system configurations.


Cheers.
--
Manuel Montecelo <mmontecelo at sipwise.com<mailto:mmontecelo at sipwise.com>>
Release Engineer

Sipwise GmbH, Campus 21/Europaring F15
AT-2345 Brunn am Gebirge

Office: +43(0)13012029 | Website: https://www.sipwise.com
--

Warmest Regards,

[Das Bild wurde vom Absender entfernt.]<https://myrepublic.com.sg/>

Walter Klomp
Head of Voice & Systems
MyRepublic Limited
T: +65 6816 1120
F: +65 6717 2031


MyRepublic Limited
11 Lorong 3 Toa Payoh Block B Jackson Square
#04-11/15 Singapore 319579

myrepublic.com.sg<https://myrepublic.com.sg/>
Follow us on: Twitter<https://twitter.com/myrepublic> | Facebook<https://facebook.com/myrepublicsg> | LinkedIn<https://www.linkedin.com/company/myrepublic>




The contents of this email and any attachments are confidential and may also be privileged. You must not disseminate the contents of this email and any attachments without permission of the sender. If you have received this email by mistake, please delete all copies and inform the sender immediately. You may refer to our company's Privacy Policy here<https://myrepublic.net/sg/legal/terms-of-use-policies/privacy-policy/>.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20210511/e7b30550/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ~WRD0000.jpg
Type: image/jpeg
Size: 823 bytes
Desc: ~WRD0000.jpg
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20210511/e7b30550/attachment-0001.jpg>


More information about the Spce-user mailing list