Help on how to safely migrate from grub-pc to grub-efi-amd64

futurepr0n

New Member
Mar 6, 2024
2
0
1
Hi fellow proxmox users, I have been struggling with a PCI-E GPU Passthrough issue which had led me to discover I was running with CSM enabled at the bios, and also that it looks like something might not have been properly installed at the original time of setting up my system.

I was dualbooting Windows and Ubuntu then migrated from Ubuntu to Proxmox and never really have booted windows again since. But it doesn't appear that I set up Proxmox correctly either.

I was running update-initramfs -u and then was shown the result:
Bash:
update-initramfs: Generating /boot/initrd.img-6.8.12-2-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.
Couldn't find EFI system partition. It is recommended to mount it to /boot or /efi.
Alternatively, use --esp-path= to specify path to mount point.
root@pr0x:/#

I was going to run the grub-efi-amd64, but I got worried that maybe something in my system could break if I did that. I dont know how to verify that efi is properly going to update if i run that and that grub-pc that gets removed will be safe. I worry it might try and update the wrong efi partition since maybe my efi partition is not being properly loaded? when I look at /boot/efi nothing is in there. I go to see my bootmgr entries i can see all the different ones.

Bash:
root@pr0x:/# efibootmgr -v
BootCurrent: 0005
Timeout: 2 seconds
BootOrder: 0005,0008,0000,0003,0001,0004
Boot0000* Windows Boot Manager  HD(2,GPT,2bcd7ec0-af13-4afc-937d-fc9ba7529cf2,0x109000,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...T................
Boot0001* ubuntu        HD(2,GPT,2bcd7ec0-af13-4afc-937d-fc9ba7529cf2,0x109000,0x32000)/File(\EFI\UBUNTU\SHIMX64.EFI)
Boot0003* UEFI: PXE IP4 Realtek PCIe GBE Family Controller      PciRoot(0x0)/Pci(0x1,0x2)/Pci(0x0,0x0)/Pci(0x5,0x0)/Pci(0x0,0x0)/MAC(04d9f5f6cd2a,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot0004* UEFI: PXE IP6 Realtek PCIe GBE Family Controller      PciRoot(0x0)/Pci(0x1,0x2)/Pci(0x0,0x0)/Pci(0x5,0x0)/Pci(0x0,0x0)/MAC(04d9f5f6cd2a,0)/IPv6([::]:<->[::]:,0,0)..BO
Boot0005* proxmox       HD(2,GPT,66a9e7b1-9cfa-4c16-be47-d78afc882fa6,0x800,0x200000)/File(\EFI\PROXMOX\SHIMX64.EFI)
Boot0008* UEFI OS       HD(2,GPT,66a9e7b1-9cfa-4c16-be47-d78afc882fa6,0x800,0x200000)/File(\EFI\BOOT\BOOTX64.EFI)..BO

But I also saw that i have no efi /boot partition on /etc/fstab
Bash:
root@pr0x:/# cat /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/pve/root / ext4 errors=remount-ro 0 1
/dev/pve/swap none swap sw 0 0
proc /proc proc defaults 0 0

So before running anything I wanted to see if I need to do more before simply running the apt install grub-efi-amd64 - If the system breaks right now that would suck.

I am looking for safest instructions to go forward with fixing this part, I think after I boot efi properly i might finally get this passthrough gpu issue resolved too.

I run lsblk -l and I can see the different nvme i have the two different os set up on,

Code:
Disk /dev/nvme0n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 970 EVO Plus 1TB           
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: D705B83B-8C06-41F6-9824-2B8C241B8F28

Device           Start        End    Sectors   Size Type
/dev/nvme0n1p1    2048    1085439    1083392   529M Windows recovery environment
/dev/nvme0n1p2 1085440    1290239     204800   100M EFI System
/dev/nvme0n1p3 1290240    1323007      32768    16M Microsoft reserved
/dev/nvme0n1p4 1323008 1953523711 1952200704 930.9G Microsoft basic data


Disk /dev/nvme1n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 970 EVO 1TB                 
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: 72086AEF-54A5-43F1-9387-E2BE9E2C0AD7

Device           Start        End    Sectors   Size Type
/dev/nvme1n1p1      34       2047       2014  1007K BIOS boot
/dev/nvme1n1p2    2048    2099199    2097152     1G EFI System
/dev/nvme1n1p3 2099200 1953525134 1951425935 930.5G Linux LVM

So I wasnt sure if I need to mount /dev/nvme1n1p2 to /boot/efi first then run the apt install, or how to go about this. Im not a total newb, but this is a bit more complicated than what I am used to trying to do.
 
Last edited:
What I think are the steps I need to do, and need help with verifying, is i think i have to do this...
Code:
apt install grub os-prober mtools
mount /dev/nvme1n1p2 /boot/efi
[ -d /sys/firmware/efi ] && apt install grub-efi-amd64
grub-install --target=x86_64-efi --bootloader-id=grub_uefi
grub-mkconfig -o /boot/grub/grub.cfg
update-initramfs -u
update-grub

Then I need to add an entry in fstab to point to the efi?
Code:
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/nvme1n1p2 /boot/efi vfat umask=0077 0 1
/dev/pve/root / ext4 errors=remount-ro 0 1
/dev/pve/swap none swap sw 0 0
proc /proc proc defaults 0 0


But I am not sure if im missing steps or doing it in a bad order
 
Last edited: