I am developing a Java application to run on Windows and Linux, instead of virtual machines, I need to use dual boot, however, after updating Ubuntu 20.04 LTS weekly, I'm trying to restart the machine and the terminal appears with an error message:
error: 'grub_calloc' symbol not found. Entering recovery mode ... grub rescue> How to fix this?
22 Answers
You need to reinstall grub to your boot partition, which can be done as follows:
boot to a linux live system (e.g. Ubuntu Desktop).
assuming your actual boot partition is /dev/sda1 run the following:
sudo apt-get update && apt-get install grub2 sudo mount /dev/sda1 /mnt sudo grub-install --root-directory=/mnt/ /dev/sdarestart your system, do not forget to remove the live image.
Actually, there is no need to reinstall grub. The root cause of the problem is that the second stage of grub is not properly updated by the installation (upgrade process).
My system is KDE Neon (Ubuntu 18.04 LTS underneath), the grub package upgrade process was copying a file called grubx64.efi into /boot/efi/neon and grub was looking for /boot/efi/BOOT/bootx64.efi.
As soon as I copied /boot/efi/neon/grubx64.efi over /boot/efi/BOOT/bootx64.efi my system booted again, using the latest grub from the Ubuntu upgrades (2.02-2ubuntu8.17). For this, I had to boot with a live distro (I used latest Mint). It is faster, easier and more secure than reinstalling a previous version of grub.
Why is this happening? I do not know yet. If I have some more time for deeper investigations, I'll update this answer.
My system seems to be too complicated for Boot-repair (dual NVME disks, RAID1, fully encrypted, LVM).
I hope this helps someone.