Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Installing Gentoo
  • Search

UEFI/GPT boot; What is minimally necessary?

Having problems with the Gentoo Handbook? If you're still working your way through it, or just need some info before you start your install, this is the place. All other questions go elsewhere.
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
duderonomy
Guru
Guru
Posts: 349
Joined: Sat Mar 20, 2004 7:51 pm
Location: SF Bay Area

UEFI/GPT boot; What is minimally necessary?

  • Quote

Post by duderonomy » Tue Aug 25, 2015 6:01 am

Hello,

I'd like to get a kind of sanity check regarding the document Quick Installation Checklist. Can it be relied on for UEFI booting? I would have thought the document would mention 'efibootmgr'. But what do I know. :) I suppose my ultimate question about that guide is, "Does it cover everything necessary for UEFI booting?"

The few times I have successfully made boards boot in UEFI mode with GPT partition is by creating a BIOS partition (type EF02), a little of my persistence and a lot of luck.

Since I have not yet learned to pronounce rEFInd, I will leave learning it for another day.

I'd really like to get to know what are the essential elements involved in a simple UEFI/GPT boot scenario with Gentoo Linux. Can somebody express it in this thread in a few lines?

Alternatively, is there a guide for this?? (which I have clearly overlooked while searching)

I notice from reading one doc that efibootmgr acts on partition 1 of the device by default, which may explain why other guides suggest putting the efi partition on the first partition. And for dual booters I think Windows wants it there, too.

Many thanks!
:D
Top
The Doctor
Bodhisattva
Bodhisattva
User avatar
Posts: 2678
Joined: Tue Jul 27, 2010 10:56 pm

  • Quote

Post by The Doctor » Tue Aug 25, 2015 6:28 am

Looks fine to me, but minimal for UEFI is really simple. Make that boot partition, format it vfat, and name your kernel /boot/efi/BOOT/BOOTX64.EFI (assuming your boot partition is mounted at /boot) Literally, that is all you need to do.

Dual booting is a little more complex since this file is windows, but you can name it anything and put it next to windows and use efibootmgr to add the new name to the list of options. Then you can choose using F12 or whatever your UEFI implantation uses to choose OS.

This will automatically boot your kernel with no questions asked, assuming you configured a bootable kernel.
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Top
duderonomy
Guru
Guru
Posts: 349
Joined: Sat Mar 20, 2004 7:51 pm
Location: SF Bay Area

  • Quote

Post by duderonomy » Tue Aug 25, 2015 8:30 am

Thank you, Doctor.

In an attempt to make use of my current state, here is what I did.
While chroot'd,

Code: Select all

sysresccd boot # mount /dev/sda2 efi
sysresccd boot # grub2-install --target=x86_64-efi
Installing for x86_64-efi platform.
Installation finished. No error reported.
where, sda2 is the vfat partition,
and 'efi' is at /boot/efi

Then, copied a kernel to the pathname "EFI/gentoo/grubx64.efi" on sda2

This was clearly progress because upon reset the desired kernel booted.
But it was quickly over as I get a kernel panic -
not sycning: VFS: Unable to mount root fs on known-block(0,0)

Could somebody suggest what may remedy this? What should I investigate? Thx!
Top
duderonomy
Guru
Guru
Posts: 349
Joined: Sat Mar 20, 2004 7:51 pm
Location: SF Bay Area

  • Quote

Post by duderonomy » Tue Aug 25, 2015 8:53 am

Is the fstab in the aforementioned Quick Installation Guide workable with the partitions created and subsequent mount points from an earlier section of the document?

Thx!
:D
Top
Troopo
Guru
Guru
Posts: 310
Joined: Sun Jun 14, 2015 9:17 pm

  • Quote

Post by Troopo » Tue Aug 25, 2015 7:09 pm

Take a look in this thread as well it was just opened not long ago.

https://forums.gentoo.org/viewtopic-t-1026858.html
Top
duderonomy
Guru
Guru
Posts: 349
Joined: Sat Mar 20, 2004 7:51 pm
Location: SF Bay Area

  • Quote

Post by duderonomy » Fri Aug 28, 2015 3:23 am

Fantastic!
Thank you so much for the awesome lead with more modern info.
Thanks Troopo! :) :)
Top
duderonomy
Guru
Guru
Posts: 349
Joined: Sat Mar 20, 2004 7:51 pm
Location: SF Bay Area

  • Quote

Post by duderonomy » Sat Aug 29, 2015 3:31 am

Well, after I got into reading that wonderful set of documentation,
the added complexity of encrypting the file systems and LVM
was a bit distracting; causing me to lose track of the details that
I am trying to sort out. Haha! :)

So, now I am back to the updated Gentoo Handbook, on this page:
https://wiki.gentoo.org/wiki/Handbook:A ... tion/Disks

The page says:
Now create a 2 MB partition that will be used by the GRUB2 boot loader later.

I am believe this is one way to do it.
I'd like to understand the objective for doing it this way. Why?

I read that UEFI can load the Linux kernel directly skipping the traditional bootloader,
with this minimal partition table:

Code: Select all

/boot  (EFI boot partition)
swap
/      (root)
What does this 2 MiB partition with the bios_grub attribute do? What's the use case for that? Is it for dual booting with Windows?

EDIT:
It looks like NeddySeagoon has a good explanation in a recent [post]7799790[/post]
Case closed, I think. :)

Thx!
:D
Top
duderonomy
Guru
Guru
Posts: 349
Joined: Sat Mar 20, 2004 7:51 pm
Location: SF Bay Area

  • Quote

Post by duderonomy » Tue Sep 01, 2015 1:10 am

So yes, it works just as easy as the doctor sez it does.
Nice that the Gentoo Handbook is updated for GPT and UEFI.
Thanks to Gentoo volunteers for that.
I presume the bios_grub partition is for Windows dual boot; I do not use one.
genkernel installed files into /boot

IIRC, the one thing slightly different was adding the arg "--efi-directory=/boot" when running grub2-install.

Code: Select all

(chroot) livecd / # grub2-install /dev/sda
Installing for x86_64-efi platform.
grub2-install: error: cannot find EFI directory.

(chroot) livecd / # grub2-install --efi-directory=/boot /dev/sda
Installing for x86_64-efi platform.
Installation finished. No error reported.

## It worked!

## Let's view some of /boot

(chroot) livecd / # ls -FlR /boot
/boot:
total 11704
drwxr-xr-x 4 root root    8192 Aug 29 01:25 efi/
drwxr-xr-x 6 root root    8192 Aug 29 01:27 grub/
-rwxr-xr-x 1 root root 3399072 Aug 29 01:08 initramfs-genkernel-x86_64-4.0.0-gentoo*
-rwxr-xr-x 1 root root 4853504 Aug 29 01:02 kernel-genkernel-x86_64-4.0.0-gentoo*
-rwxr-xr-x 1 root root 3709064 Aug 29 01:02 System.map-genkernel-x86_64-4.0.0-gentoo*

/boot/efi:
total 16
drwxr-xr-x 2 root root 8192 Aug 29 01:11 boot/
drwxr-xr-x 2 root root 8192 Aug 29 01:25 gentoo/

/boot/efi/boot:
total 4744
-rwxr-xr-x 1 root root 4853504 Aug 29 01:02 bootx64.efi*

/boot/efi/gentoo:
total 120
-rwxr-xr-x 1 root root 115712 Aug 29 08:06 grubx64.efi*

/boot/grub:
total 88
drwxr-xr-x 2 root root  8192 Aug 29 01:25 fonts/
-rwxr-xr-x 1 root root 25594 Aug 29 01:27 grub.cfg*
-rwxr-xr-x 1 root root  1024 Aug 29 01:25 grubenv*
drwxr-xr-x 2 root root  8192 Aug 29 01:25 locale/
drwxr-xr-x 3 root root  8192 Aug 29 01:25 themes/
drwxr-xr-x 2 root root 24576 Aug 29 08:06 x86_64-efi/

  8< snip >8

(chroot) livecd / # efibootmgr -v
BootCurrent: 0009
Timeout: 1 seconds
BootOrder: 0000,0007,0002,0009,000A,0008
Boot0000* gentoo	HD(1,GPT,8d86e60f-a447-4239-bec1-574a00d54e00,0x800,0xaf000)/File(\EFI\gentoo\grubx64.efi)
Boot0002* Linux	VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
Boot0007* CD/DVD Drive 	BBS(CDROM,,0x0)..GO..NO........O.H.L.-.D.T.-.S.T.D.V.D.-.R.A.M. .G.H.6.0.N.................>..Gd-.;.A..MQ..L.0.M.B.0.K.5.5.8.0.2. .1. . . . . . . . ........BO
Boot0008* Hard Drive 	BBS(HD,,0x0)..GO..NOy.......O.S.T.3.5.0.0.4.1.8.A.S.................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .2.W.0.A.A.7.2.M........BO..NO........O.H.G.S.T. .H.D.N.7.2.4.0.3.0.A.L.E.6.4.0.................>..Gd-.;.A..MQ..L. . . . . . .K.P.2.2.4.3.9.P.9.H.E.A.Y.A........BO..NO........O.S.T.3.0.0.0.D.M.0.0.1.-.1.E.R.1.6.6.................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .5.Z.0.0.M.9.G.R........BO..NO........O.H.G.S.T. .H.D.N.7.2.4.0.3.0.A.L.E.6.4.0.................>..Gd-.;.A..MQ..L. . . . . . .K.P.2.2.4.3.9.P.9.H.9.B.Y.4........BO..NO........Q.A.D.A.T.A. .U.S.B. .F.l.a.s.h. .D.r.i.v.e.................@..Gd-.;.A..MQ..L.A.D.A.T.A. .U.S.B. .F.l.a.s.h. .D.r.i.v.e........BO
Boot0009* UEFI: ADATA USB Flash Drive	PciRoot(0x0)/Pci(0x14,0x0)/USB(18,0)/USB(2,0)/HD(1,MBR,0x4294967264,0x800,0xeb7800)..BO
Boot000A* UEFI OS	HD(1,GPT,3cc50af7-2598-4854-95fe-9d8a4ffa87b6,0x800,0xaf000)/File(\EFI\BOOT\BOOTX64.EFI)

(chroot) livecd / # grub2-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/kernel-genkernel-x86_64-4.0.0-gentoo
Found initrd image: /boot/initramfs-genkernel-x86_64-4.0.0-gentoo
done

# proceed to unmount everything, exit chroot, and reboot
The disk:

Code: Select all

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 175C8317-EA91-47FF-99B7-5A2354F7622A
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          718847   350.0 MiB   EF00  EFI System
   2          718848         9107455   4.0 GiB     8200  Linux swap
   3         9107456       976773134   461.4 GiB   8300  Linux filesystem
As I only went through this once, so therefore no experimentation to discover what was not necessary.
For example, is the grub2-mkconfig necessary?
I thought that the UEFI boot process boots the code at this filepath: /boot/efi/boot/bootx64.efi
Also, I could not find 'cp' in my history to copy the kernel created by genkernel.
But clearly the file size is same as the kernel. It is the kernel. :)
I guess I ran that in another terminal session along with running genkernel (which I clearly recall. lol!).

HTH!
:D
Top
Post Reply

8 posts • Page 1 of 1

Return to “Installing Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic