Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
uefi boot install problem
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
alienfetuseater
n00b
n00b


Joined: 26 Feb 2018
Posts: 34

PostPosted: Tue Mar 06, 2018 11:10 pm    Post subject: uefi boot install problem Reply with quote

so this is a noob install of gentoo, installing on a blank hard drive. this is the second hard drive in the machine (asus), with uefi boot.

ive attempted the install several times from scratch now, so im sure the preceding portions of the install are correct. but when i get to
Code:

grub-install --target=x86_64-efi --efi-directory=/boot


i get
Quote:

efi variables are not supported on this system
efi variables are not supported on this system
installation finished. no error reported.


-the live environment i booted into is the complete live cd, not the minimal

fstab

Code:
 
# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>

/dev/sda2       /boot           vfat    defaults,noatime        0 2
/dev/sda3       none            swap    sw                      0 0
/dev/sda4       /               ext4    noatime                 0 1


-i initially had /dev/sda2 set as /boot/efi, but when i did
Code:
 mount /boot
it said it
Quote:
could find /boot in fstab
so i changed it back

partitions

Code:
Device       Start       End   Sectors   Size Type
/dev/sda1     2048      6143      4096     2M BIOS boot
/dev/sda2     6144    268287    262144   128M EFI System
/dev/sda3   268288   1316863   1048576   512M Linux filesystem
/dev/sda4  1316864 976771119 975454256 465.1G Linux filesystem


make.conf

Code:
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-march=corei7 -O2 -pipe"
CXXFLAGS="${CFLAGS}"

CHOST="x86_64-pc-linux-gnu"

# NOTE: This stage was built with the bindist Use flag enabled
PORTDIR="/usr/portage"
DISTDIR="/usr/portage/distfiles"
PKGDIR="/usr/portage/packages"

# This sets the language of build output to English.
# Please keep this setting intact when reporting bugs.
LC_MESSAGES=C
MAKEOPTS="-j5"

GENTOO_MIRRORS="rsync://rsync.gtlib.gatech.edu/gentoo http://www.gtlib.gatech.edu/pub/gentoo ftp://ftp.gtlib.gatech.edu/pub/gentoo"

USE="-gnome -kde"

GRUB_PLATFORMS="efi-64"


anyone provide some direction how to trouble shoot this?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7321
Location: Saint Amant, Acadiana

PostPosted: Tue Mar 06, 2018 11:17 pm    Post subject: Reply with quote

Code:
efi variables are not supported on this system

You need to boot in EFI mode to access efivars.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
alienfetuseater
n00b
n00b


Joined: 26 Feb 2018
Posts: 34

PostPosted: Tue Mar 06, 2018 11:42 pm    Post subject: Reply with quote

so 'boot in uefi mode', and then chroot back into the new install and re-install grub just like i did before? it wont result in two copies?
and is efi mode a choose for the live usb?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7321
Location: Saint Amant, Acadiana

PostPosted: Wed Mar 07, 2018 1:03 am    Post subject: Reply with quote

You can have a Gentoo install capable of both, legacy boot and UEFI boot. When properly installed your Grub should be visible to UEFI firmware already.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
alienfetuseater
n00b
n00b


Joined: 26 Feb 2018
Posts: 34

PostPosted: Wed Mar 07, 2018 1:38 am    Post subject: Reply with quote

right, so i havent finished the install, i havent moved forward from where i described.

should i attempt to boot into my new system?
or do i need to boot into efi mode on the the live usb?
or do i continue on and finish the install?

im not really sure what your trying to recommend i do here
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7321
Location: Saint Amant, Acadiana

PostPosted: Wed Mar 07, 2018 1:51 am    Post subject: Reply with quote

If you have the base system and kernel in place then I'd say boot into your system and then start installing software.
You have two options.
If you installed Grub for EFI mode then you should be able to select it hitting your boot choice key, F11 or whatever it is for your motherboard.
If Grub wasn't installed properly for EFI then yes, you need to boot from some EFI capable media in EFI mode and reinstall Grub.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
alienfetuseater
n00b
n00b


Joined: 26 Feb 2018
Posts: 34

PostPosted: Wed Mar 07, 2018 3:59 am    Post subject: Reply with quote

i finished the install, rebooted, and all i get is the uefi bios utility.

could this be an issue with the uefi bios? ive gone in and deleted the PK key, after first saving it to a usb, done what i thought disabled secure boot, but still everytime i boot it just goes directly to uefi bios.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2717

PostPosted: Wed Mar 07, 2018 5:27 am    Post subject: Reply with quote

alienfetuseater wrote:
... everytime i boot it just goes directly to uefi bios.

Does it offer creation of a boot item (Add Boot Option)?
Why at all do you think you need grub instead of using https://wiki.gentoo.org/wiki/EFI_stub_kernel?
Back to top
View user's profile Send private message
alienfetuseater
n00b
n00b


Joined: 26 Feb 2018
Posts: 34

PostPosted: Wed Mar 07, 2018 1:28 pm    Post subject: Reply with quote

i do not see anywhere in the eufi bios utility to add a boot item, and no grub menu comes up at all

i assumed grub was the way to go only because the handbook says its the default. should the EFI_stub_kernel be the route i choose instead?
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3250
Location: Illinois, USA

PostPosted: Wed Mar 07, 2018 2:09 pm    Post subject: Reply with quote

alienfetuseater wrote:
i assumed grub was the way to go only because the handbook says its the default. should the EFI_stub_kernel be the route i choose instead?


The EFI stub kernel is the easiest and will get you booting into EFI mode, but it offers only one choice of kernel, i.e. no choice at all. I prefer refind which was designed from the ground up for EFI, not added in like grub2. If you build a new kernel and it doesn't work, you can still boot the old kernel with refind. If your EFI stub kernel is bad, it's back to sysrecuecd and fixing your boot.

https://packages.gentoo.org/packages/sys-boot/refind


Last edited by Tony0945 on Wed Mar 07, 2018 2:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7321
Location: Saint Amant, Acadiana

PostPosted: Wed Mar 07, 2018 2:16 pm    Post subject: Reply with quote

alienfetuseater wrote:
i do not see anywhere in the eufi bios utility to add a boot item, and no grub menu comes up at all

This is because your EFI firmware does not find any compatible binaries to boot. Means your Grub was not installed correctly. Booting UEFI is not Gentoo specific in any way, you can read up on UEFI and its quirks on http://www.rodsbooks.com/linux-uefi/
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
alienfetuseater
n00b
n00b


Joined: 26 Feb 2018
Posts: 34

PostPosted: Wed Mar 07, 2018 6:14 pm    Post subject: Reply with quote

ok, so looking at what i included when i started this thread, where does it seem i went wrong with installing my boot loader? is the problem with my fstab listing for /sda2? did i not install grub to the right directory?

i did
Code:
 echo 'GRUB_PLATFORMS="efi-64"' >> /etc/portage/make.conf


Code:
emerge --ask sys-boot/grub:2


Code:
grub-install --target=x86_64-efi --efi-directory=/boot


Code:
grub-mkconfig -o /boot/grub/grub.cfg


and i made sure when i configured the kernel to check everything it said to regarding uefi,


Last edited by alienfetuseater on Thu Mar 08, 2018 4:09 am; edited 1 time in total
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7321
Location: Saint Amant, Acadiana

PostPosted: Wed Mar 07, 2018 6:50 pm    Post subject: Reply with quote

I do not like Grub2 and I do not use it. Maybe its install script is smart enough to mount EFI partition before installing, maybe it is not. You may want to check if everything went into right place, including the kernel.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
skellr
l33t
l33t


Joined: 18 Jun 2005
Posts: 901
Location: The Village, Portmeirion

PostPosted: Wed Mar 07, 2018 9:53 pm    Post subject: Re: uefi boot install problem Reply with quote

alienfetuseater wrote:
-i initially had /dev/sda2 set as /boot/efi, but when i did
Code:
 mount /boot
it said it
Quote:
could find /boot in fstab
so i changed it back.

This could be a red flag. Maybe you tried to mount /boot before you did the chroot into the new install? seems like it wasn't reading the fstab you were wanting, maybe the fstab from the livecd?

I would mount your EFI partion somewhere and look to see if grub managed to install something there. Then use efibootmgr to and an entry pointing to the grub*.efi file, wherever it may be.
Back to top
View user's profile Send private message
alienfetuseater
n00b
n00b


Joined: 26 Feb 2018
Posts: 34

PostPosted: Thu Mar 08, 2018 12:07 am    Post subject: Reply with quote

sorry, im at work, hampers my ability to reply timely.

i'll check what got installed in which directories when i get home, /boot/efi, and /sys/src/linux are the appropriate directories for the boot loader and kernel, respectively?

i chrooted into the new system long before attempting to get the bootloader installed. i only did mount /boot because just before grub install the handbook said to make sure /boot was mounted to ensure that the bootloader doesnt mistakenly get installed in a wrong directory.
the fstab file is the one on the machine im doing the install on, not the fstab file of the usb, i made sure of that.

since several people have mentioned they dont like grub2, what is the better alternative?
Back to top
View user's profile Send private message
alienfetuseater
n00b
n00b


Joined: 26 Feb 2018
Posts: 34

