Kernel Trouble on my T430 – How to Go Way Back To Fix It

Over the years, I had only little trouble during Ubuntu Linux system updates. Very occasionally, Virtualbox requires a bit of care but that was pretty much it so far. The more surprised I was when I recently saw this on the screen of two of my older notebooks after running a security fix update on Ubuntu 20.04:

So what’s going on!?

Diagnosing the Problem

The screenshot above was taken on a Lenovo X230 notebook that was produced way back in 2013. The notebook is 8 years old now, but with 16 GB of RAM and a 2 TB hard drive, it still does an amazing job. At first, I thought this might be an an isolated issue either due to a hardware error, or of this particular installation, which I upgraded from Ubuntu 20.04 kernel version 5.8.0-48 to 5.8.0-50. This would be bad enough, but at least it would be an isolated event. After some back and forth I tried the same on a Lenovo T430 with a similar but independent system installation and got the same devastating result. So it’s definitely not a hardware error or an isolated update error, the graphics driver for the 3rd generation Intel 4000 graphics in Ubuntu’s kernel 5.8.0-50 is faulty. I then had a quick check and noticed that things had already started going wrong with kernel 5.8.0-49. On my newer X250 notebook (from back in 2015…), everything works well with the latest kernel, so it’s not a general Intel GPU driver issue.

Fixing the Problem

Since I installed Ubuntu 20.04 from scratch last year, the system has automatically updated itself from kernel 5.4 to 5.8 a few months ago without any problems at the time. Another notebook I upgraded from Ubuntu 18.04 is still on kernel version 5.4 today, so I guess the Hardware Enablement (HWE) stack that automatically upgrades to the latest kernel branch supported by Ubuntu did not kick in there. So, my choices were to either stick with kernel 5.8.0-48 and hope for an update to fix things down the road, or to try and go back to the original 5.4 kernel branch. On my T430 notebook, I decided to stick to 5.8.0-48 for the moment, while on the X230, I decided to find out if I could go back to the 5.4 branch and see if that would fix things.

WARNING: Before you attempt the following on your own, use Clonezilla or some other backup software and create a backup of the UEFI partition and the system partition. After that, restore the backup on another drive to ensure the backup is actually working. If something goes wrong when playing with kernel branches, it will potentially leave you with a broken installation from which it is very difficult to recover. Take this seriously! END OF WARNING.

Alright, so apart from the inherent danger, going back to Ubuntu 20.04’s original and still supported 5.4 kernel branch is pretty much straight forward. As I had difficulties doing just about anything useful with the 5.8.0-50 kernel on my X230, I interrupted the boot process early on and asked the bootloader to use the still installed 5.8.0-48 kernel. Once the system was running and usable again, I modified the grub bootloader configuration to always stop for 5 seconds at the boot menu, as this makes it easier to actually get to the menu:

# In /etc/default/grub change:

# No menu pause (default):

# With menu pause:

# Now update the menu by running
sudo update-grub2

# Reboot and select the 5.8.0-48 in the 
# "Advanced options" sub-menu.

And with that in place, installing the 5.4 kernel line again can be done as follows:

# Ensure the HWE meta packages are gone
# Note: They might already be removed again by the system

sudo apt remove linux-{image,headers}-generic-hwe-20.04

# Now install the 'generic' linux package which will bring 
# back the original Ubuntu 20.04 5.4 kernel

sudo apt install linux-generic

# Reboot and select the 5.4 kernel in the grub bootloader menu
# (By default is still prefered)

# Check if you are in the 5.4 kernel
uname -a

# Check if things are all right now

If things are looking all right again, one should remove the 5.8 kernel line, so the system will automatically boot into the latest 5.4 kernel from now on:

# Purge the 5.8 kernel

sudo apt-get purge linux-image-5.8.0-50-generic
sudo apt-get purge linux-headers-5.8.0-50-generic

# In /boot remove all kernel 5.8 related files:

sudo rm vmlinuz-5.8.0-50-generic 
sudo rm config-5.8.0-50-generic 

# Update grub again and then reboot 
sudo update-grub2

sudo reboot

And just for the fun of it, I also tried to reverse the procedure to get the 5.8 kernel line back in case the bug is fixed at some point in the future:

# Get the latest HWE kernel (e.g. 5.8) back:

sudo apt install linux-{image,headers}-generic-hwe-20.04
sudo apt udpate && sudo apt upgrade

sudo reboot

And that’s it. Kudos to the people in this thread who gave the crucial hints.