update-grub sets wrong kernel root upon second execution

Message
Author
calm-steam
Posts: 6
Joined: Tue Apr 22, 2025 9:19 pm

Re: update-grub sets wrong kernel root upon second execution

#11 Post by calm-steam »

fehlix wrote: Sat May 03, 2025 4:39 pm
calm-steam wrote: Sat May 03, 2025 4:17 pm On the second run, os-prober generates an entry for the second OS with the root of the first OS. Did you see this? This is clearly not how os-prober should behave, right? If it is "copying" the name right, why is it not copying also the path to root?
It takes the grub.cfg for the 2nd os (which is actually for the 1st os, and assumes the grub.cfg is correct build for the 2nd os).
I think os-prober is not prepared for the constellation you setup the partitions with luks+lvm with two os on one shared /boot.
I'm not sure I can help you further. The only advice I can give you try separate /boot, which may help.
It is much easier to edit manually on the spot on grub where I want to go in the drive, rather than installing a different partition just to have the right option available.

It is changing 'govinda-mx--linux' to 'govinda-avlinux', or viceversa, under root.

And this only happens on the second consecutive run of update-grub on the same OS.

User avatar
fehlix
Developer
Posts: 12798
Joined: Wed Apr 11, 2018 5:09 pm

Re: update-grub sets wrong kernel root upon second execution

#12 Post by fehlix »

calm-steam wrote: Sat May 03, 2025 4:50 pm It is changing 'govinda-mx--linux' to 'govinda-avlinux', or viceversa, under root.
If that's the only show-stopper for you, just use identical devicemapper names for both installs
by adjusting crypttab and make sure you regenerate initramfs.
This approach would probably make the entries boot as long as you have identical kernel installed for both.
calm-steam wrote: Sat May 03, 2025 4:50 pm And this only happens on the second consecutive run of update-grub on the same OS.
Yes, the root=/dev/mapper/... kernel parameter but also the menu entries "Labels" (under Advanced) have been taken from the grub.cfg and are wrong with the 2nd run, b/c of the shared grub.cfg between both installs.

Post Reply

Return to “General”