How to fix a broken UEFI GRUB bootloader in TrueNAS/Proxmox/Unraid/QEMU VMs
Navigation of the VM's BIOS menu and a Linux command will fix it
I had provisioned more disk storage for a VM in TrueNAS than it needed, and I needed to make it use a smaller disk that wouldn’t take up so much space when thick provisioned. So, I created a new, smaller zvol, attached it to the VM, booted into GParted Live CD, and used the GParted GUI utility to shrink the partitions on the old, large zvol, and copy them to the new, smaller zvol. I shut down the VM, removed thd old zvol and the live CD ISO image, and booted the VM. After that I was greeted with a Shell>
prompt shown in the screenshot above, which indicated that the boot had failed. If you find yourself in a similar situation, here’s the quick and easy fix.
- Exit the shell by typing
exit
and pressing enter. This will drop to the BIOS. - Use the keyboard arrow keys to select
Boot Resource Manager
, then press Enter. - Use the keyboard arrow keys to select
Boot From File
, then press Enter. - Use the keyboard arrow keys to select the drive then press Enter.
- Use the keyboard arrow keys to select
<UEFI>
, then press Enter. - Use the keyboard arrow keys to select your Linux distribution, then press Enter.
- Use the keyboard arrow keys to select
grubx64.efi
, then press Enter. - Once your system has temporarily booted, run
sudo grub-install /dev/sda
to properly install the GRUB bootloader on the drive.
This post is licensed under CC BY 4.0 by the author.