You are not logged in.

#1 2013-08-27 03:07:15

DoctorSelar
Member
Registered: 2013-08-27
Posts: 47

Setting GRUB as the default boot manager on a UEFI-based system

Hi,
I recently installed Arch Linux on my PC alongside Windows 8 x64. After scouring the Arch wiki and various forum posts, I was able to install GRUB2 in UEFI mode on my computer. However, I have to press F9 to get to the GRUB menu or else it just boots into Windows. How can I change this? I am running a HP Envy dv6-7250ca if that makes any difference.


Never assume. It makes an "ass" of "u" and "me".

Offline

#2 2013-08-27 03:18:59

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: Setting GRUB as the default boot manager on a UEFI-based system

What happens when you press F9?  Does that take you to the firmware's boot manager menu where you then select grub?  If that is the case it is just a matter of setting the priority entry from your bios.  This is similar to how you would have chosen the default disk to have booted from in a legacy bios system (MBR).

Offline

#3 2013-08-27 13:00:08

DoctorSelar
Member
Registered: 2013-08-27
Posts: 47

Re: Setting GRUB as the default boot manager on a UEFI-based system

F9 brings up a list of boot devices which are:

OS Boot Manager
arch_grub (TOSHIBA MK7575GSX)
Boot From EFI File

I cannot reorder these devices. When I press F10 to go into the BIOS settings, the UEFI Boot Order is:

