elementary/triage

Unused kernels are not automatically cleaned up

Opened this issue · 11 comments

What Happened

image
I am getting this warning although I haven't touched the boot partition (although maybe changing my GRUB theme added a few kb)

Expected Behavior

image
None of the drives that appear in storage are low on storage and I don't know what can be done to fix this issue.

Possible Solutions

Maybe the default boot sector should be a bit larger? I'm not sure what is actually giving this error but files is my best guess.

Platform Information

Odin
io.elementary.files 6.0.1

This message is coming from the Gnome settings daemon ( https://github.com/GNOME/gnome-settings-daemon/blob/b23408d1cffd2ab07cb22fcf797137c41ef6f3af/plugins/housekeeping/gsd-disk-space.c#L691 ) not Files. It looks like your /boot partition is fairly full (92.7%) - but not as full as the notification says. I am not sure why that is.

For comparison my boot partition had only 24MB used - this is for a recent install of Elementary Odin (only). You can delete old kernels etc out of your /boot folder to make more space if you know how (plenty of instructions on the internet).

This has now seemingly caused the Errors were encountered while processing: linux-firmware issue. Maybe this is caused by a failure of housekeeping? I feel like updating your OS regularly shouldn't be able to break things so that you need to go in with the command line.

I also have this issue on my laptop that also used stock install settings for Odin. I've installed mainline on both to remove old kernels. Hopefully this can get added into housekeeping.

floi commented

/boot being to small in the partition layout of the installer's default full disk encryption option has been an issue for years now - I've had in in previous versions of elementary and, if I remember correctly, on Ubuntu as well. After a couple of updates, old kernels (linux-image-*, linux-headers-* and linux-modules-*) would fill up the partition.

What's new for me is that apt autoremove doesn't seem to work for removing old kernels anymore. I suspect this might be due to the way the hwe packages or their dependencies work, but I haven't looked into it.

The current situation of having to remove kernels manually before /boot runs full and apt can't handle it anymore is very annoying.

Boot size itself is being tracked at elementary/installer#506. It would seem the root cause is that the OS is not automatically cleaning up unused kernels; this issue should be focused on how/why that is specifically.

Would it make sense to work on an improvement for Jólnir users?
Or is the perspective more like elementary OS 7?

@4jNsY6fCVqZv elementary OS 6.1 shipped with a larger /boot size which should mitigate this issue: elementary/installer#506. I'm not sure what the state of auto-cleaning kernels is, though.

Is it the case that this issue causes all other system updates to fail as well?

If so, I see the impact of this issue as critical to the security of the entire system. A friend of mine told me that she has not been able to update her installation of elementary OS 6.1 for months now. I suspect that this is exactly related to this problem. And the person doesn't even know why system updates don't work anymore.

Could you please implement a solution for the upcoming version of elementary OS 7? @jeremypw @danirabbit

This looks like it's related to this issue on PackageKit. Specifically, kernels are marked as manually installed, and so are skipped by autoremove which would otherwise clean them up.

What's bugging me is that the fix for this landed in PackageKit version 1.2.5. I think we have that version in elementary OS 7, but kernels are still marked as manual.

From my current OS 7 machine:

$ apt list packagekit -a
Listing... Done
packagekit/jammy,now 1.2.5-2ubuntu2 amd64 [installed,automatic]

$ apt-mark showmanual 'linux-image-.*'
linux-image-5.19.0-32-generic
linux-image-5.19.0-35-generic
linux-image-5.19.0-41-generic
linux-image-5.19.0-42-generic
linux-image-5.19.0-43-generic
linux-image-5.19.0-45-generic
linux-image-generic-hwe-22.04

(If I manually mark a kernel as auto installed apt autoremove does successfully clean it up, as documented here. I did it for one 5.15 version I previously had on disc.)

Thanks Antolius, worked perfect for me as I'm still having this issue.

ran sudo apt-mark auto 'linux-image-.*' and then sudo apt autoremove