Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GRUB2 fails to boot kernel on UEFI system-- sometimes
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
gemarcano
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jun 2012
Posts: 94
Location: Virginia

PostPosted: Fri Jun 15, 2012 3:51 am    Post subject: GRUB2 fails to boot kernel on UEFI system-- sometimes Reply with quote

Since this had to do with GRUB2 and UEFI, I wasn't sure whether to post this here or in the Gentoo Installation forum, but here it is. I don't know if anyone can help me out or not, but just in case anyone runs into similar problems as mine, here are my experiences with GRUB2 on an UEFI setup...

Some background info:
As starters, this might be related to the firmware on my motherboard, so just for the sake of completeness this new system is using a GA-Z77X-UD5H motherboard using Firmware F8.
I mostly followed this tutorial/help guide to get Gentoo installed: http://xtothei.wordpress.com/2012/05/08/gentoo-uefi/
For some reason I couldn't get a USB to boot properly, but after burning an image of Fedora 17 I was able to install everything. I followed a mixture of this guide and the Gentoo Handbook for an amd64 system to set my system up. I then used the following pages for help on setting up GRUB2:
http://wiki.gentoo.org/wiki/GRUB2
http://dev.gentoo.org/~scarabeus/grub-2-guide.xml
https://wiki.archlinux.org/index.php/GRUB2
http://en.gentoo-wiki.com/wiki/Grub2
I can't remember exactly which commands from which ones I finally ran, and right now since GRUB2 decided to take a hike, I'm on my Windows partition so I can't check the bash history. I'll boot a little later using my Fedora 17 disk to fix GRUB2 or perhaps install something else...
--End background info

With that out of the way, GRUB2 works... kind of. If my system is configured to boot by default to GRUB2, I can successfully boot to my Gentoo partition. If I press F12 and then select GRUB2 upon booting the computer, the menu shows, but then once it says that the kernel is loading, it hangs there. Forever. Ctrl-alt-del does not work, so I'm forced to do a hard reset at this point. This is the biggest problem I found with using GRUB2. Another more minor annoyance is that GRUB2 does not find the Windows 7 partition, but that might be because maybe it doesn't know how to look for UEFI bootable information in the ESP partition? All I know is that os-prober doesn't work in my case.

So, this mess sounds to me like something in GRUB2 makes an assumption that is normally true but not true when I use my UEFI boot menu.

I'm at a loss in what can be done. I think I'm going to bail out and use another boot loader (perhaps even the stub UEFI loader from the kernel...). I guess that there is a reason GRUB2 is masked, :lol:.
Back to top
View user's profile Send private message
gemarcano
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jun 2012
Posts: 94
Location: Virginia

PostPosted: Fri Jun 15, 2012 4:06 am    Post subject: Reply with quote

Just FYI, here is the command I used to install GRUB2 in place (all one line):
Code:
grub2-install --target=x86_64-efi --modules="part_gpt part_msdos linux normal boot all_video chain efi_gop efi_uga video video_fb gzio ls lvm" --efi-directory=/boot/efi --bootloader-id=GRUB2 --no-floppy --recheck

I'm not sure if any of those modules are needed, but I'd rather not take a chance right now, unless... Perhaps the problem is in one of these modules? I'll try reinstalling GRUB2 onto ESP without any of these modules.
Back to top
View user's profile Send private message
gemarcano
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jun 2012
Posts: 94
Location: Virginia

PostPosted: Fri Jun 15, 2012 4:37 pm    Post subject: Reply with quote

Another minor update:
I managed to get my Gentoo installation working well enough that I can boot and work in it (FINALLY), with GRUB2 being as finicky as always. Tried to remove all of the modules from the grub2-install command, and it worked the same, crashing the same way and working when it worked as expected. This probably doesn't mean much, since it just means GRUB2 is properly configured and is finding its modules in my root partition. The next thing I'm going to try is installing rEFInd and using that to boot GRUB2, and check if the problem happens again. At this point I know I'm going to get rid of GRUB2, but I want to try this to see if the problem can be reproduced under a perhaps more controllable environment, perhaps useful for GRUB2 developers to know (if they ever do a Google search and run into a similar issue when they finally try to get better UEFI support for it).
Back to top
View user's profile Send private message
gemarcano
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jun 2012
Posts: 94
Location: Virginia

PostPosted: Fri Jun 15, 2012 7:14 pm    Post subject: Reply with quote

Alright, this got a little interesting. Not much progress in finding out what died with GRUB2, though.

I downloaded the binary rEFInd package (see for more information: http://www.rodsbooks.com/refind/getting.html), and installed it using it's included install.sh. I rebooted, and lo and behold, IF I use rEFInd to load GRUB2, whether rEFInd is loaded as default or through the F12 boot menu, GRUB2 boots the Linux kernel perfectly fine. I also installed an entry to check with the kernel stub, and it boots (options aren't getting passed, but that's my problem, not related to this for now), with the same behavior encountered if loaded through any of rEFInd, default boot, or through the F12 boot menu.

In the end, the only hypothesis I have is that GRUB2 makes an assumption that is no longer true after my motherboard loads its own boot menu. This might be the motherboard's fault, or GRUB2, but all other EFI loaders work fine, so either they are all more lenient and don't follow the UEFI specifications along with the motherboard, or GRUB2 has a bug. I think it's the latter, and I know not how to check for it.

With that, I bid farewell to GRUB2. It was a faithful-ish servant on my old MBR system, but this is not longer the case on my new UEFI system. If anyone has any observations, please do comment, or if someone knows who I can communicate this to. I'll try to post a bug report on the GRUB2 bug tracker, and hopefully it won't get shot down, :lol:. Once I get a tracking number, I'll post it here. I'm currently waiting for an activation email from them so I can post a bug report. The one good thing about GRUB2 is that it is relatively easy to reinstall for future testing (at least it is now after having dealt with it for the last few days).
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Sat Jun 16, 2012 4:34 am    Post subject: Reply with quote

My first comment is that UEFI firmware is proving to be quite variable in quality. Gigabyte's Hybrid EFI, in particular, is pretty dreadful, as I detail on a Web page I wrote about it. I looked up your motherboard, though, and it looks like it uses a different EFI implementation, so with any luck it's better.

Nonetheless, it does sound like your firmware has something quirky going on with it that's interacting negatively with GRUB 2. I know for a fact that GRUB 2 is finicky about the use of backslashes at the start of its pathname when it's called -- if its pathname doesn't begin with a backslash, it can't find its own configuration file. This doesn't seem to be what's happening to you, though; I mention it only to illustrate the type of issue that could be causing your problem.

You may want to check my Web page on EFI boot loaders for Linux. Given the nature of your problem, it might be worth checking ELILO, in particular. It's been pretty reliable on most systems, in my experience (my Mac being a notable exception). In conjunction with my rEFInd, which you're already using, it might serve your needs pretty well.
Back to top
View user's profile Send private message
gemarcano
Tux's lil' helper
Tux's lil' helper


Joined: 04 Jun 2012
Posts: 94
Location: Virginia

PostPosted: Sat Jun 16, 2012 4:54 am    Post subject: Reply with quote

Thanks for the reply.

Yes, I'm actually somewhat acquainted with your website, and I have to thank you for your work on rEFInd. I was hoping rEFInd would be just what I needed, but it appears that I'm going to have to settle with rEFInd loading either GRUB2 (since when it does that, GRUB2 works) or perhaps ELILO, since apparently if I load rEFInd by default on my computer it refuses to launch the kernel stub I made. It works fine if I select rEFInd from my UEFI boot menu, though, which is the opposite of what's going on with GRUB2. The kernel stub works fine if booted by default or if selected in the UEFI boot menu, if I remember correctly. rEFInd has no problems booting my Windows system (which is the main reason why I'm not just defaulting to my Linux kernel boot stub on my computer, since I want to easily change dual boot [and I guess pressing F12 isn't all that bad to change, but automatic would be nicer]).

In terms of GRUB2, I haven't done anything new to check, but I did do some reading on a possibility to make it more verbose, perhaps so that I can see where and how it crashes. I have a hunch that whatever is causing GRUB2 to die, could be related to what is making rEFInd malfunction, since both problems are being triggered when asked to load a Linux kernel, even though they seem to be triggered under differing circumstances.
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Sat Jun 16, 2012 2:59 pm    Post subject: Reply with quote

I sent you an e-mail with some debugging questions in response to your e-mail to me about rEFInd, so please check for that. This problem reeks of an EFI bug, but it may well be possible to implement a workaround in rEFInd's code (or in GRUB's code, for that matter). rEFInd's already got workarounds for several known EFI bugs.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software 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