Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] new kernel boots exactly once, but not a second tim
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
koslowj
Tux's lil' helper
Tux's lil' helper


Joined: 15 Feb 2005
Posts: 87

PostPosted: Mon May 13, 2024 6:16 am    Post subject: [Solved] new kernel boots exactly once, but not a second tim Reply with quote

I had to re-install Gentoo and successfully built kernel 6.6.30, which booted fine. However, after shutting the machine down, I can no longer boot this kernel. Older kernels I had saved, like 6.6.21 and 6.6.13 still can boot.

I've since rebuild the kernel 6.6.30 after booting from 6.6.21, but still cannot boot 6.6.30.

All my kernels reside in a /boot partition, with a grub subdirectory and an efi partition linked to another subdirectory.

Even after building the kernel with "make && make modules_install", "make install", "genkernel --install initramfs" and finally "grub-mkconfig -o /boot/grub/grub.cfg", the attempt to reboot into 6.6.60 results in

Loading Linux 6.6.30-gentoo-x86_64-nvidia ...
error: file '/vmlinuz-6.6.30-gentoo-x86_64-nvidia' not found.
Loading initial ramdisk ...
error: you need to load the kernel first.

However, booting into 6.6.21 gives the meesage

Loading Linux6.6.21-gentoo-x86_64-nvidia ...
EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path

which then succeeds in booting.

Inspecting the file /boot/grub/grub.cfg so far I cannot make out a difference in the entries for 6.6.30 and 6.6.21

I don't recall changing anything inadvertently after the first successful boot into 6.6.30, but I may well have done so.


Last edited by koslowj on Tue May 14, 2024 10:27 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon May 13, 2024 8:15 am    Post subject: Reply with quote

koslowj

Code:
Loading Linux 6.6.30-gentoo-x86_64-nvidia ...
error: file '/vmlinuz-6.6.30-gentoo-x86_64-nvidia' not found.
Loading initial ramdisk ...
error: you need to load the kernel first.


Grub has been told to load /vmlinuz-6.6.30-gentoo-x86_64-nvidia but its not there.

Its probably try to load it from /boot but you have two different places called boot
There is the /boot directory on the root filesystem. (With the leading /)
There is the boot partition. (No leading /)

Its the admins problem to mount the boot partition at the /boot directory before installing a new kernel, so that the two appear to be the same thing.

Show us
Code:
ls -l /boot
with and without boot mounted at /boot.
One of them should be empty.
_________________
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
logrusx
Veteran
Veteran


Joined: 22 Feb 2018
Posts: 1613

PostPosted: Mon May 13, 2024 4:06 pm    Post subject: Reply with quote

Also show us the output of `make install`. Do not rebuild, just run it right away and it should give us an idea where it installs the kernel. Maybe also the output of `genkernel --install initramfs`.
The contents of /etc/fstab may also prove useful.

Best Regards,
Georgi
Back to top
View user's profile Send private message
koslowj
Tux's lil' helper
Tux's lil' helper


Joined: 15 Feb 2005
Posts: 87

PostPosted: Tue May 14, 2024 10:25 am    Post subject: Reply with quote

The /boot directory is empty, if the boot partition is not mounted. There is no other vmlinuz-file anywhere but on the boot partition.

"make install" from the /usr/src/linux directory says

INSTALL /boot
Reading /usr/lib/kernel/install.conf...
/usr/lib/kernel/install.conf configures layout=compat
/usr/lib/kernel/install.conf configures initrd_generator=none
/usr/lib/kernel/install.conf configures uki_generator=none

and results in the previous 6.6.30 kernel to be saved with an .old suffix. It is identical to the newly installed 6.6.30 kernel.

/etc/fstab contains the line

UUID=... /boot ext4 noauto,noatime 1 2

OK, after reading up on the format of /etc/fstab, the second-to-last number should be 0 instead of 1, and indeed, then the 6.6.30 kernel does boot.
I guess I turned that 0 into a 1 because of older out-commented lines containing a 1 when I edited /etc/fstab in order to adjust some UUIDs... Those
lines are erased now.
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