Home arrow Site Administration arrow Page 2 - Kernel, Cron, and User Administration, Part 2

Updating Your Boot Loader - Administration

Today, continue on your path to RHCE certification. Learn about creating a new kernel the easy way, kernel sources, recompiling a kernel, and the cron and at systems. Take notes, because there's a test at the end. This comes from chapter five of Red Hat Certified Engineer Linux Study Guide (Exam RH302), fourth edition, by Michael Jang. (McGraw-Hill/Osborne, 2004, ISBN: 0-07-225365-7).

TABLE OF CONTENTS:
  1. Kernel, Cron, and User Administration, Part 2
  2. Updating Your Boot Loader
  3. The Kernel Source Tree and Documentation
  4. The Kernel RPMs
  5. GUI Kernel Source Management
  6. The Linux Kernel tar File
  7. Understanding Kernel Configuration Options
  8. Compiling and Installing a Custom Kernel
  9. The cron and at Systems
  10. Setting Up cron for Users
  11. Certification Summary
  12. Self Test
  13. Lab Questions
  14. Self Test Answers
  15. Lab
By: McGraw-Hill/Osborne
Rating: starstarstarstarstar / 7
October 06, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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 GRUB

Look 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):

title Red Hat Enterprise Linux ES (2.4.21-4.EL)
  root (hd0,0)
  kernel /vmlinuz-2.4.21-4.EL ro root=LABEL=/
  initrd /initrd-2.4.21-4.EL.img
title DOS
  rootnoverify (hd0,1)
  chainloader +1

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:

title Red Hat Enterprise Linux ES (2.4.21-4.EL)
  root (hd0,0) 
  kernel /vmlinuz-2.4.21-4.EL ro root=LABEL=/
  initrd /initrd-2.4.21-4.EL.img
title Red Hat Enterprise Linux ES (2.4.21-4.ELcustom)
  root (hd0,0)
  kernel /vmlinuz-2.4.21-4.ELcustom ro root=LABEL=/
  initrd /initrd-2.4.21-4.ELcustom.img

title DOS
  rootnoverify (hd0,1)
  chainloader +1

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

The GRUB Menu

Updating LILO

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:

image=/boot/vmlinuz-2.4.21-4.EL 
  label=linux
  initrd=/boot/initrd-2.4.21-4.EL
  read-only
  append="root=LABEL=/"

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.

image=/boot/vmlinuz-2.4.21-4.EL
  label=linux
  initrd=/boot/initrd-2.4.21-4.EL
  read-only
  append="root=LABEL=/"
image=/boot/vmlinuz-2.4.21-4.ELcustom
  label=linux
  initrd=/boot/initrd-2.4.21-4.ELcustom
  read-only
  append="root=LABEL=/"

Save this file, then run the lilo -v command. The output should resemble the following:

LILO version 21.4-4, Copyright (C) 1992-1998 Werner Almesberger
'lba32' extensions Copyright (C) 1999,2000 John Coffman

Reading boot sector from /dev/hda
Merging with /boot/boot.b
Mapping message file /boot/message
Boot image: /boot/vmlinuz-2.4.21-4.EL
Mapping RAM disk /boot/initrd-2.4.21-4.EL
Added linux *
Boot image: /boot/vmlinuz-2.4.21-4.ELcustom
Added newLinux
Backup copy of boot sector in /boot/boot.0300
Writing boot sector.

When you reboot, LILO will wait for you to enter a label, in this case, either linux or newLinux.

EXAM WATCH! Although there are references to both GRUB and LILO in the RHCT and RHCE exam curricula, Red Hat is focusing on GRUB and has “deprecated” LILO. Therefore, I believe you can expect to work with GRUB on the Red Hat exams.

Kernel Sources

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.

EXAM WATCH! Fortunately, the Red Hat exams no longer specify requirements to recompile the Linux kernel. Nevertheless, it is a very important skill for any Linux administrator.

This is part one from the fifth chapter of Red Hat Certified Engineer Linux Study Guide (Exam RH302), fourth edition, by Michael Jang. (McGraw-Hill/Osborne, 2004, ISBN: 0-07-225365-7). Check it out at your favorite bookstore today. Buy this book now.



 
 
>>> More Site Administration Articles          >>> More By McGraw-Hill/Osborne
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SITE ADMINISTRATION ARTICLES

- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: