| View previous topic :: View next topic |
| Author |
Message |
Kate Monster Apprentice

Joined: 13 Jun 2006 Posts: 221 Location: Clarkston, Michigan
|
Posted: Fri Jun 22, 2012 2:19 pm Post subject: EFI booting? |
|
|
hi,
I got a new computer. This new computer has an SSD and EFI, two technologies I've never worked with before. So of course, I first thought of Gentoo. I got new hardware, now it's time to run it through it's paces
Anyway, EFI is giving me a lot of trouble. I installed grub2 with GRUB_PLATFORM="efi-x86_64" and read a couple guides, but I'm still confused. So if I understand correctly, in order to get a boot-able system, I first need to be booted into an EFI compatible Live CD? Or was that some extra unnecessary step? I'll post the guides I used later, but I'm at work right now. I really would like to get a working system tonight, so I can get my emerge -e world running. If I need my system booted via EFI to be able to setup my boot loader, what is a good CD to use? |
|
| Back to top |
|
 |
srs5694 Guru

Joined: 08 Mar 2004 Posts: 310 Location: Woonsocket, RI
|
Posted: Fri Jun 22, 2012 5:41 pm Post subject: |
|
|
It's usually possible to install in BIOS mode and switch to EFI mode later, or to just ignore EFI and use BIOS mode entirely. That said, in the long run using EFI mode can have some advantages, such as faster boot times (on some, but not all, systems), a different selection of boot loaders (which can be a plus or a minus, depending on your needs and preferences), saner boot loader management, and so on.
If you want to install in EFI mode from the start, you could use an Ubuntu CD in its "try it before installing" mode. Those CDs generally boot pretty well in EFI mode, and you can then follow the usual Gentoo installation method. Check for a /sys/firmware/efi directory after booting. If it's present, you've booted in EFI mode. If it's absent, you've probably booted in BIOS mode, although there are ways to boot in EFI mode and not have that directory, so this condition isn't absolute proof of a BIOS-mode boot.
IMO, GRUB 2 is the worst of the available EFI boot loaders, so my advice is to avoid it. In my experience, the kernel's EFI stub loader is the most reliable of the EFI boot loaders, but it has no user interface. You'll need to add it to your firmware and use its boot manager to select which kernel or OS to boot or use some other boot manager (such as rEFInd) to select the kernel or OS to boot. Fedora's patched GRUB Legacy and ELILO are two other options that work better than GRUB 2, in my experience. See my Web page on the topic for more information on EFI boot loaders, including my detailed comments about each of them and installation instructions. Note that booting in EFI mode is required to add the NVRAM entries that are the official standard way of booting, but you can set a default by using a specific filename (EFI/boot/bootx64.efi on the ESP) instead, and you can do this even from a BIOS-mode boot. The catch is that if something else has set an NVRAM entry for the boot loader, using the default name is unlikely to work. |
|
| Back to top |
|
 |
Kate Monster Apprentice

