Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Grub2 installation error
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
xtx
Tux's lil' helper
Tux's lil' helper


Joined: 27 Dec 2011
Posts: 129

PostPosted: Fri Oct 17, 2014 4:33 pm    Post subject: [SOLVED] Grub2 installation error Reply with quote

Not sure why I'm having issues, I just installed grub like two months ago without issue.
My motherboard is a z68-ud3h-b3 mobo with an i7 2600k processor if it matters

Partitions:
Code:
/dev/sdb1          2048    6143        2048         ef     EFI (FAT-12/16/32)
/dev/sdb2     *     6144    268287     131072       83     Linux
/dev/sdb3          268288   234441647  117086680    83     Linux


Formatted /dev/sdb2 as ext2 and /dev/sdb3 as btrfs

Installed the package grub without issue. The gentoo install guide says to then run
Code:
grub2-install /dev/sda
which I changed to
Code:
grub2-install /dev/sdb
because that is the drive the boot partition is located on. I received the error
Code:
grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory

I then placed
Code:
GRUB_PLATFORMS="efi-64"
in make.conf and reinstalled grub. Now when I try to install grub I get the error message
Code:
grub2-install: error: cannot find EFI directory.


What's going on? I have installed grub with gentoo well over thirty times and never had an issue installing grub before today.


Last edited by xtx on Sun Oct 19, 2014 4:55 pm; edited 1 time in total
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Fri Oct 17, 2014 7:06 pm    Post subject: Reply with quote

http://wiki.gentoo.org/wiki/GRUB2
http://en.wikipedia.org/wiki/EFI_System_partition

Quote:
UEFI/GPT
EFI system partition

For UEFI boot, your disk must have a dedicated "EFI system partition" containing a FAT filesystem. 200 MB should be large enough.

If you need to create an EFI system partition, first create it in gdisk or parted with the proper type. In gdisk, this is type ef00.

Create a FAT filesystem using mkdosfs and add it to fstab.
root # mkdosfs -F 32 -n efi-boot /dev/sda1
root # mkdir /boot/efi
root # echo 'LABEL=efi-boot /boot/efi vfat defaults 0 2' >> /etc/fstab
root # mount /boot/efi


Quote:
Install GRUB
root # grub2-install --target=x86_64-efi

This will install grub in /boot/grub, copy the core image to /boot/efi/EFI/gentoo/grubx64.efi, and call efibootmgr to add a boot entry.
Alternative: Using the default location

If the system fails to find your bootloader, you can alternatively use the default location. This circumvents the boot menu managed by efibootmgr and thus offers reduced functionality (but is less error-prone). For this copy the file grubx64.efi to EFI/BOOT/BOOTX64.EFI on your EFI system partition (assuming you have an amd64 system, if not the file name has to be adjusted).


and there is the difference

Code:
root # grub2-install --target=x86_64-efi
Back to top
View user's profile Send private message
xtx
Tux's lil' helper
Tux's lil' helper


Joined: 27 Dec 2011
Posts: 129

PostPosted: Sat Oct 18, 2014 5:47 am    Post subject: Reply with quote

Thank you for the response. I followed those steps and grub claimed to have installed successfully, but now when I restart the computer I get:
Code:
error: file '/grub/i386-pc/normal.mod' not found. Entering rescue mode...


I will research this error but if anybody has advice please let me know.

Also, is it just me, or is this entire process different? I never had to do the steps you mentioned above before, and as I've said, I've installed gentoo dozens of times. I'm just confused as to why grub seems so much more complicated now
Back to top
View user's profile Send private message
Tefrem34
Apprentice
Apprentice


Joined: 14 Sep 2014
Posts: 268
Location: USA, California

PostPosted: Sat Oct 18, 2014 7:47 am    Post subject: Reply with quote

Hiya xtx

Did you update your grub after you did the install? I was having, I think, a similar issue.
Code:
grub2-mkconfig -o /boot/grub/grub.cfg
Back to top
View user's profile Send private message
xtx
Tux's lil' helper
Tux's lil' helper


Joined: 27 Dec 2011
Posts: 129

PostPosted: Sat Oct 18, 2014 3:19 pm    Post subject: Reply with quote

Yes, I did run that command. The only thing I may need to mention is that my /dev/sdb1 is too small to format to FAT 32. I followed the installation guide which says that partition should be +2M, while the Gentoo Grub2 wiki advises that partition should be 200MB. The only way I got that command to work is by replacing the 32 with 12.

The install Grub2 wiki also states, referring to the command grub2-install --target=x86_64-efi
Quote:
This will install grub in /boot/grub, copy the core image to /boot/efi/EFI/gentoo/grubx64.efi, and call efibootmgr to add a boot entry.
however even after running this command successfully my /boot/efi directory is empty.

Code:
ubuntu efi # mount /boot/efi
ubuntu efi # grub2-install --target=x86_64-efi
Installing for x86_64-efi platform.
Installation finished. No error reported.
ubuntu efi # pwd
/boot/efi
ubuntu efi # ls
ubuntu efi #
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Sat Oct 18, 2014 4:59 pm    Post subject: Reply with quote

My approach usually is to install a binary distro like Mint. Use that to chroot and install gentoo. I use the bootloader of grub and never change that except the entry of the bootloader entry.

As these days you have a different architecture I can not give you more detail help. My hardware is soon 6 years old and still runnig the same installation with encryption.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Sat Oct 18, 2014 7:36 pm    Post subject: Reply with quote

What is on /dev/sda? parted -l and post or pastebin the results.
if you have ubuntu installed in uefi mode, more than one ESP can exist on a disk or on the disks, but:
Windows does not support it.
The uefi (BIOS) may find the wrong ESP and use it before it finds the right one.
You only need one ESP, just need to put everything in the right place.

Quote:
I followed the installation guide which says that partition should be +2M,
This was added when the handbook decided to recognize GPT labeled disks. It was added because bootloaders traditionally used the empty space after the boot sector found in msdos(dos)(MBR) labeled disks. GPT disks do not provide the empty space. The handbook does not recognize UEFI. 2MB is not enough space for an ESP. 550Mib is usually recommended to avoid bugs in some manufacturers uefi implementations. Windows sets 100 MB.

Current motherboard implementations require FAT32. FAT12 won't work.

http://blog.uncooperative.org/blog/2014/02/06/the-efi-system-partition/
http://superuser.com/questions/688617/how-many-efi-system-partitions-esp-can-a-computer-have
_________________
Defund the FCC.
Back to top
View user's profile Send private message
xtx
Tux's lil' helper
Tux's lil' helper


Joined: 27 Dec 2011
Posts: 129

PostPosted: Sun Oct 19, 2014 4:55 pm    Post subject: Reply with quote

Thanks everybody for the assistance. I ended up solving this problem. Compiled grub2 with the PC feature and installed with
Code:
grub2-install /dev/sdb --target=i386-pc


I guess this means my motherboard doesn't use UEFI? I would have thought that my z68-ud3h-b3 mobo (which literally says "UEFI" on the splash screen when I boot my computer) used UEFI... I need to research this, I'm clearly not knowledgeable in this. I came here for help mainly because I know I've never needed to specify grub features in my make.conf before, and I've never needed the --target portion of the command to install grub, so the change was confusing for me.
Back to top
View user's profile Send private message
hrnick
Guru
Guru


Joined: 31 Aug 2002
Posts: 334

PostPosted: Thu Apr 09, 2015 1:10 am    Post subject: Reply with quote

xtx wrote:
I guess this means my motherboard doesn't use UEFI? I would have thought that my z68-ud3h-b3 mobo (which literally says "UEFI" on the splash screen when I boot my computer) used UEFI... I need to research this, I'm clearly not knowledgeable in this. I came here for help mainly because I know I've never needed to specify grub features in my make.conf before, and I've never needed the --target portion of the command to install grub, so the change was confusing for me.

How do I know if my motherboard is actually using UEFI or not? I've just bought a Gigabyte GA-Z97N Wifi and get the following errors:

Code:
$ grub2-install --target=x86_64-efi /dev/sda
grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory


Code:
$ grub2-install --target=i386-pc /dev/sda
Installing for i386-pc platform.
Failed to read /proc/cmdline, ignoring: No such file or directory
device node not found
Failed to read /proc/cmdline, ignoring: No such file or directory
device node not found
Failed to read /proc/cmdline, ignoring: No such file or directory
device node not found

...

Failed to read /proc/cmdline, ignoring: No such file or directory
device node not found
grub2-install: warning: this GPT partition label contains no BIOS boot partition: embedding won't be possible
grub2-install: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
grub2-install: error: will not proceed with blocklists.


I'm really lost here, do you have any ideas what could be wrong and how to continue with the installation?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Thu Apr 09, 2015 1:24 am    Post subject: Reply with quote

@ hrnick
your board has GIGABYTE UEFI DualBIOS™ according to gigabyte
during boot enter "bios" and find the choice that enables legacy bios or uefi mode and choose one or the other. while there figure out what you want to do about secure boot also.
usually a bad idea to reopen an old thread
_________________
Defund the FCC.
Back to top
View user's profile Send private message
hrnick
Guru
Guru


Joined: 31 Aug 2002
Posts: 334

PostPosted: Thu Apr 09, 2015 9:31 am    Post subject: Reply with quote

Thanks for your help DONAHUE! Playing around with the UEFI settings did help.
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