Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Fresh install on i5 3450 ivy bridge. (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
Catanduva
n00b
n00b


Joined: 25 Dec 2008
Posts: 64

PostPosted: Fri Oct 12, 2012 12:10 am    Post subject: [Solved] Fresh install on i5 3450 ivy bridge. (UEFI) Reply with quote

My new hardware will arrive saturday, so i'm doing a fresh install.
I never had a problem with this. I changed from Athlon XP to AMD X2 and booted the new kernel in the first run.
The problem now is that i didn't knew about about that UEFI and GPT thing. So i started reading a lot.
So when i started reading about UEFI and the possibility of not using a bootloader, i was hooked.

But the documentation is sometimes daunting. I read some things on arch wiki, another things on gentoo wiki, other kinds of things on people personal experiences. I don't know really what to do so here's the questions.

When partitioning my disks i really have to make a little partition in the beginning of the hard disk for "Protective MBR" that gdisk does automatically? And why is this, what does it do and what do i put on it?

So if i need that little partition, my table should look like:

/dev/sda1 protective mbr
/dev/sda2 /boot/efi 200mb fat32
/dev/sda3 /boot 80mb ext2
/dev/sda4 swap 512mb swap
/dev/sda5 / 20gb ext4
/dev/sda6 /home total ext4

This is correct?
I don't need extended partitions anymore with GPT, right?

Another thing. When i compile the kernel with all the EFI stuff. I just copy the bzimage to the /boot/efi/gentoo/EFI directory with the name bzimage.efi and the UEFI system of my new hardware will find it?

Thanks in advance. I'm a little lost here.


In case you need my specs:
i5 3450 ivy bridge
Asus P8B75-M
4 gb ram
HD 500 gb


Last edited by Catanduva on Tue Oct 16, 2012 10:44 am; edited 1 time in total
Back to top
View user's profile Send private message
srs5694
Guru
Guru


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

PostPosted: Fri Oct 12, 2012 2:34 am    Post subject: Re: Fresh install on i5 3450 ivy bridge. Questions about UEF Reply with quote

Catanduva wrote:
When partitioning my disks i really have to make a little partition in the beginning of the hard disk for "Protective MBR" that gdisk does automatically? And why is this, what does it do and what do i put on it?


You don't explicitly create the protective MBR; that's just a part of the GPT data structures that is created automatically by gdisk, GParted, or whatever other tool you use to create your partitions. Its purpose is to tell GPT-unaware utilities and OSes that the disk is in use, so that they won't mess with it. The protective MBR is not a separate partition within the GPT scheme, and if Linux recognizes the disk as using GPT, Linux doesn't assign it a partition number.

Quote:
So if i need that little partition, my table should look like:

/dev/sda1 protective mbr
/dev/sda2 /boot/efi 200mb fat32
/dev/sda3 /boot 80mb ext2
/dev/sda4 swap 512mb swap
/dev/sda5 / 20gb ext4
/dev/sda6 /home total ext4

This is correct?


There is no "protective mbr" partition. Other than that, your partitions seem OK, although there are other ways to do it. Personally, I'd either make a bigger (~500 MiB) EFI System Partition (ESP; your /dev/sda2, although it's usually /dev/sda1) and mount it at /boot rather than at /boot/efi or make /boot a bit bigger (at least 200 MiB), given the way kernels and initrd files are growing in size. (Fedora's much worse at this than Gentoo, though.) By mounting the ESP at /boot, your kernel will be copied to the ESP and become readable by the EFI automatically, given normal kernel installation practices. If you use a separate ext2fs /boot partition, you can use a boot loader that has an ext2fs driver, add an EFI driver for ext2fs, or copy your kernels to /boot/efi instead of or in addition to /boot.

Quote:
I don't need extended partitions anymore with GPT, right?


Correct.

Quote:
Another thing. When i compile the kernel with all the EFI stuff. I just copy the bzimage to the /boot/efi/gentoo/EFI directory with the name bzimage.efi and the UEFI system of my new hardware will find it?


Not automatically. You'll need to add it to your EFI's built-in boot manager with its own user interface (which is often so lacking as to be useless) or with a tool like Linux's efibootmgr (which works only if you boot Linux in EFI mode). You'll also need to see to it that it's given appropriate boot-time options, and if you use an initial RAM disk, you'll need to copy it to your ESP, too. Alternatively, you can install a separate boot manager like rEFInd or gummiboot and configure it to find or use your kernel. You may want to check my Web page on EFI boot loaders for more information. Check the section on installation in particular.
Back to top
View user's profile Send private message
Catanduva
n00b
n00b


Joined: 25 Dec 2008
Posts: 64

PostPosted: Fri Oct 12, 2012 9:14 am    Post subject: Reply with quote

Thanks for the huge help, friend.

I don't use initrd and my actual /boot partition have 90mb and using only 5mb. But just to be safe i'll follow your advice, i don't know how big the kernel for the new system will be.

(1) So, just to be sure, you're saying that if i create the EFI boot partition as /boot (and fat32) and i'm going to use the kernel bootloader, the kernel will automatically know this is an ESP partition and will make all the process of copying and become readable (it automatically creates an /efi subdirectory)?

I'm reading your website right now, it's really useful.
I already knew about rEFInd and another bootloaders, but first i want to try to use the built-in.

(2) So for every kernel i compile i'll have to add it to the EFI boot manager of my main board, like any other bootloader, right?
I'll be booting the new machine in UEFI mode with the systemrescuecd to install my gentoo.

(3) The boot time options you say is the root=/dev/sda* only, right? Because if i'm using KMS, i don't need to pass the vga=0x365 for example. It's the only additional option i use right now on the boot process.

(4) Another about KMS: If my monitor maximum resolution is 1440x900 but the integranted intel hd2500 supports more than that, it'll automatically set the maximum for the monitor or the maximum for the graphics processor?
Back to top
View user's profile Send private message
srs5694
Guru
Guru


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

PostPosted: Fri Oct 12, 2012 5:15 pm    Post subject: Reply with quote

Catanduva wrote:
I don't use initrd and my actual /boot partition have 90mb and using only 5mb. But just to be safe i'll follow your advice, i don't know how big the kernel for the new system will be.

(1) So, just to be sure, you're saying that if i create the EFI boot partition as /boot (and fat32) and i'm going to use the kernel bootloader, the kernel will automatically know this is an ESP partition and will make all the process of copying and become readable (it automatically creates an /efi subdirectory)?


If you mount the ESP at /boot, it'll be treated just like any FAT32 filesystem mounted there. Linux won't automatically create an EFI (/boot/EFI) subdirectory or automatically copy files there. Most people who mount the ESP at /boot deviate from the EFI spec in that their Linux kernels get stored in the root of the ESP. I haven't yet heard of this causing any problems, but I can't rule out the possibility that some EFI implementation or utility will object and flake out in one way or another. Alternatively, you can store your kernels in what Linux considers a non-standard location, like /boot/EFI/gentoo (if the ESP is mounted at /boot) or /boot/efi/EFI/gentoo (if the ESP is mounted at /boot/efi). It's also possible to use an EFI driver for ext2fs/ext3fs or ReiserFS (rEFInd ships with these drivers) and create a separate Linux /boot partition that uses one of these filesystems to hold your kernels. The choice is yours.

Quote:
(2) So for every kernel i compile i'll have to add it to the EFI boot manager of my main board, like any other bootloader, right?


Correct. This is a minor nuisance, especially if you recompile your kernel frequently. One of the advantages of rEFInd is that, once it's set up, it can detect your kernels automatically, since rEFInd scans the hard disk for EFI boot files in certain locations. If you're happy with your EFI's boot manager, though, removing rEFInd from the picture does simplify the boot path a bit.

Quote:
(3) The boot time options you say is the root=/dev/sda* only, right? Because if i'm using KMS, i don't need to pass the vga=0x365 for example. It's the only additional option i use right now on the boot process.


The boot options depend on your system, of course. As a general rule, the "vga=0x365" or similar options don't work on EFI systems, since those options set a BIOS-specific video mode. Sometimes other hardware-specific kernel options are helpful, but you'll need to experiment or investigate what's appropriate for your specific hardware.

Quote:
(4) Another about KMS: If my monitor maximum resolution is 1440x900 but the integranted intel hd2500 supports more than that, it'll automatically set the maximum for the monitor or the maximum for the graphics processor?


I don't know. Personally, I'm using VGA output through a KVM switch, which seems to interfere with auto-detection of the resolution. It might work better on laptops or desktops with HDMI or DVI connectors.
Back to top
View user's profile Send private message
Catanduva
n00b
n00b


Joined: 25 Dec 2008
Posts: 64

PostPosted: Fri Oct 12, 2012 6:37 pm    Post subject: Reply with quote

Thanks for the patience. Let's see how this unfolds tomorrow.
Back to top
View user's profile Send private message
Catanduva
n00b
n00b


Joined: 25 Dec 2008
Posts: 64

PostPosted: Tue Oct 16, 2012 10:20 am    Post subject: Reply with quote

Everything went as expected. I was shocked that it was so easy.

The only issue is that efitbootmgr didn't write anything in the UEFI. So i had to install and configure grub. Once the grub did his thing the efibootmgr worked, don't know why (i didn't even boot via grub, just installed and let it configure the UEFI). I uninstalled grub and erased all the files and everything is working now.
I can manage my boot process via efibootmgr with no problems. Now my linux is booting without grub/elilo/refind/anything, kernel only.
Today i'll figure out if i can put some boot menu so i can but older kernels in case a new one goes berserk.

My partition scheme in gpt:

/boot fat32 400mb
/ ext4 20gb
/home ext4 remaining space

Just enabled everything for EFI on the kernel (and efivars as module), and in the built-in kernel command line i did root=/dev/sda2 .

Didn't make swap because i have 4gb (1gb for the video).
Back to top
View user's profile Send private message
srs5694
Guru
Guru


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

PostPosted: Tue Oct 16, 2012 4:16 pm    Post subject: Reply with quote

Catanduva wrote:
The only issue is that efitbootmgr didn't write anything in the UEFI. So i had to install and configure grub. Once the grub did his thing the efibootmgr worked, don't know why (i didn't even boot via grub, just installed and let it configure the UEFI).


Did you get any error messages when you ran efibootmgr the first time? It requires an EFI-mode boot, so it might not have worked if you booted in BIOS mode for the installation. A subsequent boot in EFI mode (via GRUB installed as EFI/boot/bootx64.efi, for instance) would then enable efibootmgr to run. If this was what happened, then efibootmgr would have complained about an inability to access certain files, and would have suggested inserting a kernel module. (I don't recall the exact error message, though.) Inserting the kernel module from a BIOS-mode boot wouldn't have any effect, though.

Quote:
Today i'll figure out if i can put some boot menu so i can but older kernels in case a new one goes berserk.


Some EFI implementations provide a usable but fairly basic boot-options menu. On my ASUS P8H77-I, for instance, hitting F8 at boot time brings up a simple text-mode menu. Others are less usable. I've got a Gigabyte board with its wretched "Hybrid EFI" that provides only BIOS-style boot-device options. On such boards, a separate boot manager like rEFIt, rEFInd, or gummiboot is a practical necessity.
Back to top
View user's profile Send private message
Catanduva
n00b
n00b


Joined: 25 Dec 2008
Posts: 64

PostPosted: Tue Oct 16, 2012 4:44 pm    Post subject: Reply with quote

srs5694 wrote:
Did you get any error messages when you ran efibootmgr the first time? It requires an EFI-mode boot, so it might not have worked if you booted in BIOS mode for the installation. A subsequent boot in EFI mode (via GRUB installed as EFI/boot/bootx64.efi, for instance) would then enable efibootmgr to run. If this was what happened, then efibootmgr would have complained about an inability to access certain files, and would have suggested inserting a kernel module. (I don't recall the exact error message, though.) Inserting the kernel module from a BIOS-mode boot wouldn't have any effect, though.

I booted from systemrescuecd usb live in UEFI mode, i installed gentoo entirely in UEFI mode.
I even disabled legacy entirely in the board just to be sure to boot in UEFI in the installation. And i double checked the sys/firmware/ folder with efivars module loaded. I was in a UEFI environment.
Efibootmgr didn't return any error, just showed my boot order like when you type efibootmgr only. And i just installed and configured grub2, didn't even reboot the system. Maybe i was passing wrong arguments within efibootmgr before i installed grub2, who knows. It's ok now.

srs5694 wrote:
Some EFI implementations provide a usable but fairly basic boot-options menu. On my ASUS P8H77-I, for instance, hitting F8 at boot time brings up a simple text-mode menu. Others are less usable. I've got a Gigabyte board with its wretched "Hybrid EFI" that provides only BIOS-style boot-device options. On such boards, a separate boot manager like rEFIt, rEFInd, or gummiboot is a practical necessity.

When i get home i'll check, but i think i saw a boot menu too yesterday when i pressed some button. I was sleepy, so who knows.
Back to top
View user's profile Send private message
srs5694
Guru
Guru


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

PostPosted: Tue Oct 16, 2012 8:31 pm    Post subject: Reply with quote

Catanduva wrote:
srs5694 wrote:
Did you get any error messages when you ran efibootmgr the first time?

I booted from systemrescuecd usb live in UEFI mode,
...
Efibootmgr didn't return any error, just showed my boot order like when you type efibootmgr only. And i just installed and configured grub2, didn't even reboot the system. Maybe i was passing wrong arguments within efibootmgr before i installed grub2, who knows. It's ok now.


A completely wrong option (like "-z") produces a help message, so that's unlikely; but it's conceivable you mistyped one correct option as another one. That could end up doing something unexpected, like displaying old data rather than change the boot order. I guess in your specific case it'll be one of life's little mysteries....

Quote:
When i get home i'll check, but i think i saw a boot menu too yesterday when i pressed some button. I was sleepy, so who knows.


Whatever you find, you'll have 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