4

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.

8
  • boot loader or menu? the efi is the loader... its a totally different thing than an mbr system.
    – mikeserv
    Dec 12, 2015 at 12:55
  • @mikeserv not sure. What I call the "boot menu" is something provided by the motherboard. It has options like "boot from USB", "enter BIOS" etc. That menu seems to also detect installed bootloaders and presents me with a submenu that allows me to choose them. So I go to "mobo boot menu -> boot loader -> system".
    – terdon
    Dec 12, 2015 at 13:00
  • 1
    so thats the real thing - its kind of awkward, though, usually. but you can install your own items to it w/ efibootmgr if you like. or just get some other menu app. using grub is crazy overkill - with refind your whole boot script would be half a line. using a go-between is a little silly - your firmware will just load and execute the linux-kernel if you let it.
    – mikeserv
    Dec 12, 2015 at 13:02
  • @mikeserv perhaps but I know and like grub and would prefer not to learn a new one unless necessary. Also, I don't think the menu I'm talking about has anything to do with efibootmgr. I used to see it when the system was BIOS as well. Plus, the "arch" entry I defined for bootctl only appears in the 2nd level menu I get after choosing "EFI bootloader"
    – terdon
    Dec 12, 2015 at 13:05
  • copy grubx64.efi or whatever it calls itself to /boot/EFI/BOOT/bootx64.efi - but grub is the only one that requires any learning cause it does all of this nonsense. All you need is an executable on the disk the efi mounts at boot that the efi knows where to find - its a lot more simple to make it the kernel. The bootx64.efi is the default executable path. If there's something already there just back it up.
    – mikeserv
    Dec 12, 2015 at 13:13

1 Answer 1

4

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.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .