You are not logged in.

#1 2019-09-05 15:02:12

jaap aarts
Member
Registered: 2017-09-04
Posts: 30

[SOLVED] GRUB boots old kernel after disk migration

I migrated my disk to a new nvme ssd, I wanted to try out f2fs and thus needed to make a separate EFI partition with grub on it, my old system used legacy boot, so I didn't know about about this at the time but that's irrelevant.
For making the EFI partition I used this, chrooted into my new root partition, since my old disk wasn't booting with EFI I booted from EFI USB drive to do this.
After rebooting everything worked fine, but after the latest linux update I couldn't boot anymore. I had 5.2.11 installed but GRUB was still booting 5.2.9 so all my kernel modules stopped loading -> couldn't mount home -> failed to boot.

This is the menu entry generated by grub:

        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod f2fs
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root  8052b7f6-47a8-4906-ba7e-ae257abd4c0d
        else
          search --no-floppy --fs-uuid --set=root 8052b7f6-47a8-4906-ba7e-ae257abd4c0d
        fi
        echo    'Loading  linux kernel ...'
        linux   /boot/vmlinuz-linux root=UUID=8052b7f6-47a8-4906-ba7e-ae257abd4c0d rw  quiet
        echo    'Loading initial ramdisk ...'
        initrd   /boot/initramfs-linux.img

Updating the kernel successfully builds /boot/vmlinuz-linux and /boot/initramfs-linux.img. I don't know how to check if /boot/vmlinuz-linux is actually the correct kernel, but I assume so since pacman build them successfully.
The efi partition is not mounted when updating, but as far as I know that is not needed, /boot is just on the root partition.

Is anyone able to help me with this? It would be greatly appreciated.

Last edited by jaap aarts (2019-09-14 20:29:13)

Offline

#2 2019-09-14 19:25:43

ua4000
Member
Registered: 2015-10-14
Posts: 402

Re: [SOLVED] GRUB boots old kernel after disk migration

jaap aarts wrote:

, but I assume so since pacman build them successfully.

Probably in the wrong folder/partition/drive!
Search on all disks/partitions and folders for the 2nd set of kernel and initramfs.

Try this on the file to inspect:

$ file vmlinuz-linux
/boot/vmlinuz-linux: Linux kernel x86 boot executable bzImage, version 5.2.14-arch2-1-ARCH ...

And:
Did you use now legacy or efi boot ?
Did you follow https://wiki.archlinux.org/index.php/GRUB - which steps exactly ?

Offline

#3 2019-09-14 20:23:30

jaap aarts
Member
Registered: 2017-09-04
Posts: 30

Re: [SOLVED] GRUB boots old kernel after disk migration

Hi, thanks for the reply.

I wanted to know how to check the version of vmlinuz-linux before posting this but I couldn't find it, I checked and it does update those correctly.

I followed the instructions on that page as well, mostly just #Installation_2. AKA:

grub-install --target=x86_64-efi --efi-directory=/efi/ --bootloader-id=GRUB

For my own sanity I installed grub, this time without copy-pasting like done in the video, so only what is listed in the wiki. This time it upgraded the linux version on boot (I think) and it rebooted the correct kernel.
Maybe making copying the grub binary into a /efi/EFI/BOOT/BOOTX86.EFI, as instructed in the video, it boots some special thing which doesn't correctly detects the new kernel.

So it wasn't a wrong directory/anything(I think) nor some old kernel laying around(still wondering how it booted into the old kernel though).

Thanks for the response!
Everything works now, for some reason.

Last edited by jaap aarts (2019-09-14 20:29:44)

Offline

#4 2019-09-14 20:41:01

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: [SOLVED] GRUB boots old kernel after disk migration

This is why youtube guides are not supported here -- they are almost always outdated or just wrong. In the future please use the wiki if you want support here.


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

#5 2019-09-14 20:46:27

jaap aarts
Member
Registered: 2017-09-04
Posts: 30

Re: [SOLVED] GRUB boots old kernel after disk migration

I didn't think the extra step of making a new directory and copying a file would have affected the outcome.
I looked at the wiki and just thought "yeah, I did that" and I did, I just did a bit to much smile

Last edited by jaap aarts (2019-09-14 20:46:54)

Offline

Board footer

Powered by FluxBB