Red Hat Bugzilla – Bug 6907
Botched kernel upgrade
Last modified: 2008-05-01 11:37:52 EDT
Installing redhat 6.0 and then upgrading the kernel to
2.2.5-22smp screwed up /etc/lilo.conf making the system
unbootable. Worse the upgrade failed to make a new
initrd, deleted the old kernel, and deleted the old
modules. This left the system not only unbootable but
incompatible with the rescue disks and the install disks.
Redhat has a very bad habit of deleting old stuff which
you still need when you do an upgrade. And they botched the
Any competent system manager always keeps at least one old
to boot from when they do an upgrade. Also, it is good to
loadable kernel modules from at least the current kernel
and the one which corresponds to the prior kernel and the
which correspond to the version of the kernel on the install
you have to boot from that) and rescue disk.
Kernel upgrades should also rewrite lilo.conf so that
the old kernel becomes, say, oldlinux and the new one
becomes linux and the default. Actually, the best
way to do this is always make a boot name be of the form
linux-X.Y.Zpdq and have linux be an alias for the most
recent ones. Never delete an old kernel, initrd, or modules
without explicit user choice. This is could be as simple as
appending the new configuration to /etc/lilo.conf and then
running it through
sed -e 's/alias=linux//'.
A little more work is needed to convert any lilo.conf files
created using your oldconvention, such as
sed -e 's/label=linux/label=linux-unknown-version/
If the system is availible, sed won't be availible but you
can safely skip this step and just create a decent lilo.conf
by the new convention.
# tried to reboot system. reboot failed misserably
# can't use the custom boot floppy because redhat install
# when it tried to create it.
# tried rescue disk. rescue disk fails even more miserably.
# inserted redhat 6.0 boot disk
# boot: linux root=/dev/hda1 initrd=
# actually boots, but modules are screwed up and not
# because modules are screwed up. The initrd= trick
# is needed to keep the install program from running but
# you lose all the handy modules (and it won't work for
# scsi devices.
# The problem seems to be that /etc/lilo.conf was for
# but the kernel has been upgraded to 2.2.5-22smp and
# redhat, YET AGAIN, deletes stuff you still need when it
# does an upgrade.
# Okay, we will rebuild lilo.conf and rerun lilo
# guess what, there is no initrd that matches any version of
# the kernel that hasn't been deleted. Well, ok, we just
# run mkinitrd, right? wrong! mkinitrd won't run because
# it needs a loopback device which won't work because
# are screwed up.
# Blood pressure reaching dangerous levels
# edited lilo.conf to use /boot/vmlinuz-2.2.5-22smp with
# NO initrd, ran lilo and rebooted.
# now we build the initrd now that we are running a kernel
# which can run the modules which stillexist on the system.
mkinitrd /boot/initrd-2.2.5-22smp.img 2.2.5-22
Assigned to dledford
This is how rpm's -U upgrade works; it removes the old package.
You're correct in that you normally don't want to use
this for kernels; see the Kernel-Upgrade-HOWTO.