Hyper-V update grub-efi-amd64 error: /var/lib/grub/esp

Lukas Mersch 1 Reputation point
2021-03-24T20:15:46.78+00:00

I have an Ubuntu 20.04.2 running as a Generation 2 (UEFI) VM on a Hyper-V.
Today I wanted to do an apt upgrade with grub-efi-amd64 (2.04-1ubuntu26.9) previously grub-efi-amd64 (2.04-1ubuntu26.7)
The update process stops at

Installing grub to /var/lib/grub/esp.
Installing for x86_64-efi platform.
grub-install: error: /var/lib/grub/esp doesn't look like an EFI partition.

This error only occurs if the VM has more than one virtual hard disk.
What can I do so that /var/lib/grub/esp is not used but only /boot/efi?

I have only one boot partition!

The problem can be reproduced with sudo apt --reinstall install grub-efi-amd64
With one virtual hard disk it is all ok:

Installing grub to /boot/efi.
Installing for x86_64-efi platform.
Windows for business | Windows Client for IT Pros | Storage high availability | Virtualization and Hyper-V
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.