Legacy bios to uefi mode

juju01

Member
May 16, 2020
87
3
13
I installed proxmox using the legacy mode - setting the bios to legacy on my supermicro server.

Is it possible now, to change to uefi bootloader for my proxmox host? Or do I have to tear everything down and redo?
 
did you install with the PVE ISO? - if so you could just try to change the boot mode (the iso installs grub in both modes (or for zfs grub for legacy, systemd-boot for uefi) and see if the box boots

would be grateful if you shared if that worked :)
 
did you install with the PVE ISO? - if so you could just try to change the boot mode (the iso installs grub in both modes (or for zfs grub for legacy, systemd-boot for uefi) and see if the box boots

would be grateful if you shared if that worked :)

hello @Stoiko Ivanov - yes, I used the iso for install with a zfs raid1 setup. So, I changed the boot mode on the supermicro server to uefi and it booted ok! The host, vms and containers all came back up ok.

I also setup a fresh vm using OVMF (UEFI) and it all came up ok. I couldn't do that before. Always got the uefi shell.

However, when I tried to change the bios of existing vms , from seabios to ovms (uefi) , it didnt work. Starting the vm goes into the uefi shell. I added an EFI disk but still didnt work. Is there a way to convert existing vms to ovms (uefi)?

Also how do I know the proxmox host is now using systemd and UEFI bootloader? Thank you.
 
However, when I tried to change the bios of existing vms , from seabios to ovms (uefi) , it didnt work.
yes - this is (usually) to be expected - if you setup a system with legacy bios - it only installs legacy bios (same with uefi) - PVE itself is a bit of an exception here)
changing the boot from legacy bios to uefi is something which is guest-os specific (for linux it could be as easy as booting with a live-cd and running grub-install with the fitting arch) - so you should check for instructions based on the guest os

Also how do I know the proxmox host is now using systemd and UEFI bootloader? Thank you.
check if efivarfs is mounted: mount |grep efi if yes and you have ZFS on root it's booting with uefi+systemd-boot

I hope this helps!
 
yes - this is (usually) to be expected - if you setup a system with legacy bios - it only installs legacy bios (same with uefi) - PVE itself is a bit of an exception here)
changing the boot from legacy bios to uefi is something which is guest-os specific (for linux it could be as easy as booting with a live-cd and running grub-install with the fitting arch) - so you should check for instructions based on the guest os


check if efivarfs is mounted: mount |grep efi if yes and you have ZFS on root it's booting with uefi+systemd-boot

I hope this helps!


mount | grep efi shows:

efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)


Also, I am using ubuntu-live server for the vms. So there is a way to change this to uefi? can you point me to some instruction on how to do this?
 
mount | grep efi shows:

efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)

looks like you're running with uefi mode and systemd boot then

Also, I am using ubuntu-live server for the vms. So there is a way to change this to uefi? can you point me to some instruction on how to do this?
this link looks ok (make sure to have a backup though! since I haven't tested it myself):
https://askubuntu.com/questions/913397/how-to-change-ubuntu-install-from-legacy-to-uefi
 
Hi!

Sorry for up the post. It's only for the people that need to upgrade the boot from grub-legacy to grub-efi. It's too easy to do and low risky.

For default, Proxmox Install do a Partition table too peculiar. LegacyBoot, EFI and LVM. The steps for convert a legacy Proxmox to U-EFI Proxmox are those.

Put the USB/CD from Proxmox Install and boot in EFI mode. For avoid mistakes, enter into the BIOS/UEFI and disable the CSM or Legacy Boot. How the system don't find any internal boot, goes to external. To the Proxmox Install Disk.

Select
-> Rescue Boot

Don't worry, it doesn't destroy anything. Only boots in EFI mode. When your'e logged into root's account. Do the next steps.

apt install grub-efi efibootmgr

It removes the oldest grub (Legacy) and install the EFI bootloader.
After it install, do the next step

fdisk -l

check where are your disk.

Code:
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Disk model: ST9500325AS     
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: F40FBF6A-334F-49C6-B50C-1A06C1E62955

Device       Start       End   Sectors   Size Type
/dev/sda1       34      2047      2014  1007K BIOS boot
/dev/sda2     2048   1050623   1048576   512M EFI System
/dev/sda3  1050624 976773134 975722511 465.3G Linux LVM

How I say, we known the EFI partition. Next procedure, mount it.

mount /dev/sda2 /boot/efi/

Next step, is install grub.

grub-install /dev/sda --target=x86_64-efi --efi-directory=/boot/efi/

Verify if it works with this command.

efibootmgr -v

See something like this.

Code:
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,0000
Boot0000* proxmox    HD(2,GPT,1dd2b36b-f48b-4f5b-bf6b-32f01cb6e4d9,0x800,0x100000)/File(\EFI\proxmox\grubx64.efi)

If in any case, you don't see the Boot entry, you need to add to the list.

The next information is a example and how to put correctly the entry. in -d parameter you need to put the "Proxmox intalled Hard disk", in my case /dev/sda, and the -p parameter the partition where are the EFI partition, in my case the second partition. The Label you can put "Proxmox", or anything you like to put.
efibootmgr -c -d /dev/sda -p 2 -L <label> -l \EFI\proxmox\grubx64.efi

Verify with efibootmgr -v . It's important the verbose parameter. Because if it's don't correct, the values after GPT are zeroes and it don't boot.

Ta-da. Reboot and enjoy with a EFI boot.

Be careful with oldest motherboards how get EFI 1.5 or 1.2. It can do errors how the entry cant be added. But if the procedure is correct and install-grub doesn't detect any failure, you can't add an entry, but in the UEFI shows your drive EFI bootable. Don't worry about that.

If your try of convert to Legacy to UEFI doesn't sucessfully. Don't worry, boot again with the Proxmox Installation Disk, Recover Boot and

apt install grub-legacy

and
grub-install /dev/sda
 
This is and old post, but very helpful. Thanks mate!

I had so many troubles:
  1. Booting into Rescue mode was impossible because it tries to mount rpool. I use lvm.
    1. The other boot option didn't load the keyboard driver.
  2. Booting into the Graphical installation, falling back to tty I needed to configure my keyboard properly.
  3. grub-install.real wasn't available. Needed to uninstall grub-common and force installation of another grub package, namely grub2-efi or something like that.
  4. The right string was
Code:
grub-install <boot partition> --target=x86_64-efi --efi-directory=/mnt/efi/ --root-directory=<path of where I mounted my root partition>

Voilà
 

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!