EFI partition sync setup fails

GabrieleV

Renowned Member
May 20, 2013
56
6
73
I have a machine that boots via UEFI.
Currently filesystems are mounted as is:
Code:
Filesystem                      Size  Used Avail Use% Mounted on
/dev/mapper/sys-root             15G  4.3G  9.6G  31% /
/dev/md0                        920M  275M  582M  33% /boot
/dev/sdb1                       511M   12M  500M   3% /boot/efi

Root is on LVM over MD.

If I try to setup esp sync:

Code:
# proxmox-boot-tool format /dev/sda1
UUID="" SIZE="536870912" FSTYPE="" PARTTYPE="c12a7328-f81f-11d2-ba4b-00a0c93ec93b" PKNAME="sda" MOUNTPOINT=""
Formatting '/dev/sda1' as vfat..
mkfs.fat 4.2 (2021-01-31)
Done.

I got the following error:

Code:
# proxmox-boot-tool init /dev/sda1
Re-executing '/usr/sbin/proxmox-boot-tool' in new private mount namespace..
UUID="E7D9-2C88" SIZE="536870912" FSTYPE="vfat" PARTTYPE="c12a7328-f81f-11d2-ba4b-00a0c93ec93b" PKNAME="sda" MOUNTPOINT=""
Mounting '/dev/sda1' on '/var/tmp/espmounts/E7D9-2C88'.
Installing systemd-boot..
Failed to probe partition scheme of "/dev/block/9:0": Input/output error

It tries to get partitions from the MD /boot array :
Code:
# ls /dev/block/9:0
lrwxrwxrwx 1 root root 6 Dec 13 15:52 /dev/block/9:0 -> ../md0

How con I setup ESP sync ?

Thank you,
GV
 
Hi,
please post the output of lsblk -o +FSTYPE
 
Here it is:
x
Code:
#  lsblk -o +FSTYPE
NAME           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT FSTYPE
sda              8:0    1 114.6G  0 disk             
├─sda1           8:1    1   512M  0 part             vfat
├─sda2           8:2    1   954M  0 part             linux_raid_member
│ └─md0          9:0    0   953M  0 raid1 /boot      ext4
└─sda3           8:3    1  28.5G  0 part             linux_raid_member
  └─md1          9:1    0  28.5G  0 raid1            LVM2_member
    └─sys-root 253:0    0  14.9G  0 lvm   /          ext4
sdb              8:16   1  29.9G  0 disk             
├─sdb1           8:17   1   512M  0 part  /boot/efi  vfat
├─sdb2           8:18   1   954M  0 part             linux_raid_member
│ └─md0          9:0    0   953M  0 raid1 /boot      ext4
└─sdb3           8:19   1  28.5G  0 part             linux_raid_member
  └─md1          9:1    0  28.5G  0 raid1            LVM2_member
    └─sys-root 253:0    0  14.9G  0 lvm   /          ext4
zram0          252:0    0     1G  0 disk  /var/log
 
Could you try to unmount /boot for the time being and try to execute the command again. Seems like systemd-boot is scanning the /boot mountpoint.

It worked:

Code:
# umount /boot/efi
Code:
# umount /boot

Original EFI partition was /dev/sdb1, I want to sync the empty one on /dev/sda1:

Code:
proxmox-boot-tool init /dev/sda1

Code:
Re-executing '/usr/sbin/proxmox-boot-tool' in new private mount namespace..
UUID="E7D9-2C88" SIZE="536870912" FSTYPE="vfat" PARTTYPE="c12a7328-f81f-11d2-ba4b-00a0c93ec93b" PKNAME="sda" MOUNTPOINT=""
Mounting '/dev/sda1' on '/var/tmp/espmounts/E7D9-2C88'.
Installing systemd-boot..
Created "/var/tmp/espmounts/E7D9-2C88/EFI/systemd".
Created "/var/tmp/espmounts/E7D9-2C88/EFI/BOOT".
Created "/var/tmp/espmounts/E7D9-2C88/loader".
Created "/var/tmp/espmounts/E7D9-2C88/loader/entries".
Created "/var/tmp/espmounts/E7D9-2C88/EFI/Linux".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/var/tmp/espmounts/E7D9-2C88/EFI/systemd/systemd-bootx64.efi".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/var/tmp/espmounts/E7D9-2C88/EFI/BOOT/BOOTX64.EFI".
Random seed file /var/tmp/espmounts/E7D9-2C88/loader/random-seed successfully written (512 bytes).
Successfully initialized system token in EFI variable with 512 bytes.
Created EFI boot entry "Linux Boot Manager".
Configuring systemd-boot..
Unmounting '/dev/sda1'.
Adding '/dev/sda1' to list of synced ESPs..
Refreshing kernels and initrds..
Running hook script 'proxmox-auto-removal'..
Running hook script 'zz-proxmox-boot'..
No /etc/kernel/cmdline found - falling back to /proc/cmdline
Copying and configuring kernels on /dev/disk/by-uuid/E7D9-2C88
No linux-image /boot/vmlinuz-5.15.83-1-pve found - skipping
No linux-image /boot/vmlinuz-5.19.17-1-pve found - skipping
        /var/tmp/espmounts/E7D9-2C88/EFI/proxmox/* is not a directory - skipping

Code:
# mount -a

It seems to work now:

Code:
# update-initramfs -u -k all
update-initramfs: Generating /boot/initrd.img-5.19.17-1-pve
Running hook script 'zz-proxmox-boot'..
Re-executing '/etc/kernel/postinst.d/zz-proxmox-boot' in new private mount namespace..
No /etc/kernel/cmdline found - falling back to /proc/cmdline
Copying and configuring kernels on /dev/disk/by-uuid/E7D9-2C88
        Copying kernel and creating boot-entry for 5.15.74-1-pve
        Copying kernel and creating boot-entry for 5.15.83-1-pve
        Copying kernel and creating boot-entry for 5.19.17-1-pve

Do you agree ?
 
Whats the output of:
Code:
proxmox-boot-tool status
proxmox-boot-tool kernel list
 
Whats the output of:
Code:
proxmox-boot-tool status
proxmox-boot-tool kernel list
Here they are:

Code:
# proxmox-boot-tool status

Code:
Re-executing '/usr/sbin/proxmox-boot-tool' in new private mount namespace..
System currently booted with uefi
E7D9-2C88 is configured with: uefi (versions: 5.15.74-1-pve, 5.15.83-1-pve, 5.19.17-1-pve)

Code:
# proxmox-boot-tool kernel list
Code:
Manually selected kernels:
None.

Automatically selected kernels:
5.15.83-1-pve
5.19.17-1-pve
 
Root is on LVM over MD.
proxmox-boot-tool was never developed with mdraid in mind - as a) mdraid is not really supported by PVE, and b) usually mdraid setups keep their /boot in sync, by mdraid.
additionally it was initially implemented to work around the ZFS limitations in grub as a boot-loader.

Why would you like to use proxmox-boot-tool on this setup?
(Asking primarily because it seems it does not add any functionality here, but I would not want to miss a potential improvement)
 
Why would you like to use proxmox-boot-tool on this setup?
(Asking primarily because it seems it does not add any functionality here, but I would not want to miss a potential improvement)
Hy,
yes /boot is redundant because it's on MD raid.
But /boot/efi cannot be on MD Raid. It must be on a plain vanilla vfat partition. I tried to put on MD raid, but boot fails.
So to sync /boot/efi the only way seems to be proxmox-boot-tool.
Am I wrong ?
 
So to sync /boot/efi the only way seems to be proxmox-boot-tool.
Am I wrong ?
right - I forgot about the ESP - however usually with grub the esp (/boot/efi) only contains the efi files from grub - so while it's a good idea to install grub to all of the 2 disks in the mdraid - and to upgrade the installation when there's a grub update - this does not happen too often (and as far as I can remember - the grub-postinstall asks you where you want to install it and usually does the right thing)
 
  • Like
Reactions: Chris

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!