public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] UEFI booting
@ 2015-08-17 12:59 Rod
  2015-08-17 13:26 ` Alec Ten Harmsel
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Rod @ 2015-08-17 12:59 UTC (permalink / raw
  To: gentoo-user

     Hi list,

     I'm trying to figure out how to make my boot partition to boot from 
UEFI, I have grub2 installed, but I keep getting a error when I ask it 
to install the boot information.

mount
/dev/sdc1                   201633        156     201478   1% /boot/efi

     I have the /boot/efi part mounted ok..

# efibootmgr
efibootmgr: EFI variables are not supported on this system.


# grub2-install --target=x86_64-efi /dev/sdc
Installing for x86_64-efi platform.
efibootmgr: EFI variables are not supported on this system.
efibootmgr: EFI variables are not supported on this system.
Installation finished. No error reported.

     I have this disk as my 1st boot drive in BIOS, the 2nd is the 
normal drive.

     Boot order is EFI then Legacy  (EFI only tells me "Insert boot disk 
and hit Enter)


     I'm assuming the "variables not supported" is blocking the install.


     BIOS reports the 1st disk to boot is

         EFI: ST2000DM001-1ER1


     Mobo is a Gigabyte Z68X-UD3H-B3  (with the latest UEFI firmware)

     How can I get this UEFI be become bootable without media to make it 
boot in to that mode to begin with ?

-- 
---

       Regards,
    
       Rod Smart
       0417 513 286



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] UEFI booting
  2015-08-17 12:59 [gentoo-user] UEFI booting Rod
@ 2015-08-17 13:26 ` Alec Ten Harmsel
  2015-08-17 13:37 ` Jeremi Piotrowski
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Alec Ten Harmsel @ 2015-08-17 13:26 UTC (permalink / raw
  To: gentoo-user

On Mon, Aug 17, 2015 at 10:59:30PM +1000, Rod wrote:
>      Hi list,
> 
> # efibootmgr
> efibootmgr: EFI variables are not supported on this system.
> 
> 
> # grub2-install --target=x86_64-efi /dev/sdc
> Installing for x86_64-efi platform.
> efibootmgr: EFI variables are not supported on this system.
> efibootmgr: EFI variables are not supported on this system.
> Installation finished. No error reported.
> 

I haven't done a UEFI install in a while, but the first thing that comes
to mind is that you haven't booted your install medium in UEFI mode.
What install media are you using and how did you boot it?

Alec


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] UEFI booting
  2015-08-17 12:59 [gentoo-user] UEFI booting Rod
  2015-08-17 13:26 ` Alec Ten Harmsel
@ 2015-08-17 13:37 ` Jeremi Piotrowski
  2015-08-19 13:28   ` [gentoo-user] UEFI booting [solved] Rod
  2015-08-17 20:05 ` [gentoo-user] Re: UEFI booting Nikos Chantziaras
  2015-08-19  5:20 ` [gentoo-user] " microcai
  3 siblings, 1 reply; 6+ messages in thread
From: Jeremi Piotrowski @ 2015-08-17 13:37 UTC (permalink / raw
  To: gentoo-user

On Mon, 17 Aug 2015, Rod wrote:
>     Hi list,

Hi

>     I'm trying to figure out how to make my boot partition to boot from UEFI,
> I have grub2 installed, but I keep getting a error when I ask it to install
> the boot information.

First things first, are you installing gentoo from an UEFI booted 
installation media? From what I know the gentoo minimal install cd does 
not allow for this, and I will assume you are using that.

If you're using some other installation method, check whether the 
directory /sys/firmware/efi/efivars has any content, try to mount efivarfs 
following the instructions in this link: 

https://wiki.gentoo.org/wiki/Efibootmgr#Configuration 

and then check again.

> # efibootmgr
> efibootmgr: EFI variables are not supported on this system.
> 
> 
> # grub2-install --target=x86_64-efi /dev/sdc
> Installing for x86_64-efi platform.
> efibootmgr: EFI variables are not supported on this system.
> efibootmgr: EFI variables are not supported on this system.
> Installation finished. No error reported.

In your case it seems that the system is not in an UEFI-booted state. But 
we can work around this by using a nice part of the UEFI specification, 
details below.

> mount
> /dev/sdc1                   201633        156     201478   1% /boot/efi
> 
>     I have the /boot/efi part mounted ok..

Before we go further make sure that the partition is a valid EFI boot
partition: code EF00 (gdisk), partition flags boot/esp (for parted).  

>     How can I get this UEFI be become bootable without media to make it boot
> in to that mode to begin with ?

It's actually much easier than it may seem, and it's outlined here: 

https://wiki.gentoo.org/wiki/GRUB2#Alternative:_using_the_default_UEFI_firmware_location

Basically, for all sorts of removable media there must be a way to tell
UEFI what to boot without having to hardcode the entries into NVRAM (like
efibootmgr does). Therefore UEFI firmware is supposed to check for the
first ESP partition on a drive and boot \EFI\boot\bootx64.efi from it.
This also works for harddrives, and since you can access a FAT partition
even when booted in bios mode you just put grub there.

Now this works perfectly well for a linux kernel with efi stub and cmdline
built-in, but grub may have trouble finding it's configuration files, I do
not know. So I suggest you try it. Find grubx64.efi in /boot/efi and copy
it to /boot/efi/EFI/BOOT/BOOTX64.EFI. Voila, should boot just fine. 

On my first UEFI install I did not know about this, efibootmgr did not 
work, but the handbook says to place the kernel at /EFI/boot/bootx64.efi 
and it just magically worked.

Generally you will find that provided the UEFI implementation of your
vendor is not complete shit (lots of them exist) UEFI makes it generally
easier to handle booting. One partition and the EFI variables and you can
boot anything, no more hidden sectors.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-user] Re: UEFI booting
  2015-08-17 12:59 [gentoo-user] UEFI booting Rod
  2015-08-17 13:26 ` Alec Ten Harmsel
  2015-08-17 13:37 ` Jeremi Piotrowski
@ 2015-08-17 20:05 ` Nikos Chantziaras
  2015-08-19  5:20 ` [gentoo-user] " microcai
  3 siblings, 0 replies; 6+ messages in thread
From: Nikos Chantziaras @ 2015-08-17 20:05 UTC (permalink / raw
  To: gentoo-user

On 17/08/2015 03:59 μμ, Rod wrote:
>      Hi list,
>
>      I'm trying to figure out how to make my boot partition to boot from
> UEFI, I have grub2 installed, but I keep getting a error when I ask it
> to install the boot information.
>
> mount
> /dev/sdc1                   201633        156     201478   1% /boot/efi
>
>      I have the /boot/efi part mounted ok..
>
> # efibootmgr
> efibootmgr: EFI variables are not supported on this system.

Boot in UEFI mode first. You can't access those "variables" if you boot 
in BIOS mode.

To do that, just boot from a SysRescueCD USB stick in UEFI mode and 
install the bootmanager from there.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] UEFI booting
  2015-08-17 12:59 [gentoo-user] UEFI booting Rod
                   ` (2 preceding siblings ...)
  2015-08-17 20:05 ` [gentoo-user] Re: UEFI booting Nikos Chantziaras
@ 2015-08-19  5:20 ` microcai
  3 siblings, 0 replies; 6+ messages in thread
From: microcai @ 2015-08-19  5:20 UTC (permalink / raw
  To: Gentoo User

2015-08-17 20:59 GMT+08:00 Rod <Rod@rods.id.au>:
>     Hi list,
>
>     I'm trying to figure out how to make my boot partition to boot from
> UEFI, I have grub2 installed, but I keep getting a error when I ask it to
> install the boot information.
>
> mount
> /dev/sdc1                   201633        156     201478   1% /boot/efi
>
>     I have the /boot/efi part mounted ok..
>
> # efibootmgr
> efibootmgr: EFI variables are not supported on this system.
>
>
> # grub2-install --target=x86_64-efi /dev/sdc
> Installing for x86_64-efi platform.
> efibootmgr: EFI variables are not supported on this system.
> efibootmgr: EFI variables are not supported on this system.
> Installation finished. No error reported.
>
>     I have this disk as my 1st boot drive in BIOS, the 2nd is the normal
> drive.
>
>     Boot order is EFI then Legacy  (EFI only tells me "Insert boot disk and
> hit Enter)
>

if you see "Insert boot disk and hit Enter" then you are not using EFI
mode. it is printed by MS DOS bootloader, aka , the MBR.

>
>     I'm assuming the "variables not supported" is blocking the install.
>
>
>     BIOS reports the 1st disk to boot is
>
>         EFI: ST2000DM001-1ER1
>
>
>     Mobo is a Gigabyte Z68X-UD3H-B3  (with the latest UEFI firmware)
>
>     How can I get this UEFI be become bootable without media to make it boot
> in to that mode to begin with ?
>
> --
> ---
>
>       Regards,
>          Rod Smart
>       0417 513 286
>
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] UEFI booting [solved]
  2015-08-17 13:37 ` Jeremi Piotrowski
