Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
grub-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doe
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
frau-needs-help
n00b
n00b


Joined: 12 Dec 2020
Posts: 7
Location: Kiel

PostPosted: Sat Dec 12, 2020 1:54 pm    Post subject: grub-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doe Reply with quote

I have Gentoo installed and it works. But i cant activate Grub. The system will be load at the moment with Super-Grub.
Please help: where is the error? I have tried efi and pc Version.

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


Code:
localhost ~ # grub-install --target=x86_64-efi --efi-directory=/boot
grub-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory.


Code:
localhost ~ # fdisk /dev/sda

Welcome to fdisk (util-linux 2.35.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 860
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: F3652E21-88D4-44BB-BC49-04E43060CBD5

Device       Start        End    Sectors  Size Type
/dev/sda1     2048       6143       4096    2M BIOS boot
/dev/sda2     6144     268287     262144  128M Linux filesystem
/dev/sda3   268288    2365439    2097152    1G Linux swap
/dev/sda4  2365440 1050941439 1048576000  500G Linux filesystem

Command (m for help):

Code:

localhost ~ # mount | grep sda
/dev/sda4 on / type ext4 (rw,relatime)
/dev/sda2 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
localhost ~ #
Back to top
View user's profile Send private message
GDH-gentoo
l33t
l33t


Joined: 20 Jul 2019
Posts: 620
Location: South America

PostPosted: Sat Dec 12, 2020 2:54 pm    Post subject: Re: Reply with quote

Hello,

frau-needs-help wrote:
I have tried efi and pc Version.

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


Code:
localhost ~ # grub-install --target=x86_64-efi --efi-directory=/boot
grub-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory.


Code:
localhost ~ # fdisk /dev/sda
...
Device       Start        End    Sectors  Size Type
/dev/sda1     2048       6143       4096    2M BIOS boot
/dev/sda2     6144     268287     262144  128M Linux filesystem
...

Code:

localhost ~ # mount | grep sda
...
/dev/sda2 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)

First, we need to know for sure whether this is a UEFI install or a BIOS install. It seems that you set up GRUB for a BIOS install, but your computer is booting in UEFI mode, and, on top of that, the ESP hasn't been marked as such in the partition table. Post the outputs of:
Code:
$ ls /usr/lib/grub
$ ls /sys/firmware
$ emerge -pv grub
Back to top
View user's profile Send private message
frau-needs-help
n00b
n00b


Joined: 12 Dec 2020
Posts: 7
Location: Kiel

PostPosted: Sat Dec 12, 2020 3:16 pm    Post subject: Reply with quote

Here are the infos:

Code:
localhost ~ # ls /usr/lib/grub/
i386-pc
localhost ~ # ls /sys/firmware/
acpi  dmi  efi  memmap
localhost ~ # emerge -pv grub
setlocale: unsupported locale setting
setlocale: unsupported locale setting

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-boot/grub-2.04-r2:2/2.04-r2::gentoo  USE="fonts nls sdl themes truetype -device-mapper -doc -efiemu -libzfs -mount (-test)" GRUB_PLATFORMS="pc -coreboot -efi-32 -efi-64 -emu -ieee1275 -loongson -multiboot -qemu -qemu-mips -uboot -xen -xen-32 -xen-pvh" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

 * IMPORTANT: 10 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.

localhost ~ #
Back to top
View user's profile Send private message
GDH-gentoo
l33t
l33t


Joined: 20 Jul 2019
Posts: 620
Location: South America

PostPosted: Sat Dec 12, 2020 3:46 pm    Post subject: Reply with quote

Right.

frau-needs-help wrote:
Code:
localhost ~ # ls /sys/firmware/
acpi  dmi  efi  memmap
UEFI system, but...

frau-needs-help wrote:
Code:
localhost ~ # ls /usr/lib/grub/
i386-pc
...
localhost ~ # emerge -pv grub
...
[ebuild   R    ] sys-boot/grub-2.04-r2:2/2.04-r2::gentoo  USE="fonts nls sdl themes truetype -device-mapper -doc -efiemu -libzfs -mount (-test)" GRUB_PLATFORMS="pc -coreboot -efi-32 -efi-64 -emu -ieee1275 -loongson -multiboot -qemu -qemu-mips -uboot -xen -xen-32 -xen-pvh" 0 KiB
... BIOS-only GRUB. We have to fix that first. Post the contents of /etc/portage/make.conf and /etc/fstab, and the output of ls /boot.

Also:
frau-needs-help wrote:
Code:
Total: 1 package (1 reinstall), Size of downloads: 0 KiB

 * IMPORTANT: 10 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.
Not related to the problem, but you should read them.
Back to top
View user's profile Send private message
frau-needs-help
n00b
n00b


Joined: 12 Dec 2020
Posts: 7
Location: Kiel

PostPosted: Sat Dec 12, 2020 4:16 pm    Post subject: Reply with quote

Many thanks. I hope we can clear ist and the woman will understand it :-)
I tryed GRUB_PLATFORMS=pc after uefi dont work.

Code:
#less /etc/portage/make.conf
# 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.
COMMON_FLAGS="-O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"

# 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="https://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo/ rsync://mirror.eu.onea>

USE="X, alsa, -kde, -qt, -games"
L10N="de"
GRUB_PLATFORMS="pc"


Code:
#less /etc/fstab
# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed); notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

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

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
#
# NOTE: Even though we list ext4 as the type here, it will work with ext2/ext3
#       filesystems.  This just tells the kernel to use the ext4 driver.
#
# NOTE: You can use full paths to devices like /dev/sda3, but it is often
#       more reliable to use filesystem labels or UUIDs. See your filesystem
#       documentation for details on setting a label. To obtain the UUID, use
#       the blkid(8) command.

/dev/sda2               /boot           vfat            noauto,noatime  1 2
#UUID=58e72203-57d1-4497-81ad-97655bd56494              /               ext4            noatime         0 1
/dev/sda3               none            swap            sw              0 0
#/dev/cdrom             /mnt/cdrom      auto            noauto,ro       0 0
/dev/sda1               /               ext4
/etc/fstab lines 1-30/30 (END)


Code:

localhost ~ # ls /boot/
EFI                                 initramfs-5.4.80-gentoo-r1-x86_64.img
System.map-5.4.80-gentoo-r1-x86_64  vmlinuz-5.4.80-gentoo-r1-x86_64
grub
localhost ~ #
Back to top
View user's profile Send private message
GDH-gentoo
l33t
l33t


Joined: 20 Jul 2019
Posts: 620
Location: South America

PostPosted: Sat Dec 12, 2020 6:10 pm    Post subject: Reply with quote

Alright. First step, remove this line from make.conf:

frau-needs-help wrote:
Code:
#less /etc/portage/make.conf
...
GRUB_PLATFORMS="pc"

And then, reinstall GRUB:
Code:
# emerge --ask --oneshot grub
This should enable GRUB for installing it on both UEFI and BIOS systems. When this finishes, check the output of ls /usr/lib/grub/x86_64-efi/mod*. It should now contain modinfo.sh.

If that goes well, in preparation for the next steps, post the output of ls /boot/EFI.
Back to top
View user's profile Send private message
frau-needs-help
n00b
n00b


Joined: 12 Dec 2020
Posts: 7
Location: Kiel

PostPosted: Sat Dec 12, 2020 6:39 pm    Post subject: Reply with quote

Quote:

It should now contain modinfo.sh.


Yes, its ok:


Code:
localhost ~ # ls /usr/lib/grub/x86_64-efi/mod*
/usr/lib/grub/x86_64-efi/moddep.lst  /usr/lib/grub/x86_64-efi/modinfo.sh
localhost ~ # ls /boot/EFI/       
gentoo
localhost ~ # cd /boot/EFI/gentoo/
localhost /boot/EFI/gentoo # ls -all
total 125
drwxr-xr-x 2 root root    512 Dec 12 10:15 .
drwxr-xr-x 3 root root    512 Dec 12 10:15 ..
-rwxr-xr-x 1 root root 126976 Dec 12 10:15 grubx64.efi
localhost /boot/EFI/gentoo #
Back to top
View user's profile Send private message
GDH-gentoo
l33t
l33t


Joined: 20 Jul 2019
Posts: 620
Location: South America

PostPosted: Sat Dec 12, 2020 6:53 pm    Post subject: Reply with quote

frau-needs-help wrote:
Yes, its ok:


Code:
localhost ~ # ls /usr/lib/grub/x86_64-efi/mod*
/usr/lib/grub/x86_64-efi/moddep.lst  /usr/lib/grub/x86_64-efi/modinfo.sh
Good.

frau-needs-help wrote:
Code:
localhost ~ # cd /boot/EFI/gentoo/
localhost /boot/EFI/gentoo # ls -all
total 125
drwxr-xr-x 2 root root    512 Dec 12 10:15 .
drwxr-xr-x 3 root root    512 Dec 12 10:15 ..
-rwxr-xr-x 1 root root 126976 Dec 12 10:15 grubx64.efi
localhost /boot/EFI/gentoo #
Oh, so you have done a UEFI install of GRUB before on this computer. Let's see what's the system state before doing anything else. Post the output of:

Code:
$ ls /boot/grub
$ efibootmgr
Back to top
View user's profile Send private message
frau-needs-help
n00b
n00b


Joined: 12 Dec 2020
Posts: 7
Location: Kiel

PostPosted: Sat Dec 12, 2020 6:56 pm    Post subject: Reply with quote

I love mans which can help :-* :-)

Code:

