I started this thread so that I wouldn’t hijack my own over on -dev.

One of the comments on my draft hint was this:

> It's uncler to me the order of partitions of if it matters.  I think
> using GRUB and UEFI requires both a 1MB GRUB partitiion (type ef02) and
> a 250 MB FAT32 (type 0700) partition.


In the overall scheme of things these distinctions may or may not be important. 
 But they are needed to use UEFI firmware to boot into EFI Mode which is what 
the hint is about.  Here’s where my knowledge is incomplete.  I *think*—and 
I’ll attempt to bolster this with additional research—that the partition types, 
especially the FAT32 partition, indicate how the firmware will boot.  [Writing 
this cleared up the “I *think* part.  It’s now a matter of “how it boots.” It’s 
a matter of where grub goes *to* boot.]  Type ef02 indicates the system’s  ESP, 
EFI System PartitionAdditionally, which is the location of any and all 
executable boot loaders—this even includes an actual kernel image.

Researching this particular comment caused me to review my knowledge and got me 
to a reference about which I had forgotten.  I will be able to add 
clarification.  The “meat” of the hint is operational and not conceptual.  
Therefore, information with the detail in this post, probably won’t be 
included, except in a reduced form.

The reference is an article from Issue #168 March 2013 of “Linux Format,” 
entitled “UEFI: Boot redefined.”  The pdf file is 450kb and I don’t want to 
attach it to a list post.  I cannot supply a link from linuxformat.com 
<http://linuxformat.com/> because the archives are available only to magazine 
subscribers.

Here is a small excerpt of the discussion on UEFI and MS-DOS and GPT 
partitioning.
> The GPT scheme also includes a master boot record, and its purpose is to help 
> prevent corruption of a GPT disk by tools that are not GPT-aware. This 
> Protective MBR, or PMBR, contains an MSDOS partition table with one partition 
> covering the whole disk (or 2TiB if the disk is bigger). This partition is 
> marked with a type of 0xEE. Systems unaware of GPT will see an unknown 
> partition occupying the whole disk and leaving no available space.
> 
> Another use of the protective MBR is to allow a BIOS to boot a GPT disk. If 
> it contains
> a bootloader then the BIOS will blindly load and execute it. If that 
> bootloader understands GPT then it can boot it. One such bootloader is Grub2, 
> and is used by many Linux distributions. This allows BIOS-based systems to 
> use disks greater than 2TiB.
> 
> MS-DOS partitioned disks usually leave a gap (known as the DOS Compatibility 
> region), starting at sector 1 and running up to the beginning of the first 
> partition. Bootloaders traditionally used this unallocated space to locate 
> code (Grub 1 wrote its stage 1.5 loader here). With GPT, the partition table 
> begins at sector 1, immediately after the PMBR – so there is no unallocated 
> space to use in this way. Instead, the GPT specification provides for a 
> special BIOS boot partition for use by boot loaders that would otherwise have 
> used the DOS Compatibility region. Grub 2 writes its bootloader directly onto 
> that partition (it does not contain a filesystem). Given that the presence of 
> the DOS Compatibility region was by convention rather than definition, having 
> a specifically allocated partition is more robust.
> 
The article goes on from here with an exercise using VirtualBox to “...set up a 
new system based on UEFI and GPT. Our new system will dual boot: it will work 
with both UEFI and BIOS firmware. “   The disk created was 10GB.

I am not able to “copy and paste” the partition table after the exercise from 
running <parted -l>.   So I will attempt to recreate the table:

Number          Start           End                     Size                    
        Code Name
1                       2048            411647          200.MiB                 
EF00 EFI System
2                       34                      2047            1007.0 KiB      
        EF02 BIOS boot partition
3                       411648          821247          200.0 MiB               
8300 Linux /boot filesystem
4                       821248          20971486        200.0 MiB               
8300 Linux /root filesystem

I hope that table comes through holding the formatting.

I guess that the specific reply to the comment is that the GPT specification 
has this partitioning scheme.  It’s not required by the combination of 
UEFI-GPT-GRUB.  It’s a matter of a user being able to distinguish between the 
partitions and where the grub image will be installed.

Writing this post has helped solidify my knowledge of this and I think 
discussions like this are quite valuable in this “new” UEFI environment.

Before the end, I must reiterate—UEFI and “Secure Boot” are not synonymous.  
Maybe that should be my e-mail signature.  :)

Dan



-- 
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Do not top post on this list.

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

http://en.wikipedia.org/wiki/Posting_style

Reply via email to