Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
grub not seeing new kernel [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
mikefot
l33t
l33t


Joined: 19 Nov 2014
Posts: 669

PostPosted: Sun Oct 18, 2020 1:42 pm    Post subject: grub not seeing new kernel [SOLVED] Reply with quote

Dear All,

I am running gentoo stable on an FX 8350 machine.

I compiled a new kernel (5.9.0) and installed it in the /boot directory.
I tried running grub-mkconfig to attach it to the grub table on booting the machine.

But it doesn't work.

Code:
➜  mikef ping www.google.com                 
ping: connect: Network is unreachable
➜  mikef grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.9.0-gentoo
Found linux image: /boot/vmlinuz-5.8.14
Found initrd image: /boot/initramfs-5.8.14.img
Found linux image: /boot/vmlinuz-5.7.13
Found initrd image: /boot/initramfs-5.7.13.img
Found linux image: /boot/vmlinuz-5.4.38-gentoo
 WARNING: Failed to connect to lvmetad. Falling back to device scanning.
 WARNING: Device /dev/sda not initialized in udev database even after waiting 10000000 microseconds.
 WARNING: Device /dev/sda1 not initialized in udev database even after waiting 10000000 microseconds.
 WARNING: Device /dev/sda2 not initialized in udev database even after waiting 10000000 microseconds.
 WARNING: Device /dev/sda3 not initialized in udev database even after waiting 10000000 microseconds.
 WARNING: Device /dev/sda4 not initialized in udev database even after waiting 10000000 microseconds.
 WARNING: Device /dev/sda1 not initialized in udev database even after waiting 10000000 microseconds.
 WARNING: Device /dev/sda2 not initialized in udev database even after waiting 10000000 microseconds.
 WARNING: Device /dev/sda3 not initialized in udev database even after waiting 10000000 microseconds.
 WARNING: Device /dev/sda4 not initialized in udev database even after waiting 10000000 microseconds.
done
➜  mikef


The problem with
Code:
lvmetad
could be a bug possibly according to other posts I have looked at.

My
Code:
/boot
directory looks like this:

Code:
➜  mikef cd /boot
➜  /boot ls -la
total 102000
drwxr-xr-x  3 root root     4096 Oct 18 14:18 .
drwxr-xr-x 21 root root     4096 May 21 12:06 ..
-rw-r--r--  1 root root        0 May 21 12:06 .keep
-rw-r--r--  1 root root  2090043 May 23 21:45 System.map-5.4.38-gentoo
-rw-r--r--  1 root root  5174965 Aug 18 12:40 System.map-5.7.13
-rw-r--r--  1 root root  5356126 Oct 14 15:30 System.map-5.8.14
-rw-r--r--  1 root root  2525093 Oct 18 14:18 System.map-5.9.0-gentoo
-rw-r--r--  1 root root    73078 May 23 21:45 config-5.4.38-gentoo
-rw-r--r--  1 root root   221044 Aug 18 12:40 config-5.7.13
-rw-r--r--  1 root root   224954 Oct 14 15:30 config-5.8.14
-rw-r--r--  1 root root    74865 Oct 18 14:18 config-5.9.0-gentoo
drwxr-xr-x  2 root root     4096 Oct 18 14:32 grub
-rw-r--r--  1 root root 30769543 Aug 18 12:40 initramfs-5.7.13.img
-rw-r--r--  1 root root 30091785 Oct 14 15:30 initramfs-5.8.14.img
-rw-r--r--  1 root root  4022832 May 23 21:45 vmlinuz-5.4.38-gentoo
-rw-r--r--  1 root root  9629984 Aug 18 12:40 vmlinuz-5.7.13
-rw-r--r--  1 root root 10152064 Oct 14 15:30 vmlinuz-5.8.14
-rw-r--r--  1 root root  3998208 Oct 18 14:18 vmlinuz-5.9.0-gentoo
➜  /boot


Suggestions on fixing this would be greatly appreciated.

Regards

Michael Fothergill


Last edited by mikefot on Tue Oct 20, 2020 6:27 pm; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Guru
Guru


Joined: 23 Mar 2019
Posts: 550

PostPosted: Sun Oct 18, 2020 1:49 pm    Post subject: Reply with quote

Hi please run
Code:

rc-update add lvm boot
rc-update add lvmetad default

and reboot
:D
_________________
:)
Back to top
View user's profile Send private message
mikefot
l33t
l33t


Joined: 19 Nov 2014
Posts: 669

PostPosted: Sun Oct 18, 2020 2:31 pm    Post subject: Reply with quote

Many thanks for your advice.

I ran the two commands you suggested.

After rebooting when I ran the
Code:
grub-mkconfig
command again I did not get the warning messages.

