Re-installing GRUB on Debian Linux

Recently I had a Debian Linux VM that wasn’t booting. It was getting a GRUB error: ‘error symbol grub_register_command_lockdown not found’. Attempting to select any other boot option, including the listed recovery options, all took me back to this same error.

I didn’t find a lot of helpful information while searching for that error. In the end, the solution was to re-install GRUB. These steps walk through how I was able to re-install GRUB in a Debian Linux VM on DigitalOcean (DO).

Resolution

  1. Shutdown the droplet
  2. Take a snapshot
  3. Click into the Recovery tab in DO
  4. Select Boot from Recovery ISO
  5. Power on your droplet
  6. Click into the Access tab
  7. Click on Launch Recovery Console to access the VM
  8. When choosing recovery environment options, select the interactive shell
  9. Find the boot disk using fdisk -l (mine was Disk: /dev/vda; Partition: /dev/vda1)
  10. Mount the boot disk’s partition mount /dev/vda1 /mnt
  11. Mount the critical virtual filesystems for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt/$i; done
  12. ChRoot into the normal boot disk chroot /mnt
  13. Re-install GRUB on to the disk grub-install /dev/vda (NOTE: on the disk, not on the partition)
  14. Re-create the GRUB menu update-grub
  15. Exit ChRoot exit
  16. Power off the droplet poweroff
  17. Back in DO, select the Recovery tab again
  18. Select Boot from Hard Drive
  19. Power the droplet back on
  20. Click on the Access tab again
  21. Click on Launch Recovery Console to access the VM again
  22. Validate that it booted correctly

References