Kernel recompile - won't boot - howto fix?

Kernel recompile - won't boot - howto fix?

Post by DMI » Mon, 30 Jul 2001 09:15:50



I am running Red Hat 6.2 and it was working fine. I installed a new CDRW
drive so I was trying to get the necessary drivers installed and
compiled into the kernel. I was following the CD-Writing-HOWTO and other
documents I found on the net, but I was having trouble getting the drive
recognized by cdrecord -scanbus.

I noticed that the CD-Writing-HOWTO suggested that Red Hat users needed
to run mkinitrd with a command like:

mkinitrd --preload ide-cd initrd-2.2.14.img 2.2.14

I have never run mkinitrd when re-compiling kernels before so I'm not
sure when/if I need to do this. Now, my system won't boot. I was getting
kernel panics and Linux would hang.

I booted off my installation CDROM and ran "linux rescue" from the Red
Hat CD so I could try and fix this. I booted, mounted my linux
partition, and copied System.old to System.map, and vmlinuz.old to
vmlinuz, and tried to run lilo. I now get an error message from lilo
saying that vmlinuz is too big. I've tried to boot again, but now I get
no error message, Linux just hangs.

I didn't do a good job of keeping a copy of my old kernel around to boot
(other than the .old ones that were around). So now, I'm basically
screwed. How can I get a bootable kernel back on my system so I can get
the system up and running again? Is is possible to boot off the CDROM
and mount my /dev/hdb1 to / and recompile like normal?

I need some serious help here. I've used Linux for years but never run
into a problem this bad.

David

 
 
 

Kernel recompile - won't boot - howto fix?

Post by Michael Kell » Mon, 30 Jul 2001 10:30:47



>I need some serious help here. I've used Linux for years but never run
>into a problem this bad.

Hi David.  You should be able to mount the Linux partition on
the HD under the ram disk image when you boot off CD or
Diskette.  If you don't remember the partition number use
fdisk once you've booted the Linux CD to display partition
information.  Then you should be able to mount the Linux
boot partition under /mnt

As a precaution when compiling your own kernels it's
good to have lilo set up to boot multiple kernels.  Keep
one that you know will work as the default and the
new one you're working on as an optional boot.

I think there are HOWTOs advising how to set up
the lilo.conf files for multiple kernel setups.

Mike

--

"A man's only as old as the woman he feels."
    -- Groucho Marx

 
 
 

Kernel recompile - won't boot - howto fix?

Post by DMI » Mon, 30 Jul 2001 13:08:32



> Hi David.  You should be able to mount the Linux partition on
> the HD under the ram disk image when you boot off CD or
> Diskette.  If you don't remember the partition number use
> fdisk once you've booted the Linux CD to display partition
> information.  Then you should be able to mount the Linux
> boot partition under /mnt

I've been able to mount my hard drive partition under mnt, but what next?
How do I get a functioning kernel onto the hard drive now that I have it
mounted? I don't seem to have any good backups and I don't know where the
kernel from the CDROM is stored.

Quote:> As a precaution when compiling your own kernels it's
> good to have lilo set up to boot multiple kernels.  Keep
> one that you know will work as the default and the
> new one you're working on as an optional boot.

I've seen that advice before, but have been lazy about implementing it. I
will be sure to do it in the future.

David

 
 
 

Kernel recompile - won't boot - howto fix?

Post by Tony Yi » Tue, 31 Jul 2001 20:47:48


David,

If you have the source in your /usr/src/linux-2.2.14
(you may have something attach the 2.2.14, e.g. 2.2.14-5,
so all of the following you just attach -5 at the end).
You can find default config files from this directory,
/usr/src/linux-2.2.14/config; during a RH install process,
RH pick one of the kernel that build by one of the config file.
During the install process it detect your CPU, (386,Pentium,
or PII or above) or if it is more than 2 CPU then it decide
which kernel it should copy to your hard disk's /boot and
which moudle it should copy to /lib/modules/2.2.14

0. Make sure you do a make mrproper first, to clean up.
So you just pick one of the configure file match your CPU and
1. copy it to /usr/src/linux-2.2.14/.config
   then you should be able to follow the
2. make dep; make bzImage; make modules; make modules_install
it should create /lib/modules/2.2.14 for you.
I perfer manually copy the compiled kernel to /boot
3. cp /usr/src/linux-2.2.14/arch/i386/bzImage /boot/vmlinuz-2.2.14
4. cp /usr/src/linux-2.2.14/System.map /boot/System.map-2.2.14
  (assume you know how to do the following two before the next two steps
  rm /boot/System.map
  rm /boot/vmlinuz
  )
5. ln -s /boot/System.map-2.2.14 /boot/System.map
6. ln -s /boot/vmlinuz-2.2.14 /boot/vmlinuz
7. mkinitrd 2.2.14 initrd-2.2.14.img

8. and modify your /etc/lilo.conf like this
-----------------------------------------
boot=/dev/hda5
map=/boot/map
install=/boot/boot.b
prompt
timeout=150
linear
default=linux-2214
message=/boot/message

image=/boot/vmlinuz-2.2.14
        label=linux-2214
        initrd=/boot/initrd-2.2.14.img
        read-only
        root=/dev/hda5
--------------------------------------------
9. run lilo -v before you do a reboot.
10. sync
11. reboot

Let me know if you can/can't get it to work.
And may be which step fail.

Good luck :)

Tony.



> > Hi David.  You should be able to mount the Linux partition on
> > the HD under the ram disk image when you boot off CD or
> > Diskette.  If you don't remember the partition number use
> > fdisk once you've booted the Linux CD to display partition
> > information.  Then you should be able to mount the Linux
> > boot partition under /mnt

> I've been able to mount my hard drive partition under mnt, but what next?
> How do I get a functioning kernel onto the hard drive now that I have it
> mounted? I don't seem to have any good backups and I don't know where the
> kernel from the CDROM is stored.

> > As a precaution when compiling your own kernels it's
> > good to have lilo set up to boot multiple kernels.  Keep
> > one that you know will work as the default and the
> > new one you're working on as an optional boot.

> I've seen that advice before, but have been lazy about implementing it. I
> will be sure to do it in the future.

> David

 
 
 

1. Help: Trouble recompiling kernel, won't boot from new Kernel

I have two linux machines: one is an IDE system and the other is SCSI.

On the IDE machine, I have just upgraded from Kernel 1.2.11 to 1.2.13.
I got a new kernel source and renamed the old kernel directory tree to
something like linux.old. then I went through the entire proceedure:

make config
make dep
make clean
make zImage

after the compile I did :

cd /usr/src/linux/arch/i386/boot
rdev -R zImage 1
rdev -v zImage -1
rdev zImage /dev/hda2
fdformat /dev/fd0H1440
cat zImage > /dev/fd0H1440

Everything *seemed* to work fine. BUT when I tried to boot off of the
hard disk and not the floppy, it clearly came up with Kernel 1.2.11,
which was the old one. When I booted from the floppy, it came up with
kernel 1.2.13, which was the new one .

There must be an additional step to set LILO to boot from the new
kernel, but I can find nothing about it in the documentation.

Also, with my SCSI machine, I have loaded linux for the first time. I
went through the whole proceedure and recompiled the kernel just as
above, with my other machine.

The problem is that when I boot up the system goes into AUTOPROBE. It
taked about 7 minutes for this to complete before the system fully
boots. I went through the recompile process again and was very careful
to NOT include the following step which looked suspicious to me:
"Probe all LUNs on each SCSI device".

I can boot from the hard disk without this happening. I am now
suspicious that I am not really booting from the recompiled kernel.

Please help

thank you

Tom


2. Bill Gates to resign from MS

3. SLS 1.05 - recompiled kernel won't boot

4. OpenGL - any supported hardware yet?

5. SLS: Recompiled Kernel Won't Boot! :-(

6. MS bus mouse w/ svgalib

7. Won't boot after kernel recompile

8. Dynamic DNS/DHCP for Linux?

9. where's HOWTO on slackware kernel recompile?

10. after an ABORTED kernel recompile, my busmouse SUDDENLY won't work !!!

11. Recompiled my Kernel, but X won't start anymore..help please!!?

12. RH8 kernel won't recompile

13. Nic card won't activate after 2.4.18-14 kernel recompile