That has improved things for me.

But the new kernels were still not attached to the grub table on boot up.

Cheers

MF

PS I tried reinstalling grub:

Code:
➜  mikef grub-install /dev/sda   
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
➜  mikef


Something is not right there....
Back to top
View user's profile Send private message
alamahant
Guru
Guru


Joined: 23 Mar 2019
Posts: 550

PostPosted: Sun Oct 18, 2020 6:25 pm    Post subject: Reply with quote

In your "grub-install" line.
You are using a bios invocation when in fact it should have been an uefi
Code:

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

I am also a bit confused.
You seem to have lvm.
Can you please run
Code:

lsblk
cat /etc/fstab

and post the output.
The prefered structure --for me-- is separate /boot and /boot/efi directories.
If you use lvm then you will need a standard partition mounted on /boot.
If not you do NOT need separate /boot.Only an EFI partition mounted on /boot/efi.
Please run
Code:

mkdir /boot/efi
#####Then create a 500M  partition with gdisk and mark it ef00 Then run
mkfs.vfat </dev/partition-name>
mount /dev/<partition-name> /boot/efi
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=gentoo --recheck

followed by
Code:

dracut /boot/initramfs-$(uname -r).img $(uname -r) ####To create new OR
dracut --force ### to update existing ----if you have dracut.I dont know how you do it with genkernel.
grub-mkconfig -o /boot/grub/grub.cfg

Do you use lvm???
_________________
:)
Back to top
View user's profile Send private message
mikefot
l33t
l33t


Joined: 19 Nov 2014
Posts: 669

PostPosted: Mon Oct 19, 2020 10:31 am    Post subject: Reply with quote

Many thanks for your advice.

The output of lsblk is here:


Code:
(chroot) pigface / # lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 232.9G  0 disk
├─sda1   8:1    0   8.3G  0 part
├─sda2   8:2    0  86.4G  0 part
├─sda3   8:3    0   4.9G  0 part
└─sda4   8:4    0 133.3G  0 part /


and

Code:
(chroot) pigface / # cat /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/sda1      /boot/efi   vfat      noauto,noaatime   1 2
/dev/sda4      /      ext4      noatime      0 1
/dev/sda3      none      swap      sw      0 0
#/dev/cdrom      /mnt/cdrom   auto      noauto,ro   0 0
(chroot) pigface / #


I am now running gentoo from an ubuntu install on the same drive.

I mounted the root partition and chrooted into gentoo from ubuntu.

I can mount the boot partition for gentoo as well if needed.

Cheers

MF

PS

Opening a second terminal as
Code:
sudo
in ubuntu and running
Code:
lsblk
shows that
Code:
sda1
is the
Code:
/boot/efi
partition:

Code:
➜  mikef lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 232.9G  0 disk
├─sda1   8:1    0   8.3G  0 part /boot/efi
├─sda2   8:2    0  86.4G  0 part /
├─sda3   8:3    0   4.9G  0 part
└─sda4   8:4    0 133.3G  0 part /mnt/gentoo
➜  mikef mount /sda1 /boot/efi
mount: /boot/efi: special device /sda1 does not exist.
➜  mikef


But when you try to mount the partition it doesn't work:

Code:
➜  mikef mount /sda1 /boot/efi
mount: /boot/efi: special device /sda1 does not exist.
➜  mikef


Something is not right there.

PPS

I already have an
Code:
/efi/boot
directory:

Code:
(chroot) pigface /boot/efi # ls -l
total 0


PPPS I don't have
Code:
lvm
turned on anywhere in my
Code:
make.conf
file if that would be possible that I can see and I don't have any
Code:
lvm
related use flag present in the file either.

Maybe if I would create the extra 500MB partition and label it
Code:
ef00
as you say and run the
Code:
grub-install
command you gave that will solve the problem.....

Comments appreciated.

PPPPS

Ubuntu is on /sda2; the common swap partition is on /sda3 and the root partition for gentoo is on /sda4
Back to top
View user's profile Send private message
alamahant
Guru
Guru


Joined: 23 Mar 2019
Posts: 550

PostPosted: Mon Oct 19, 2020 12:47 pm    Post subject: Reply with quote

Ok from what I see first you do not seem to have logical volumes therefore lvm is unnecessary.
Secondly you do not seem to have a /boot/efi partition.
According to your fstab
/dev/sda1 IS the ESP partition but from lsblk i see it is a 8.3 Gigs partition.
Something doesnt feel right.
Since you do not have lv's you dont need to have a separate /boot partiion.
Just the "/" and /boot/efi
But you MUST have a /boot and /boot/efi directories in your fs.
Just create the ESP partition and MOUNT it on /boot/efi NOT on /boot.
Please do something like that:

First edit your fstab with the name of your new EFI partition.
Then please run:
Code:

####FROM UBUNTU
mount /dev/sda4 /mnt
mount /dev/<your new EFI partition you should create> /mnt/boot/efi
mount --rbind /dev /mnt/dev
mount --make-rslave /mnt/dev
mount -t proc /proc /mnt/proc
mount --rbind /sys /mnt/sys
mount --make-rslave /mnt/sys
mount --rbind /tmp /tmp
chroot /mnt /bin/bash
source /etc/profile
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=gentoo --recheck


I dont know what is your initramfs setup.If you use one create it or update it.
Then update grub:
Code:
grub-mkconfig -o /boot/grub/grub.cfg

Then exit the chroot and reboot.

You mention
Quote:


➜ mikef mount /sda1 /boot/efi
mount: /boot/efi: special device /sda1 does not exist.
➜ mikef

It should have been
mount /dev/sda1 /boot/efi
BUT /dev/sda1 does NOT seem to be an EFI partition.IT is 8.3Gigs!!!
What does /dev/sda1 contain?
_________________
:)


Last edited by alamahant on Mon Oct 19, 2020 1:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4873
Location: Dallas area

PostPosted: Mon Oct 19, 2020 12:58 pm    Post subject: Reply with quote

Is your kernel configured for dos/vfat filesystems?
_________________
PRIME x570-pro, 3700x, RX 550 - 5.8 zen kernel
Acer E5-575 (laptop), i3-7100u - i965 - 5.5 zen kernel
---both---
gcc 9.3.0, profile 17.1 (no-pie & modified) amd64-no-multilib, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
mikefot
l33t
l33t


Joined: 19 Nov 2014
Posts: 669

PostPosted: Tue Oct 20, 2020 12:28 pm    Post subject: Reply with quote

Many thanks for your advice.

I checked the kernel I was using. The
Code:
vfat
and
Code:
dos
flags are turned on.

Do I need the
Code:
EFI stub
stuff turned on as well?

I tried turning that on as well and recompiling the kernel.

I got the

Code:
no rule to make target 'arch/x86/tools/relocs_32.c'


type error when I tried running
Code:
make -j9
after exiting from
Code:
make menuconfig
.

Comments appreciated.

Regards

MF

PS

Here is the parted print for it:

Code:
chroot) pigface / # parted
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                           
Model: ATA WDC WD2500AAJS-6 (scsi)
Disk /dev/sda: 250GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system     Flags
 1      1049kB  8871MB  8870MB  primary  fat32           boot, esp
 2      8871MB  102GB   92.8GB  primary  ext4
 3      102GB   107GB   5243MB  primary  linux-swap(v1)
 4      107GB   250GB   143GB   primary  ext4

(parted)           


gparted gives the mount point as /boot/efi and I gave it a label efi-boot

Here is the fdisk -l output:

Code:
 (chroot) pigface / # fdisk -l
Disk /dev/sda: 232.91 GiB, 250059350016 bytes, 488397168 sectors
Disk model: WDC WD2500AAJS-6
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: dos
Disk identifier: 0x94e26dd6

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048  17326079  17324032   8.3G ef EFI (FAT-12/16/32)
/dev/sda2        17326080 198555647 181229568  86.4G 83 Linux
/dev/sda3       198555648 208795647  10240000   4.9G 82 Linux swap / Solaris
/dev/sda4       208795648 488396799 279601152 133.3G 83 Linux
(chroot) pigface / #


I tried running genkernel all to make a kernel it failed saying there was no boot mount point.....

I ran emerge sys-kernel/vanilla-kernel and made a new kernel.

I will try getting grub to see it.

Regards

MF

PPS

I ran the following:

Code:
chroot) pigface / # !447
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=gentoo --recheck
Installing for x86_64-efi platform.
grub-install: error: /boot/efi doesn't look like an EFI partition.
(chroot) pigface / #


I ran

(
Code:
chroot) pigface / # !457
grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.9.1
Found initrd image: /boot/initramfs-5.9.1.img
Found linux image: /boot/vmlinuz-5.9.0-gentoo
Found linux image: /boot/vmlinuz-5.8.14
Found initrd image: /boot/initramfs-5.8.14.img
Found linux image: /boot/vmlinuz-5.7.13
Found initrd image: /boot/initramfs-5.7.13.img
Found linux image: /boot/vmlinuz-5.4.38-gentoo
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.
Found Ubuntu 20.04 LTS (20.04) on /dev/sda2
done
(chroot) pigface / #


It looks like it might have worked.

I will try rebooting to see if the new 5.9.1 kernel is there and whether I can actually log in with it.

PPPS

I managed to boot up this kernel and log in with it with the help of supergrub.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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