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).
If you’re pressed for time with these labs, I suggest that you run Lab 3 first. As you’ve read in the chapter, recompiling the kernel takes a long time. If you have a slower computer, some of the commands required to recompile the kernel take a while to complete. You can use this time to log into a different terminal and run the other labs in this chapter.
Lab 1 In this first lab, we’ll look at setting up automatic connections to a shared network directory. While this lab uses files described in Chapter 4, it is focused on shell configuration files. For the purpose of this lab, assume your username is vaclav and you’re mounting a shared NFS /mnt/inst directory from a remote computer with an IP address of 192.168.30.4. You’re going to mount it in vaclav’s home directory, in a blank directory named inst.
Select the regular user of your choice. That user should have files such as .bashrc and .bash_logout.
Find a shared directory on a remote computer.
Set up a local directory for that user as a mount point.
Configure commands for that user to mount and umount that remote directory. Make sure those commands run only when that user logs into his or her account.
Lab 2 In this lab, we will test the quotas created in this chapter. You’ll use the basic quota settings described in this chapter, and then copy files to fill up the home directory of a user who has a quota applied. The steps required for this lab are straightforward.
Set up quotas on the local computer. Use the criteria described earlier in this chapter. If you don’t have a separate /home directory partition, you can set up quotas on the top-level root directory (/).
Once you’ve set quotas in your /etc/fstab configuration file, remember to remount the partition where you’ve created a quota. Alternatively, you could reboot Linux, but that would take time that you may not be able to spare during either of the Red Hat exams.
Set up a quota for the user of your choice. Remember, when you use the edquota command on a specific user, you can edit the quota file directly using vi editor commands. Configure a hard and a soft limit for that user.
Log in as the user with the quota. Copy some large files to the home directory of that user.
Continue the copying process until you see a warning message. When you do, run the quota command. What do you see? Is there anything in the output that gives you warning that you’ve exceeded the quota?
Copy some additional files until you see a “Disk quota exceeded” message. Run the quota command again. What do you see?
Delete some files from that user’s home directory—at least enough to get the files under the quota limits.
Lab 3 This lab is more of a detailed kernel-building exercise than a typical lab in this book. The exercise will include concise steps on how to configure, install, and test a new kernel. While the Red Hat Exam Prep guide no longer specifies that you have to know how to recompile the kernel, it is something you will need to do at some point in time as a Linux system administrator. See the Lab Answer section at the end of this chapter for the exercise.
Lab 4 In this fourth lab, you’ll be updating your kernel from another source. One proviso—this lab will work only if there is a Red Hat RPM kernel file that is a later version from what is already installed on your computer. If you’re running RHEL 3, you can still download and use one of the Fedora development kernel RPMs for the purpose of this exercise. (While there are no guarantees, the Fedora development kernel available as of this writing works fine on my RHEL 3 computer. However, there have been reported issues with various video cards and printer configurations.)
Check download.fedora.redhat.com or one of the mirrors listed online at fedora.redhat.com /download/mirrors.html.
Download the new kernel to the /tmp directory.
Back up your current /etc/grub.conf configuration file, as well as the current files in your boot directory, in case something goes wrong.
Use the rpm -ivh kernelfile command to install the new kernel.
Observe the results. Check the files in /boot. Which files look like they’re duplicated but with a different version number?
Check your boot loader file. Assuming it’s GRUB, open the /etc/grub.conf file in a text editor. Change the defaultvariable in this file to point to the new kernel. If it’s LILO, remember to run lilo to record the change in the MBR.
Reboot your computer to test the new kernel.
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.