SUSE Support

Here When You Need Us

System Fails to Boot: grub2 error: symbol `grub_calloc' not found

This document (000019679) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 12 SP5
SUSE Linux Enterprise Server 15 SP2
SUSE Linux Enterprise Server for SAP Applications 12 SP5
SUSE Linux Enterprise Server for SAP Applications 15 SP2

Situation

System was patched to fix the "Boothole" security issue (shim, grub2, mokutils plus additional needed patches like kernel, etc...)
Following reboot, the system is stuck in bootloader, saying:
 
grub2 error: symbol `grub_calloc' not found 

 

Resolution

This must be fixed out of the rescue system.
Insert a SLES installation medium matching the installed (!) OS and boot the Rescue system.
Follow the instructions of https://www.suse.com/support/kb/doc/?id=000018770  and chroot into the installed OS.
  • Check if the mandatory filesystems are mounted (compare /etc/fstab with "mount" output)
  • Check if  /etc/default/grub_installdevice  contains the device where the root volume/filesystem is on.
    • NOTE: grub_installdevice is a DISK device, not a partition! Also do not try to install the grub2 bootloader onto a disk without partitiontable. Grub2 needs space on the device to embed it's code and that can only happen if there is a partition table on the disk.
Use  " lsblk -f "  command to determine the correct root disk.

If the correct device is found it is sufficient to reinstall the bootloader manually.
Examples (do NOT copy and paste, always use your system's devices!):

grub2-install /dev/sda
grub2-install /dev/disk/by-id/scsi-361866d....
grub2-install /dev/mapper/mpatha

Should the disk name have changed (e.g. from sda to sdb for some reason) make sure all partitions in fstab use correct disk devices or the next reboot will end in emergency target as one or more partitions could not be found. In that case run "dracut -f --kver <installed kernel version>" to update initramfs.
Hint: use the directory name in /lib/modules/ like:

dracut  -f --kver  4.12.14-197.29-default


If the system is UEFI/EFI there is a specific grub install command for that:
/usr/sbin/shim-install --config-file=/boot/grub2/grub.cfg

Cause

grub2 error: symbol `grub_calloc' not found 

This error message points to a generic problem where the bootloader code itself is not compatible with the bootloader modules, hence the symbol error.

There are multiple reasons why this can happen:
  • Bootloader is not installed on the disk with the root and/or boot filesystem
  • /etc/default/grub_installdevice file contains false information
  • /usr, /boot and/or /boot/efi filesystems out of space
  • the copy operation from /usr/share/grub2/ to /boot/grub2 failed for some reason
  • Bootloader installation failed after patching and system is using the old bootloader code with the new bootloader modules
  • UEFI issues like broken loader entries
  • ...

Additional Information

In general, if a system fails to boot with errors like: : grub2 error: symbol `XYZ' not found  almost always there is a mismatch between bootloader code itself and the rest of the bootloader files. Reinstallation of the bootloader (grub2-install <device> ) usually fixes this.

grub2 error: module`XYZ' not found   points to a different problem. There the bootloader files /boot/grub2/i386-pc are not where the bootloader expects them to be. Note that kernel device names like sda, sdb, etc are not necessarily persistent across reboots and may change at any reboot. Here check carefully the disk names and use unique names like /dev/disk/by-id/scsi-36... wherever possible.

Note: older VMware ESX versions do not generate unique disk names in the guests by default. To enable uuids, follow this TID https://www.suse.com/support/kb/doc/?id=000016951 

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000019679
  • Creation Date: 11-Aug-2020
  • Modified Date:11-Oct-2021
    • SUSE Linux Enterprise Server
    • SUSE Linux Enterprise Server for SAP Applications

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.