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