[pve-devel] [PATCH manager v4 2/2] 8 to 9 checks: check for removable grub-install

Stoiko Ivanov s.ivanov at proxmox.com
Fri Aug 8 14:45:40 CEST 2025


some upgrades result in unbootable systems, which can be traced back
to grub being installed in BOOTX64.efi, but not being upgraded by
grub-install. Refer the cases to the output of
`proxmox-boot-tool refresh` as it has a sensible check logic for those
cases. Some affected systems printed the warning of proxmox-boot-tool,
but it was lost in the large output of the dist-upgrade.

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 PVE/CLI/pve8to9.pm | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/PVE/CLI/pve8to9.pm b/PVE/CLI/pve8to9.pm
index db155184..a8b4c718 100644
--- a/PVE/CLI/pve8to9.pm
+++ b/PVE/CLI/pve8to9.pm
@@ -1569,6 +1569,7 @@ sub check_bootloader {
         return;
     }
 
+    my $boot_ok = 1;
     if (-f "/etc/kernel/proxmox-boot-uuids") {
         if (!$upgraded) {
             log_skip("not yet upgraded, systemd-boot still needed for bootctl");
@@ -1587,13 +1588,37 @@ sub check_bootloader {
                     . " boot-related packages. Remove 'systemd-boot' See"
                     . " https://pve.proxmox.com/wiki/Upgrade_from_8_to_9#sd-boot-warning for more information."
             );
+            $boot_ok = 0;
         }
         if (!-f "/usr/share/doc/grub-efi-amd64/changelog.Debian.gz") {
             log_warn("System booted in uefi mode but grub-efi-amd64 meta-package not installed,"
                 . " new grub versions will not be installed to /boot/efi! Install grub-efi-amd64."
             );
-            return;
-        } else {
+            $boot_ok = 0;
+        }
+        if (-f "/boot/efi/EFI/BOOT/BOOTX64.efi") {
+            my $removable_update = 0;
+            my $exit_code = eval {
+                run_command(
+                    ['debconf-show', '--db', 'configdb', 'grub-efi-amd64', 'grub-pc'],
+                    outfunc => sub {
+                        my ($line) = @_;
+                        if ($line =~ m|grub2/force_efi_extra_removable: +true$|) {
+                            $removable_update = 1;
+                        }
+                    },
+                    noerr => 1,
+                );
+            };
+            log_warn(
+                "Removable bootloader found at '/boot/efi/EFI/BOOT/BOOTX64.efi', but GRUB packages"
+                    . " not set up to update it!\nRun the following command:\n"
+                    . "echo 'grub-efi-amd64 grub2/force_efi_extra_removable boolean true' | debconf-set-selections -v -u\n"
+                    . "Then reinstall GRUB with 'apt install --reinstall grub-efi-amd64'")
+                if !$removable_update;
+            $boot_ok = 0;
+        }
+        if ($boot_ok) {
             log_pass("bootloader packages installed correctly");
         }
     }
-- 
2.39.5





More information about the pve-devel mailing list