Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GRUB2 on a NVMe media (doesn't detect kernel) [SOLVED]
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
Adarion
n00b
n00b


Joined: 22 Aug 2005
Posts: 63

PostPosted: Tue Sep 24, 2019 6:43 pm    Post subject: GRUB2 on a NVMe media (doesn't detect kernel) [SOLVED] Reply with quote

Solution: boils down to read the wiki entry carefully ;) and make sure the naming of the very kernel images follows a scheme like
Code:

vmlinuz-x.y.z
or
kernel-x.y.z-gentoo




Hello everyone,

I have a little problem with a new Gentoo installation to a new box.
I'm fighting with Grub2 on an NVMe media.

situation:
New Zen+ system, all seems to work nicely.
Gentoo CD boots up, I can chroot.
The NVME is partitioned (classic MBR though, with the classic scheme) into some empty space for bootloaders, 1st partition (nvme0n1p1) of ~128MB boot (ext4 FS), followed by ~ 2 GB swap (nvme0n1p2) and then root (FS ext4 again) for the rest. (/home will be on some larger HDD to mount via fstab).
Code:
/dev/nvme0n1p1 -> boot 128 M
/dev/nvme0n1p2 -> swap 2 G
/dev/nvme0n1p3 -> root ~120 G
(/dev/sdx1 -> will be /home later)


So far I have the full Gentoo installed, even up to KDE and whatnot.
It was actually the first time for me to use Grub2 so I kept that step til the end. ;)
(Grub1 had usually done fine for me in the past.)
And then I failed.

I managed to install it (went acc. to the handbook) and it installed into nvme0n1p1 (mounted at /boot), it wrote its directories and files under /boot.
The problem is that first

Code:
#grub-mkconfig -o /boot/grub/grub.cfg


won't seem to write an entry for (any) attached Linux kernel.
It simply does not detect the Kernel image or anything else there - although it detects other "Linuxes" on various media (even some old i686 VIA C7 kernel on a HDD) - as long as they are attached via SATA and via the onboard controller. (os-prober is installed)
It also detects a W64 installation on a HDD I put there.

"BIOS" is set to classic/UEFI boot and to boot from the NVMe.

After reboot Grub2 fires up from the NVMe but it only showed e.g. that W64, but no Linux kernel on my NVMe. :(


What did I miss? Is it possibly due to the MBR partitioning? Do I really have to use GPT in that case? (the NVMe is only 128 GB)
Or do I have to follow a specific naming scheme with the kernel images? Use a special compression for them?
Do I need some additional configuration in /etc/defaults/grub ?
Or do I even have to use this (pesky) UEFI boot with some VFAT partition and messing around in UEFI variables? I just wanted a clean and classic boot.


Is there a good tutorial how to write grub.cfg manually, though it says "don't edit this file manually"? (The man pages have lots of info on fancy themes, but seem sparse on possibly NVMe related obstacles.)


grub2 (v 2.02-r4) is built w. GRUB_PLATFORMS="efi-64 multiboot pc" and USE="mount" (no other fancy stuff in there); os-prober (v 1.76-r1) doesn't have any flags.
I usually build my own kernel images (roughly 7+ machines w. Gentoo here) and put the bzImage_version-x-y-z and the according System.map-x.y.z. onto the boot partition. (But then I always used Grub1 so far...)
_________________
stop tcpa, swpatents, corrupt politicians and other scary stuff


Last edited by Adarion on Wed Sep 25, 2019 11:52 am; edited 1 time in total
Back to top
View user's profile Send private message
GDH-gentoo
Apprentice
Apprentice


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

PostPosted: Tue Sep 24, 2019 7:35 pm    Post subject: Reply with quote

Adarion wrote:
Or do I have to follow a specific naming scheme with the kernel images?

If you use grub-mkconfig, I believe that yes, kernels must have a name that starts with vmlinuz- or kernel- to be recognized. If you manually edit grub.cfg to write menu entries, you can name the kernel images anything you like. I use GRUB2 but not grub-mkconfig.

Adarion wrote:
Is there a good tutorial how to write grub.cfg manually, though it says "don't edit this file manually"? (The man pages have lots of info on fancy themes, but seem sparse on possibly NVMe related obstacles.)

YMMV on whether it is good or not, but the GRUB manual (info grub) has a chapter devoted to that, and another one for the configuration commands. If you are booting kernels from the same partition and filesystem in which the grub directory with grub.cfg and the modules lives (the /boot partition in your MBR case), the configuration is fairly simple, and if you don't want the graphical terminal (the gfxterm), even more so. But be sure to check the file with grub-script-check when you are done.
Back to top
View user's profile Send private message
Gentlenoob
n00b
n00b


Joined: 10 Apr 2008
Posts: 39

PostPosted: Wed Sep 25, 2019 7:41 am    Post subject: Reply with quote

FWIW, I learned here https://forums.gentoo.org/viewtopic-p-8122378.html#8122378 about simple, grub-legacy-style grub2 config-files.

Good luck, Ralph
Back to top
View user's profile Send private message
Adarion
n00b
n00b


Joined: 22 Aug 2005
Posts: 63

PostPosted: Wed Sep 25, 2019 11:50 am    Post subject: Reply with quote

Thanks for the quick replies.

Indeed, silly me. It's even written in the Gentoo wiki Grub2 quick start. It won't discover other names. I rebuilt grub2 with device-mapper (just in case) though and now it found the renamed kernel images

kernel-x.y.z.-gentoo
and its copy
vmlinuz-x.y.z

instantly.
Interestingly, the other HDDs/SSDs via SATA were only detected as "found Gentoo/Linux" on /dev/sda3 and /dev/sdb3. But sdx3 ist root, not boot, even though /dev/sdx1 was always marked as bootable (old MBR style) but the kernel names there were "custom".
Well, probably I thought grub2 has a more generic approach.

I just booted successfully into a shell. I'm glad that it works now, since that was the last missing step (besides adding a user and setting the root passwd, which I love to forget :) so I lock myself out).
Also thanks for the forum hint on the manual-good-old-true-and-tried-simple-grub1-style config, it looks very helpful.

Thanks a bunch!
_________________
stop tcpa, swpatents, corrupt politicians and other scary stuff
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