PostPosted: Thu Mar 08, 2018 4:08 am    Post subject: Reply with quote

i found this in the quick check list and think this may be the cause of my problems, the quick checklist for uefi and gpt says this should have been done;

Code:

root #mkdir -p /mnt/gentoo
root #mount /dev/sda4 /mnt/gentoo
root #mkdir /mnt/gentoo/boot
root #mount /dev/sda1 /mnt/gentoo/boot
root #mkdir /mnt/gentoo/boot/efi
root #mount /dev/sda2 /mnt/gentoo/boot/efi


but in the handbook, in the preparing the disks section, it only mentioned

Code:

root # mount /dev/sda4 /mnt/gentoo


i assume this is the error in my install, do you think so? and if it is, should i start over from the begining?
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2717

PostPosted: Thu Mar 08, 2018 5:06 am    Post subject: Reply with quote

Tony0945 wrote:
The EFI stub kernel is the easiest and will get you booting into EFI mode, but it offers only one choice of kernel, i.e. no choice at all.

What is your problem here?
You can have several boot items, each with a different kernel. And can always keep the older kernel's boot item(s) until you are sure the new one works.
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2552
Location: Near Toronto

PostPosted: Thu Mar 08, 2018 1:43 pm    Post subject: Reply with quote

I failed at this too; refind worked on one computer but not my
other laptop for some reason

in the end I cheaped out and installed ubuntu which does everything
automagically. Then I just adjust ubuntu's grub.cfg file to have
gentoo the default option alongside windows (and, of course,
ubuntu).

I know I am weak :lol:
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3250
Location: Illinois, USA

PostPosted: Thu Mar 08, 2018 2:02 pm    Post subject: Reply with quote

charles17 wrote:
Tony0945 wrote:
The EFI stub kernel is the easiest and will get you booting into EFI mode, but it offers only one choice of kernel, i.e. no choice at all.

What is your problem here?
You can have several boot items, each with a different kernel. And can always keep the older kernel's boot item(s) until you are sure the new one works.
Perhaps I have misinterpreted the wiki. What you say is true of grub and refind and syslinux for that matter, but the wiki reads to me that THE kernel is is the efi stub and boots automatically with no menu and that to boot a different kernel you have to copy or rename the new kernel. i.e. there is no boot time choice, it is a build time choice. Yes, if the kernel fails to boot I can insert a usb, boot sysrescuecd, change the stub kernel and reboot. but with either grub or refind, if the default kernel fails, I have only to reboot and select a an alternate menu choice. No messing with F12 to select altenate boot media or searching for boot media to insert. just CTRl_ALT_DEL or at worst the power button.
Back to top
View user's profile Send private message
skellr
l33t
l33t


Joined: 18 Jun 2005
Posts: 901
Location: The Village, Portmeirion

PostPosted: Thu Mar 08, 2018 2:10 pm    Post subject: Reply with quote

alienfetuseater wrote:
i found this in the quick check list and think this may be the cause of my problems, the quick checklist for uefi and gpt says this should have been done;

Code:

root #mkdir -p /mnt/gentoo
root #mount /dev/sda4 /mnt/gentoo
root #mkdir /mnt/gentoo/boot
root #mount /dev/sda1 /mnt/gentoo/boot
root #mkdir /mnt/gentoo/boot/efi
root #mount /dev/sda2 /mnt/gentoo/boot/efi


but in the handbook, in the preparing the disks section, it only mentioned

Code:

root # mount /dev/sda4 /mnt/gentoo


i assume this is the error in my install, do you think so? and if it is, should i start over from the begining?

Sounds like that was it.

You can chroot back into the new install and skip to the part about installing Grub.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7558
Location: Goose Creek SC

PostPosted: Thu Mar 08, 2018 11:52 pm    Post subject: Reply with quote

Recommend not starting over from the beginning.
For best results: The drive containing the EFI Systems Partition (ESP) should have a GPT disk label not an MSDOS disk label.
The ESP file system should be FAT32. The ESP can be any partition on any mass storage device; the UEFI should find it. The ESP only needs to be mounted when the user needs to read from or write to it. The ESP can be mounted anywhere in the operational file system (/boot/efi is someone's preference not a requirement); the user (and grub-install) need to know where the ESP is mounted.
In UEFI installations, the handbook's recommended 2MB grub/boot partition at sda1 is extraneous because Grub2 will install on the EFI Systems Partition.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
alienfetuseater
n00b
n00b


Joined: 26 Feb 2018
Posts: 34

PostPosted: Fri Mar 09, 2018 1:38 am    Post subject: Reply with quote

ok, so i can just delete what i have for
Code:
/dev/sda1
and just have (what is now);
Code:

/dev/sda2  /boot/efi
/dev/sda3  swap
/dev/sda4  /

and then mount each of those partitions at the respective directories,
so
Code:

mount /dev/sda2  /mnt/gentoo/boot/efi
mount /dev/sda4 /mnt/gentoo

and then when i install the bootloader, grub2 or whichever, after emerging,
Code:

grub-install --target=x86_64-efi --efi-directory=/boot

this will automatically know to install bootloader to
Code:
/mnt/gentoo/boot/efi
? how does that part work? sounds kind of magical
Back to top
View user's profile Send private message
alienfetuseater
n00b
n00b


Joined: 26 Feb 2018
Posts: 34

PostPosted: Fri Mar 09, 2018 1:47 am    Post subject: Reply with quote

so maybe this is the part that seems a little magical,

im supposed have mounted
Code:
/dev/sda2
at
Code:
/mnt/gentoo/boot/efi

but then i read that

Quote:
Supposing the system has UEFI firmware and the EFI partition is mounted in the /boot directory:
Code:
root #grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --boot-directory=/boot /dev/sda



so do i need to update my install command to reflect that the partitions werent mounted at
Code:
 /boot
but rather mounted at
Code:
 /mnt/gentoo/boot/efi
?

and now that i think about it, why is the root directory
Code:
 /
when it is actually
Code:
 /mnt/gentoo
?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14276

PostPosted: Fri Mar 09, 2018 2:35 am    Post subject: Reply with quote

Tony0945 wrote:
charles17 wrote:
Tony0945 wrote:
The EFI stub kernel is the easiest and will get you booting into EFI mode, but it offers only one choice of kernel, i.e. no choice at all.

What is your problem here?
You can have several boot items, each with a different kernel. And can always keep the older kernel's boot item(s) until you are sure the new one works.
Perhaps I have misinterpreted the wiki. What you say is true of grub and refind and syslinux for that matter, but the wiki reads to me that THE kernel is is the efi stub and boots automatically with no menu and that to boot a different kernel you have to copy or rename the new kernel. i.e. there is no boot time choice, it is a build time choice. Yes, if the kernel fails to boot I can insert a usb, boot sysrescuecd, change the stub kernel and reboot. but with either grub or refind, if the default kernel fails, I have only to reboot and select a an alternate menu choice. No messing with F12 to select altenate boot media or searching for boot media to insert. just CTRl_ALT_DEL or at worst the power button.
On classic BIOS systems, the boot order was: BIOS -> boot loader -> OS. Some boot loaders (mostly Linux-oriented ones) could pick one of several OS choices based on user input and a configuration file. Once the OS was picked, it was not expected to offer another round of choice. Basic UEFI follows the same process: UEFI -> EFI loader -> OS. Some EFI loaders, such as grub2, again offer the ability to pick an OS. However, unlike classic BIOS where it was relatively rare for the BIOS to have any interactive component, it is somewhat common for UEFI to offer an easy way to pick an alternate EFI loader. When using EFI stub kernel, the path is shortened to UEFI -> EFI stub kernel, with no separate EFI loader. If your UEFI is cannot easily pick an alternate EFI application to run, then yes, a bad kernel can be very difficult to recover from. Every UEFI that I have used and can remember has offered an early boot key that drops me into UEFI shell. Some also offered a key that lets me pick any recognized EFI application, rather than running the default application (which would be the EFI stub kernel). Either of these approaches could be used to boot an alternate (known-good) Linux kernel without use of external media.
Back to top
View user's profile Send private message
skellr
l33t
l33t


Joined: 18 Jun 2005
Posts: 901
Location: The Village, Portmeirion

PostPosted: Fri Mar 09, 2018 2:59 am    Post subject: Reply with quote

alienfetuseater wrote:
so maybe this is the part that seems a little magical,

im supposed have mounted
Code:
/dev/sda2
at
Code:
/mnt/gentoo/boot/efi

but then i read that

Quote:
Supposing the system has UEFI firmware and the EFI partition is mounted in the /boot directory:
Code:
root #grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub --boot-directory=/boot /dev/sda



so do i need to update my install command to reflect that the partitions werent mounted at
Code:
 /boot
but rather mounted at
Code:
 /mnt/gentoo/boot/efi
?

and now that i think about it, why is the root directory
Code:
 /
when it is actually
Code:
 /mnt/gentoo
?

The Grub manual says it's supposed to be easy to use. I would try it the easy way.
Code:
On EFI systems for fixed disk install you have to mount EFI System Partition. If you mount it at /boot/efi then you don’t need any special arguments:

# grub-install

Otherwise you need to specify where your EFI System partition is mounted:

# grub-install --efi-directory=/mnt/efi
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
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
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