[TUTORIAL] Fixing UEFI boot

nak

Member
Apr 15, 2021
9
6
8
I recently installed Proxmox VE on a server that was set to boot in BIOS/legacy mode, not UEFI. I later ran into the bug in grub where grub is really picky about what features are enabled in ZFS and will refuse to boot if certain features are enabled (large_dnode in my case). So I decided to switch the server to boot using UEFI but it dropped me to the UEFI shell.

It looks like although the Proxmox installer creates the UEFI partition, it does not properly create the boot entry if it is installed in BIOS/legacy mode (with grub).

So here are my notes on how I fixed this, hopefully this can help someone else:

On my system, at the UEFI prompt I entered:

fs0:\EFI\systemd\systemd-bootx64.efi

in order to boot the system as a one-time thing.

Once the system was booted I did fdisk -l and found that /dev/sda2 was my EFI partition. I also did efibootmgr -v and found that only the EFI shell was setup. So to fix this I ran (making sure /dev/sda2 is the proper EFI partition)

Code:
pve-efiboot-tool init /dev/sda2
pve-efiboot-tool refresh

Now I ran efibootmgr -v and found that there was an entry for Proxmox in the list.

Reboot and it should work.

See https://pve.proxmox.com/wiki/Host_Bootloader#sysboot_systemd_boot for more info.
 
  • Like
