You are not logged in.

#1 2022-09-29 21:19:22

Alarming_Thing
Member
Registered: 2021-06-01
Posts: 30

Unable to install GRUB on an UEFI machine

This is the first time I am installing Arch on a real hardware. I've installed all necessary packages (base, linux, vim etc). I've installed grub on /mnt. I've followed what I think are right instructions from variety of webpages (too stupid to follow arch wiki, yet)

/dev/sda1 => UEFI / 500M / FAT32
/dev/sda2 => main. Mounted on /mnt with sda1 on /mnt/boot.

grrub advised me to run grub-mkconfig,

[root@archiso /]#grub-mkconfig -o /boot/grub/grub.cfg 
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot:  initramfs-linux-fallback.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot:  initramfs-linux-fallback.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done

Then  I  tried,

[root@archiso /]# grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi
Installing for x86_64-efi platform.
EFI variables are not supported on this system.
EFI variables are not supported on this system.
grub-install: error: efibootmgr failed to register the boot entry: No such file or directory.

Can someone  help  me with installing grub? Instead, should I try bootctl?
TIA

Update Problem is halfway resolved. Instead  of '/boot/efi' the directory name is is '/boot/EFI'. Once I made those changes, I can at least see the grub menu. But it doesn't anywhere from there.

Last edited by Alarming_Thing (2022-09-29 21:43:15)

Offline

#2 2022-09-29 21:25:46

kgtuning
Member
From: New Hampshire
Registered: 2015-09-30
Posts: 44

Re: Unable to install GRUB on an UEFI machine

Hmm shouldn’t it be:
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub

Offline

#3 2022-09-29 21:29:11

æyno
Member
Registered: 2022-09-25
Posts: 7

Re: Unable to install GRUB on an UEFI machine

Have you booted in UEFI or legacy mode ? If you have booted in legacy mode, it is normal that efivars aren't accessible. Try rebooting in UEFI mode (by disabling legacy mode on your motherboard) and reinstaling grub

Offline

#4 2022-09-29 21:30:48

æyno
Member
Registered: 2022-09-25
Posts: 7

Re: Unable to install GRUB on an UEFI machine

kgtuning wrote:

Hmm shouldn’t it be:
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub

Or maybe sda1 should be mounted on /boot/efi ?

Offline

#5 2022-09-30 04:14:47

jonno2002
Member
Registered: 2016-11-21
Posts: 684

Re: Unable to install GRUB on an UEFI machine

did you 'arch-chroot' after mounting ?

do this in this order:
-boot from arch iso or similar
-mount root partition to /mnt
-mount efi partition to /mnt/boot
-run "arch-chroot /mnt"
-run "grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB"
-run "grub-mkconfig -o /boot/grub/grub.cfg"
-run "mkinitcpio -p linux"
-reboot and everything SHOULD work

NOTE: if your going to have the EFI partition as your /boot then you NEED to have it mounted permanently in /etc/fstab, OR you can choose to have it mounted to /boot/efi or /efi and then its NOT required to have it mounted permanently.
in your case you need to have it mounted in your fstab.

Offline

#6 2022-10-08 03:29:12

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: Unable to install GRUB on an UEFI machine

Welcome to Arch.

Alarming_Thing wrote:

I've followed what I think are right instructions from variety of webpages (too stupid to follow arch wiki, yet)

Use the installation guide on the Arch wiki. If you followed a bunch of instructions on random web pages, you should expect to have problems and should not expect support on these forums.

If you get stuck following the wiki, you can post asking for help, but you need to be following the wiki because those  *are* the right instructions.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB