Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
kernel upgrade still boots into old kernel
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
craigdolson
n00b
n00b


Joined: 30 Apr 2022
Posts: 15

PostPosted: Mon May 23, 2022 4:46 pm    Post subject: kernel upgrade still boots into old kernel Reply with quote

my gentoo sources were upgraded during last @world update, to 5.15.41-gentoo-x86_64 and the previous sources
Code:
5.15.32-gentoo-r1-x86_64
were removed in a depclean, and are no longer available to emerge, even without an unmask option. So, i went through the process of reviewing the gentoo kernel upgrade wiki, and i thought i followed all of the steps correctly, however when i boot, i still boot into the "old" kernel. See items below. I did go through the whole make-oldconfig, make, make install process for the kernel.

Code:
craig@gentoox ~ $ uname -r
5.15.32-gentoo-r1-x86_64 (OLD KERNEL)


Code:
craig@gentoox ~ $ eix gentoo-sources
[?] sys-kernel/gentoo-sources
     Available versions: 
     (4.9.309) 4.9.309^bs
     (4.9.311) ~4.9.311^bs
     (4.9.312) ~4.9.312^bs
     (4.14.275) 4.14.275^bs
     (4.14.276) ~4.14.276^bs
     (4.14.277) ~4.14.277^bs
     (4.19.237) 4.19.237^bs
     (4.19.238) ~4.19.238^bs
     (4.19.239) ~4.19.239^bs
     (4.19.240) ~4.19.240^bs
     (5.4.188) 5.4.188^bs
     (5.4.189) ~5.4.189^bs
     (5.4.190) ~5.4.190^bs
     (5.4.191) ~5.4.191^bs
     (5.10.109) 5.10.109^bs
     (5.10.110) ~5.10.110^bs
     (5.10.111) [M]~5.10.111^bs
     (5.10.112) [M]~5.10.112^bs
     (5.10.112-r1) ~5.10.112-r1^bs
     (5.10.113) ~5.10.113^bs
     (5.15.32-r1) 5.15.32-r1^bs
     (5.15.33) ~5.15.33^bs
     (5.15.34) [M]~5.15.34^bs
     (5.15.35) [M]~5.15.35^bs
     (5.15.35-r1) ~5.15.35-r1^bs
     (5.15.36) ~5.15.36^bs
     (5.16.20) [M]~5.16.20^bs
     (5.17.1) ~5.17.1^bs
     (5.17.1-r1) ~5.17.1-r1^bs
     (5.17.2) ~5.17.2^bs
     (5.17.3) [M]~5.17.3^bs
     (5.17.4) [M]~5.17.4^bs
     (5.17.4-r1) ~5.17.4-r1^bs
     (5.17.5) ~5.17.5^bs
       {build experimental symlink}
     Installed versions:  5.15.41(5.15.41)^bs(09:22:30 PM 05/20/2022)(-build -experimental -symlink)
     Homepage:            https://dev.gentoo.org/~mpagano/genpatches
     Description:         Full sources including the Gentoo patchset for the 5.17 kernel tree


Code:
craig@gentoox ~ $ sudo grub-mkconfig -o /boot/grub/grub.cfg
Password:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.41-gentoo-x86_64
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
craig@gentoox ~ $


However when i reboot, i still boot into
Code:
5.15.32-gentoo-r1-x86_64
, rather than
Code:
5.15.41-gentoo-x86_64


Im sure i just missed a step, but i cannot seem to figure out what that might be. This is my first time "upgrading" to a new kernel, so im still trying to get the hang of this.

Thanks.
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Mon May 23, 2022 4:59 pm    Post subject: Reply with quote

Is your /boot partition mounted when you run
Code:

sudo grub-mkconfig -o /boot/grub/grub.cfg

Do you use a "noauto" option to mount /boot in fstab?
Also under /lib/modules the old kernel should normally be present
_________________
:)
Back to top
View user's profile Send private message
craigdolson
n00b
n00b


Joined: 30 Apr 2022
Posts: 15

PostPosted: Mon May 23, 2022 5:06 pm    Post subject: Reply with quote

alamahant wrote:
Is your /boot partition mounted when you run
Code:

sudo grub-mkconfig -o /boot/grub/grub.cfg

Do you use a "noauto" option to mount /boot in fstab?
Also under /lib/modules the old kernel should normally be present


My fstab file shows the following for /boot partition

Code:
/dev/nvme0n1p1          /boot           Vfat            defaults,noatime        0 2


my /lib/modules directory is populated with:
Code:
craig@gentoox /lib/modules $ ls
total 12K
drwxr-xr-x  3 root root 4.0K Apr 29 12:05 .
drwxr-xr-x 11 root root 4.0K May 11 14:15 ..
drwxr-xr-x  3 root root 4.0K Apr 29 12:05 5.15.32-gentoo-r1-x86_64


my /boot directory contains:
Code:
craig@gentoox /boot $ ls
total 15M
drwxr-xr-x  3 root root 4.0K May 23 11:15 .
drwxr-xr-x 21 root root 4.0K Apr 24 12:11 ..
-rw-r--r--  1 root root 227K May 23 11:09 config-5.15.41-gentoo-x86_64
drwxr-xr-x  2 root root 4.0K May 23 11:32 grub
-rw-r--r--  1 root root    0 Apr 24 12:11 .keep
-rw-r--r--  1 root root 4.8M May 23 11:09 System.map-5.15.41-gentoo-x86_64
-rw-r--r--  1 root root 9.2M May 23 11:09 vmlinuz-5.15.41-gentoo-x86_64
craig@gentoox /boot $
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Mon May 23, 2022 5:11 pm    Post subject: Reply with quote

Quote:


Code:
craig@gentoox /lib/modules $ ls
total 12K
drwxr-xr-x 3 root root 4.0K Apr 29 12:05 .
drwxr-xr-x 11 root root 4.0K May 11 14:15 ..
drwxr-xr-x 3 root root 4.0K Apr 29 12:05 5.15.32-gentoo-r1-x86_64

You forgot to run
Code:

make modules_install

You only have the old kernel.

Also in /etc/fstab
Code:

/dev/nvme0n1p1          /boot           Vfat            defaults,noatime        0 2


you have a capital "V" for vfat.
Plz make it "v".
This means that when you run "sudo grub-mkconfig -o /boot/grub/grub.cfg" your /boot is never mounted.
Code:

cd /usr/src/linux
mount /boot
make install
make modules_install
sudo grub-mkconfig -o /boot/grub/grub.cfg


should fix it
_________________
:)
Back to top
View user's profile Send private message
craigdolson
n00b
n00b


Joined: 30 Apr 2022
Posts: 15

PostPosted: Mon May 23, 2022 5:23 pm    Post subject: Reply with quote

alamahant wrote:
Quote:


Code:
craig@gentoox /lib/modules $ ls
total 12K
drwxr-xr-x 3 root root 4.0K Apr 29 12:05 .
drwxr-xr-x 11 root root 4.0K May 11 14:15 ..
drwxr-xr-x 3 root root 4.0K Apr 29 12:05 5.15.32-gentoo-r1-x86_64

You forgot to run
Code:

make modules_install

You only have the old kernel.

Also in /etc/fstab
Code:

/dev/nvme0n1p1          /boot           Vfat            defaults,noatime        0 2


you have a capital "V" for vfat.
Plz make it "v".
This means that when you run "sudo grub-mkconfig -o /boot/grub/grub.cfg" your /boot is never mounted.
Code:

cd /usr/src/linux
mount /boot
make install
make modules_install
sudo grub-mkconfig -o /boot/grub/grub.cfg


should fix it


Thanks for that info. i ran the make-modules, and upon trying to update grub, i am met with the following.
Code:
craig@gentoox /boot/grub $ sudo grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
cat: write error: No space left on device


Code:
craig@gentoox /boot/grub $ df -h
Filesystem      Size  Used Avail Use% Mounted on
none             32G  1.9M   32G   1% /run
udev             10M     0   10M   0% /dev
tmpfs            32G  9.5M   32G   1% /dev/shm
/dev/nvme0n1p3  908G  105G  758G  13% /
cgroup_root      10M     0   10M   0% /sys/fs/cgroup
//truenas/Main  2.7T  239G  2.4T   9% /media/truenas
tmpfs           6.3G   28K  6.3G   1% /run/user/1000
/dev/nvme0n1p1  253M  253M     0 100% /boot


clearly, i am out of space. so, what is the safest way to remove old config? im not using LVM, so i cant really expand that drive.
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Mon May 23, 2022 5:31 pm    Post subject: Reply with quote

Maybe delete old /boot partition and IF YOU HAVE space create a new one?
Then reinstall grub and kernel and update grub?
My boot
Code:

du -sh /boot
76M   /boot

Why is yours so big?
plz run
Code:

mountpoint /boot
ls /boot

after properly mounting boot
Maybe not needed new /boot.
Just clean clutter in it?
_________________
:)


Last edited by alamahant on Mon May 23, 2022 5:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
craigdolson
n00b
n00b


Joined: 30 Apr 2022
Posts: 15

PostPosted: Mon May 23, 2022 5:35 pm    Post subject: Reply with quote

alamahant wrote:
Maybe delete old /boot partition and IF YOU HAVE space create a new one?
Then reinstall grub and kernel and update grub?


Code:
craig@gentoox ~ $ du -sh /boot
253M   /boot
craig@gentoox ~ $