Joined: 13 Jun 2006 Posts: 221 Location: Clarkston, Michigan
|
Posted: Fri Jun 22, 2012 5:54 pm Post subject: |
|
|
| srs5694 wrote: | It's usually possible to install in BIOS mode and switch to EFI mode later, or to just ignore EFI and use BIOS mode entirely. That said, in the long run using EFI mode can have some advantages, such as faster boot times (on some, but not all, systems), a different selection of boot loaders (which can be a plus or a minus, depending on your needs and preferences), saner boot loader management, and so on.
If you want to install in EFI mode from the start, you could use an Ubuntu CD in its "try it before installing" mode. Those CDs generally boot pretty well in EFI mode, and you can then follow the usual Gentoo installation method. Check for a /sys/firmware/efi directory after booting. If it's present, you've booted in EFI mode. If it's absent, you've probably booted in BIOS mode, although there are ways to boot in EFI mode and not have that directory, so this condition isn't absolute proof of a BIOS-mode boot.
IMO, GRUB 2 is the worst of the available EFI boot loaders, so my advice is to avoid it. In my experience, the kernel's EFI stub loader is the most reliable of the EFI boot loaders, but it has no user interface. You'll need to add it to your firmware and use its boot manager to select which kernel or OS to boot or use some other boot manager (such as rEFInd) to select the kernel or OS to boot. Fedora's patched GRUB Legacy and ELILO are two other options that work better than GRUB 2, in my experience. See my Web page on the topic for more information on EFI boot loaders, including my detailed comments about each of them and installation instructions. Note that booting in EFI mode is required to add the NVRAM entries that are the official standard way of booting, but you can set a default by using a specific filename (EFI/boot/bootx64.efi on the ESP) instead, and you can do this even from a BIOS-mode boot. The catch is that if something else has set an NVRAM entry for the boot loader, using the default name is unlikely to work. |
Alright, I was starting to wonder if GRUB sucked, or if it was just me. I'm not opposed to the kernel loader, I have no need for user interface since I won't be installing Windows on this machine(outside of a VM). How do I install it? Is there a guide?. Thanks for the tip. Hopefully Ubuntu fits on one of my flash drives.
Yeah, I'm aware I could boot into BIOS mode, but actually didn't realize until after I'd partitioned and gotten halfway through the install. Doesn't matter though, I really want to take advantage of the new hardware(although, this machine has been taking awhile to POST...warning sign?) |
|
| Back to top |
|
 |
khayyam Veteran


Joined: 07 Jun 2012 Posts: 1241
|
Posted: Fri Jun 22, 2012 8:45 pm Post subject: |
|
|
| Kate Monster wrote: | | [...] I'm not opposed to the kernel loader, I have no need for user interface since I won't be installing Windows on this machine(outside of a VM). How do I install it? Is there a guide? |
Kate ... there are brief (though complete) instructions on darkphaders blog here. The only thing you will need, other than the kernel itself, is sys-boot/efibootmgr.
HTH & best ...
khay |
|
| Back to top |
|
 |
Kate Monster Apprentice

Joined: 13 Jun 2006 Posts: 221 Location: Clarkston, Michigan
|
Posted: Sat Jun 23, 2012 2:30 am Post subject: |
|
|
| khayyam wrote: | | Kate Monster wrote: | | [...] I'm not opposed to the kernel loader, I have no need for user interface since I won't be installing Windows on this machine(outside of a VM). How do I install it? Is there a guide? |
Kate ... there are brief (though complete) instructions on darkphaders blog here. The only thing you will need, other than the kernel itself, is sys-boot/efibootmgr.
HTH & best ...
khay | Followed the instructions to a T. nothing. system doesn't seem to think the flash drive is bootable |
|
| Back to top |
|
 |
khayyam Veteran


Joined: 07 Jun 2012 Posts: 1241
|
Posted: Sat Jun 23, 2012 6:35 am Post subject: |
|
|
| Kate Monster wrote: | | Followed the instructions to a T. nothing. system doesn't seem to think the flash drive is bootable |
... is the drive formated as a GPT disk?
best ... khay |
|
| Back to top |
|
 |
Kate Monster Apprentice

Joined: 13 Jun 2006 Posts: 221 Location: Clarkston, Michigan
|
Posted: Sat Jun 23, 2012 2:16 pm Post subject: |
|
|
| khayyam wrote: | | Kate Monster wrote: | | Followed the instructions to a T. nothing. system doesn't seem to think the flash drive is bootable |
... is the drive formated as a GPT disk?
best ... khay | Yes. The EFI BIOS recognizes that the drive is EFI bootable, it just silently fails. I did get the system booting with plain lilo though |
|
| Back to top |
|
 |
khayyam Veteran


