Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SOLVED: EFI hangs on boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 186
Location: Dallas, TX

PostPosted: Mon Nov 05, 2012 2:10 am    Post subject: SOLVED: EFI hangs on boot Reply with quote

This isn't gentoo specific b/c both SysRescueCD and the latest Kubuntu hang as well, but maybe somebody here can help me figure out my problem.

I have a brand new custom built desktop that I got to play with Linux. It has an Intel i5 CPU and a true Intel Motherboard (specifically the DB75EN).

In BIOS mode, the system installs and runs Gentoo or any other Linux just fine when I use a 2TB or smaller drive. I have a 3TB drive that I want to use as my main disk though, so I have to go EFI. This is where I'm running into problems.


I can boot off CD in bios mode and install Gentoo, but when I go to reboot using either a SysRescueCD or Kubu or some other EFI enabled boot drive, The system hangs. I get the GRUB loader screen, but when I hit enter from any of the available boot options, I get a hung system w/ a black screen and have to power cycle.


I went with an Intel board figuring it would play the nicest with the Intel CPUs... Guess I was wrong. (BTW, using Integrated graphics, nothing in any of the PCI/PCIe slots, all drives internal SATA).


Hoping somebody has some ideas.


Last edited by JumboAg on Fri Nov 09, 2012 5:00 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21490

PostPosted: Mon Nov 05, 2012 2:18 am    Post subject: Reply with quote

Please post the output of grep -e '^[^#]' .config for your kernel configuration. Does it work if you use a different bootloader? Have you tried using the Linux self-hosting EFI loader?
Back to top
View user's profile Send private message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 186
Location: Dallas, TX

PostPosted: Mon Nov 05, 2012 2:24 am    Post subject: Reply with quote

cart before the horse I'm afraid Hu. I cant get the hardware to boot cleanly into EFI mode so I can install the OS/kernel. I can boot off a CD in bios mode no problem, but I cant boot into EFI (no EFI in /sys/firmware). Cant do it using a USB stick, a sysrescuecd, the latest Kubu that supports EFI ,etc...


I can install in bios mode fine, but once I configure my kernel from there, how can I setup grub w/o the system already being in EFI mode? It's my understanding that you cant configure grub for EFI unless you booted in an EFI environment.
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Mon Nov 05, 2012 3:06 am    Post subject: Reply with quote

Hi, try to update your bios, I had the same problem with my intel z77bh55k

http://www.intel.com/content/www/us/en/motherboards/desktop-motherboards/desktop-board-dz77bh-55k.html
Back to top
View user's profile Send private message
srs5694
Guru
Guru


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

PostPosted: Mon Nov 05, 2012 4:14 pm    Post subject: Re: EFI hangs on boot Reply with quote

JumboAg wrote:
I have a 3TB drive that I want to use as my main disk though, so I have to go EFI. This is where I'm running into problems.


You're laboring under a false assumption. A 3TB data disk does not require a switch to EFI. In fact, even a 3TB boot disk is fine under Linux, although Windows can't cope with it.

The disk size issue is primarily one of the partition table. The old MBR partition table maxes out at 2TiB (assuming a 512-byte logical block size, which to date the vast majority of hard disks use), so a disk larger than this requires a new partition table type. To the best of my knowledge, only GPT fits the bill. GPT is defined as part of the EFI spec, but you don't need to use EFI to use GPT. Although I've migrated most of my computers to EFI at this point, I've used GPT with BIOS-based computers for quite a while, including booting Linux from them. You'll have to specify use of GPT when you partition the disk, either by "mklabel gpt" in parted (or GUI equivalents in GParted or other GUI tools) or by using GPT fdisk (gdisk, cgdisk, or sgdisk) rather than fdisk, cfdisk, or sfdisk.

The most important caveat in this is that it's conceivable that boot loader or other software limits will require keeping certain boot components below the 2TiB mark on an over-2TiB boot disk. Since you're talking about a data disk, this isn't relevant to you, but in case somebody else reads this, place a BIOS Boot Partition and a separate Linux /boot partition below the 2TiB mark and you should be fine.

You might not want to bother with fixing your EFI-boot problems, but if you do....