crazy idea here, but could i just not delete the old kernel version entries from the /boot volume and let
Code:
grub-makeconfig
create the new ones? Current /boot volume shows

Code:
craig@gentoox /boot $ ls
total 25M
drwxr-xr-x  4 root root  512 Dec 31  1969 .
drwxr-xr-x 21 root root 4.0K Apr 24 12:11 ..
drwxr-xr-x  4 root root  512 May 21 02:40 EFI
drwxr-xr-x  6 root root  512 May 23 12:20 grub
-rwxr-xr-x  1 root root  11M Apr 29 17:07 initramfs-5.15.32-gentoo-r1-x86_64.img
-rwxr-xr-x  1 root root 4.8M Apr 29 16:57 System.map-5.15.32-gentoo-r1-x86_64
-rwxr-xr-x  1 root root 9.2M Apr 29 16:57 vmlinuz-5.15.32-gentoo-r1-x86_64


i have no additional space in my drive. i obviously regret not creating a larger /boot volume. was going off of the gentoo handbook at the time.


Last edited by craigdolson on Mon May 23, 2022 5:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Mon May 23, 2022 5:37 pm    Post subject: Reply with quote

Yes just delete all but the last working kernel
BUT you have
Code:

 /boot $ ls
total 25M

/boot is 253M
Code:

/dev/nvme0n1p1  253M  253M     0 100% /boot


Why the problem?
Strange.....
_________________
:)


Last edited by alamahant on Mon May 23, 2022 5:42 pm; edited 2 times in total
Back to top
View user's profile Send private message
craigdolson
n00b
n00b


Joined: 30 Apr 2022
Posts: 15

PostPosted: Mon May 23, 2022 5:39 pm    Post subject: Reply with quote

alamahant wrote:
Yes just delete all but the last working kernel


it only appears as if there is 1 kernel listed in boot. thats the "old" one im trying to replace.
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Mon May 23, 2022 5:46 pm    Post subject: Reply with quote

Plz see my above updated post.
Dont delete it.Just move it to a safe location together with initramfs and System-map.
Ah I see your old kernel had an initramfs also.
You might need to create one for your new kernel also.
Is your / partition ext4?
You could try to shrink it a bit.
_________________
:)
Back to top
View user's profile Send private message
craigdolson
n00b
n00b


Joined: 30 Apr 2022
Posts: 15

PostPosted: Mon May 23, 2022 7:11 pm    Post subject: Reply with quote

alamahant wrote:
Plz see my above updated post.
Dont delete it.Just move it to a safe location together with initramfs and System-map.
Ah I see your old kernel had an initramfs also.
You might need to create one for your new kernel also.
Is your / partition ext4?
You could try to shrink it a bit.


My / partition is ext4. i will look into that for the future. i was able to get the required files moved into the /boot directory and have booted into the new kernel. I will also take better care in the future to not allow a --depclean to remove my sources until im ready for a kernel upgrade.

Thanks again!
Back to top
View user's profile Send private message
flysideways
Guru
Guru


Joined: 29 Jan 2005
Posts: 437

PostPosted: Mon May 23, 2022 8:01 pm    Post subject: Reply with quote

craigdolson wrote:
alamahant wrote:
Plz see my above updated post.
Dont delete it.Just move it to a safe location together with initramfs and System-map.
Ah I see your old kernel had an initramfs also.
You might need to create one for your new kernel also.
Is your / partition ext4?
You could try to shrink it a bit.


My / partition is ext4. i will look into that for the future. i was able to get the required files moved into the /boot directory and have booted into the new kernel. I will also take better care in the future to not allow a --depclean to remove my sources until im ready for a kernel upgrade.

Thanks again!



I have not recently looked at the Handbook, but it never has introduced the --noreplace option to someone doing their install. --noreplace is your friend, mine too.

https://forums.gentoo.org/viewtopic-t-1148159-start-0-postdays-0-postorder-asc-highlight-noreplace.html

edit to add: I also use lsblk to remind myself what is mounted before doing emerges. It does no good to try and emerge something to an unmounted spot.

more: Just looked through all of the linked pages in the AMD64 Handbook, there is one unexplained use of --noreplace.
Code:
First install net-misc/netifrc:
root #emerge --ask --noreplace net-misc/netifrc
That is found on the configuring the system page. Nothing on the Configuring the kernel page or Working with Portage section.
Back to top
View user's profile Send private message
craigdolson
n00b
n00b


Joined: 30 Apr 2022
Posts: 15

PostPosted: Thu May 26, 2022 6:44 pm    Post subject: Reply with quote

Thanks again, everyone. I really like Gentoo. Been a Debian / Arch user for years. this is more challenging, but its more rewarding.
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