[SOLVED] The GRUB boot loader was previously installed to a disk that is no longer present

ggrey

New Member
Jan 26, 2025
4
0
1
Hi everyone, just run a routine update this morning from GUI and the horrid GRUB screen popped up. On the following screen this comes up
GRUB install devices: │
│ │
│ [ ] /dev/sda (1000204 MB; ST1000DM003-1SB102) │
│ [*] /dev/sdb (500107 MB; CT500BX500SSD1) │
│ [ ] /dev/sdb3 (499031 MB; CT500BX500SSD1) │
│ [ ] /dev/sdc (500107 MB; External_USB_3.0) │
│ [ ] /dev/dm-1 (40475 MB; pve-root)

sda and sdc being storage disks, so my installation disk is sdb. version is 8.3.4

I have tried to select /dev/sdb but that didn't seem to work, with

GRUB failed to install to the following devices: │
│ │
│ /dev/sdb │
│ │
│ Do you want to continue anyway? If you do, your computer may not start up │
│ properly. │
│ │
│ Writing GRUB to boot device failed - continue?

I've never had problems with boot so far in 6 months I have been running proxmox, and this was a fresh 8.3.x installation, so not upgraded from 7.x.x (I read a lot alraedy in this forum about GRUB bug from 7.x.x but did not find anything that helped). I'm a bit lost and out of ideas. ATM I have not completed the installation, waiting for some hints from the experts. Don't know if it's safe to proceed or not. Here is some CLI, any help would be much appreciated.


root@pve:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 931.5G 0 disk
└─sda1 8:1 0 931.5G 0 part /mnt/media
sdb 8:16 0 465.8G 0 disk
├─sdb1 8:17 0 1007K 0 part
├─sdb2 8:18 0 1G 0 part
└─sdb3 8:19 0 464.8G 0 part
├─pve-swap 252:0 0 8G 0 lvm [SWAP]
├─pve-root 252:1 0 37.7G 0 lvm /
├─pve-data_tmeta 252:2 0 2G 0 lvm
│ └─pve-data-tpool 252:4 0 149.3G 0 lvm
│ ├─pve-data 252:5 0 149.3G 1 lvm
│ ├─pve-vm--101--disk--0 252:6 0 4G 0 lvm
│ ├─pve-vm--102--disk--0 252:7 0 12G 0 lvm
│ ├─pve-vm--105--disk--0 252:8 0 4G 0 lvm
│ ├─pve-vm--103--disk--0 252:9 0 4G 0 lvm
│ ├─pve-vm--107--disk--0 252:10 0 4G 0 lvm /var/lib/lxc/107/rootfs
│ ├─pve-vm--113--disk--0 252:11 0 8G 0 lvm
│ ├─pve-vm--122--disk--0 252:12 0 8G 0 lvm
│ ├─pve-vm--106--disk--0 252:13 0 4G 0 lvm
│ ├─pve-vm--201--disk--0 252:14 0 8G 0 lvm
│ ├─pve-vm--202--disk--0 252:15 0 8G 0 lvm
│ ├─pve-vm--104--disk--0 252:16 0 2G 0 lvm
│ ├─pve-vm--108--disk--0 252:17 0 4G 0 lvm
│ ├─pve-vm--111--disk--0 252:18 0 60G 0 lvm
│ ├─pve-vm--120--disk--0 252:19 0 8G 0 lvm
│ ├─pve-vm--100--disk--0 252:20 0 4M 0 lvm
│ ├─pve-vm--100--disk--1 252:21 0 32G 0 lvm
│ ├─pve-vm--109--disk--0 252:22 0 4G 0 lvm
│ ├─pve-base--200--disk--0 252:23 0 4G 1 lvm
│ ├─pve-vm--203--disk--0 252:24 0 8G 0 lvm
│ └─pve-vm--107--disk--1 252:25 0 4G 0 lvm
└─pve-data_tdata 252:3 0 149.3G 0 lvm
└─pve-data-tpool 252:4 0 149.3G 0 lvm
├─pve-data 252:5 0 149.3G 1 lvm
├─pve-vm--101--disk--0 252:6 0 4G 0 lvm
├─pve-vm--102--disk--0 252:7 0 12G 0 lvm
├─pve-vm--105--disk--0 252:8 0 4G 0 lvm
├─pve-vm--103--disk--0 252:9 0 4G 0 lvm
├─pve-vm--107--disk--0 252:10 0 4G 0 lvm /var/lib/lxc/107/rootfs
├─pve-vm--113--disk--0 252:11 0 8G 0 lvm
├─pve-vm--122--disk--0 252:12 0 8G 0 lvm
├─pve-vm--106--disk--0 252:13 0 4G 0 lvm
├─pve-vm--201--disk--0 252:14 0 8G 0 lvm
├─pve-vm--202--disk--0 252:15 0 8G 0 lvm
├─pve-vm--104--disk--0 252:16 0 2G 0 lvm
├─pve-vm--108--disk--0 252:17 0 4G 0 lvm
├─pve-vm--111--disk--0 252:18 0 60G 0 lvm
├─pve-vm--120--disk--0 252:19 0 8G 0 lvm
├─pve-vm--100--disk--0 252:20 0 4M 0 lvm
├─pve-vm--100--disk--1 252:21 0 32G 0 lvm
├─pve-vm--109--disk--0 252:22 0 4G 0 lvm
├─pve-base--200--disk--0 252:23 0 4G 1 lvm
├─pve-vm--203--disk--0 252:24 0 8G 0 lvm
└─pve-vm--107--disk--1 252:25 0 4G 0 lvm
sdc 8:32 0 465.8G 0 disk
└─sdc1 8:33 0 465.8G 0 part /mnt/backup

