kernelbootubuntu-22.04dkms

Ubuntu 22.04.2 failes booting every other time


Yesterday [2023-06-21] I ran # apt upgrade on my Ubuntu 22.04.2 and during updating some errors happend -- smth related to dkms. I was not focused on the process, so I just try to run # apt upgrade again and it processed then witout errors. Today, after restarting my laptop, I get stuck booting with some randomness - after one or two reboots it can boot successfully, but there could be some issues:

uname -a

# Linux hostname 5.19.0-32-generic #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC
# Mon Jan 30 17:03:34 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
dpkg --list | grep linux-image | awk '{print $2}'
# linux-image-5.19.0-32-generic
# linux-image-unsigned-5.19.0-41-generic
dpkg --list | grep 5.19.0 | awk '{print $2}'
# linux-headers-5.19.0-32-generic
# linux-headers-5.19.0-41-generic

# linux-hwe-5.19-headers-5.19.0-32
# linux-hwe-5.19-headers-5.19.0-41

# linux-image-5.19.0-32-generic
# linux-image-unsigned-5.19.0-41-generic

# linux-modules-5.19.0-32-generic
# linux-modules-5.19.0-41-generic

# linux-modules-extra-5.19.0-32-generic
# linux-modules-extra-5.19.0-41-generic

# linux-objects-nvidia-530-5.19.0-41-generic

Despite some listed packages of version 5.19.0-41, there are no kernel files of this version in /boot dir.

So, as there is no sustainability in my problem, it is totaly look like chaos, that I tried to describe.

I suppose, the problem is in kernel modules building while upgrading. I tried to rebuild them:

ls /boot/initrd.img-* | cut -d- -f2- | \
sudo xargs -n1 /usr/lib/dkms/dkms_autoinstaller start

It built some modules, but it didn't help. I stay with random booting result.


Solution

  • I spend a day trying to solve this issue, and got no success. There was a restriction, that I should backup my data from 1tb SSD to reinstall the system and no separate storage for that. But I decided to dig in and found out, that BTRFS automatically created two subvolumes: /@ for system data and /@home for user data. I just cleaned out /@ and reinstall the system, keeping my data on place.