Mystery - vmlinuz & initrd.img being renamed by unknown process

I have a mystery on my hands!

I am running Ubuntu MATE 22.04.5.

Many months ago, I installed a newer kernel, version 6.8.0-45-generic instead of the expected 5.15.0-177-generic.

I discovered about 6 months ago, that

vmlinuz -> vmlinuz-5.15.0-177-generic
vmlinuz.old -> vmlinuz-6.8.0-45-generic

initrd.img -> initrd.img-5.15.0-177-generic
initrd.img.old -> initrd.img-6.8.0-45-generic

Thinking that updates of that 5.* kernel improperly bumped my 6.* kernel out of its position of primacy, I intervened manually, renaming the files for what for me was logical, meaning

vmlinuz.old -> vmlinuz-5.15.0-177-generic
vmlinuz -> vmlinuz-6.8.0-45-generic

initrd.img.old -> initrd.img-5.15.0-177-generic
initrd.img -> initrd.img-6.8.0-45-generic

When I noticed the swap again 1 month ago, I did not remember doing any kernel updates, but the swap had been done again!

Once again I “repaired” the “mis-alignment” manually.

Today, going to check my kernel version, I noticed once again that the files were swapped !!!


Does anyone undestand why this is happening and what I need to do prevent it from happening again?

No, I do not have automatic updates. Those have been turned off for years!

3 Likes

Those symlinks are managed by update-initramfs and related kernel post installation scripts. Even with auto-updates off, something is occasionally triggering a kernel hook. ITs worth checking your apt and dpkg logs around the times you noticed the swap to see if anythng touched a linux-image package.

Also, to avoid this you can look at pinning your preferred kernel as the GRUB default so it boots correctly regardless of what the symlinks are doing.

5 Likes

It does boot with the proper kernel, which is 6.8.0-45-generic.

Definitely not for this last instance. So something currently configured on the OS is doing it for some reason. :frowning:

I will look into the update-initramfs. Thank you, Hayden.

2 Likes