localhost / # ls /boot/grub/
fonts  grub.cfg  grubenv  themes  x86_64-efi
localhost / # efibootmgr
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0006,0004,0005
Boot0004* UEFI: PXE IP4 Realtek PCIe GBE Family Controller
Boot0005* UEFI: PXE IP6 Realtek PCIe GBE Family Controller
Boot0006* UEFI: ASUS SDRW-08U7M-U A101, Partition 1
localhost / #
Back to top
View user's profile Send private message
GDH-gentoo
l33t
l33t


Joined: 20 Jul 2019
Posts: 620
Location: South America

PostPosted: Sat Dec 12, 2020 7:38 pm    Post subject: Reply with quote

Alright. Next, let's fix this:
frau-needs-help wrote:
Code:
Device       Start        End    Sectors  Size Type
/dev/sda1     2048       6143       4096    2M BIOS boot
/dev/sda2     6144     268287     262144  128M Linux filesystem
/dev/sda3   268288    2365439    2097152    1G Linux swap
/dev/sda4  2365440 1050941439 1048576000  500G Linux filesystem

Partition 2 is actually this disk's EFI System Partition (ESP), but it is marked in the partition table as an ordinary Linux filesystem. We are going to change the partition type using fdisk, which will not destroy the contents, change its size, or modify any other partition, but should mark it in a way that helps the UEFI firmware recognize that this is the ESP. This might have been what has failed in the first place.

Code:
# fdisk /dev/sda
...
Command (m for help): t
Partition number (1-4, default ??): 2
Partition type (type L to list all types): 1

Changed type of partition 'Linux filesystem' to 'EFI System'.
Now, before doing anything else, use the p command to show the partition table again. It should now look like this:
Code:
Command (m for help): p
...
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    2365439    2097152    1G Linux swap
/dev/sda4  2365440 1050941439 1048576000  500G Linux filesystem
If it doesn't look like this, you can use the q command to quit without making any changes.

Otherwise, use the w command to make the changes and quit. If you want to double check, you can use the i command before saving:
Code:
Command (m for help): i
Partition number (1-4, default ??): 2

         Device: /dev/sda2
          ...
           Type: EFI System
      Type-UUID: C12A7328-F81F-11D2-BA4B-00A0C93EC93B

Tell us how that went.
Back to top
View user's profile Send private message
frau-needs-help
n00b
n00b


Joined: 12 Dec 2020
Posts: 7
Location: Kiel

PostPosted: Sat Dec 12, 2020 7:57 pm    Post subject: Reply with quote

I think its all ok:

Code:
localhost / # fdisk /dev/sda

Welcome to fdisk (util-linux 2.35.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): t
Partition number (1-4, default 4): 2
Partition type (type L to list all types): 1

Changed type of partition 'Linux filesystem' to 'EFI System'.

Command (m for help): p
Disk /dev/sda: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 860
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: F3652E21-88D4-44BB-BC49-04E43060CBD5

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    2365439    2097152    1G Linux swap
/dev/sda4  2365440 1050941439 1048576000  500G Linux filesystem

Command (m for help): w
The partition table has been altered.
Syncing disks.

localhost / # fdisk /dev/sda

Welcome to fdisk (util-linux 2.35.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): i
Partition number (1-4, default 4): 2

         Device: /dev/sda2
          Start: 6144
            End: 268287
        Sectors: 262144
           Size: 128M
           Type: EFI System
      Type-UUID: C12A7328-F81F-11D2-BA4B-00A0C93EC93B
           UUID: 57B9024D-AFB6-AF49-BA07-3E234EB0ECB5

Command (m for help):
Back to top
View user's profile Send private message
GDH-gentoo
l33t
l33t


Joined: 20 Jul 2019
Posts: 620
Location: South America

PostPosted: Sat Dec 12, 2020 8:06 pm    Post subject: Reply with quote

frau-needs-help wrote:
I think its all ok:

Yes, it looks OK to me as well. Now, try once more to install GRUB to the ESP. If /dev/sda2 is still mounted:
Code:
grub-install --efi-directory=/boot
This time, it should give no errors.

If that succeeded, let's see if a boot entry was created for GRUB. Post again the output of efibootmgr.
Back to top
View user's profile Send private message
frau-needs-help
n00b
n00b


Joined: 12 Dec 2020
Posts: 7
Location: Kiel

PostPosted: Sat Dec 12, 2020 8:09 pm    Post subject: Reply with quote

ok, no error. I will restart the system to check it. One moment

Code:
localhost / # mount | grep sda2
/dev/sda2 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
localhost / # grub-install --efi-directory=/boot
Installing for x86_64-efi platform.
Installation finished. No error reported.
localhost / # efibootmgr
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0000,0006,0004,0005
Boot0000* gentoo
Boot0004* UEFI: PXE IP4 Realtek PCIe GBE Family Controller
Boot0005* UEFI: PXE IP6 Realtek PCIe GBE Family Controller
Boot0006* UEFI: ASUS SDRW-08U7M-U A101, Partition 1
localhost / #



WAU - i am happy! Many Thanks. All ok and i have lern many thinks.
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