Joined: 07 Jun 2012 Posts: 1241
|
Posted: Sat Jun 23, 2012 2:59 pm Post subject: |
|
|
| Kate Monster wrote: | | The EFI BIOS recognizes that the drive is EFI bootable, it just silently fails. I did get the system booting with plain lilo though |
OK, well 'lilo' is BIOS/MBR, unless you mean 'elilo'? If you booted with lilo then your disk will be MBR or 'hybrid MBR/GPT' (which may be the case if your "EFI" comes configured as "BIOS"), you want to avoid this if at all possible.
I'm a little sketchy WRT the various EFI "BIOS" (hehe, thats like "USB Serial") but I'd imagine its setup to boot Windows, and as Windows currently boots via BIOS/MBR then you may have some horid 'hybrid MBR/GPT', or its competely MBR and your "BIOS" is just telling porky pies :)
The best way to check is to boot whatever install medium you used and run 'gdisk -l /dev/sda'.
best ... khay |
|
| Back to top |
|
 |
Kate Monster Apprentice

Joined: 13 Jun 2006 Posts: 221 Location: Clarkston, Michigan
|
Posted: Sun Jun 24, 2012 5:45 am Post subject: |
|
|
| khayyam wrote: | | Kate Monster wrote: | | The EFI BIOS recognizes that the drive is EFI bootable, it just silently fails. I did get the system booting with plain lilo though |
OK, well 'lilo' is BIOS/MBR, unless you mean 'elilo'? If you booted with lilo then your disk will be MBR or 'hybrid MBR/GPT' (which may be the case if your "EFI" comes configured as "BIOS"), you want to avoid this if at all possible.
I'm a little sketchy WRT the various EFI "BIOS" (hehe, thats like "USB Serial") but I'd imagine its setup to boot Windows, and as Windows currently boots via BIOS/MBR then you may have some horid 'hybrid MBR/GPT', or its competely MBR and your "BIOS" is just telling porky pies
The best way to check is to boot whatever install medium you used and run 'gdisk -l /dev/sda'.
best ... khay | no, lilo. My partition is formatted as GPT but it still worked. Idk. I'm gonna pop in an Ubuntu disk and install EFI from there. |
|
| Back to top |
|
 |
khayyam Veteran


Joined: 07 Jun 2012 Posts: 1241
|
Posted: Sun Jun 24, 2012 9:30 am Post subject: |
|
|
| Kate Monster wrote: | | no, lilo. My partition is formatted as GPT but it still worked. Idk. I'm gonna pop in an Ubuntu disk and install EFI from there. |
Kate ... OK, given that you booted with lilo then your disk is formated hybrid GPT/MBR, if you formated the disk yourself it may be that your "BIOS" noticed this fact and as it's set to somekind of "compatability" mode hybridised it. Again, I'm not that familiar with the various EFI "BIOS" but I imagine there is an option to disable "compatability" and so run native GPT (though this may require you un-hybrid using gdisk).
HTH & best ...
khay |
|
| Back to top |
|
 |
gemarcano n00b

