Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
problems installing grub2
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
tuxgt
n00b
n00b


Joined: 11 May 2020
Posts: 4

PostPosted: Mon May 11, 2020 4:41 pm    Post subject: problems installing grub2 Reply with quote

Hello colleagues, I require your help, I am new to gentoo this is the first time that I install this system, however it gives me problems when I want to install grub2 since it throws the following error: grub-install –target = x86_64-efi –efi- directory = / boot
grub-install: error: More than one installation device ?.

I have been investigating the solutions of this forum but none of the solutions of other users have worked for me, I share my partition table and my fstab table



Code:
/dev/sda1               /boot/efi       vfat            auto,noatime         1 2
/dev/sda2               /boot           ext2            auto,noatime         1 2
/dev/sda3               none            swap            sw                   0 0
/dev/sda4               /               ext4            defaults,noatime     0 1


Code:
                                Disco: /dev/sda
                                                                               Tama▒o: 100 GiB, 107374182400 bytes, 209715200 sectores
                                                                          Etiqueta: gpt, identificador: 395D53C2-591E-4750-9814-C7B70B884214

    Disposit.                                                Comienzo                            Final                        Sectores                       Tama▒o Tipo
>>  /dev/sda1                                                    2048                             6143                            4096                           2M Arranque de BIOS
    /dev/sda2                                                    6144                           268287                          262144                         128M Sistema EFI
    /dev/sda3                                                  268288                          1316863                         1048576                         512M Sistema de ficheros de Linux
    /dev/sda4                                                 1316864                        209713151                       208396288                        99.4G Sistema de ficheros de Linux


[Moderator edit: added [code] tags to preserve output layout. -Hu]
_________________
Si no lo sabes, investigalo, no hay nada como el conocimiento
Back to top
View user's profile Send private message
alamahant
Apprentice
Apprentice


Joined: 23 Mar 2019
Posts: 295

PostPosted: Mon May 11, 2020 4:46 pm    Post subject: Reply with quote

Try please
Code:

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=gentoo --recheck

Also before emerging grub did you have this entry in make.conf?
Code:

GRUB_PLATFORMS="efi-64"

:D


Last edited by alamahant on Mon May 11, 2020 4:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 45451
Location: 56N 3W

PostPosted: Mon May 11, 2020 4:47 pm    Post subject: Reply with quote

tuxgt,

Welcome to Gentoo.

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

White space matters. The command you posted won't do what you expected.
Code:
grub-install –target = x86_64-efi –efi- directory = /boot


With /boot (no space) in place of "/ boot", might work.

-- edit --
In fact, that will fail too. The handbook says
Code:
grub-install --target=x86_64-efi --efi-directory=/boot

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
tuxgt
n00b
n00b


Joined: 11 May 2020
Posts: 4

PostPosted: Mon May 11, 2020 5:01 pm    Post subject: Reply with quote

alamahant wrote:
Try please
Code:

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=gentoo --recheck

Also before emerging grub did you have this entry in make.conf?
Code:

GRUB_PLATFORMS="efi-64"

:D


thanks, if i run

Code:

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=gentoo --recheck

throws me the following error
Code:

Installing for x86_64-efi platform.
grub-install: error: could not get canonical path of  / boot / efi.


and if before executing grub emerge, validate that in the make.conf it had GRUB_PLATFORMS = "efi-64

Code:


COMMON_FLAGS="-O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
MAKEOPTS="-j3"
ACCEPT_LICENSE= "- * @FREE"
USE="-bluetooth"
# NOTE: This stage was built with the bindist Use flag enabled
PORTDIR="/var/db/repos/gentoo"
DISTDIR="/var/cache/distfiles"
PKGDIR="/var/cache/binpkgs"

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

GENTOO_MIRRORS="ftp://ftp.ussg.iu.edu/pub/linux/gentoo rsync://mirrors.rit.edu/gentoo/ https://mirror.sjc02.svwh.net/gentoo/"

GRUB_PLATFORMS="efi-64"


_________________
Si no lo sabes, investigalo, no hay nada como el conocimiento
Back to top
View user's profile Send private message
tuxgt
n00b
n00b