root@pve:~# dpkg -l | grep -i grub
ii grub-common 2.06-13+pmx5 amd64 GRand Unified Bootloader (common files)
ii grub-efi-amd64-bin 2.06-13+pmx5 amd64 GRand Unified Bootloader, version 2 (EFI-AMD64 modules)
ii grub-efi-amd64-signed 1+2.06+13+pmx5 amd64 GRand Unified Bootloader, version 2 (amd64 UEFI signed by Debian)
iF grub-pc 2.06-13+pmx5 amd64 GRand Unified Bootloader, version 2 (PC/BIOS version)
ii grub-pc-bin 2.06-13+pmx5 amd64 GRand Unified Bootloader, version 2 (PC/BIOS modules)
ii grub2-common 2.06-13+pmx5 amd64 GRand Unified Bootloader (common files for version 2
 
having a few machines hanging around i ended up just installing from fresh on another disk and migrating vm and lcx from the pbs backup - probably beginner mistakes which ovelapped over the time and got to this today. great stuff this proxmox, it would have taken me days to do the same on a standard ubuntu server.
 
do you still have the system around? "efibootmgr -v" output would be interesting!
 
I've just hit this - I'm not going to physically visit the machine for ~6 months so not ideal :eek:
Nothing production obviously, but my little remote homelab.

`efibootmgr -v` gives:

Code:
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,0000,0001
Boot0000* ubuntu    VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0001* proxmox    VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0002* UEFI OS    HD(2,GPT,0928a9ca-db14-4991-8968-2dea84b6bf0d,0x1000,0x200000)/File(\EFI\BOOT\BOOTX64.EFI)..BO

I don't recognise `ubuntu` in there - this is a single boot OS - proxmox. I have numerous Ubuntu-based guests, but no dual-boot host.

The setup is simple - /dev/sda is a single SSD installed as part of a standard GUI install. `lsblk` gives:

Code:
NAME                             MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda                                8:0    0   1.7T  0 disk
├─sda1                             8:1    0     1M  0 part
├─sda2                             8:2    0     1G  0 part /boot/efi
└─sda3                             8:3    0   1.7T  0 part
  ├─pve-swap                     252:0    0     8G  0 lvm  [SWAP]
  ├─pve-root                     252:1    0    68G  0 lvm  /
  ├─pve-data_tmeta               252:2    0   1.4G  0 lvm
  │ └─pve-data-tpool             252:4    0 137.1G  0 lvm
  │   ├─pve-data                 252:5    0 137.1G  1 lvm
  │   ├─pve-vm--200--disk--0     252:6    0    42G  0 lvm
  (etc...)

That all looks right to me. sda2 does not appear in the `configuring grub-pc` menu - just /dev/sda and /dev/sda3

Would greatly appreciate any and all advice!
 
the "0001" boot entry should still work, you can fix up the "0000" one by updating to the current packages and following the instructions:

- make sure "grub-efi-amd64" is installed
- make sure debconf is set correctly to make the grub packages install/update the removable bootloader (the 0002 boot option)
- reinstall grub with "grub-install /dev/sda"

post the output here ;)
 
OK....

After coming out of the debconf window:


