Feb 11 2023

Install / Reinstall Grub

For UEFI, assuming the system partition is sda2 and the EFI partition is sda1.

sudo mount /dev/sda2 /mnt
sudo mount /dev/sda1 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done
sudo cp /etc/resolv.conf /mnt/etc
modprobe efivars
sudo chroot /mnt
apt purge grub-common
# for secure boot enabled
apt install grub-efi-amd64-signed os-prober shim-signed
# for secure boot disabled
apt install grub-efi-amd64 os-prober
exit
sudo umount /mnt/boot/efi 
sudo umount -R /mnt

For BIOS, assuming the system partition is sda1:

sudo mount /dev/sda1 /mnt
for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done
sudo cp /etc/resolv.conf /mnt/etc
sudo chroot /mnt
apt purge grub-common
apt install grub-pc os-prober
exit
sudo umount -R /mnt

short brief from https://forums.linuxmint.com/viewtopic.php?t=320504

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.