Reactions: illumina7
Proxmox-boot-tool wants a 512MB ESP partition for systemd boot. So maybe you can shink an existing partition to get some unallocated space to create a new 512MB ESP partition. Also thought about switching from grub to systemd boot but I only got a free 300MB partition I reserved back then for the ESP. :(
 
I recently installed Proxmox VE on a server that was set to boot in BIOS/legacy mode, not UEFI. I later ran into the bug in grub where grub is really picky about what features are enabled in ZFS and will refuse to boot if certain features are enabled (large_dnode in my case). So I decided to switch the server to boot using UEFI but it dropped me to the UEFI shell.

It looks like although the Proxmox installer creates the UEFI partition, it does not properly create the boot entry if it is installed in BIOS/legacy mode (with grub).

So here are my notes on how I fixed this, hopefully this can help someone else:

On my system, at the UEFI prompt I entered:

fs0:\EFI\systemd\systemd-bootx64.efi

in order to boot the system as a one-time thing.

Once the system was booted I did fdisk -l and found that /dev/sda2 was my EFI partition. I also did efibootmgr -v and found that only the EFI shell was setup. So to fix this I ran (making sure /dev/sda2 is the proper EFI partition)

Code:
pve-efiboot-tool init /dev/sda2
pve-efiboot-tool refresh

Now I ran efibootmgr -v and found that there was an entry for Proxmox in the list.

Reboot and it should work.

See https://pve.proxmox.com/wiki/Host_Bootloader#sysboot_systemd_boot for more info.
This works like a charm dude. Thanks a lot.
 
Last kernel upgrade on January30th from :
Kernel Version Linux 6.5.11-7-pve (2023-12-05T09:44Z)
to
Kernel Version Linux 6.5.11-8-pve (2024-01-30T12:27Z)
After reboot in UEFI mode (been using for years) to upgrade to new kernel, all 4 nodes in cluster now stop booting at "grub rescue>". If I switch my BIOS setting from UEFI only to DUAL (UEFI and LEGACY) the nodes will boot. Motherboards are Supermicro X10. latest BIOS version.

message on terminal:
error: symbol 'grub_is_lockdown' not found.
entering rescue mode...
grub rescue>

Any ideas to fix?
 
Thank you for the guide, it did help me a lot. My only issue was FIRSTLY, getting into the "UEFI Shell". My HP Z840 does NOT have one built in, took me forever to figure that out, had to download a "rescue" iso, DISABLE SECURE BOOT, boot from rescue iso from my Ventoy USB stick. Then I got into UEFI shell after hours I worked on it.

From there it was pretty easy, except to figure out the UEFI SHELL commands. I eventually went "cd FS0:" (capitals mattered, and the ":". I just slowly navigated one folder at a time until I reached the path OP specified, but just make sure to do a "dir" at every level so you can see the capitalization required. I did not wanna mess this up after it took so long to get there. Then once I got to the EFI folder, just typed the "SYSTEMD-BOOTx64.EFI" filename, and it worked. All the other commands given in the tutorial were accurate. Just glossed over the hardest part lmao.
 
I have a Proxmox (currently running version 8) server, that was installed on ZFS RAID1 a few years ago, booting Legacy BIOS mode.
There is a 512MB EFI partition present, but when I switch the BIOS to EFI boot mode. nothing happens beside the EFI shell starting.

When I try to boot with the command in the original post, nothing happens.
Code:
fs0:\EFI\systemd\systemd-bootx64.efi
Listing the files on fs0: reveals that there is only a grub folder, and no EFI folder.

Then I found this page:
https://pve.proxmox.com/wiki/ZFS:_Switch_Legacy-Boot_to_Proxmox_Boot_Tool

So I did the following steps (actually I did them for sdi and sdj as well, as those two drives are in the ZFS mirror):
Code:
# pve-efiboot-tool status
Re-executing '/usr/sbin/pve-efiboot-tool' in new private mount namespace..
System currently booted with legacy bios
2556-97DF is configured with: grub (versions: 5.15.152-1-pve, 6.8.12-4-pve, 6.8.12-5-pve)
25D7-3B0E is configured with: grub (versions: 5.15.152-1-pve, 6.8.12-4-pve, 6.8.12-5-pve)

# pve-efiboot-tool format /dev/sdi2 --force
UUID="2556-97DF" SIZE="536870912" FSTYPE="vfat" PARTTYPE="c12a7328-f81f-11d2-ba4b-00a0c93ec93b" PKNAME="sdi" MOUNTPOINT=""
Formatting '/dev/sdi2' as vfat..
mkfs.fat 4.2 (2021-01-31)
Done.

# pve-efiboot-tool init /dev/sdi2
Re-executing '/usr/sbin/pve-efiboot-tool' in new private mount namespace..
UUID="9A36-DC38" SIZE="536870912" FSTYPE="vfat" PARTTYPE="c12a7328-f81f-11d2-ba4b-00a0c93ec93b" PKNAME="sdi" MOUNTPOINT=""
Mounting '/dev/sdi2' on '/var/tmp/espmounts/9A36-DC38'.
Installing grub i386-pc target..
Installing for i386-pc platform.
Installation finished. No error reported.
Unmounting '/dev/sdi2'.
Adding '/dev/sdi2' to list of synced ESPs..
Refreshing kernels and initrds..
Running hook script 'proxmox-auto-removal'..
Running hook script 'zz-proxmox-boot'..
WARN: /dev/disk/by-uuid/2556-97DF does not exist - clean '/etc/kernel/proxmox-boot-uuids'! - skipping
Copying and configuring kernels on /dev/disk/by-uuid/25D7-3B0E
        Copying kernel 5.15.152-1-pve
        Copying kernel 6.8.12-4-pve
        Copying kernel 6.8.12-5-pve
Generating grub configuration file ...
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-5.15.152-1-pve
Found initrd image: /boot/initrd.img-5.15.152-1-pve
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
done
Copying and configuring kernels on /dev/disk/by-uuid/9A36-DC38
        Copying kernel 5.15.152-1-pve
        Copying kernel 6.8.12-4-pve
        Copying kernel 6.8.12-5-pve
Generating grub configuration file ...
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-5.15.152-1-pve
Found initrd image: /boot/initrd.img-5.15.152-1-pve
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
done

# pve-efiboot-tool clean
Checking whether ESP '2556-97DF' exists.. Not found!
Checking whether ESP '25D7-3B0E' exists.. Found!
Checking whether ESP '9A36-DC38' exists.. Found!
Sorting and removing duplicate ESPs..

# pve-efiboot-tool status
Re-executing '/usr/sbin/pve-efiboot-tool' in new private mount namespace..
System currently booted with legacy bios
25D7-3B0E is configured with: grub (versions: 5.15.152-1-pve, 6.8.12-4-pve, 6.8.12-5-pve)
9A36-DC38 is configured with: grub (versions: 5.15.152-1-pve, 6.8.12-4-pve, 6.8.12-5-pve)

But there is still no EFI boot possible after rebooting the system, I'm back to where I started, there is no EFI folder found on fs0:

@Moayad @nak Anyone know how to solve this problem and switch to EFI successfully without reinstalling the entire server?
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!