Update-grub doesn't create kernel-symlinks in root anymore

Hi!

I upgraded to UM 20.04 LTS.

sudo update-grub works but don't create
the symlinks in root /

It don't create the symlinks in / (root) anymore:

I have:
initrd.img (Link target: boot/initrd.img-5.0.0-38-generic)

vmlinuz (Link target: boot/vmlinuz-5.0.0-38-generic

I need:
initrd.img (Link target: boot/initrd.img-5.4.0-42-generic)

vmlinuz (Link target: boot/vmlinuz-5.4.0-42-generic

Is it possible to do that manually to create/make link to the kernel files in /boot?

I have not seen this issue. I don't think it's the job of update-grub to create those symlinks in the root. I'm guessing those are created by a post-install script in the debfile from which the kernel is installed. How was the new kernel installed?

Hold on! My last kernel update seems to have created the symlinks not in root, but in /boot! vmlinuz and vmlinuz.old are in /boot, pointing to the appropriate files also in /boot. Same with the initrd links. I wonder if this is just part of some effort to clean up the root directory? Everything seems to work fine...

Do you have the links in /boot? You might try re-installing grub - something I read indicated that is responsible for the links, not just update-grub.

I also read that Debian no longer creates those links in root, but a reason wasn't given. I'm sure a bit of searching would reveal the whole story.

You might want to delete (rename temporarily, in case you need 'em back) the links you have in root, and re-install grub:

sudo grub-install --recheck --no-floppy --force
sudo update-grub

and see what happens...

In the past before upgraded to UM 20.04 LTS, the kernel symlinks was in / "initrd.img & vmlinuz"

I prefer to upgrade the kernel manually.

I did:

sudo apt get install linux-headers-5.4.0-42 linux-headers-5.4.0-42-generic linux-image-5.4.0-42-generic linux-modules-5.4.0-42-generic linux-modules-extra-5.4.0-42-generic

I wondered why initrd.img & vmlinuz were placed in /boot and not under /.

So I had deleted initrd.img & vmlinuz from /boot.

I can only boot the old kernel because I have the old kernel symlinks in /.

Shall I repeat?

sudo apt get install linux-headers-5.4.0-42 linux-headers-5.4.0-42-generic linux-image-5.4.0-42-generic linux-modules-5.4.0-42-generic linux-modules-extra-5.4.0-42-generic

Then remove the old symlinks from / and let initrd.img & vmlinuz placed in /boot?

The kernel symlinks now in /boot but I can't boot the new kernel. :confused:

Black screen :confused:

In grub.cfg I have:

linux /vmlinuz-5.4.0-42-generic
initrd /initrd.img-5.4.0-42-generic

Must I change to?

linux /boot/vmlinuz-5.4.0-42-generic
initrd /boot/initrd.img-5.4.0-42-generic


initrd.img & vmlinuz are in /boot.

Which lines are correct?

I believe you want to point directly to the /boot directory. At least, in my grub.cfg it does. Mine looks like this:

linux /boot/vmlinuz-5.4.0-42-generic root=UUID=d6f36f3b-2100-45e2-9ff5-cdc4702845ee ro quiet splash $vt_handoff
initrd /boot/initrd.img-5.4.0-42-generic

@ sgage,

I did a test and copy my old kernel symlinks back to /.

Now I can boot my old kernel again.

I want point directly.

Where should I put the kernel symlinks? /boot or /.?

I removed again kernel symlinks in /.

have left initrd.img & vmlinuz in /boot.

Changed in grub.cfg the lines.

Error-message on boot:

error: file '/boot/vmlinuz-5.4.0-42-generic' not found.
error: you need to load the kernel first.

Can i make a symlink of vmlinuz-5.4.0-42-generic and initrd.img-5.4.0-42-generic in /boot and place it in /?

Possible?

I'm afraid I'm not really an expert on this. It seems to me that the system of having a vmlinuz/initrd symlink is changing. I have no symlink in /, only in /boot. And my grub.cfg linux and initrd stanzas point directly to /boot.

I have done nothing 'manually' on this installation - just let apt update/upgrade take care of things. Perhaps try reinstalling grub if you haven't already, followed by an update-grub.

Got it now :slight_smile:

Make a link of: vmlinuz-5.4.0-42-generic and initrd.img-5.4.0-42-generic in /boot.

and placed the links it in / Renamed the links to:

vmlinuz & initrd.img

Change the line in grub.cfg to:

linux /vmlinuz-5.4.0-42-generic
initrd /initrd.img-5.4.0-42-generic

Now I can boot automatic again with the new kernel.

My workaround :slight_smile: