Arch Linux UEFI installation problem

i am facing a problem while installing vanilla arch on my desktop pc. whole installation process goes fine even the grub install also goes fine, but when i reboot my machine no os detected. if i boot into live usb again and change the efi partition to bios boot partition and install grub again for legacy it boots fine. while looking around for the problem i found that while installing grub for efi it did not create any file to boot from eg. /efi/EFI/GRUB/GRUBX64.EFI. also the genfstab command did not create any listing for the efi partition. i dont knw why this is happening. i have tried other distros like kubuntu linux mint manjaro arcolinuxd everything works fine with uefi its just this vanilla arch giving me problem. also i had arch installed on this pc before they changed the base package it installed fine back then with uefi.

my partition table is GPT, and partitions are -
/dev/sda1 - fat32 efi partition 512M
/dev/sda2 - swap 8192M
/dev/sda3 - root filesystem x86-64 215G

its a 240GB ssd.

i need some help figuring out this. right now im using legacy boot but i want to switch to uefi because i am dual booting windows and everytime i want to boot to linux i have manually press f11 for choosing which disk to boot from. even if i set the linux drive to boot by default in bios settings. and i want grub to be the default bootloader. im using windows just for gaming nothing else. arch is my main os.

1 Like

Hey man! So, let me begin by saying you don’t need an 8GB swap partition on Arch with an SSD :wink:

I have two partitions: a 512M and a 237G.

Your partition table is GPT (you’ve verified this with something like parted? You can mklabel gpt to 100% confirm).

Before the genfstab command, are you mounting the partitions correctly?

mount /dev/sda2 /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot

The above is assuming /dev/sda1 is EFI and /dev/sda2 is root.

After that, I typically select my mirrorlist /etc/pacman.d/mirrorlist and then run pacstrap /mnt base linux linux-firmware.

Finally: genfstab -U /mnt > /mnt/etc/fstab

After this is complete, I can arch-chroot into my /mnt

arch-chroot /mnt

A lot of things are missing so I install those real quick.

pacman -S vim git sudo dhcpcd

I do a really simple config and then reboot to make sure the installation works.

bootctl install

Then I add the GRUB configurations to arch.conf

vim /boot/loader/entries/arch.conf

title    MyArch
linux    /vmlinuz-linux # add -lts or -hardened if you are using those kernels
initrd   /initramfs-linux.img # add -lts or -hardened before .img if using those kernels
options  root=/dev/sda2 rw # If you are using LUKS this is very different. Let me know and I'll check my notes for what I have.

Lastly, I edit /boot/loader/loader.conf

timeout 5 # This can be whatever number you want. It's the seconds you have at the boot menu
default arch

Exit, unmount, reboot, and remove the installation media and see if you get into your minimal installation.

umount -R /mnt
shutdown -r now

these are the exact steps/commands that i do when installing. a small guide for my self i made when i first installed arch. i always follow this. i updated the pacstrap command when they changed base everything else is same as before.

Arch Install Guide.txt (3.2 KB)

i make a gpt partition table and mount all partitions before chrooting.

efi - mount /dev/sda1 /mnt/efi

Pretty sure that’s the issue. I always do /mnt/boot for EFI.

Also, I’ve never had to do this with UEFI

#install bootloader
grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB

#generate grub config
grub-mkconfig -o /boot/grub/grub.cfg

You sure you’re using a GPT boot disk and partition?

1 Like

but i have arch installed on my laptop also and is using /efi as the efi partition.

can you tell me what you never had to do with uefi i don’t understand… is the grub-install command wrong?

i am pretty sure im using gpt… however how can i check which partition table im using ? just to confirm…

I’ve never had to run grub-install or grub-mkconfig. Only on MBR CentOS installations.

For Arch on UEFI I just run bootctl install and then edit the loader.conf and arch.conf

1 Like

i just checked through parted -l if my disk and partitions are using gpt, and they are, all the flags and file system are correct still unable to install grub. i always installed grub… on my laptop also im using uefi with grub with efi mounted /efi same as my desktop everything looks fine to me. still it wont boot.

is the fat32 partition labeled as fat32 or as EFI, i know it may seem to be a small thing but I have had issues with that in the past.

how can i verify this?

it should show you if you run fdisk -l
mine for reference:

Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Disk model: CT250BX100SSD1  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 7DC9FB29-9E15-344B-8823-F1B8B6CC9B30

Device       Start       End   Sectors   Size Type
/dev/sda1     2048    206847    204800   100M EFI System
/dev/sda2   206848   1255423   1048576   512M Linux filesystem
/dev/sda3  1255424 488397134 487141711 232.3G Linux root (x86-64)

Notice /dev/sda1 is marked as EFI System and the Disklabel type is gpt.

yes the type is efi and disklabel is gpt… i dont know what is going on why cant i use vanilla arch… is the intel ME trying to keep me out lol

From the gentoo handbook

Some motherboard manufacturers seem to only support the /efi/boot/ directory location for the .EFI file in the EFI System Partition (ESP). The GRUB installer can perform this operation automatically with the --removable option. Verify the ESP is mounted before running the following commands. Presuming the ESP is mounted at /boot (as suggested earlier), execute:

root # grub-install --target=x86_64-efi --efi-directory=/boot --removable

This creates the default directory defined by the UEFI specification, and then copies the grubx64.efi file to the ‘default’ EFI file location defined by the same specification.

i reinstalled using the same guide i use, this time installing grub generated the /efi/EFI/GRUB/grubx64.efi… but after rebooting i get a grub promt with nothing no error nothing just grub written on top left and if i press any key it says no os detected… man im getting irritated…:unamused:

i would think this means that EFI is working correctly as the EFI stub is loading grub. But grub doesnt see the kernel

do you mean grub menu or bios boot menu?

its just a black screen with written GRUB on it does not look like grub menu

sounds like a kernel problem or an initramfs problem

but there is no prompt or rescue shell if i press any key it says no os detected please insert any boot media and press enter

Try installing without UEFI and see if it works. Or try the

1 Like

well legacy bios works fine its just uefi… and i want uefi because im dual booting windows and if im on legacy for linux i have to manually select which drive to boot from everytime. i want grub to be the main bootloader