Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
UEFI boots GRUB2 via GPT but not by default [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
kwesadilo
n00b
n00b


Joined: 12 Jul 2010
Posts: 68
Location: United States

PostPosted: Sun Jun 01, 2014 6:05 pm    Post subject: UEFI boots GRUB2 via GPT but not by default [solved] Reply with quote

I recently set up a new Gentoo system with an UEFI motherboard and GPT partition tables. I installed GRUB to my EFI system partition, created a boot entry called "GRUB," and used efibootmgr to make that the first boot entry after my CD drive. I expected my computer to automatically boot this when it turns on, but I instead get the screen saying it can't find any boot media, and I should insert something and press any key or reboot. However, if I press F11 right when my computer turns on to get a list of boot entries and pick GRUB, it loads and boots Linux successfully.

It seems like my firmware isn't dealing with the boot order properly, which is a little bit outside the scope of this forum, but I'll give it a shot anyway. Does anyone know what's going on or at least how to troubleshoot this kind of problem?

Here is the output of efibootmgr:
Code:
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0003,0002,0001,0004
Boot0001  Hard Drive
Boot0002* GRUB
Boot0003* CD/DVD Drive
Boot0004  USB
and here is efibootmgr -v. I don't know what's up with all of the periods and gibberish.
Code:
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0003,0002,0001,0004
Boot0001  Hard Drive    BIOS(2,0,00)..GO..NO........o.S.T.2.0.0.0.D.M.0.0.1.-.1.C.H.1.6.4....................A...........................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .1.Z.7.E.A.C.2.C........BO..NO........o.H.I.T.A.C.H.I. .H.T.S.5.4.3.2.2.5.A.7.A.3.8.4....................A...........................>..Gd-.;.A..MQ..L. . . . . . .2.E.G.0.2.4.3.3.M.C.A.B.M.6........BO..NO........o.S.a.m.s.u.n.g. .S.S.D. .8.4.0. .E.V.O. .2.5.0.G.B....................A...........................>..Gd-.;.A..MQ..L.1.S.B.D.S.N.F.B.0.2.8.6.8.6. .Z. . . . ........BO
Boot0002* GRUB  HD(1,800,3f800,6f99188b-eec9-4edb-982d-db9ff40481f5)File(\efi\gentoo\grubx64.efi)
Boot0003* CD/DVD Drive  BIOS(3,0,00)..GO..NO........o.A.T.A.P.I. . . .i.H.A.S.1.2.4. . . .W....................A...........................>..Gd-.;.A..MQ..L.5.3.4.2.0.6. .2.2.2.4.8.3.0.0.5.6.6.7.0........BO
Boot0004  USB   BIOS(5,0,00)..GO..NO.........S.e.a.g.a.t.e. .F.A. .G.o.F.l.e.x. .D.e.s.k. .0.D.1.2....................A.............................L..Gd-.;.A..MQ..L.S.e.a.g.a.t.e. .F.A. .G.o.F.l.e.x. .D.e.s.k. .0.D.1.2........BO..NO........s.S.e.a.g.a.t.e. .P.o.r.t.a.b.l.e. .0.1.3.0....................A.............................@..Gd-.;.A..MQ..L.S.e.a.g.a.t.e. .P.o.r.t.a.b.l.e. .0.1.3.0........BO
Lastly, my EFI executable:
Code:
$ ls /boot/efi/EFI/gentoo/grubx64.efi
/boot/efi/EFI/gentoo/grubx64.efi
$ file /boot/efi/EFI/gentoo/grubx64.efi
/boot/efi/EFI/gentoo/grubx64.efi: PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows


My motherboard is an ASRock Z87M Extreme4 if that matters.

Thanks for taking a look.


Last edited by kwesadilo on Thu Jun 05, 2014 2:33 am; edited 1 time in total
Back to top
View user's profile Send private message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1170
Location: Edinburgh, UK

PostPosted: Mon Jun 02, 2014 12:52 pm    Post subject: Reply with quote

Hi kwesadilo,

I had a mare of a time getting Gentoo booted as default on my UEFI laptop too. If your problem is as mine, then it may be that the BIOS simply won't let you permanently relocate which .efi file is booted by default.

Per the EFI spec, the default bootloader *should* reside at /boot/efi/EFI/Boot/bootx64.efi. Does this file exist on your system? If so, you may want to try backing it up (you can just rename it to bootx64.bak and leave it in place) and replacing it with the grub file (changing its name to boot64.efi).

Are you by any chance dual-booting with Windows (and if so, is it an OEM copy tied to the motherboard)? If so, please can you show the output of the following command:
Code:
find /boot/efi/EFI/ -iname '*.efi' -exec md5sum {} \;
Back to top
View user's profile Send private message
kwesadilo
n00b
n00b


Joined: 12 Jul 2010
Posts: 68
Location: United States

PostPosted: Wed Jun 04, 2014 1:48 am    Post subject: Reply with quote

I have no EFI/Boot directory, and Windows has never been installed here. However, for the sake of completeness:
Code:
$ ls -lR /boot/efi/
/boot/efi/:
total 512
drwxr-xr-x 3 root root 512 Apr 19 05:25 EFI

/boot/efi/EFI:
total 512
drwxr-xr-x 2 root root 512 Apr 20 05:11 gentoo

/boot/efi/EFI/gentoo:
total 220K
-rwxr-xr-x 1 root root 220K Apr 20 05:11 grubx64.efi
$ find /boot/efi/EFI/ -iname '*.efi' -exec md5sum {} \;
cde92a60c063faa5e69fcac3f9f5e1e1  /boot/efi/EFI/gentoo/grubx64.efi

I supposed I could try copying grubx64.efi to /boot/efi/EFI/Boot anyway and see what happens. When I do that, do I need to do something with efibootmgr, or does the copy suffice to install it?
Back to top
View user's profile Send private message
Havin_it
Veteran
Veteran


Joined: 17 Jul 2005
Posts: 1170
Location: Edinburgh, UK

PostPosted: Wed Jun 04, 2014 1:07 pm    Post subject: Reply with quote

I would try it without using efibootmgr first of all (make sure the path from root of partition is /EFI/Boot/bootx64.efi) as this is supposed to be a built-in default. If not, you can try adding it using efibootmgr as you did for the original path.
Back to top
View user's profile Send private message
lacitilis
n00b
n00b


Joined: 21 Apr 2011
Posts: 2

PostPosted: Wed Jun 04, 2014 2:04 pm    Post subject: Reply with quote

Hi there,

Have you tried creating a new boot Option directly in your bios?
When doing so in my bios, i can even specify the path to the efi file..
Back to top
View user's profile Send private message
kwesadilo
n00b
n00b


Joined: 12 Jul 2010
Posts: 68
Location: United States

PostPosted: Thu Jun 05, 2014 2:33 am    Post subject: Solved Reply with quote

I got it to work, and it was something so stupid that I thought of it the first time this happened and immediately dismissed it. I tried putting the GRUB boot entry first in the boot order and the CD drive second. Lo and behold, GRUB by default. I guess it was trying to boot from the CD drive even though there wasn't a CD in there. No computer I've ever used before has done that. What's the point of having a boot order if you give up after you can't boot the first thing? Maybe my CD drive is acting like it has something to the firmware when it actually doesn't. I don't know how the boot order is supposed to work internally.

This does mean that I'll have to manually tell it to boot a CD on the rare occasion that I want to, but that's no great hardship.

@Havin_it Copying my boot entry into the default location without messing with efibootmgr didn't appear to have any effect.

@lacitilis I don't think my firmware interface has any such facility. I can only enable/disable or reorder boot entries that it already knows about. What brand of motherboard/firmware do you have?
Back to top
View user's profile Send private message
brummbaer
n00b
n00b


Joined: 08 Jun 2014
Posts: 14

PostPosted: Tue Jun 10, 2014 8:37 pm    Post subject: Re: Solved Reply with quote

kwesadilo wrote:
I don't know how the boot order is supposed to work internally.

Have you lately tried to install e.g. Windows 7? If the System starts from DVD you get the Message "If you want to boot from DVD please press any key…" and if you don't, the system tries to start from Harddisk. So it seems to be the design that the Bootloader can pass the focus to the next device in bootorder.
kwesadilo wrote:
This does mean that I'll have to manually tell it to boot a CD on the rare occasion that I want to, but that's no great hardship.

That is also by design for EFI-Systems. There is not one bootmanager in the MBR, that starts the OS, but there is the EFI-Partition that contains for each OS a separate folder with the system bootloader.
So a Windows-Installation does not destroy grub, but resides beside it in another folder. The task to select between several OSes is now taken from EFI-Bootmenu.

Neverthless it still is possible to integrate an entry for Windows in the Grub menu.
Back to top
View user's profile Send private message
kwesadilo
n00b
n00b


Joined: 12 Jul 2010
Posts: 68
Location: United States

PostPosted: Wed Jun 11, 2014 12:48 am    Post subject: Reply with quote

brummbaer wrote:
That is also by design for EFI-Systems. There is not one bootmanager in the MBR, that starts the OS, but there is the EFI-Partition that contains for each OS a separate folder with the system bootloader.
So a Windows-Installation does not destroy grub, but resides beside it in another folder. The task to select between several OSes is now taken from EFI-Bootmenu.

Neverthless it still is possible to integrate an entry for Windows in the Grub menu.
Good to know. Won't be happening any time soon though. It's bad enough I have to use it at work.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum