Red Hat Linux 7.2: The Official Red Hat Linux Customization Guide | ||
---|---|---|
Prev | Chapter 23. Ugrading the Kernel | Next |
Now that you have the new kernel installed, you must configure the boot loader to boot the new kernel. This is a crucial step. If you do not perform this step or if you perform it incorrectly, you will not be able to boot your system. If this happens, boot your system with the boot diskette you created earlier and try configuring the boot loader again.
In order to provide a redundant boot source to protect from a possible error in a new kernel, you should keep the original kernel available. During the installation of Red Hat Linux 7.2, you had the option to choose either LILO or GRUB as your boot loader. Refer to the appropriate section that follows.
If you selected GRUB as your boot loader, you need to modify the file /boot/grub/grub.conf. The default GRUB configuration file looks similar to the following:
# NOTICE: You have a /boot partition. This means that # all kernel paths are relative to /boot/ default=0 timeout=30 splashimage=(hd0,0)/grub/splash.xpm.gz title Red Hat Linux (2.4.7-3) root (hd0,0) kernel /vmlinuz-2.4.7-3 ro root=/dev/hda3 initrd /initrd-2.4.7-3.img |
If you created a separate /boot partition, the paths to the kernel and initrd image are relative to the /boot partition.
To add your new kernel to GRUB, copy the existing section to a new one and modify it to boot your new kernel image (and initrd image if you have any SCSI devices and created an initrd image). Be sure the title of the new section is different from the title of the section to boot the old kernel. By default, Red Hat Linux uses linux and the kernel version in parentheses to differentiate between different kernels for GRUB to boot. In our example, the new /boot/grub/grub.conf file would look like the following:
# NOTICE: You have a /boot partition. This means that # all kernel paths are relative to /boot/ default=0 timeout=30 splashimage=(hd0,0)/grub/splash.xpm.gz title Red Hat Linux (2.4.7-3-jul2001) root (hd0,0) kernel /vmlinuz-2.4.7-3-jul2001 ro root=/dev/hda3 initrd /initrd-2.4.7-3-jul2001.img title Red Hat Linux (2.4.7-3) root (hd0,0) kernel /vmlinuz-2.4.7-3 ro root=/dev/hda3 initrd /initrd-2.4.7-3.img |
The default boot entry is set to number 0. To make your new kernel the default, either place its section first or change the default entry number to the appropriate number (remember that it starts counting with 0).
From now on, when the system boots you will see Red Hat Linux
(2.4.7-3-jul2001) and Red Hat Linux
(2.4.7-3) as GRUB boot options. To boot the
default kernel, press
You can begin testing your new kernel by rebooting your computer and watching the messages to ensure your hardware is detected properly.
To configure LILO to boot the new kernel, you need to update the /etc/lilo.conf file and run the command /sbin/lilo.
The default /etc/lilo.conf file looks similar to the following:
boot=/dev/hda map=/boot/map install=/boot/boot.b prompt timeout=50 message=/boot/message linear default=linux image=/boot/vmlinuz-2.4.7-3 label=linux initrd=initrd-2.4.7-3.img read-only root=/dev/hda5 |
To add your new kernel to LILO, copy the existing section to a new one and modify it to boot your new kernel image (and initrd image if you have any SCSI devices and created an initrd image). Also, rename the label of the old kernel to something such as linux-old. Your /etc/lilo.conf should look similar to the following:
boot=/dev/hda map=/boot/map install=/boot/boot.b prompt timeout=50 message=/boot/message linear default=linux image=/boot/vmlinuz-2.4.7-3-jul2001 label=linux initrd=initrd-2.4.7-3-jul2001.img read-only root=/dev/hda5 image=/boot/vmlinuz-2.4.7-3 label=linux-old initrd=initrd-2.4.7-3.img read-only root=/dev/hda5 |
To activate your changes, run the command /sbin/lilo. If all goes well, you will see output similar to the following:
Added linux * Added linux-old |
The * after linux means that the section labeled linux is the default kernel that LILO will boot.
From now on, when the system boots you will see linux and linux-old as LILO boot options.
To boot the new kernel (linux)
simply press
You can begin testing your new kernel by rebooting your computer and watching the messages to ensure your hardware is detected properly.