Joined: 04 Jun 2012 Posts: 34 Location: New York
|
Posted: Thu Jun 28, 2012 5:34 am Post subject: |
|
|
I don't know if this is solved or not, but I'll add my two cents since I did try to get GRUB2 to work on an UEFI system. In the end I gave up with GRUB2 and resorted to booting from rEFInd. I did experiment with the kernel stubs (and they WORK really well), so I'll share a few of the problems (and solutions) I ran into along the way (not many). Forgive me if these suggestions sound simple-- I'm just a simple individual, and at one point these "simple" points were mountains in my view.
-First of all, I didn't use a flash drive to install in EFI mode. I simply burned a Fedora 17 CD (make sure to boot it in EFI mode) (I tried making it into a USB Flashdrive image but it failed miserably, even with Fedora's own tools for it) and then followed the Gentoo Handbook for amd64 (in my case). I also used this blog entry as help.
-In regards to the instructions from the blog, I do not have any framebuffer stuff enabled because I use KMS (nouveau driver), and I can still boot fine, BUT I do see some graphic artifacts (a bunch of yellow lines) for a split second a the beginning of boot, may be related to the framebuffer.
-Once the new kernel was compiled and installed (make && make_install && make modules_install), I simply copied the vmlinuz image from /boot to /boot/efi/EFI/Gentoo/ (NOTE: /boot/efi is where I mounted my FAT32 EFI System Partition, your mount point may vary).
-While on the topic of the EFI System Partition (ESP), it seems some UEFI implementations (and Windows, but you might not care about this) are finicky about the format for this partition, as well as its location. The recommended location for it is the first partition (size anywhere between 100 to 200 MB, or whatever, just large enough to fit all of your bootloaders), and things all seem to favor FAT32 over FAT16 (in other words, if you use mkfs.vfat to make a FAT32 partition, make sure to specify the -F32 parameter).
-I passed kernel parameters by building them into the EFI entry through efibootmgr, through something like this:
| Code: | | echo "root=/dev/sda4" | iconv -f ascii -t ucs2 | efibootmgr --create --disk /dev/sda --part 1 --label "Gentoo" --loader '\efi\Gentoo\vmlinuz.efi --append-binary-args - |
It seems UEFI uses UCS2 to encode characters, hence the conversion from ASCII to UCS2 before passing the parameters to efibootmgr. Please look at the efibootmgr man page for more information, since it actually is useful!
-BTW, if you, for some reason, ever reformat the ESP, you need to reconstruct the boot entries on your firmware. I ran into this problem when experimenting. I backed up the partition, reformatted it, and reloaded the data on it, and I couldn't get it to boot until I ran efibootmgr and added all of the entries again.
-Sadly, I found that it is best to avoid problems on some finicky boards and just wipe out the whole hard drive and start from scratch if things aren't working well (back up data, of course). Make sure that the drive is formatted using GTP (see "man gdisk" , and take a look at expert options also, since these can help in reformatting a drive and killing MBR for good). BTW, if you use the Fedora 17 LiveCD, IF gdisk or partprobe whine about some partition not covering the whole data section of the drive, it's not your hard drive, it's the LiveCD. It freaked me out when I first saw it, but when I loaded Gentoo on its own, that message was long gone. Thank goodness!
I THINK that's most of my experience... I'm disappointed at how awkward it is to install Gentoo on an UEFI system IN EFI mode, and since other distros have similar issues as well, this might be a (mostly) Linux-wide problem. I'm also disappointed at Motherboard manufacturers in that some of their UEFI implementation aren't that great (I suspect my Gigabyte board has its issues, esp. since I've had problems booting GRUB2 and some with rEFInd [workarounds discovered for the later, anyhow]). Well, with that, good luck! Hopefully this helps a little (and hopefully you don't waste a weekend on just this issue of booting like I did!). |
|
| Back to top |
|
 |
keet Guru

Joined: 09 Sep 2008 Posts: 330
|
Posted: Sat Jun 30, 2012 1:51 am Post subject: |
|
|
I've had a U.E.F.I. motherboard for over a year, and I just got an S.S.D., plus I've reinstalled Windows a couple times, so I've been through reinstalling G.R.U.B. 2 in U.E.F.I. multiple times. Usually I just boot GRUB using an UEFI Ubuntu disc, use the GRUB command line to boot into Gentoo, and reinstall GRUB 2 in the UEFI. It's not that difficult once you've done it half a dozen times.  _________________ My Gentoo computers:
Home-built i7 2600K / 8GB RAM || Dell T6400/4GB RAM
Panasonic Toughbook CF-51 T2300/4GB RAM || Fujitsu Lifebook P4/1.6Ghz, 512MB RAM |
|
| Back to top |
|
 |
WorBlux n00b

Joined: 07 May 2011 Posts: 25
|
Posted: Tue Aug 21, 2012 11:55 am Post subject: |
|
|
You don't actually need a liveCD booted in UEFI mode to get it to work.
If you copy the UEFI shell onto the UEFI system partition your boot menu will let you load it. You can then boot any .efi executable you have on that partition, (grub, rEFInd, the kernel with EFI_STUB). So long as you compiled the gentoo kernel with support for the /sys efi variable interface you can use efibootmgr to finish. |
|
| Back to top |
|
 |
|
|
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
|
|