Joined: 11 May 2020
Posts: 4

PostPosted: Mon May 11, 2020 5:04 pm    Post subject: Reply with quote

NeddySeagoon wrote:
tuxgt,

Welcome to Gentoo.

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

White space matters. The command you posted won't do what you expected.
Code:
grub-install –target = x86_64-efi –efi- directory = /boot


With /boot (no space) in place of "/ boot", might work.

-- edit --
In fact, that will fail too. The handbook says
Code:
grub-install --target=x86_64-efi --efi-directory=/boot


thanks NeddySeagoon,

if i run the command
Code:
grub-install –target = x86_64-efi –efi- directory = /boot


generates the following error
Code:

 grub-install --target=x86_64-efi --efi-directory=/boot
Instalando para plataforma x86_64-efi.
grub-install: error: /boot no parece una particion EFI..

_________________
Si no lo sabes, investigalo, no hay nada como el conocimiento
Back to top
View user's profile Send private message
apurkrt
Tux's lil' helper
Tux's lil' helper


Joined: 26 Feb 2011
Posts: 116
Location: Czechia, Europe

PostPosted: Mon May 11, 2020 7:13 pm    Post subject: Reply with quote

hey, the following setup works for me

Code:

/dev/sda1      2048    262143    260096  127M EFI System
/dev/sda2    262144    524287    262144  128M Linux filesystem
/dev/sda3    524288 839385087 838860800  400G Linux filesystem


I install grub this way:
1) mount /dev/sda2 /boot
2) mount /dev/sda1 /boot/efi
3) grub-install
4) grub-mkconfig -o /boot/grub/grub.cfg

that's it - just "grub-install" without any parameters - and it works, if the partitions are mounted as above
only requirement: the system has to be booted in efi mode and have efi support enabled in kernel. how to tell: check if /sys/firmware/efi/ exists
Back to top
View user's profile Send private message
alamahant
Apprentice
Apprentice


Joined: 23 Mar 2019
Posts: 295

PostPosted: Mon May 11, 2020 8:26 pm    Post subject: Reply with quote

The / partition(=/dev/sda4) has to have a "boot" directory.
The /boot partition(=/dev/sda2) has to have an "efi" directory.
Your efi partition(=/dev/sda1) should have the type ef00(efi partition type in gdisk)

If you are building in chroot this is how to prepare your filesystem:
Code:

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


CHROOT into your system,install and update grub.The full procedure:
Code:

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

mount --types proc /proc /mnt/proc
mount --rbind /sys /mnt/sys
mount --make-rslave /mnt/sys
mount --rbind /dev /mnt/dev
mount --make-rslave /mnt/dev
mount --rbind /tmp /mnt/tmp

chroot /mnt /bin/bash

source /etc/profile

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=gentoo --recheck

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

It should work this way..it HAS to..
PS your --efi-directory is NOT "/boot" it IS "/boot/efi"

:D
Back to top
View user's profile Send private message
tuxgt
n00b
n00b


Joined: 11 May 2020
Posts: 4

PostPosted: Thu May 14, 2020 3:30 am    Post subject: Reply with quote

apurkrt wrote:
hey, the following setup works for me

Code:

/dev/sda1      2048    262143    260096  127M EFI System
/dev/sda2    262144    524287    262144  128M Linux filesystem
/dev/sda3    524288 839385087 838860800  400G Linux filesystem


I install grub this way:
1) mount /dev/sda2 /boot
2) mount /dev/sda1 /boot/efi
3) grub-install
4) grub-mkconfig -o /boot/grub/grub.cfg

that's it - just "grub-install" without any parameters - and it works, if the partitions are mounted as above
only requirement: the system has to be booted in efi mode and have efi support enabled in kernel. how to tell: check if /sys/firmware/efi/ exists



thanks for supporting everyone, I was reviewing the steps and I realized that I forgot the command
Code:
make install

I did everything again and I was able to install grub
_________________
Si no lo sabes, investigalo, no hay nada como el conocimiento
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