Internal CD/DVD ROM Drive
USB CD/DVD ROM Drive
USB Diskette on Key/USB Hard Disk
OS boot manager (no capitals on "boot" and "manager" so I'm thinking it might be something different)
! Network Adapter

As you can see, arch_grub or even grub does not appear on this list.


Never assume. It makes an "ass" of "u" and "me".

Offline

#4 2013-08-27 13:24:14

christov84
Member
From: West. Australia
Registered: 2013-08-27
Posts: 27

Re: Setting GRUB as the default boot manager on a UEFI-based system

OS boot manager should be your UEFI partition.

When you installed grub did you mount the UEFI partition as /boot/Efi

This tends to be make the multiboot instructions a bit more clearer

Offline

#5 2013-08-27 13:40:44

DoctorSelar
Member
Registered: 2013-08-27
Posts: 47

Re: Setting GRUB as the default boot manager on a UEFI-based system

I did just that when I was installing it. I can boot into Arch Linux just fine, but Windows still boots first and I have to press F9 to get into GRUB.


Never assume. It makes an "ass" of "u" and "me".

Offline

#6 2013-08-27 14:06:01

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: Setting GRUB as the default boot manager on a UEFI-based system

@DoctorSelar: Change the BootOrder using efibootmgr.

Offline

#7 2013-08-27 14:21:44

DoctorSelar
Member
Registered: 2013-08-27
Posts: 47

Re: Setting GRUB as the default boot manager on a UEFI-based system

How would I do that?


Never assume. It makes an "ass" of "u" and "me".

Offline

#8 2013-08-27 14:27:21

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: Setting GRUB as the default boot manager on a UEFI-based system

DoctorSelar wrote:

How would I do that?

RTFM - "man efibootmgr".

Offline

#9 2013-08-27 15:27:15

DoctorSelar
Member
Registered: 2013-08-27
Posts: 47

Re: Setting GRUB as the default boot manager on a UEFI-based system

I tried explicitly settings the BootOrder using "sudo efibootmgr -o 0005 (arch_grub), 0000 (Windows)" but Windows overwrote that and started up without going through GRUB.


Never assume. It makes an "ass" of "u" and "me".

Offline

#10 2013-08-27 15:46:41

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: Setting GRUB as the default boot manager on a UEFI-based system

I don't think that windows has the capability of overwriting an entry either when it is not booted or when it is booting.  What probably happened is that you didn't actualy change anything, which is particularly likely since the format of the command above is not valid. 

The entry numbers should be comma separated with no space, and numbers only (ie. 0005,0000,0001,0002,0003,000A).  Running 'efibootmgr' without any options should give you an overview of what is set in your NVRAM.  It specifically gives you the current boot order, which is what you should check to make sure you are actually changing something.

As the.ridikulus.rat said above RTFM.  All the necessary info is there, and it is how the rest of us learned how to use it.

Offline

#11 2013-08-27 15:51:45

DoctorSelar
Member
Registered: 2013-08-27
Posts: 47

Re: Setting GRUB as the default boot manager on a UEFI-based system

I did use it without spaces and brackets, I just did that to improve readability. I used "sudo efibootmgr -o 0005,0000"

Last edited by DoctorSelar (2013-08-27 17:31:24)


Never assume. It makes an "ass" of "u" and "me".

Offline

#12 2013-08-27 16:15:48

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: Setting GRUB as the default boot manager on a UEFI-based system

Some firmwares are broken and reset the boot order, or interface poorly with efibootmgr (which could be an efibootmgr bug, not an EFI bug). In any event, there are some other things you can try:

  • Update your firmware and try again with efibootmgr. Current EFIs are usually bug-laden, and manufacturers often release updates that fix at least some of these bugs, so they're worth installing.

  • Use the bcfg command in an EFI version 2 shell to change the boot oder.

  • Set the default boot loader in Windows via its bcdedit command, as in "bcdedit /set {bootmgr} path \EFI\gentoo\grubx64.efi". (I'm not sure that's the right path, since I don't use GRUB on Arch. Check the path and adjust it as necessary.)

  • Move or rename EFI/Microsoft/Boot/bootmgfw.efi (such as moving it down one level, to EFI/Microsoft/) and adjust your GRUB configuration to launch it from its new name/location. If necessary, combine this with installing GRUB as EFI/BOOT/bootx64.efi or even as EFI/Microsoft/Boot/bootmgfw.efi.

These options are listed in more-or-less increasing order of desperation. The last one is a last-resort sort of deal; it's necessary only on systems with badly broken EFIs.

Offline

#13 2013-08-27 16:33:57

DoctorSelar
Member
Registered: 2013-08-27
Posts: 47

Re: Setting GRUB as the default boot manager on a UEFI-based system

How do I get to an EFI shell? Do I need to install it? It's not an option in either the Setup Utility (F10) or the Boot Device Options (F9).


Never assume. It makes an "ass" of "u" and "me".

Offline

#14 2013-08-27 16:42:26

DoctorSelar
Member
Registered: 2013-08-27
Posts: 47

Re: Setting GRUB as the default boot manager on a UEFI-based system

Since I apparently cannot edit my previous post, I have already tried:

  • Updating firmware (it is currently up-to-date) and re-running efibootmgr

  • Used the bcdedit command on Windows, nothing happens

  • Fiddled around with the name/position of the Windows bootloader, only thing that happened (even when I put it back) was that Windows refuses to boot and just kicks me into a repair menu. When I try fixing Windows' bootloader through the command prompt, it comes up with errors and diskpart doesn't detect any disks/volumes/partitions. I installed Windows 8 right before Arch and haven't used it much, so if a reinstall of Windows would help, I would gladly do it

Last edited by DoctorSelar (2013-08-27 16:48:06)


Never assume. It makes an "ass" of "u" and "me".

Offline

#15 2013-08-28 01:13:23

DoctorSelar
Member
Registered: 2013-08-27
Posts: 47

Re: Setting GRUB as the default boot manager on a UEFI-based system

Okay, so I was trying to install Arch on another computer and noticed that there was an EFI Shell v1 & 2 option on the Arch install disk. I ran that on the computer that is having trouble. Once I could enter commands, I did bcfg boot -v dump. It came up with
Boot2001 - USB Drive (UEFI)
Boot3001 - EFI Internal HD or SSD
Boot3002 - EFI Internal HD or SSD
Boot2002 - Internal CD/DVD ROM Drive
Error. Unable to read from 'Boot2003' (Not Found).
I used bcfg boot mv 2 1 to swap Boot3002 with Boot3001. I then used exit and restarted my computer. It booted straight to Windows 8. When I went back into the EFI shell and ran bcfg boot -v dump again, the Boot3002 option was missing. When I went to Boot Device Options (F9) the arch_grub entry was missing.

EDIT: I tried re-installing GRUB and using efibootmgr (through the live USB) to manually configure the boot options again. efibootmgr reports all of the proper boot options as well as the proper boot order. However, F9 still does not show arch_grub. On the second boot into the live USB, efibootmgr does not show arch_grub as a boot option although it does refer to a boot option that is non-existent (Boot2003). When I use the live USB to check the EFI partition, it has the correct directories Boot, Microsoft, arch_grub, and grub. When I try to cd to arch_grub or grub, I get the error message:
FAT-fs (sda2): error, fat_get_cluster: invalid cluster chain (i pos 0)
sh: cd: grub: Not a directory
For arch_grub
FAT-fs (sda2): error, fat_get_cluster: invalid cluster chain (i pos 0)
FAT-fs (sda2): Filesystem has been set read-only
sh: cd: arch_grub: Not a directory

Last edited by DoctorSelar (2013-08-28 01:28:14)


Never assume. It makes an "ass" of "u" and "me".

Offline

#16 2013-08-28 02:31:15

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,675

Re: Setting GRUB as the default boot manager on a UEFI-based system

I would backup the contents of the EFI partition and recreate the filesystem on it. (Note that this may change its ID and require you to reconfigure things). Then put the windows stuff back but reinstall grub etc. for Arch from scratch.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#17 2013-08-28 12:14:45

DoctorSelar
Member
Registered: 2013-08-27
Posts: 47

Re: Setting GRUB as the default boot manager on a UEFI-based system

What do you mean by recreate the filesystem on it? Use mkfs.vfat -F32 /dev/sdXX to reformat it?


Never assume. It makes an "ass" of "u" and "me".

Offline

#18 2013-08-28 12:40:04

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: Setting GRUB as the default boot manager on a UEFI-based system

DoctorSelar wrote:

What do you mean by recreate the filesystem on it? Use mkfs.vfat -F32 /dev/sdXX to reformat it?

This would indeed do the trick.

Offline

#19 2013-08-28 12:50:46

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: Setting GRUB as the default boot manager on a UEFI-based system

cfr wrote:

I would backup the contents of the EFI partition and recreate the filesystem on it. (Note that this may change its ID and require you to reconfigure things). Then put the windows stuff back but reinstall grub etc. for Arch from scratch.

AFAIK UEFI and Windows uses Unique GPT Partition GUIDs so formatting the FS should not be an issue. Better to reinstall grub again, since AFAIK grub uses FSUUID internally to determine its prefix (/boot/grub mostly) where all its modules are stored.

Offline

#20 2013-08-28 17:30:34

DoctorSelar
Member
Registered: 2013-08-27
Posts: 47

Re: Setting GRUB as the default boot manager on a UEFI-based system

Okay, should I do Windows or GRUB first?


Never assume. It makes an "ass" of "u" and "me".

Offline

#21 2013-08-28 20:57:37

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,675

Re: Setting GRUB as the default boot manager on a UEFI-based system

the.ridikulus.rat wrote:
cfr wrote:

I would backup the contents of the EFI partition and recreate the filesystem on it. (Note that this may change its ID and require you to reconfigure things). Then put the windows stuff back but reinstall grub etc. for Arch from scratch.

AFAIK UEFI and Windows uses Unique GPT Partition GUIDs so formatting the FS should not be an issue. Better to reinstall grub again, since AFAIK grub uses FSUUID internally to determine its prefix (/boot/grub mostly) where all its modules are stored.

That's good to know about the GUIDs. I'm not certain if you are recommending a different strategy than me or not, though.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#22 2013-08-28 20:58:41

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,675

Re: Setting GRUB as the default boot manager on a UEFI-based system

DoctorSelar wrote:

Okay, should I do Windows or GRUB first?

Put the Windows stuff back before reinstalling grub so that grub-mkconfig can find it. I doubt it matters whether you put it back before or after grub-install, though.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#23 2013-08-29 19:50:07

DoctorSelar
Member
Registered: 2013-08-27
Posts: 47

Re: Setting GRUB as the default boot manager on a UEFI-based system

I've reinstalled the Windows bootloader and GRUB. What should I try next?


Never assume. It makes an "ass" of "u" and "me".

Offline

#24 2013-08-29 20:13:43

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: Setting GRUB as the default boot manager on a UEFI-based system

DoctorSelar wrote:

I've reinstalled the Windows bootloader and GRUB. What should I try next?

You reinstalled windows and grub, and... what happened?  This is a pretty terribly vague post.  You need to really give a bit more detail than that to get any kind of reasonable response.

Offline

#25 2013-08-29 21:05:52

DoctorSelar
Member
Registered: 2013-08-27
Posts: 47

Re: Setting GRUB as the default boot manager on a UEFI-based system

And then everything was back to the start of this thread. I can boot into both Windows and Arch fine, but I need to press F9 to access the GRUB bootloader or else it boots straight into Windows.


Never assume. It makes an "ass" of "u" and "me".

Offline

Board footer

Powered by FluxBB