Today, get started with your RHCE certification. Learn about shell configuration files, setting up and managing disk quotas, and the basics of the kernel. 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).
There are a number of different kernels included with the RHEL 3 installation files. You can and should install the kernel best suited to your system. I briefly describe available RHEL 3 kernels in Table 5-1. The ďELĒ in each of these kernels refers to their customization for Red Hat Enterprise Linux. The version numbers shown is what was released with RHEL 3. If youíve used the Red Hat update agent, your kernel version number may vary.
Table 5-1Available Red Hat Enterprise Linux 3 Kernels (and Related Packages)
Suitable for PCs with a single AMD Athlon CPU.
Designed for PCs with a single Intel CPU.
The Athlon kernel with additional unsupported modules.
The Intel kernel with additional unsupported modules.
Kernel used only during the RHEL 3 installation process.
Supports multiple CPUs and systems with more than 4GB of RAM.
The hugemem kernel configured with additional untested kernel modules.
Adds PCMCIA (PC Card) modules to your current kernel.
The symmetric multiprocessing (SMP) kernel suitable for multi-CPU AMD Athlon systems. Also supports more than 4GB of RAM.
The symmetric multiprocessing (SMP) kernel suitable for multi-CPU Intel systems. Also supports more than 4GB of RAM.
The SMP kernel with additional untested kernel modules for Athlon CPUs.
The SMP kernel with additional untested kernel modules for Intel CPUs.
Includes the source code for the RHEL 3 kernel.
This is just a short list of kernels available for RHEL 3. As the Red Hat exams assume the use of standard PCs with a single CPU, Iíve limited the list in Table 5-1 to such kernels. For more information on RHEL 3 kernels available for multi-CPU or higher-end CPUs, refer to the RHEL 3 documentation available online from http://www.redhat.com/docs/manuals/enterprise/.
The /boot Partition
The Linux kernel is stored in the partition with the /boot directory. New kernels must also be transferred to this directory. By default, RHEL 3 configures a partition of about 100MB for this directory. This provides enough room for your current kernel plus several additional upgraded kernels.
The /proc Filesystem
The /proc directory is based on a virtual filesystem; in other words, it does not include any files that are stored on the hard drive. But it is a window into what the kernel sees of your computer. Itís a good idea to study the files and directories in /proc, as it can helpyou diagnose a wide range of problems. Figure 5-6 shows the /proc from a typical RHEL 3 computer.
Figure 5-6A Red Hat Enterprise Linux 3 /proc directory
The numbered items are based on process IDs. For example, the process ID of init is 1. The files in this directory include the memory segments that make up the active process. The contents of each of these files include the active memory for that process.
The other items in the listing are files and directories that correspond to configuration information for components such as DMA channels or whole subsystems such as memory information.
Take a look at some of these files. For example, the /proc/meminfo file provides excellent information as to the state of memory on the local computer, as shown in Figure 5-7. It can help you determine if RHEL 3 is having trouble detecting all of the memory on your computer.
It can also help you measure the current memory state of your system. For example, if your system is overloaded, youíll probably find very little free swap space. The HugePage settings are associated with systems with over 4GB of RAM.
Now you can examine how Linux looks at your CPU in the /proc/cpuinfo file, as shown in Figure 5-8. In this particular case, the cpu family information is important; the number 6 in this figure corresponds to a 686 CPU. Some of this information is available through the top utility.
Many programs are available that simply look at the information stored in /proc and interpret it in a more readable format. The top utility is a perfect example. It reads the process table, queries RAM and swap usage and the level of CPU use, and presents it all on one screen.
More importantly, there are kernel variables you can alter to change the way the kernel behaves while itís running. Sometimes itís appropriate to configure a Linux computer as a router between networks. By default, it does not forward TCP/IP information. You can confirm it with the following command:
# cat /proc/sys/net/ipv4/ip_forward 0
If your computer has two or more network cards, you may want to activate IPforwarding with the following command:
The following is another useful change to a proc kernel variable, which enables the use of TCP SYN packet cookies. These cookies prevent SYN flood attacks on your system, including the so-called ďping of death.Ē
# echo 1 >> /proc/sys/net/ipv4/tcp_syncookies
Managing /proc Graphically
There is a Red Hat graphical tool that you can use to manage /proc directories. Itís known as the Kernel Tuning tool, which you can start from a GUI command line with the redhat-config-proc command. For example, you can use it to set up IP Forwarding, as shown in Figure 5-9.
FIGURE 5-9 Tuning the kernel through /proc
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.