How to fix missing grub from Boot Menu after windows install or update1
Burn Linux Live CD ISO into your USB drive. then boot to it.
Then, install grub-efi-amd
or grub-efi-ia32
based on your system specification.
sudo apt install grub-efi-amd
OR
sudo apt install grub-efi-ia32
using
sudo fdisk -l
or Using any Partition Manager Software
As you can see, my linux root folder is in /dev/sda10
with ext4
format. I've also labeled my disk to root_linux
, so it'll be easily to found.
Mount the disk,
sudo mount /dev/sda10 /mnt
Make sure all other necessary folder in in your /mnt folder. If they are placed in other partition, you could mount those.
sudo mount /dev/sdaX /mnt/boot
sudo mount /dev/sdaY /mnt/var
sudo mount /dev/sdaZ /mnt/usr
Next, find your EFI System
Partition. You can use sudo fdisk -l
command to find it.
...
Device Start End Sectors Size Type
/dev/sda1 2048 1187839 1185792 579M Microsoft basic data
/dev/sda2 1187840 1800191 612352 299M EFI System
/dev/sda3 1802184 294404039 292601856 139,5G Microsoft basic data
...
As you can see above, my EFI System
partition is on /dev/sda2
. You can mount it.
sudo mount /dev/sda2 /mnt/boot/efi
If /dev
, /proc
, /run
, and /sys
are empty in /mnt
folder, you could --rbind
from Live CD root. This also will solve error grub-install: warning: EFI variables are not supported on this system..
.
for i in /sys /proc /run /dev;
do sudo mount --rbind "$i" "/mnt$i";
done
Alternatively, manually mount efivarfs
virtual system to /sys/firmware/efi/efivars
after you've sudo chroot /mnt
:
mount -t efivarfs none /sys/firmware/efi/efivars
OR you could --rbind
from Live CD root, but you will need to do this outside chroot:
sudo mount --rbind /sys/firmware/efi/efivars /mnt/sys/firmware/efi/efivars
sudo chroot /mnt
grub-install
update-grub
exit
sudo reboot
[OPTIONAL] Go to your UEFI Bios Menu, then make sure your Linux Boot Manager placed on the first sequence
Footnotes
-
Severance, S. (2011, December 17). Answer to “How can I repair grub? (How to get Ubuntu back after installing Windows?).” Ask Ubuntu. https://askubuntu.com/a/88432/1091674 ↩
-
Udo. (2022, March 6). Reinstall GRUB (grub-install: Warning: EFI variables are not supported on this system.) [Forum post]. Unix & Linux Stack Exchange. https://unix.stackexchange.com/q/693101/498611 ↩
-
telcoM. (2022, March 6). Answer to “Reinstall GRUB (grub-install: Warning: EFI variables are not supported on this system.).” Unix & Linux Stack Exchange. https://unix.stackexchange.com/a/693111/498611 ↩