Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] GRUB2 installation error
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
enrico68
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2016
Posts: 130

PostPosted: Sat Oct 29, 2016 6:35 pm    Post subject: [SOLVED] GRUB2 installation error Reply with quote

Hi,

I have been following the Handbook, and I am at the GRUB2 installation part. I have an UEFI BIOS, so I echoed:"

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


and then:

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

But, when I run the install command:" grub-install --target=x86_64-efi --efi-directory=/boot"

I get the message: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist.

What did I screw up??

enrico


Last edited by enrico68 on Thu Nov 10, 2016 2:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
enrico68
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2016
Posts: 130

PostPosted: Sat Oct 29, 2016 11:24 pm    Post subject: Reply with quote

One info, that maybe might help you help me...

when I run parted, it sees:

NUMBER FILE SYSTEM NAME FLAGS
1 grub bios_grub
2 fat16 boot boot, esp
3 linux-swap swap
4 ext4 rootfs

I ran:
Code:
mkfs.vfat /dev/sda2
before, but it still reads: fat16.

Then, I ran:
Code:
mount -l -t vfat
, and I got:

/dev/sdb2 on mnt/gentoo/boot type vfat. So, according to this, /dev/sdb2 has been formatted as vfat, although the above list says: fat16. Given my very limited knowledge of all this, it is as far as I could go to find a possible error...

enrico
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Sat Oct 29, 2016 11:36 pm    Post subject: Reply with quote

Let's check it out. Boot a system rescue cd or usb in uefi mode. The minimal install cd is not uefi capable. Mount the gentoo partitions. Then run
Code:
parted -l | wgetpaste -t
# disk & partition structure
mount | wgetpaste -t
# file systems
wgetpaste -t /mnt/gentoo/etc/fstab
# intended file systems
ls -lR /mnt/gentoo/usr/lib/grub/ | wgetpaste -t
#did grub really emerge?
Post the url's returned by wgetpaste.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
enrico68
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2016
Posts: 130

PostPosted: Sun Oct 30, 2016 8:10 am    Post subject: Reply with quote

Ho Donahue,

here are the URL's you requested:

http://bpaste.net/show

d1b00d28f21d

71ced35fc01a

1b6fd6e5878e

5a85c891d297


One more thing to mention:

I have three ssds, /sda with Windows10, /sdb with Gentoo Linux, /sdc with data. In the Handbook, in the GRUB installation part, it says to install it to the disk the system boots from. I installed to /sdb, the Gentoo Linux ssd.

enrico
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Sun Oct 30, 2016 2:42 pm    Post subject: Reply with quote

For easier use:
parted -l: http://bpaste.net/show/d1b00d28f21d
mount: http://bpaste.net/show/71ced35fc01a
fstab: http://bpaste.net/show/1b6fd6e5878e
/usr/lib/grub: http://bpaste.net/show/5a85c891d297

parted -l shows that /dev/sdb2 is formatted with a fat16 filesystem. Most current uefi implementations require vfat (fat32) filesystems on the EFI System Partition. Suggest you backup the current contents of the boot partition, reformat the boot partition as vfat, restore the backup.

