linux – GRUB does not appear on UEFI machine

Question:

Good day to all! There is a computer with UEFI and preinstalled Windows 7. Installed Linux from under live-usb (partitions are marked with an automatic machine, gpt). As a result, the grub bootloader is displayed only when the live-usb is connected in the 'Security Boot – Enabled' mode and only as a command line. The Linux partition from under the standard bootloader, of course, is not visible (only usb, lan, hdd with Windows), and how to boot from it is not clear. Various solutions were tried, as, for example, from under the terminal to live-usb:

$ sudo mount /dev/sda6 /mnt
$ sudo grub-install —root-directory=/mnt /dev/sda
$ sudo update-grub

And also from under the grub2 terminal:

$ set root=(hd1,gpt6)
$ linux (hd1,gpt6)/boot/vmlinuz-3.<...>-generic root=/dev/sda6
$ initrd (hd1,gpt6)/boot/initrd.img-3.<...>-generic
$ boot

However, they did not lead to the desired result (displaying grub as a list of OSes and without connecting a flash drive). What else do you recommend trying to do?

Answer:

Everything turned out to be simple: in order for grub2 to be installed safely, you need to set 'UEFI only'-mode before installing Linux.

Scroll to Top