Page 1 of 1

lilo wrong kernel [solved] by using Grub2, so not really

Posted: 5. Aug 2012, 20:13
by mimosa
I have current installed in one partition alongside two other 13.37 Salixes. I am using the latest lilo, as available from source or in the current repo. When I run lilo -v from current, the 13.37 Salixes are set to boot from the current kernel, which of course isn't there, so nothing works. If I call lilo from 13.37, current tries to boot with 2.6.37.6, ditto. So at the moment if I want to switch between current and 13.37, I have to run lilo after booting into the other version, and then reboot.

I have tried editing lilo.conf to specify the right kernel (rather than just vmlinuz), but no luck.

This is all the more puzzling because I previously had Slitaz in the guest partition, and it had a 3 series kernel - no such problem. I may have been using the older lilo at that point, but I had to upgrade it from source when I upgraded the kernel in one of my Salixes. Again, there was no difficulty about correctly assigning the correct kernel to each install - it was just that the lilo in the 13.37 repos can't cope with some kernels because of a bug.

I'm posting here rather than to the mailing list because on balance, this looks like a problem I am having with lilo rather than anything to do with current.

Re: lilo wrong kernel [solved] by using Grub2, so not really

Posted: 5. Aug 2012, 22:30
by mimosa
Grub2 gets it right - though I have a lot to learn about how to tidy up the result.

However, the question remains as to what went wrong with Lilo.

Re: lilo wrong kernel [solved] by using Grub2, so not really

Posted: 5. Aug 2012, 23:33
by gapan
Short answer: use lilosetup, it gets it right.

Long answer: lilo needs to be able to read the kernels you're supposed to use at the time that you run it. If the kernels are on a different partition, which is not mounted, it cannot read them. Same thing happens if the partitions are mounted, but lilo is told to not look at those mounted partitions, but rather at your normal /boot partition/directory.

So, assuming /dev/sda1 is your currently running system and /dev/sda2 holds another salix (or any other distro), this is wrong:

Code: Select all

image = /boot/vmlinuz
root = /dev/sda1
label = Salix-13.37
read-only

image = /boot/vmlinuz
root = /dev/sda2
label = Salix-13.1
read-only
because both entries point to the same kernel, the one in your current /boot/vmlinuz.

The way to do it right, would be to mount the /dev/sda2 partition and use that mountpoint to point lilo to the right kernel

Code: Select all

image = /boot/vmlinuz
root = /dev/sda1
label = Salix-13.37
read-only

image = /mnt/sda2/boot/vmlinuz
root = /dev/sda2
label = Salix-13.1
read-only

Re: lilo wrong kernel [solved] by using Grub2, so not really

Posted: 5. Aug 2012, 23:52
by mimosa
Gapan, that's a very helpful explanation - and I'll give it a try. Even should lilosetup fail for some reason, now I understand how to get it right by hand. :D