yokem55 Guru
Joined: 18 Apr 2002 Posts: 360 Location: Oregon
|
Posted: Fri Nov 22, 2002 6:57 am Post subject: KC1: Won't boot with new kernel |
|
|
Navigation: [next KC2: devfs] [Kernel Compilation] [Table of Contents]
KC1: I made a mistake compiling my kernel and now my computer won't boot. What can I do now?
First of all, this isn't too big of a problem, so stay calm about this. You shouldn't have to reinstall Gentool from scratch, and repairing your system usually isn't much of a problem.
The first possible solution to this problem is to simply boot your system with your Gentoo installation boot cd, and then chroot into your existing system so that you can recompile your kernel again. To do this, start by booting your system with your Gentoo boot cdrom. Remember, you may have to change boot device order for your system in your bios. Once the CD has finished booting you will want to bring up the Gentoo install guide by entering the command Now you most certainly don't have to go through the whole install process again, so don't worry about that. We will simply go through only the segments of the install guide that are required to get the Gentoo on your hard drive up and running. You may want to have networking setup in case you have to download a different version of the kernel. So, to do this, you will have to load your appropriate kernel modules in section 3 and possibly section 4 of the install guide if you have a laptop, and go through the steps in section 5 set configure your network settings. Next, you will want to skip ahead in the install guide to section 7 to mount your Gentoo partitions into the filesystem. Once that is done, you can skip ahead again to the end of section 9, and only follow the instructions for chrooting your system, skipping the instructions on unpacking a stage tarball. Once this is done, you are "inside" your gentoo installation.
The next possible solution to this problem is only possible if you'd previously had a working kernel that you had backed up as "bzImage.old" before installing your new "bzImage" into your /boot directory and if you are using the GRUB bootloader. It is possible to still boot your system with this old kernel by editing the GRUB configuration at boot time to boot your old kernel. As far as I know, Lilo does not support editing its configuration on the fly at boottime.
To do this, start by turning on your system as normal, but when GRUB brings up your boot menu, highlight the Gentoo entry and press the "e" key. Now, using the up and down arrow keys, highlight the line that looks like this:
Code: | kernel /boot/bzImage root=/dev/hda3 | and press the "e" key again. Change this line so that instead of pointing to your non-functional "bzImage" kernel, it points to your old, working kernel, possibly named "bzImage.old" or whatever name you gave your old kernel when you backed it up. Now press the "Esc" key and then press the "b" key, and your system should now boot with your old kernel. One thing to note however: the editing of the boot config while within GRUB is not permanent. Unless you rename your backup kernel back to "bzImage" or you edit your menu.lst file manually once your sytem is up and running again, GRUB will continue to try to boot your non-working kernel.
Now, once you have completed either method, and your system is up and running in your Gentoo install, you can go ahead and rebuild your kernel again.
Last edited by yokem55 on Sat Nov 23, 2002 4:51 am; edited 8 times in total |
|