XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    bug: UEFI boot parameters not preserved with Delta backups

    Scheduled Pinned Locked Moved Xen Orchestra
    6 Posts 5 Posters 696 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R Offline
      rkelley
      last edited by rkelley

      Greetings all,

      Per this thread, I ran into the same problem: Delta backups with a UEFI bios won't boot. Instead of adding to that thread, I felt it would be better to start a new thread with the "bug" info in the title. Copying @creoleMalady and @olivierlambert as they were part of the initial thread.

      Problem
      When Delta backups are taken, the UEFI boot environment variables are not preserved from the full copy. It appears a blank/clean UEFI bios is added to the restore process to get the VM booted. When this happens, the boot list presented to the VM does not include the installed OS. The current workarounds are (1) boot from a rescue disk and reinstall grub, or (2) manually boot the system via the UEFI Shell then add the proper boot disk to the UEFI boot list.

      Fix
      The fix is to ensure the UEFI boot environment parameters are preserved from the running VM into the Delta copy. This is presumably inside the delta backup code.


      Below is the UEFI boot list on a non-working system:

      root@Debian-11-delta-restore:~# efibootmgr                                           
      BootCurrent: 0003
      Timeout: 0 seconds
      BootOrder: 0001,0000,0003,0002
      Boot0000* UiApp
      Boot0001* UEFI Misc Device
      Boot0002* UEFI PXEv4 (MAC:0EE793689990)
      Boot0003* EFI Internal Shell
                                                          <-- No local boot devices defined.         
      
      

      Below is the UEFI boot list on a working system (note the last entry "Boot0004* debian"):

      root@Debian-11-full-restore:~# efibootmgr                                           
      BootCurrent: 0005
      Timeout: 0 seconds
      BootOrder: 0005,0001,0000,0004,0003
      Boot0000* UiApp
      Boot0001* UEFI Misc Device
      Boot0002* UEFI PXEv4 (MAC:1A5848A7B5DD)
      Boot0003* EFI Internal Shell
      Boot0004* debian.                                    <-- UEFI boot param kept from full backup 
      
      

      Workaround 1: Full grub reinstall

      • Mount a rescue disk to the VM
      • Boot into rescue mode
      • Select correct OS disk
      • Reinstall grub

      Workaround 2: Boot via EFI Shell then re-install grub

      • At the UEFI "Shell" prompt, type map to get a list of EFI partitions. On my system, FS0: is the EFI partition
      • Type ls FS0:\EFI to get a list of installed OSs. On my system, debian is the name of the installed OS
      • Type ls FS0:\EFI\<os> to get a list of grub efi binaries. On my system, grubx64.efi is the bootable efi file
      • Run the efi binary. On my system, I used FS0:\EFI\debian\grubx64.efi to get my system running
      • Once the OS is running, reinstall grub.

      Note: the UEFI Shell expects standard "DOS" partition identifiers. Specifically, note the use of drive:backslash (fs0:\) vs standard unix path/forwardslash (/fs0/)

      For additional details on fixing UEFI grub installs, visit this page. It has much more detail on repairing UEFI boot problems.

      C 1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by

        That's interesting, we'll have to explore how we can restore the UEFI variable (at least, if it's possible from XAPI perspective)

        1 Reply Last reply Reply Quote 0
        • C Offline
          creoleMalady @rkelley
          last edited by

          @rkelley Thank you for doing all the work for us.

          When there is a proper patch, I be happy to test it in our environment as well.

          1 Reply Last reply Reply Quote 0
          • stormiS Offline
            stormi Vates 🪐 XCP-ng Team
            last edited by stormi

            This will also be important to fix so that Secure-Boot protected VMs can keep their certificate databases (necessary for secureboot) with delta backups.

            (CC @beshleman FYI)

            1 Reply Last reply Reply Quote 0
            • R Offline
              rkelley
              last edited by rkelley

              @stormi @olivierlambert @beshleman
              FYI - I have opened a bug in github to track this issue

              julien-fJ 1 Reply Last reply Reply Quote 1
              • julien-fJ Offline
                julien-f Vates 🪐 Co-Founder XO Team @rkelley
                last edited by julien-f

                Thank you all for your help 🙂

                Please try the fix-uefi-delta-backups branch and keep me posted.

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post