Quote:
I can boot off CD in bios mode and install Gentoo, but when I go to reboot using either a SysRescueCD or Kubu or some other EFI enabled boot drive, The system hangs. I get the GRUB loader screen, but when I hit enter from any of the available boot options, I get a hung system w/ a black screen and have to power cycle.


Does the system hang immediately, or does the screen clear, begin to show Linux kernel messages, or have much in the way of disk activity after you select the boot option? If it hangs immediately, then it could be you're running into a GRUB bug or incompatibility with your firmware. This can be resolved by switching to another EFI boot loader. I've written a Web page on the topic, so check there for further advice.

If the kernel loads and then hangs, OTOH, you've got another problem. Perhaps an updated kernel would help; EFI-related developments are happening quite quickly, so there could be a bug that's been fixed in a more recent kernel.
Back to top
View user's profile Send private message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 186
Location: Dallas, TX

PostPosted: Mon Nov 05, 2012 10:49 pm    Post subject: Reply with quote

d2_racing - I had a late August bios revision (.37). Found .39 on Intel's site. The release notes didnt indicate anything that would help me, but i tried it anyway. That appears to have fixed the issue. I can now boot EFI.
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Tue Nov 06, 2012 2:16 am    Post subject: Reply with quote

Nice :P
Back to top
View user's profile Send private message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 186
Location: Dallas, TX

PostPosted: Wed Nov 07, 2012 12:35 am    Post subject: Reply with quote

OK Next step: get the Gentoo install to EFI boot. (Because I want to make it work, I know there are alternatives....)

My EFI boot partition is /dev/sda1

I've tried going with Grub2 and with just keeping it "simple" and manually configuring with efibootmgr. My kernel contains all the normal EFI requirements as far as I'm aware. (gentoo-sources:3.5.7)

efibootmgr:
/dev/sda1 contains: /EFI/gentoo/3.5.7-gentoo.efi

ran efibootmgr -c -l '\\EFI\\gentoo\\3.5.7-gentoo.efi' -L Gentoo.

reboot - Gentoo partition not showing up in list.

remove the partition with a efibootmgr -b X -B, try with grub2:

mounted /dev/sda1 on /boot/efi
ran
grub2-install
grub2-mkconfig -o /boot/grub2/grub.cfg

system shows /EFI/gentoo/grubx64.efi present. Reboot.... still see no Gentoo.


Trying to figure out if I'm doing something wrong or if my Intel Mobo still is buggy and I should abandon messing with it.


One thing of note: if I run efibootmgr -v AFTER the reboot when I dont see the Gentoo partition, it has the Gentoo object listed, but it does NOT show the "File" information for it....
Back to top
View user's profile Send private message
srs5694
Guru
Guru


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

PostPosted: Wed Nov 07, 2012 4:09 am    Post subject: Reply with quote

JumboAg, try using the "bcfg" command in an EFI 2.0 shell. This sometimes works when efibootmgr doesn't, and your comment about the firmware "forgetting" the file information makes me think you may have a system where this would be helpful. See this Arch wiki for details of how to use bcfg. See another part of the same page for download links to EFI shell binaries, if you don't already have one.

If that doesn't work, then I recommend using efibootmgr or bcfg to delete all the entries and install a boot manager as EFI/BOOT/bootx64.efi on the ESP. This is the default name that most EFI implementations will launch as a fallback if nothing else is available. If you put something like rEFInd or gummiboot there and configure it properly, it'll let you boot whatever else you desire, so a flaky NVRAM holding area for boot loaders needn't be too crippling. Note that I maintain rEFInd, so if you use it and have problems, I can help you out.
Back to top
View user's profile Send private message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 186
Location: Dallas, TX

PostPosted: Thu Nov 08, 2012 8:25 pm    Post subject: Reply with quote

well the good news is I finally got it working. I think Intel's EFI is really really buggy and/or picky. What I've found is that I MUST have a valid \EFI\boot\bootx64.efi file on my EFI partition. I dont have to reference it in the efibootmgr/bcfg entry, but there must be a valid file. So what I've done for now is put the EFI Shell .efi file in that location but have still told efibootmgr to look in EFI\gentoo\<kernel>

Granted, I panic on boot right now b/c the kernel isnt yet being passed parameters (I gave it the raw kernel not the grub.efi overlay just for testing. Havent decided yet what actual bootmgr I am going to use. I might even pass the parameters in the kernel itself.

srs5694 - You're a lifesaver.
Back to top
View user's profile Send private message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 186
Location: Dallas, TX

PostPosted: Fri Nov 09, 2012 5:00 am    Post subject: Reply with quote

Update: I never could get elilo working, but Grub2 functions like a champ. I managed to (quite easily) get Fedora, Ubuntu and Gentoo each sitting side by side all using EFI. Fedora ended up wanting its own EFI-boot partition but ubuntu decided to share the /dev/sda1 I had assigned to Gentoo.


I'm glad I went this route. Having the BIOS/EFI layer sitting over grub is going to make it so much easier to have multiple flavors of linux sit next to each other. No more having to manually grub-install every time something updates itself to get back to my preferred grub.cfg environment.

Thank you to all that assisted!!
Back to top
View user's profile Send private message
srs5694
Guru
Guru


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

PostPosted: Fri Nov 09, 2012 3:27 pm    Post subject: Reply with quote

JumboAg wrote:
I'm glad I went this route. Having the BIOS/EFI layer sitting over grub is going to make it so much easier to have multiple flavors of linux sit next to each other. No more having to manually grub-install every time something updates itself to get back to my preferred grub.cfg environment.


That depends on how it's set up. Ubuntu, for one, is trying to fit UEFI into a BIOS mold. Its GRUB 2 configuration relies on autodetection scripts that try to add everything they can find to GRUB, and it stores its GRUB configuration file on an Ubuntu partition, not on the ESP. Thus, if you set up Ubuntu's GRUB as the default boot loader, your system will boot to a nice "grub>" prompt if you remove Ubuntu or if its partition is damaged.

Fedora 17 still uses GRUB Legacy and places its GRUB configuration file on the ESP, so it's less susceptible to breakage than is Ubuntu's GRUB. It presumably has script to update the configuration when the kernel is updated, but I've not looked into that.

I don't know what Gentoo's GRUB 2 does in an EFI environment.

In any of these cases, of course, you can bypass the standard boot loader configuration by doing things manually, but then you've got to track down and remove the configuration scripts. You can also rely on your firmware's own boot manager to select which of the GRUB installations you use on a boot-by-boot basis. That will at least enable you to boot to another OS if Ubuntu's (or any other distribution's) configuration gets flaky. Yet another possibility is to scrap it all in favor of rEFInd or gummiboot as a boot manager and the kernel's EFI stub loader as the boot loader. (The EFI stub loader was introduced with the 3.3.0 kernel, so it's available in Fedora 17 and Ubuntu 12.10; or you can compile your own kernel. Gentoo's been pushing suitable kernels for a while via portage, but you may need to ensure that the EFI stub loader support is enabled when you compile it.) You'll need to manage your boot configuration manually with gummiboot, but if you use rEFInd, after initial configuration, it can pick up your kernel changes automatically, provided you set it up right.
Back to top
View user's profile Send private message
JumboAg
Apprentice
Apprentice


Joined: 03 Mar 2007
Posts: 186
Location: Dallas, TX

PostPosted: Fri Nov 09, 2012 3:55 pm    Post subject: Reply with quote

srs5694, What I was getting at with the "manually grub-install" comment was referring to pre-EFI bios configurations where each time you install a flavor of linux, the tendency was for it to whack the MBR linkage to the users preferred boot loader requiring a user to have to constantly manually "fix" things, especially if the users preference was say Gentoo's Grub environment..

Intel's boot manager may be really really picky and buggy as heck, but it does work once you figure out some of the required directory and filenames to anchor it.

What I like about going EFI over BIOS is that regardless of the boot manager I use (whether it be the firmwares or rEFInd or other) the boot loaders play much nicer with each other because they dont step on each other. Sure, some like Ubuntu's will "see" other linux flavors and add them to its menu option list, but in doing so it wont obliterate a grub.cfg setup elsewhere for say Gentoo.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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