Introduction.

Have you encountered a situation where you cloned a Debian OS VM, but the cloned VM failed to boot up? If so, you can try to use refind to fix that problem.

Steps:

  • Download the refind iso from here: (Refind Download)[http://www.rodsbooks.com/refind/getting.html]
  • Boot refind and choose shell
  • Ensure that the /boot/efi is mounted.
  • If not, use mount /dev/sda1 /boot/efi
  • To reinstall the grub-efi package:
apt-get install --reinstall grub-efi

Put the Debian bootloader in /boot/efi and create an appropriate entry in the computer NVRAM

grub-install
  • To re-create a grub config file based on your disk partitioning schema
update-grub
  • Check and ensure the following file is exist, after Grub EFi reinstallation:
/boot/efi/EFI/debian/grubx64.efi
  • Reboot and see if the boot can now work properly.

Remove Refind Boot From the boot order.

In case you have already install the refind boot utility, it would replace the existing Debian boot. After you follow the above steps, you can proceed the following to remove the refind boot utility from boot order.

sudo efibootmgr -b 1 -B
efibootmgr