Messed up Lilo with update
Help! I installed updates on current today. Since the kernel was updated, it asked me if I wanted to run lilo, to which I replied 'y'. I rebooted after that, but it still lists the old 4.4.12 kernels only, which are no longer installed, so they fail to boot. I had created a generic 4.4.12 kernel and modified lilo.conf, but I guess I made the mistake of thinking slackpkg would replace that file. My fault there for not checking.
So, my question is, is there a way I can boot from the new 4.4.13 huge kernel, even though it's not listed? Otherwise, how to recover? |
Quote:
I think removing the symbolic link and replacing it with one pointing to the huge kernel is all your going to have to do. However I haven't had to tinker with the lilo boot system on Slackware in a long time, normally when I do that it's on a RHEL node that uses grub |
Quote:
|
I put that disclaimer in there because I thought the "I'm often wrong" thing was a little too cryptic. Proceed with caution (that's how I'd proceed) and make sure you're in a position to do a full recovery if things go south (back up early, back up often).
|
No worries, I have all my files backed up and /home on a separate partition already, so reinstalling wouldn't be a huge issue. The main inconvenience would be reinstalling all my SBo packages.
|
Cool. Since you seem to know what you're doing,
You could always just download the source and build it. |
So I burned Eric's slackware64-live, booted, and mounted my files. However, I don't really see what the problem is. /boot/vmlinuz points to /boot/vmlinuz-huge-4.4.13 which was just installed, and one of my lilo entries is already for this kernel. It doesn't boot, though -- it gets through the BIOS check and then restarts. I was afraid that this might be the case...
Any ideas why this is happening? Otherwise, it looks I'm going to have to reinstall. :( |
Please post the contents of /etc/lilo.conf
|
Quote:
Code:
# LILO configuration file Code:
total 26M |
Hello,
Quote:
To fix that, you can proceed as below : 1. boot with the slackware install cd/dvd/usb 2. mount your root partition : Code:
$ mkdir /SYSMAIN.ROOT Code:
$ mount --bind /proc /SYSMAIN.ROOT/proc 5. edit /etc/lilo.conf, then replace references to vmlinuz-generic-4.4.12 by vmlinuz-generic-4.4.13 6. update lilo by running the command : Code:
$ lilo Code:
$ exit -- SeB |
montagdude --
Your /etc/lilo.conf still points at 4.4.12 which was removed because the kernel packages were replaced by `upgradepkg` ( as opposed to `installpkg` ) Been there done that. You're going to want to boot from a rescue medium to runlevel 3 Then mount /dev/sda6 and chroot it. Here is a handy doc: http://docs.slackware.com/howtos:sla...oot_from_media Note the notes about single-vs-multiple partitions and proceed accordingly And here is a short-n-sweet version that should work ( again assuming your single /dev/sda6 partition contains at least /bin/ and /sbin/ and /usr/ ) ... http://blog.tpa.me.uk/2009/09/29/re-...kware-boot-cd/ Only the huge kernel will boot until you make a new initrd file but you can save the Generic Kernel for after you've rebooted. Optional: edit your /etc/lilo.conf and fix the 4.4.12 label so that it says 4.4.13 ( the label is only a label ) IMPORTANT: after you've done the optional edits on /etc/lilo.conf, rerun /sbin/lilo After you've rerun /sbin/lilo, reboot. Select the huge kernel. It should boot now. Once you're up, proceed with the mkinitrd steps to install an initrd for 4.4.13 IMPORTANT: find out how to installpkg vs upgradepkg the kernel group for the Package Manager you're using. Always install Never upgrade kernels. This will leave you with a fallback ( or two ) if you do forget to run lilo after installing new kernels. HTH And welcome to my not-so-exclusive clubs: The Oops-I-Forgot-To-mkinitrd-before-I-reran-lilo Club and The Oops-I-Forgot-To-Run-lilo Club :) -- kjh [edit] Dang SeB ! You beat me to it again :) |
Thanks for your help, guys. I got it working again. I knew about chroot buy hasn't ever used it before -- that is an awesome tool!
What I still don't understand is why the second kernel in lilo.conf didn't work before, when it was pointing to the huge 4.4.13 image, especially since I did tell slackpkg to run lilo after the update. Any insight there? |
Quote:
Looking back at your file listing of /boot/ your pkg manager tool did an upgradepkg instead of an installpkg on the kernel. Note that there are no old 4.4.12 files in /boot/ at all ... UPGRADING the Kernel will always lead to trouble if you use Generic + an initrd file unless you mkinitrd ; edit lilo.conf ; run lilo every time there is a new Kernel. UPGRADING the Kernel MAY lead to trouble if there happen to be regressions in the Kernel where it won't work on your Hardware for some reason. OTOH if you always INSTALL your Kernels ( never UPGRADE ), you'll always have one-or-more fall-back Kernels to boot if things go south. Glad to help and HTH. -- kjh |
Did running lilo after slackpkg succeed? Because, it might've errorred out because /boot/vmlinuz-generic-4.4.12 no longer existed. If it did that, then it wouldn't have updated the MBR with the correct location of the new vmlinuz-huge-4.4.13 that the symlink of vmlinuz pointed to. The MBR would've still had the location of the old kernel, which had been removed when the kernel was updated.
For reasons like this, I always manually manage my kernels and lilo.conf. While it may normally be easier to let slackpkg do its thing with kernel updates, when you run into problems, it makes the extra effort of doing it manually worth it. I always installpkg my new kernels, which keep the old ones intact. Then I will just add a new entry in my lilo.conf for the new kernel, while keeping my old entry in place. Then, if my new kernel fails to boot, for whatever reason, then I can fall back on my old one without requiring a rescue disc. Once I've verified the new one boots properly, I can remove the old kernel, remove the entries in my lilo.conf, and then run lilo to save those entries. |
I see. Now I have a better understanding of how it works. Lilo didn't tell me about any errors (assuming slackpkg actually did run it when I selected 'y'), but that must be because it doesn't run it with the verbose option and/or redirects the error message (I'm not sure because I haven't looked). In any case, I will definitely be more careful about manually updating my configuration and running lilo in the future, and I'll plan to also keep working kernels as backup until the new one is verified.
The good thing about making mistakes and messing stuff up is that you get a chance to learn something new, and I've definitely done that here. Thanks again, everyone. |
All times are GMT -5. The time now is 07:12 PM. |