Code:
root@datto-ssd:~# dpkg --configure -a
Setting up ssh (1:9.2p1-2+deb12u5) ...
Setting up grub-pc (2.06-13+pmx5) ...
grub-pc: Running grub-install ...
Installing for i386-pc platform.
File descriptor 3 (pipe:[38761230]) leaked on vgs invocation. Parent PID 1511387: grub-install.real
File descriptor 3 (pipe:[38761230]) leaked on vgs invocation. Parent PID 1511387: grub-install.real
File descriptor 3 (pipe:[38761230]) leaked on vgs invocation. Parent PID 1511387: grub-install.real
grub-install.real: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
grub-install.real: error: embedding is not possible, but this is required for RAID and LVM install.
  grub-install failure for /dev/sda
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.8.12-8-pve
Found initrd image: /boot/initrd.img-6.8.12-8-pve
Found linux image: /boot/vmlinuz-6.8.12-7-pve
Found initrd image: /boot/initrd.img-6.8.12-7-pve
Found linux image: /boot/vmlinuz-6.8.12-5-pve
Found initrd image: /boot/initrd.img-6.8.12-5-pve
Found linux image: /boot/vmlinuz-6.8.12-4-pve
Found initrd image: /boot/initrd.img-6.8.12-4-pve
Found linux image: /boot/vmlinuz-6.8.12-2-pve
Found initrd image: /boot/initrd.img-6.8.12-2-pve
Found linux image: /boot/vmlinuz-6.8.8-3-pve
Found initrd image: /boot/initrd.img-6.8.8-3-pve
Found linux image: /boot/vmlinuz-6.8.8-2-pve
Found initrd image: /boot/initrd.img-6.8.8-2-pve
Found linux image: /boot/vmlinuz-6.5.13-6-pve
Found initrd image: /boot/initrd.img-6.5.13-6-pve
Found linux image: /boot/vmlinuz-6.5.13-5-pve
Found initrd image: /boot/initrd.img-6.5.13-5-pve
Found memtest86+ 64bit EFI image: /boot/memtest86+x64.efi
Adding boot menu entry for UEFI Firmware Settings ...
done
Setting up python3-rgw (17.2.8-pve2) ...
Setting up python3-cephfs (17.2.8-pve2) ...
Setting up ceph-common (17.2.8-pve2) ...
Setting system user ceph properties..usermod: no changes
..done
chown: cannot access '/var/log/ceph/*.log*': No such file or directory
Fixing /var/run/ceph ownership....done
Setting up libproxmox-rs-perl (0.3.5) ...
Setting up libpve-rs-perl (0.9.2) ...
Setting up pve-manager (8.3.4) ...
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for pve-ha-manager (4.0.6) ...
Processing triggers for initramfs-tools (0.142+deb12u1) ...
update-initramfs: Generating /boot/initrd.img-6.8.12-8-pve
Running hook script 'zz-proxmox-boot'..
Re-executing '/etc/kernel/postinst.d/zz-proxmox-boot' in new private mount namespace..
No /etc/kernel/proxmox-boot-uuids found, skipping ESP sync.
System booted in EFI-mode but 'grub-efi-amd64' meta-package not installed!
Install 'grub-efi-amd64' to get updates.

Removable bootloader found at '/boot/efi/EFI/BOOT/BOOTX64.efi', but GRUB packages not set up to update it!
Run the following command:

echo 'grub-efi-amd64 grub2/force_efi_extra_removable boolean true' | debconf-set-selections -v -u

Then reinstall GRUB with 'apt install --reinstall grub-efi-amd64'

Processing triggers for libc-bin (2.36-9+deb12u9) ...
root@datto-ssd:~# echo 'grub-efi-amd64 grub2/force_efi_extra_removable boolean true' | debconf-set-selections -v -u
info: Trying to set 'grub2/force_efi_extra_removable' [boolean] to 'true'
info: Loading answer for 'grub2/force_efi_extra_removable'
root@datto-ssd:~# apt install^C
root@datto-ssd:~# grub-install /dev/sda
Installing for x86_64-efi platform.
Installation finished. No error reported.

Looks OK... anything else to check?
 
you need to install "grub-efi-amd64" (the first step, which also prints a warning ;))
 
Sorry - I didn't show my check for that:

Code:
root@datto-ssd:~# apt list --installed | grep grub-efi-amd64
grub-efi-amd64-bin/stable,now 2.06-13+pmx5 amd64 [installed]

I need to _reinstall_ it?
 
no, you need to install grub-efi-amd64 (that is a different package than grub-efi-amd64-bin)
 
Ah - I knew there was a reason I'd looked at getting more involved with bootloaders, and then walked away...

Code:
root@datto-ssd:~# apt install grub-efi-amd64
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  proxmox-kernel-6.5.13-5-pve-signed proxmox-kernel-6.8.12-2-pve-signed
  proxmox-kernel-6.8.12-4-pve-signed proxmox-kernel-6.8.12-5-pve-signed
  proxmox-kernel-6.8.8-2-pve-signed proxmox-kernel-6.8.8-3-pve-signed
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  grub-pc
The following NEW packages will be installed:
  grub-efi-amd64
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 45.7 kB of archives.
After this operation, 384 kB disk space will be freed.
Do you want to continue? [Y/n]
Get:1 http://download.proxmox.com/debian/pve bookworm/pve-no-subscription amd64 grub-efi-amd64 amd64 2.06-13+pmx5 [45.7 kB]
Fetched 45.7 kB in 0s (305 kB/s)
Preconfiguring packages ...
(Reading database ... 114569 files and directories currently installed.)
Removing grub-pc (2.06-13+pmx5) ...
Selecting previously unselected package grub-efi-amd64.
(Reading database ... 114561 files and directories currently installed.)
Preparing to unpack .../grub-efi-amd64_2.06-13+pmx5_amd64.deb ...
Unpacking grub-efi-amd64 (2.06-13+pmx5) ...
Setting up grub-efi-amd64 (2.06-13+pmx5) ...
Installing for x86_64-efi platform.
File descriptor 3 (pipe:[39113767]) leaked on vgs invocation. Parent PID 1580813: grub-install.real
File descriptor 3 (pipe:[39113767]) leaked on vgs invocation. Parent PID 1580813: grub-install.real
Installation finished. No error reported.
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.8.12-8-pve
Found initrd image: /boot/initrd.img-6.8.12-8-pve
Found linux image: /boot/vmlinuz-6.8.12-7-pve
Found initrd image: /boot/initrd.img-6.8.12-7-pve
Found linux image: /boot/vmlinuz-6.8.12-5-pve
Found initrd image: /boot/initrd.img-6.8.12-5-pve
Found linux image: /boot/vmlinuz-6.8.12-4-pve
Found initrd image: /boot/initrd.img-6.8.12-4-pve
Found linux image: /boot/vmlinuz-6.8.12-2-pve
Found initrd image: /boot/initrd.img-6.8.12-2-pve
Found linux image: /boot/vmlinuz-6.8.8-3-pve
Found initrd image: /boot/initrd.img-6.8.8-3-pve
Found linux image: /boot/vmlinuz-6.8.8-2-pve
Found initrd image: /boot/initrd.img-6.8.8-2-pve
Found linux image: /boot/vmlinuz-6.5.13-6-pve
Found initrd image: /boot/initrd.img-6.5.13-6-pve
Found linux image: /boot/vmlinuz-6.5.13-5-pve
Found initrd image: /boot/initrd.img-6.5.13-5-pve
Found memtest86+ 64bit EFI image: /boot/memtest86+x64.efi
Adding boot menu entry for UEFI Firmware Settings ...
done
Processing triggers for man-db (2.11.2-2) ...
Removing subscription nag from UI...
root@datto-ssd:~# efibootmgr -v
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0001,0002,0000
Boot0000* ubuntu    VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0001* proxmox    HD(2,GPT,0928a9ca-db14-4991-8968-2dea84b6bf0d,0x1000,0x200000)/File(\EFI\proxmox\grubx64.efi)
Boot0002* UEFI OS    HD(2,GPT,0928a9ca-db14-4991-8968-2dea84b6bf0d,0x1000,0x200000)/File(\EFI\BOOT\BOOTX64.EFI)..BO
root@datto-ssd:~# grub-install /dev/sda
Installing for x86_64-efi platform.
Installation finished. No error reported.

which now leads to:

Code:
root@datto-ssd:~# efibootmgr -v
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0001,0002,0000
Boot0000* ubuntu    VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0001* proxmox    HD(2,GPT,0928a9ca-db14-4991-8968-2dea84b6bf0d,0x1000,0x200000)/File(\EFI\proxmox\grubx64.efi)
Boot0002* UEFI OS    HD(2,GPT,0928a9ca-db14-4991-8968-2dea84b6bf0d,0x1000,0x200000)/File(\EFI\BOOT\BOOTX64.EFI)..BO

Doing some very basic checks, from someone who's only ever read about this and never played:

Code:
blkid | grep 0928a
/dev/sda2: UUID="D2D4-6D97" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="0928a9ca-db14-4991-8968-2dea84b6bf0d"
which matches the disk, and:

Code:
ls /boot/efi/EFI/proxmox/grubx64.efi
/boot/efi/EFI/proxmox/grubx64.efi

I'd still like to know why Boot0000 is pointing at ubuntu, which has never been on this disk, but looks good?
 
yes, that looks okay.

the 0000 entry is probably a leftover from some point where you installed ubuntu? the entries are not limited to one disk, they are stored in the EFI settings ;)
 
if you don't need/want it anymore, you can remove it (with "efibootmgr -B 0000") or your EFI firmware settings)
 
Great - thanks, I spent a little while looking into efibootmgr as a result of this and now I know a little more than I do before.