Arch Linux not showing bootloader on UEFI system

11,336

After trying all sorts of things, none of which made any difference, I finally figured out that what I had to do was disable fastboot in my BIOS. In my case, it was:

BIOS fastboot setting

Changing that from "Minimal" to "Thorough" let me go straight to my bootloader without needing to hit F12.

Share:
11,336

Related videos on Youtube

terdon
Author by

terdon

Elected moderator on Unix & Linux. I've been using Linux since the late '90s and have gone through a variety of distributions. At one time or another, I've been a user of Mandrake, SuSe, openSuSe, Fedora, RedHat, Ubuntu, Mint, Linux Mint Debian Edition (basically Debian testing but more green) and, for the past few years, Arch. My Linux expertise, such as it is, is mostly on manipulating text and regular expressions since that represents a large chunk of my daily work.

Updated on September 18, 2022

Comments

  • terdon
    terdon over 1 year

    I recently installed Arch on my laptop (Dell Precision M4500). I had just changed the hard disk so I had to partition from scratch during the installation. I chose to go for a GPT partition and also set my system to boot with UEFI.

    During installation, I tried to install GRUB and failed since I was using the traditional command to install to an MBR disk (grub-install /dev/sda). This failed with a message about EFI (I'm afraid I don't remember what) so I went for bootctl instead. I followed the Arch Beginners Guide to the letter:

    # bootctl install
    

    Created boot/loader/entries/arch.conf with the following contents:

    title   Arch Linux
    linux   /vmlinuz-linux
    initrd  /initramfs-linux.img
    options root=/dev/sda2 rw
    

    And /boot/loader/loader.conf

    timeout 3
    default arch
    

    I then proceeded to install the system normally. However, upon rebooting, I am presented with a black screen and no boot loader after the system POSTs. The only way to get to the bootloader is to press F12 to bring up the system's boot menu (the same one which lets—or let, when the system wasn't EFI anyway—me get to the BIOS) and then choose "linux bootloader" from the menu. This will take me to a bootloader screen where I can choose "Arch".

    1. The menu I get when pressing F12:

      main menu

    2. If I choose "grub", I get:

      sub menu1

      choosing "grub" again just brings me straight back to the same menu.

    3. If, from the 1st menu, I choose "Linux Boot Manager", I get a menu with an Arch entry and an "EFI default loader" entry :

      enter image description here

      Choosing "Arch" boots my Arch install and choosing "EFI default loader" takes me to the menu shown in 4 below.

    4. If, from the 1st menu, I choose "UEFI: INT 13(RAID.0x80)", I get a menu with only an Arch entry, choosing which will boot my Arch system:

      enter image description here

    I also tried installing grub (correctly this time):

    pacman -S efibootmgr grub os-prober
    grub-install --target=x86_64-efi --efi-directory=/boot/EFI --bootloader-id=grub --recheck
    grub-mkconfig -o /boot/grub/grub.cfg
    

    This made a new "grub" entry appear in the F12 boot menu, but selecting it takes me to a black screen and then back to the boot menu.

    My grub.cfg is (comments removed):

    insmod part_gpt
    insmod part_msdos
    if [ -s $prefix/grubenv ]; then
      load_env
    fi
    if [ "${next_entry}" ] ; then
       set default="${next_entry}"
       set next_entry=
       save_env next_entry
       set boot_once=true
    else
       set default="0"
    fi
    
    if [ x"${feature_menuentry_id}" = xy ]; then
      menuentry_id_option="--id"
    else
      menuentry_id_option=""
    fi
    
    export menuentry_id_option
    
    if [ "${prev_saved_entry}" ]; then
      set saved_entry="${prev_saved_entry}"
      save_env saved_entry
      set prev_saved_entry=
      save_env prev_saved_entry
      set boot_once=true
    fi
    
    function savedefault {
      if [ -z "${boot_once}" ]; then
        saved_entry="${chosen}"
        save_env saved_entry
      fi
    }
    
    function load_video {
      if [ x$feature_all_video_module = xy ]; then
        insmod all_video
      else
        insmod efi_gop
        insmod efi_uga
        insmod ieee1275_fb
        insmod vbe
        insmod vga
        insmod video_bochs
        insmod video_cirrus
      fi
    }
    
    if [ x$feature_default_font_path = xy ] ; then
       font=unicode
    else
    insmod part_gpt 
    insmod ext2
    set root='hd0,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  98202b4b-af35-413a-b3ff-87c149c5061d
    else
      search --no-floppy --fs-uuid --set=root 98202b4b-af35-413a-b3ff-87c149c5061d
    fi
        font="/usr/share/grub/unicode.pf2"
    fi
    
    if loadfont $font ; then
      set gfxmode=auto
      load_video
      insmod gfxterm
      set locale_dir=$prefix/locale
      set lang=en_US
      insmod gettext
    fi
    terminal_input console
    terminal_output gfxterm
    if [ x$feature_timeout_style = xy ] ; then
      set timeout_style=menu
      set timeout=5
    else
      set timeout=5
    fi
    
    menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-98202b4b-af35-413a-b3ff-87c149c5061d' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt 
        insmod fat
        set root='hd0,gpt1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  9943-114D
        else
          search --no-floppy --fs-uuid --set=root 9943-114D
        fi
        echo    'Loading Linux linux ...'
        linux   /vmlinuz-linux root=UUID=98202b4b-af35-413a-b3ff-87c149c5061d rw  quiet
        echo    'Loading initial ramdisk ...'
        initrd   /initramfs-linux.img
    }
    submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-98202b4b-af35-413a-b3ff-87c149c5061d' {
        menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-98202b4b-af35-413a-b3ff-87c149c5061d' {
            load_video
            set gfxpayload=keep
            insmod gzio
            insmod part_gpt 
            insmod fat
            set root='hd0,gpt1'
            if [ x$feature_platform_search_hint = xy ]; then
              search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  9943-114D
            else
              search --no-floppy --fs-uuid --set=root 9943-114D
            fi
            echo    'Loading Linux linux ...'
            linux   /vmlinuz-linux root=UUID=98202b4b-af35-413a-b3ff-87c149c5061d rw  quiet
            echo    'Loading initial ramdisk ...'
            initrd   /initramfs-linux.img
        }
        menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-98202b4b-af35-413a-b3ff-87c149c5061d' {
            load_video
            set gfxpayload=keep
            insmod gzio
            insmod part_gpt 
            insmod fat
            set root='hd0,gpt1'
            if [ x$feature_platform_search_hint = xy ]; then
              search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  9943-114D
            else
              search --no-floppy --fs-uuid --set=root 9943-114D
            fi
            echo    'Loading Linux linux ...'
            linux   /vmlinuz-linux root=UUID=98202b4b-af35-413a-b3ff-87c149c5061d rw  quiet
            echo    'Loading initial ramdisk ...'
            initrd   /initramfs-linux-fallback.img
        }
    }
    if [ -f  ${config_directory}/custom.cfg ]; then
      source ${config_directory}/custom.cfg
    elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
      source $prefix/custom.cfg;
    fi
    

    My partition table (note the error, I don't know if that's relevant):

    $ sudo parted  /dev/sda print
    Error: The backup GPT table is corrupt, but the primary appears OK, so that will
    be used.
    OK/Cancel? OK                                                             
    Model: ATA TOSHIBA MQ01ABD0 (scsi)
    Disk /dev/sda: 750GB
    Sector size (logical/physical): 512B/4096B
    Partition Table: gpt
    Disk Flags: 
    
    Number  Start   End     Size    File system     Name  Flags
     1      1049kB  538MB   537MB   fat32                 boot, esp
     2      538MB   32.7GB  32.2GB  ext4
     3      32.7GB  462GB   429GB   ext4
     4      462GB   479GB   17.2GB  linux-swap(v1)
     5      479GB   750GB   271GB   ntfs                  msftdata
    

    And /etc/fstab:

    # /dev/sda2
    UUID=98202b4b-af35-413a-b3ff-87c149c5061d   /           ext4        rw,relatime,data=ordered    0 1
    # /dev/sda3
    UUID=baa9dd1e-835c-4d88-af8a-31dc97ac7af6   /home       ext4        rw,relatime,data=ordered    0 2
    # /dev/sda1
    UUID=9943-114D          /boot       vfat        rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro    0 2
    # /dev/sda4
    UUID=8eaf91cd-f638-487b-8299-50d39342df0d   none        swap        defaults    0 0
    

    (My EFI partition (sda1) is mounted at /boot; should that be /boot/EFI instead?)

    So, my question is, how can I get my system to boot directly into a usable bootloader without my having to press F12? I would prefer that this bootloader be grub but I could live with bootctl if necessary.