Suggested procedure: boot sysresccd/usb in uefi mode. mount the gentoo partitions. Then run:
Code:
mkdir /mnt/gentoo/bkup
mv /mnt/gentoo/boot/* /mnt/gentoo/bkup
umount  /mnt/gentoo/boot
ls /mnt/gentoo/boot
# the /mnt/gentoo/boot directory should now be empty
fdisk /dev/sdb
t # to change partition type
2 # of partition sdb2
1 # to change to type 1, EFI System Partition (ESP)
w # to write the changes
mount /dev/sdb2 /mnt/gentoo/boot
mount | grep sdb2 # should show /dev/sdb2 on /mnt/gentoo/boot type vfat
# if not vfat or fat32
umount /mnt/gentoo/boot # if neither
mkfs.vfat /dev/sdb2 # if neither
mount /dev/sdb2 /mnt/gentoo/boot # if neither
mv /mnt/gentoo/bkup/* /mnt/gentoo/boot

#enter the chroot
mount -t proc proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --make-rslave /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
mount --make-rslave /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) $PS1"
mount | grep sdb2 # should now show /dev/sdb2 on /boot type vfat
# should see GRUB_PLATFORMS="efi-64 .... as part of response to next command
emerge -avuND =sys-boot/grub-2.02_beta3-r1:2
grub-install --target=x86_64-efi --efi-directory=/boot
grub-mkconfig -o /boot/grub/grub.cfg

_________________
Defund the FCC.


Last edited by DONAHUE on Sun Oct 30, 2016 6:06 pm; edited 3 times in total
Back to top
View user's profile Send private message
enrico68
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2016
Posts: 130

PostPosted: Sun Oct 30, 2016 3:32 pm    Post subject: Reply with quote

Hi Donahue,

when I try to move /mnt/gentoo/boot into mnt/gentoo/bkup, it says: Device or resource busy....
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Sun Oct 30, 2016 3:39 pm    Post subject: Reply with quote

mv /mnt/gentoo/boot/* /mnt/gentoo/bkup

sorry brain sputter will edit earlier post
_________________
Defund the FCC.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Sun Oct 30, 2016 4:14 pm    Post subject: Reply with quote

While in the chroot: your /etc/fstab has
Quote:
/dev/sdb2 /boot ext2 defaults,noatime 0 2
should be
Quote:
dev/sdb2 /boot vfat defaults,noatime 0 2

_________________
Defund the FCC.
Back to top
View user's profile Send private message
enrico68
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2016
Posts: 130

PostPosted: Sun Oct 30, 2016 4:15 pm    Post subject: Reply with quote

All instructions were executed, and this time it shows vfat, instead of fat16. Still, I keep getting the same error:

/usr/lib...../modinfo.sh does not exist...
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Sun Oct 30, 2016 4:32 pm    Post subject: Reply with quote

does
Code:
fdisk -l | grep sdb2
yield
Quote:
/dev/sdb2 <number> <number> <number> <number> EFI System

_________________
Defund the FCC.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Sun Oct 30, 2016 6:04 pm    Post subject: Reply with quote

With sysresccd/usb booted in uefi mode and gentoo partitions mounted run
Code:
ls -l /mnt/gentoo/usr/lib/grub/ | wgetpaste -t
This should show subdirectory
Quote:
x86_64-efi
or subdirectories
Quote:
i386-pc x86_64-efi
Earlier
Code:
ls -lR mnt/gentoo/usr/lib/grub/
returned only one sudirectory
Quote:
i386-pc
which is good for GRUB_PLATFORMS="pc" but not for GRUB_PLATFORMS="efi-64" or GRUB_PLATFORMS="efi-64 pc" in /etc/portage/make.conf.
Check /mnt/gentoo/etc/portage/make.conf with:
Code:
 grep -i "GRUB_PLATFORMS" /mnt/gentoo/etc/portage/make.conf | wgetpaste -t
This should produce only one entry for GRUB_PLATFORMS either GRUB_PLATFORMS="efi-64" or GRUB_PLATFORMS="efi-64 pc" if all is well.
Post url's returned by wgetpaste.
Strange possibilities include: the motherboard is not uefi capable (what is make and model?), Secure Boot is not disabled or shimmed (check in "bios"), or the sysreccd/usb is not booted in uefi mode (black background when it boots to opening menu?).
_________________
Defund the FCC.
Back to top
View user's profile Send private message
enrico68
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2016
Posts: 130

PostPosted: Sun Oct 30, 2016 6:40 pm    Post subject: Reply with quote

DONAHUE wrote:


With sysresccd/usb booted in uefi mode and gentoo partitions mounted run
Code:
ls -l /mnt/gentoo/usr/lib/grub/ | wgetpaste -t


I get: http://bpaste.net/show/ecfdb25b5617

This should show subdirectory
Quote:
x86_64-efi
or subdirectories
Quote:
i386-pc x86_64-efi
Earlier
Code:
ls -lR mnt/gentoo/usr/lib/grub/
returned only one sudirectory
Quote:
i386-pc
which is good for GRUB_PLATFORMS="pc" but not for GRUB_PLATFORMS="efi-64" or GRUB_PLATFORMS="efi-64 pc" in /etc/portage/make.conf.

Check /mnt/gentoo/etc/portage/make.conf with:
Code:
 grep -i "GRUB_PLATFORMS" /mnt/gentoo/etc/portage/make.conf | wgetpaste -t


I get: No input read. Nothing to paste. Aborting.

This should produce only one entry for GRUB_PLATFORMS either GRUB_PLATFORMS="efi-64" or GRUB_PLATFORMS="efi-64 pc" if all is well.
Post url's returned by wgetpaste.
Strange possibilities include: the motherboard is not uefi capable (what is make and model?), Secure Boot is not disabled or shimmed (check in "bios"), or the sysreccd/usb is not booted in uefi mode (black background when it boots to opening menu?).


Motherboard make: ASUS Sabertooth Z87. The systemrescuecd is booted in UEFI. Secure Boot is not disable, or shimmed: I do not know, have to check the BIOS, but, since it is something I have never heard, I suppose it is set to default.
Back to top
View user's profile Send private message
enrico68
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2016
Posts: 130

PostPosted: Sun Oct 30, 2016 6:53 pm    Post subject: Reply with quote

I ran the above commands not in chroot, so disregard my post, I will send you a new one...sorry...
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Sun Oct 30, 2016 6:57 pm    Post subject: Reply with quote

Apparently GRUB_PLATFORMS entry never made it into /etc/portage/make.conf
Again sysresccd/usb booted uefi mode and gentoo partitions mounted
echo 'GRUB_PLATFORMS="efi-64"' >> /mnt/gentoo/etc/portage/make.conf
grep -i "GRUB_PLATFORMS" /mnt/gentoo/etc/portage/make.conf | wgetpaste -t
or use nano /mnt/gentoo/etc/portage/make.conf to add the entry

commands including /mnt/gentoo are not intended for chroot but for install media with gentoo partitions mounted. If in chroot omitting /mnt/gentoo from the path will work if you have emerged wgetpaste in the chroot

when sure a valid GRUB_PLATFORMS="efi-64" exists in /mnt/gentoo/etc/portage/make.conf (/etc/portage/make.conf if in the chroot already), then from the chroot run:
Code:
mount | grep sdb2 # should now show /dev/sdb2 on /boot type vfat
# should see GRUB_PLATFORMS="efi-64 .... as part of the use flag response to next command
emerge -avD =sys-boot/grub-2.02_beta3-r1:2
grub-install --target=x86_64-efi --efi-directory=/boot
grub-mkconfig -o /boot/grub/grub.cfg

_________________
Defund the FCC.


Last edited by DONAHUE on Sun Oct 30, 2016 7:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
enrico68
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2016
Posts: 130

PostPosted: Sun Oct 30, 2016 7:04 pm    Post subject: Reply with quote

DONAHUE wrote:


With sysresccd/usb booted in uefi mode and gentoo partitions mounted run
Code:
ls -l /mnt/gentoo/usr/lib/grub/ | wgetpaste -t


I get: bash: wgetpaste: command not found
ls: cannot access /mnt/..../grub: No such file or directory

Check /mnt/gentoo/etc/portage/make.conf with:
Code:
 grep -i "GRUB_PLATFORMS" /mnt/gentoo/etc/portage/make.conf | wgetpaste -t


I get: bash: wgetpaste: command not found
ls: cannot access /mnt/..../grub: No such file or directory

I find it very strange both commands return nothing... :roll:


Strange possibilities include: the motherboard is not uefi capable (what is make and model?), Secure Boot is not disabled or shimmed (check in "bios"), or the sysreccd/usb is not booted in uefi mode (black background when it boots to opening menu?).


Motherboard make: ASUS Sabertooth Z87. The systemrescuecd is booted in UEFI. Secure Boot is not disable, or shimmed: I do not know, have to check the BIOS, but, since it is something I have never heard, I suppose it is set to default.
Back to top
View user's profile Send private message
enrico68
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2016
Posts: 130

PostPosted: Sun Oct 30, 2016 7:06 pm    Post subject: Reply with quote

Ok, got it. I will rerun them not in chroot.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Sun Oct 30, 2016 7:39 pm    Post subject: Reply with quote

From your Owner's manual:
Quote:
Secure Boot
Allows you to configure the Windows ® Secure Boot settings and manage its keys to protect
the system from unauthorized access and malwares during POST.
OS Type
[Windows UEFI Mode]
Allows you to select your installed operating system. Execute the Microsoft ® Secure Boot check.
Only select this option when booting on Windows ® UEFI mode or other Microsoft ® Secure Boot compliant OS.

[Other OS]
Get the optimized function when booting on Windows ® non-UEFI mode. Microsoft ® Secure Boot only supports Windows ® UEFI mode.


So in your "bios" select Other OS to disable secure boot.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
enrico68
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2016
Posts: 130

PostPosted: Sun Oct 30, 2016 8:40 pm    Post subject: Reply with quote

Ok, so, it seems make.conf has now the correct GRUB_PLATFORMS in it. It also looks like the grub installation worked...but with a final message:

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

I have not done the secure boot part, yet. Could that be why?
Back to top
View user's profile Send private message
enrico68
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2016
Posts: 130

PostPosted: Sun Oct 30, 2016 8:46 pm    Post subject: Reply with quote

I just did the secure boot part (selected: Other OS), will try the installation again, and will report back in a few....
Back to top
View user's profile Send private message
enrico68
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2016
Posts: 130

PostPosted: Sun Oct 30, 2016 9:11 pm    Post subject: Reply with quote

With the secure boot on (other OS), and running again : grub-install --target=x86_64-efi-directory=/boot, I get:
grub install: error: /usr/lib/...../modinfo.sh does not exist...

so, just to recap:

without the secure boot part, grub install works, but with an efi error message,

with the (other OS) grub won't install...
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Sun Oct 30, 2016 11:46 pm    Post subject: Reply with quote

With Other OS selected in "bios" (meaning secure boot is disabled), sysresccd/usb booted in uefi mode (Black background sysresc menu screen), run:
Code:
ls -al /sys/firmware/efi | wgetpaste -t
post the url returned; if you get a file not found the sysresccd/usb system is not booted in uefi mode, once the system is confirmed booted in uefi mode: mount the gentoo partitions and enter the chroot, then run:
Code:
emerge efibootmgr wgetpaste
emerge -1 efivar
# You should see GRUB_PLATFORMS="efi-64 .... as part of response to next command
emerge -av =sys-boot/grub-2.02_beta3-r1:2 | wgetpaste -t
grub-install --target=x86_64-efi --efi-directory=/boot | wgetpaste -t
grub-mkconfig -o /boot/grub/grub.cfg | wgetpaste -t
wgetpaste -t /usr/src/linux/.config

post the url's returned by wgetpaste
_________________
Defund the FCC.
Back to top
View user's profile Send private message
enrico68
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2016
Posts: 130

PostPosted: Mon Oct 31, 2016 10:13 am    Post subject: Reply with quote

DONAHUE wrote:


With Other OS selected in "bios" (meaning secure boot is disabled), sysresccd/usb booted in uefi mode (Black background sysresc menu screen), run:
Code:
ls -al /sys/firmware/efi | wgetpaste -t
post the url returned;

URL return: http://bpaste.net/show/6e388243e085


if you get a file not found the sysresccd/usb system is not booted in uefi mode, once the system is confirmed booted in uefi mode: mount the gentoo partitions and enter the chroot, then run:

Code:
emerge efibootmgr wgetpaste


wgetpaste did not return any URL, but the command shows:

Emering, then Installing sys-boot/efibootmgr-0.12::gentoo
Emrging, then installing app-text/wgetpaste-2.28::gentoo

Code:
emerge -1 efivar


# You should see GRUB_PLATFORMS="efi-64 .... as part of response to next command
Code:
emerge -av =sys-boot/grub-2.02_beta3-r1:2 | wgetpaste -t


https://paste.pound-phyton.org/show/MQs14yXm1bws19viVIYs


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


Installation finished. No error reported.
No input read. Nothing to paste. Aborting.


Code:
grub-mkconfig -o /boot/grub/grub.cfg | wgetpaste -t


No input read. Nothing to paste. Aborting.
Found Linux image: /boot/vmlinuz-4.4.26-gentoo
done

Code:
wgetpaste -t /usr/src/linux/.config


https://paste.pound-phyton.org/show/2UGTKwdTIsVAQtO4xiIG/ <<<<The bold letter could be a 0, I am not sure...


I just checked /boot, these are the shown files:

config-4.4.26-gentoo
EFI
grub
System.map-4.4.26-gentoo
vmlinuz-4.4.26-gentoo.
I hope it looks all right now.


According to the handbook: "Those desiring dual boot systems should emerge the sys-boot/os-prober package then re-run the grub-mkconfig command". Should I do this, as I would like to dual boot with Windows10, and maybe another Linux distro...

Last: do I have to leave the secure boot option disabled all the time?

I went ahead with the handbook, rebooted the system, finalized it, and after entering login and password, I am now in Linux, at the prompt...I thought I had installed a Linux version with Desktop, but all I see is the prompt...
And in the Boot section my system just shows me the ssd with Linux, so I can't see the other disks and boot into Windows...according to the handbook, I should install the sys-boot-os-prober package, which I just did, and it failed to emerge it...the reason beng there is no network connection. I tried to ping google.com, but it says: unknown host.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


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

PostPosted: Mon Oct 31, 2016 12:55 pm    Post subject: Reply with quote

Hooray, the good news is you can boot. do so and run
Code:
 ifconfig -a
the output should consist of the interfaces the kernel can see and provide a driver for. do you have an eth0 or en<something> along with lo.
Best guesses are that the kernel configuration does not provide a driver for your NIC(s) or the NIC requires firmware which is not in /lib/firmware or the system is not configured to bring up the interface.
To gather more information and communicate it: reboot to the sysresccd/usb in uefi mode, then run:
Code:
lspci -k | wgetpaste -t # find the ethernet controller driver used by sysresccd
lshw | grep -i driver | wgetpaste -t
wgetpaste -t /mnt/gentoo/usr/src/linux/.config # could not get the previous copy with o or 0
post the url's returned by wgetpaste, then enter the chroot where you can fix the new gentoo system and communicate, when in the chroot, run
Code:
emerge netifrc linux-firmware dhcpcd
rc-update show | wgetpaste -t
wgetpaste -t /var/log/dmesg
grep -i 'firmware\|eth0' /var/log/dmesg | wgetpaste -t
Post url's returned by wgetpaste
_________________
Defund the FCC.
Back to top
View user's profile Send private message
enrico68
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2016
Posts: 130

PostPosted: Mon Oct 31, 2016 2:36 pm    Post subject: Reply with quote

DONAHUE wrote:
Hooray, the good news is you can boot. do so and run
Code:
 ifconfig -a
the output should consist of the interfaces the kernel can see and provide a driver for. do you have an eth0 or en<something> along with lo.

I see lo. and eno1


Best guesses are that the kernel configuration does not provide a driver for your NIC(s) or the NIC requires firmware which is not in /lib/firmware or the system is not configured to bring up the interface.
To gather more information and communicate it: reboot to the sysresccd/usb in uefi mode, then run:

Code:
lspci -k | wgetpaste -t # find the ethernet controller driver used by sysresccd


https://paste.pound-python.org/show/Q3mxtr129UNDEUoPL4S1


Code:
lshw | grep -i driver | wgetpaste -t


lshw command not found


Code:
wgetpaste -t /mnt/gentoo/usr/src/linux/.config


https://paste.pound-python.org/show/CjxPIN5FEZEIB304KdqC

# could not get the previous copy with o or 0; post the url's returned by wgetpaste, then enter the chroot where you can fix the new gentoo system and communicate, when in the chroot, run

Code:
emerge netifrc linux-firmware dhcpcd


Code:
rc-update show | wgetpaste -t


https://paste.pound-python.org/show/Nz9n9a8yHwqhyy0E7RE9


Code:
wgetpaste -t /var/log/dmesg


https://paste.pound-python.org/show/pDmckqG3jzPREt6RfyUD

Code:
grep -i 'firmware\|eth0' /var/log/dmesg | wgetpaste -t


https://paste.pound-python.org/show/qWYvM51Ibnerkr13cEf7d[/code]

Post url's returned by wgetpaste
Back to top
View user's profile Send private message
enrico68
Tux's lil' helper
Tux's lil' helper


Joined: 21 Oct 2016
Posts: 130

PostPosted: Mon Oct 31, 2016 3:06 pm    Post subject: Reply with quote

I was able to install the lshw, here it is:

Code:
lshw | grep -i driver | wgetpaste -t


https://paste.pound-python.org/show/FV36viHLFw8ZawTHMP6K
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  Next
Page 1 of 3

 
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