Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Confusion about GPT and UEFI
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
acidmonkey
n00b
n00b


Joined: 27 Feb 2010
Posts: 39

PostPosted: Tue Oct 30, 2012 4:12 pm    Post subject: Confusion about GPT and UEFI Reply with quote

This is the first time I am dealing with this, although not absolutely necessary. I still have 2TB Disks.
But I want to have my PC using GPT for upward compatibility and for convince of re-partitioning.
My mainboard supports UEFI with all the strings and whistles, but it seems to generate more pain to deal with than I anticipated.
It may be the available boot-loaders which generate much the frustration. grub2 seems utterly bloated. I'd like to use syslinux, if possible without any initramfs or any extra partitions, not a requirement however.

Do I absolutely have to use some sort of extra partition in addition my boot and root partitions with GPT?
If else I am fine with any suggestion, I have even tried out elilo and looked at the possibility to use the UEFI loader to boot the kernel directly from a vfat partition.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Tue Oct 30, 2012 5:51 pm    Post subject: Re: Confusion about GPT and UEFI Reply with quote

acidmonkey wrote:
Do I absolutely have to use some sort of extra partition in addition my boot and root partitions with GPT?

acidmonkey ... you mean with EFI? Yes, an "ESP" (EFI System Partition) is required for EFI booting. But your ESP can function as /boot if you so wish, or you can have a small ESP and a seperate /boot as all the ESP need hold is the bootloader/bootmanager. You could also place /boot on the rootfs and have /boot/efi as the mountpoint for the ESP ... there are various ways of approaching the issue.

acidmonkey wrote:
If else I am fine with any suggestion, I have even tried out elilo and looked at the possibility to use the UEFI loader to boot the kernel directly from a vfat partition.

Well, there are various EFI bootloaders/bootmanager ... the kernels efi stub, rEFInd, gummyboot, efibootmgr ... and others. You might want to get familiar with the basics of EFI.

best ... khay
Back to top
View user's profile Send private message
srs5694
Guru
Guru


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

PostPosted: Tue Oct 30, 2012 5:54 pm    Post subject: Re: Confusion about GPT and UEFI Reply with quote

acidmonkey wrote:
It may be the available boot-loaders which generate much the frustration. grub2 seems utterly bloated. I'd like to use syslinux, if possible without any initramfs or any extra partitions, not a requirement however.


SYSLINUX is a BIOS-mode boot loader; the last I checked, it didn't support EFI-mode booting. AFAIK, all the EFI-mode boot loaders capable of booting a Linux kernel are:


  • The Linux kernel itself (version 3.3.0 or later); the EFI stub loader turns the kernel into its own boot loader. This is a little awkward to use by itself, but with the help of a boot manager (see below) it can be quite usable.
  • ELILO, which is the oldest of the EFI boot loaders for Linux. It borrows a lot from LILO in terms of its configuration file format and user interface.
  • Fedora's patched GRUB Legacy, which adds both EFI and GPT support.
  • GRUB 2, which as you say is rather bloated.


Those are listed in decreasing order of reliability, based on my personal experience. Note that in EFI, it's very useful to distinguish between a boot loader, which loads the kernel, and a boot manager, which gives you a list of boot options. Most BIOS boot loaders for Linux include both functions, so Linux users aren't used to making a clear distinction between the two classes of programs. EFI firmware should theoretically include a boot manager, but some implementations provide such poor boot managers that using a separate boot manager program is often a practical necessity. Both GRUB Legacy and GRUB 2 can fill this role, but there are other programs that function only as boot managers:


  • rEFIt, which was originally created for Macs but that works on UEFI-based PCs (albeit with some bugs and limitations).
  • rEFInd, which is a fork of rEFIt that aims to add features (particularly related to booting Linux) and fix bugs (particularly related to UEFI). FWIW, I'm the one who forked rEFIt into rEFInd, and I currently maintain rEFInd.
  • gummiboot, which is a simpler program than either rEFIt or rEFInd.


Personally, my first choice for booting Linux on EFI is to use the EFI stub loader in conjunction with rEFInd -- but since I maintain rEFInd, I'm not exactly an objective third-party observer! See my EFI boot loaders for Linux Web page for details on all of these boot loaders and boot managers except for gummiboot (which is very new; I need to update my Web pages).

Quote:
Do I absolutely have to use some sort of extra partition in addition my boot and root partitions with GPT?


This isn't a requirement of GPT, but it is a requirement of EFI. The EFI spec spells out the EFI boot process in detail, including the need for an EFI System Partition (ESP), which is where boot loaders, boot managers, EFI drivers, and related files reside.

That said, there is one way to fudge it under Linux: Since the ESP and the Linux /boot partition have similar purposes, you can mount the ESP at /boot. This will put stuff on the ESP beyond what the EFI spec says you should put there, and/or put it in different locations than what the EFI spec says. Since the ESP must be a FAT partition, this also means that you won't be able to use links or other Linux-style filesystem features. Despite these caveats, people who do this generally say it works well for them, and it can simplify certain configuration and/or maintenance tasks. For instance, if you use rEFInd and the EFI stub loader, and if you either give your kernels .efi filename extensions or use the scan_all_linux_kernels option in rEFInd, rEFInd will detect your new kernels when you drop them in their usual location in /boot. This simplifies kernel management compared to every BIOS boot loader.

One more point is Secure Boot, which is a complicating force on systems that ship with Windows 8. The easiest way to deal with it if you know your way around your firmware setup utility is to disable it. Otherwise you'll need to deal with adding keys or using a restricting boot loader, like the one Fedora is preparing for Fedora 18.

On a broader note, EFI support is still a bit weak in Linux. All the pieces are there, but distributions don't yet integrate them very well, so there are a lot of rough edges. In Gentoo, this is mostly a matter of documentation and knowledge among Gentoo users generally, but in distributions like Ubuntu and Fedora, it's a question of relatively unpolished EFI support in system installers. That said, learning it now still makes sense, because you may be forced to use EFI in the future.
Back to top
View user's profile Send private message
srs5694
Guru
Guru


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

PostPosted: Tue Oct 30, 2012 5:59 pm    Post subject: Re: Confusion about GPT and UEFI Reply with quote

khayyam wrote:
Well, there are various EFI bootloaders/bootmanager ... the kernels efi stub, rEFInd, gummyboot, efibootmgr ... and others. You might want to get familiar with the basics of EFI.


Actually, efibootmgr isn't a boot loader; it's a Linux user-mode program for managing the NVRAM variables related to the boot loader from Linux. I suspect you're thinking of efilinux, which I forgot to mention in my list. This is a very simple prototype/reference boot loader for Linux. Personally, I've never gotten it to work -- but I admit I haven't tried all that hard.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Tue Oct 30, 2012 6:33 pm    Post subject: Re: Confusion about GPT and UEFI Reply with quote

srs5694 wrote:
khayyam wrote:
Well, there are various EFI bootloaders/bootmanagers [...]

Actually, efibootmgr isn't a boot loader; it's a Linux user-mode program for managing the NVRAM variables related to the boot loader from Linux.

srs5694 ... thats why I stated "bootloaders/bootmanagers", the point being that with efi stub, you need nothing else but to update the NVRAM, and strictly speaking if using {ESP}/efi/boot/bootx64.efi even that isn't necessary. All I was pointing to is that there are various methods of booting EFI and various tools to help in doing so.

best ... khay
Back to top
View user's profile Send private message
acidmonkey
n00b
n00b


Joined: 27 Feb 2010
Posts: 39

PostPosted: Tue Oct 30, 2012 6:59 pm    Post subject: Reply with quote

thanks alot to all of you. :)

One thing I haven't yet figured out exactly is if I can still use a regular BIOS bootloader on a GPT partition scheme? (I noticed the legacy bios bootable flag). Is it right that I have to use a hybrid MBR in that case or does this work with straight GPT?


I'd either use a BIOS bootloader or go with the kernel built-in chainloader, in which case:
Do I have to use any extras like a built in kernel command line for options? Because, the possibility to have different kernels available without manual management sound really convenient.
Back to top
View user's profile Send private message
Jickler
n00b
n00b


Joined: 09 Sep 2011
Posts: 72

PostPosted: Tue Oct 30, 2012 8:29 pm    Post subject: Reply with quote

I'm not so sure about the terminology; my guess is this is how it's done to use an MBR on GUID disk, but I might be wrong. Either way, it works and it's how I boot on my UEFI box. All you need to do is create a 2MB partition at the start of the disk with gdisk, code EF02. Then, using grub2,
Code:
mkdir /boot/grub2 && run grub2-mkconfig -o /boot/grub2/grub.cfg
&& grub2-install --grub-setup=/bin/true /dev/sda
and it should boot.
Back to top
View user's profile Send private message
srs5694
Guru
Guru


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

PostPosted: Tue Oct 30, 2012 10:44 pm    Post subject: Re: Confusion about GPT and UEFI Reply with quote

khayyam wrote:
srs5694 wrote:
khayyam wrote:
Well, there are various EFI bootloaders/bootmanagers [...]

Actually, efibootmgr isn't a boot loader; it's a Linux user-mode program for managing the NVRAM variables related to the boot loader from Linux.

srs5694 ... thats why I stated "bootloaders/bootmanagers", the point being that with efi stub, you need nothing else but to update the NVRAM, and strictly speaking if using {ESP}/efi/boot/bootx64.efi even that isn't necessary. All I was pointing to is that there are various methods of booting EFI and various tools to help in doing so.


I see what you mean; however, in common usage, "boot manager" usually refers to a boot-time program for selecting the OS you want to boot. In fact, the efibootmgr man page uses the term in this sense, referring to the boot manager built into the EFI itself. I suppose efibootmgr could be consider an "EFI boot manager manager," but that's just an awkward phrase! ;-)

acidmonkey wrote:
One thing I haven't yet figured out exactly is if I can still use a regular BIOS bootloader on a GPT partition scheme? (I noticed the legacy bios bootable flag). Is it right that I have to use a hybrid MBR in that case or does this work with straight GPT?


You can boot in BIOS mode from a GPT disk. You do NOT need a hybrid MBR to do so on most computers, and in fact I advise strongly against creating hybrid MBRs unless they're absolutely necessary.

GRUB 2 and patched versions of GRUB Legacy both support booting from GPT disks. In the case of GRUB 2, it works best if you create a BIOS Boot Partition on the disk. LILO is also reported to work on GPT disks, although I've never gotten it to work myself. (I haven't tried all that hard, though.) The "legacy BIOS bootable" flag is used by SYSLINUX's GPT support, and possibly by some other obscure boot loaders, but it's not used by GRUB or LILO.

acidmonkey wrote:
I'd either use a BIOS bootloader or go with the kernel built-in chainloader, in which case:
Do I have to use any extras like a built in kernel command line for options? Because, the possibility to have different kernels available without manual management sound really convenient.


If you're using the EFI stub loader, you need a way to pass it command-line options. Broadly speaking, there are four ways to do this:


  • By launching the kernel directly using the EFI's boot manager and specifying the options in the entry for the kernel maintained in the EFI's NVRAM. This involves some rather awkward commands, as detailed under "Configuring and Using the EFI Stub Loader" on this page I wrote on the topic.
  • By launching the kernel directly using the EFI's boot manager and relying on an external configuration file called linux.conf. I know this was planned some time ago, but I'm not sure if it's been implemented yet. If not, you'll just have to wait to use this method.
  • By launching the kernel directly using the EFI's boot manager and building the options into the kernel using the built-in command-line options feature of the kernel, as you suggested.
  • By launching the kernel from a separate boot manager program, such as rEFInd or gummiboot, that's designed to pass options to a boot loader. This method is likely to be the easiest and most reliable to set up and reconfigure, but it can slow the boot process down by a second or two (or more, depending on configuration options).
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