@ 2015-08-19 13:28   ` Rod
  0 siblings, 0 replies; 6+ messages in thread
From: Rod @ 2015-08-19 13:28 UTC (permalink / raw
  To: gentoo-user


On 08/17/2015 11:37 PM, Jeremi Piotrowski wrote:
> On Mon, 17 Aug 2015, Rod wrote:
>>      Hi list,
> Hi
>
>>      I'm trying to figure out how to make my boot partition to boot from UEFI,
>> I have grub2 installed, but I keep getting a error when I ask it to install
>> the boot information.
> First things first, are you installing gentoo from an UEFI booted
> installation media? From what I know the gentoo minimal install cd does
> not allow for this, and I will assume you are using that.
>
> If you're using some other installation method, check whether the
> directory /sys/firmware/efi/efivars has any content, try to mount efivarfs
> following the instructions in this link:
>
> https://wiki.gentoo.org/wiki/Efibootmgr#Configuration
>
> and then check again.
>
>> # efibootmgr
>> efibootmgr: EFI variables are not supported on this system.
>>
>>
>> # grub2-install --target=x86_64-efi /dev/sdc
>> Installing for x86_64-efi platform.
>> efibootmgr: EFI variables are not supported on this system.
>> efibootmgr: EFI variables are not supported on this system.
>> Installation finished. No error reported.
> In your case it seems that the system is not in an UEFI-booted state. But
> we can work around this by using a nice part of the UEFI specification,
> details below.
>
>> mount
>> /dev/sdc1                   201633        156     201478   1% /boot/efi
>>
>>      I have the /boot/efi part mounted ok..
> Before we go further make sure that the partition is a valid EFI boot
> partition: code EF00 (gdisk), partition flags boot/esp (for parted).
>
>>      How can I get this UEFI be become bootable without media to make it boot
>> in to that mode to begin with ?
> It's actually much easier than it may seem, and it's outlined here:
>
> https://wiki.gentoo.org/wiki/GRUB2#Alternative:_using_the_default_UEFI_firmware_location
>
> Basically, for all sorts of removable media there must be a way to tell
> UEFI what to boot without having to hardcode the entries into NVRAM (like
> efibootmgr does). Therefore UEFI firmware is supposed to check for the
> first ESP partition on a drive and boot \EFI\boot\bootx64.efi from it.
> This also works for harddrives, and since you can access a FAT partition
> even when booted in bios mode you just put grub there.
>
> Now this works perfectly well for a linux kernel with efi stub and cmdline
> built-in, but grub may have trouble finding it's configuration files, I do
> not know. So I suggest you try it. Find grubx64.efi in /boot/efi and copy
> it to /boot/efi/EFI/BOOT/BOOTX64.EFI. Voila, should boot just fine.
>
> On my first UEFI install I did not know about this, efibootmgr did not
> work, but the handbook says to place the kernel at /EFI/boot/bootx64.efi
> and it just magically worked.
>
> Generally you will find that provided the UEFI implementation of your
> vendor is not complete shit (lots of them exist) UEFI makes it generally
> easier to handle booting. One partition and the EFI variables and you can
> boot anything, no more hidden sectors.

     Ok, thnks for your help, all was checked out as you said, the boot 
partition was correct, boot, esp which was a good thing.


     Just found a slight problem, my .efi program that the system was 
trying to boot was /boot/efi/EFI/gentoo/grubx64.efi

     copying the .efi to /boot/efi/EFI/BOOT changed nothing, I filed to 
notice that the name was incorrect, as installing the UEFI with the 
bootloader (without the efivar loaded) resulted in a file named 
"grubx86.efi" which doesn't work when copied in to the BOOT directory :(

     Renaming this file    ->  mv grubx86.efi bootx86.efi

     System now happily boots in UEFI mode, I guess I didn't read "Find 
grubx64.efi in /boot/efi and copy it to /boot/efi/EFI/BOOT/BOOTX64.EFI" 
correctly :P

     during this time, the original sda drive I was using failed (SMART 
was reporting that I should replace it soon) and I guess it was slightly 
too soon, but I did have the chance to rsync the filesystem across :P

     Thanks heaps for your help :)

-- 
---

       Regards,
    
       Rod Smart
       0417 513 286



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-08-19 13:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-17 12:59 [gentoo-user] UEFI booting Rod
2015-08-17 13:26 ` Alec Ten Harmsel
2015-08-17 13:37 ` Jeremi Piotrowski
2015-08-19 13:28   ` [gentoo-user] UEFI booting [solved] Rod
2015-08-17 20:05 ` [gentoo-user] Re: UEFI booting Nikos Chantziaras
2015-08-19  5:20 ` [gentoo-user] " microcai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox