Site Administration Page 2 - Kernel, Cron, and User Administration, Part 2 |
If properly configured, the Red Hat kernel that you install should automatically update your boot loader. But as a RHCT or RHCE, you need to know how to check. If the code described in this chapter has not been added, you’ll need to know how. Whether you’re using GRUB or LILO, it is advisable to keep your old kernel in case something goes wrong. So you’ll be adding a stanza to either /etc/grub.conf or /etc/lilo.conf. In either case, the changes that you’ll make will be as if you’re setting up two different operating systems. Updating GRUBLook at your /etc/grub.conf file. If you have Linux on your system and use GRUB, you should already have a stanza that points to the appropriate locations for your original Linux kernel and Initial RAM disk. For example, here is an excerpt from my RHEL 3 /etc/grub.conf file (which includes a dual-boot configuration with Microsoft Windows):
In Red Hat Enterprise Linux, the vmlinuz and initrd files are already in the /boot directory. Since you’ve copied the revised kernels to the same directory, all you need is a second stanza that points to your revised files. When I revised my kernel earlier in this chapter, my EXTRAVERSION variable in /usr/src/linux-2.4/Makefile was -4.ELcustom. The changes are in bold:
Since you don’t need to load /etc/grub.conf into the MBR, no further action is required. The resulting GRUB menu looks like Figure 5-10. Note how the original kernel is set as the default. If you’ve watched closely, you’ll note that in /etc/grub.conf, the value of default was changed from 0 to 1. If you want to set the default to the new kernel, change the value of default back to 0. Figure 5-10 GRUB menu with original and recompiled kernels
Alternatively, if you’re using LILO as a boot loader, you’ll need to revise /etc/lilo.conf. Add a stanza that points to the new kernel. Take a look at the following excerpt from /etc/lilo.conf:
From this information, you can see that the original kernel is called vmlinuz-2.4.21-4.EL. Assume LILO resides on the MBR and controls the boot process. Now add another stanza for the new kernel.
Save this file, then run the lilo -v command. The output should resemble the following:
When you reboot, LILO will wait for you to enter a label, in this case, either linux or newLinux.
One of the strengths of Linux is the ease with which you can customize your kernel to precisely meet your needs. But before you can start this process, you need the Linux kernel source code. While references to recompiling the kernel have been removed from the Red Hat exam requirements, you may still need to find kernel modules and configuration files, which I cover in this section.
blog comments powered by Disqus |