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

Lab Answers - 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

Lab 1
This lab has two purposes: it is designed to help you understand mounted network directories and the login process. You can substitute the user, the shared network directory, and directories of your choice. But based on the premises in this lab, I would take the following steps:

  1. Log in as user vaclav. Create the specified directory. For this lab, you would use the mkdir /home/vaclav/inst command.

  2. Test the network connection. Mount the remote NFS directory on the directory that you just created. For this lab, use the following command:

    # mount -t nfs 192.168.30.4:/mnt/inst /home/vaclav/inst

  3. Run the mount command by itself. If youíve successfully mounted to the shared directory, you should see it at the end of the list of mounted directories.

  4. Unmount the network connection. For this lab, you would use the following command:

    # umount /home/vaclav/inst

  5. Add the commands specified from steps 2 and 4 to the local .bashrc and .bash_logout configuration files. Remember, since these files start with a dot, they are hidden.

  6. Test the result. Log out and log back in. Check your mounted directories. If the command in .bash_logout does not work, youíll probably see the shared directory mounted multiple times.

Lab 2
The purpose of this lab is to get you some more practice with creating quotas for users. Itís quite possible that youíll have to configure quotas on the Red Hat exams. While you may not have to test quotas in the way described in this lab, it will help you become familiar with the error messages that youíll see when you exceed a hard and then a soft quota limit.

Lab 3
Before we can build a new kernel, we have to ensure we have all the correct RPM packages. You could do so by checking a list of RPMs as described. Alternatively, you can start the Package Management utility with the redhat-config-packages command. From this GUI utility, make sure you have the Kernel Development package group installed. As with the rest of this chapter and the Red Hat exams,

this assumes that you have a PC with a 32-bit Intel type CPU. The procedures for other CPUs vary and are not, as of this writing, covered on the Red Hat exams. The following list of RPMs are associated with the source code:

kernel-source-*
glibc-kernelheaders-*
glibc-devel-*
cpp-*
ncurses-*
ncurses-devel-*
binutils-*
gcc-*

  1. When you install RHEL 3, youíve probably already installed most of these packages. Alternatively, it may be faster to install the Kernel Development package group using the Package Management utility. This utility automatically takes care of any dependencies.

  2. Navigate to the /usr/src directory with the cd /usr/src command. Run the ls -l command. You should see a link between the linux-2.4 directory and the location of your source code files. In RHEL, that is by default the /usr/src/linux-2.4.21-4.EL directory.

  3. Navigate to the /usr/src/linux-2.4 directory. Youíll be running the remaining kernel configuration commands from this directory.

  4. Set up a unique name for the kernel that youíre about to modify. Open the Makefile file in a text editor. Look for the EXTRAVERSION variable. Red Hat adds this variable as a suffix to the recompiled kernel. Modify this variable as desired; save and exit from Makefile.

  5. Jot down the value of the EXTRAVERSION variable here: ______________

  6. Determine the correct CPU on your hardware. Use the command

    # cat /proc/cpuinfo

  7. Jot down the CPU model name here: ________________

  8. Run the ls /usr/src/linux-2.4/configs command. Youíll see a list of available default kernel configuration files. Find the file associated with your CPU. If your computer has more than one CPU, use the smp version of the kernel, if available. If your computer has more than 4 GB of RAM, use the hugemem version of the kernel, if available. Save it in the /usr/src/linux-2.4 /.config file.

  9. Make sure youíre in the /usr/src/linux-2.4 directory. Clean up any stray source code from previous kernel reconfigurations with the following command:

    # make mrproper

  10. Wait until the messages are complete. Problems are rare at this stage.

  11. Next, it is time to configure your kernel, using one of the three major tools:

    • make config A line-by-line tool that gives you a choice with all kernel options

    • make menuconfig A text-based menu that allows you to select just the changes you want

    • make xconfig A GUI interface that works only in the X Window System

  12. Set the processor type to match your hardware (for example, Pentium, Pentium II, Pentium III, Pentium IV).

  13. Return to the kernel configuration tool of your choice. Turn off all unneeded devices. Some possible unneeded devices are in the following categories:

    • ISDN Subsystem
    • I2O
    • Old CD-ROMs
    • Amateur Radio
    • Telephony Support
    • Symmetric Multiprocessing Support
    • MTR Memory Support

  14. Be sure to turn on Kernel Loadable Modules support.

  15. Save your changes and exit.

  16. When you save the new configuration, the kernel configuration tool overwrites your /usr/src /linux-2.4/.config file.

  17. Resolve all kernel dependencies (between sources) with the following command. This will produce a lot of output and may take several minutes.

    # make dep

  18. Prepare the source code directories to create the new kernel with the following command:

    # make clean

  19. Once your dependencies are resolved, itís time to build a new compressed kernel image, with the following command:

    # make bzImage

  20. This is the actual kernel build, which will take some time. You may take this opportunity to log into another terminal and run one of the other labs.

  21. The easiest way to see if the kernel build worked is to run the following command immediately after the messages from make bzImage command stop:

    # echo $? 0

  22. If you got a 0, everything worked (success). Any other result indicates a failure during the kernel build process. In that case, go back and reconfigure your kernel to make a configuration that works.

  23. Check for the existence of two new files. Run this command:

    # ls -l System.map arch/i386/boot/bzImage

    It should show you two files, a relatively small System.map and a much larger bzImage.

  24. Make the loadable modules that will be used by this kernel:

    # make modules

  25. Install the new custom kernel files into their correct locations and update your boot loader so that it knows about your new kernel. The make install command should perform all of these tasks.

  26. Check to see that the make install command worked. Based on the EXTRAVERSION variable that you set earlier, check your /boot directory. You should see at least a new initrd, System.map, and vmlinuz file in this directory, with this variable as a suffix. Otherwise, youíll need to copy these files yourself. Also, check your boot loader configuration file (/etc/grub.conf for the default GRUB boot loader).

  27. If the make install command didnít put an initial RAM disk (initrd) into the /boot directory, youíll have to create one with the following command (if your version and EXTRAVERSION variables are different, revise this command accordingly):

    # mkinitrd /boot/initrd-2.4.21-4.ELcustom1 2.4.21-4.ELcustom1

  28. Congratulations, you have just installed a custom kernel on your new system. As long as you also have your original kernel in your boot loader menu, test it out!

  29. Run the reboot command. You should see both kernels in the boot loader menu. Try your custom kernel!

Lab 4
Assuming everything works with the updated Red Hat RPM kernel package, you should not have to update anything, especially if your boot loader is GRUB. The steps described in the lab should help you confirm this through the appropriate configuration files on your RHEL 3 computer.

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: