System Administration Guide

Red Hat Enterprise Linux 4

For Red Hat Enterprise Linux 4

Edition 2

Abstract

The System Administrator's Guide documents relevant information regarding the deployment, configuration and administration of Red Hat Enterprise Linux 4. It is oriented towards system administrators with a basic understanding of the system.

Introduction

Welcome to the System Administrators Guide.
The System Administrators Guide contains information on how to customize your Red Hat Enterprise Linux system to fit your needs. If you are looking for a step-by-step, task-oriented guide for configuring and customizing your system, this is the manual for you. This manual discusses many intermediate topics such as the following:
  • Setting up a network interface card (NIC)
  • Performing a Kickstart installation
  • Configuring Samba shares
  • Managing your software with RPM
  • Determining information about your system
  • Upgrading your kernel
This manual is divided into the following main categories:
  • Installation-Related Reference
  • File Systems Reference
  • Package Management
  • Network Configuration
  • System Configuration
  • System Monitoring
This guide assumes you have a basic understanding of your Red Hat Enterprise Linux system. If you need help installing Red Hat Enterprise Linux, refer to the Installation Guide. For more general information about system administration, refer to the Introduction to System Administration. If you need more advanced documentation such as an overview of file systems, refer to the Reference Guide. If you need security information, refer to the Security Guide.

1. Changes To This Manual

This manual has been reorganized for clarity and updated for the latest features of Red Hat Enterprise Linux 4. Some of the changes include:
Updated Kernel Modules and Manually Updating the Kernel Chapters
The Kernel Modules and the Upgrading the Kernel Manually chapters include updated information in regards to the 2.6 kernel. Special thanks to Arjan van de Ven for his hard work in helping to complete this chapter.
An Updated Network File System (NFS) Chapter
The Network File System (NFS) chapter has been revised and reorganized to include NFSv4. Special thanks to Steve Dickson for his hard work in helping to complete this chapter.
An Updated OProfile Chapter
The OProfile chapter has been revised and reorganized to include updated information in regards to the 2.6 kernel. Special thanks to Will Cohen for his hard work in helping to complete this chapter.
An Updated X Window System Chapter
The X Window System chapter has been revised to include information on the X11R6.8 release developed by the X.Org team.
Before reading this guide, you should be familiar with the contents of the Installation Guide concerning installation issues, the Introduction to System Administration for basic administration concepts, the System Administrators Guide for general customization instructions, and the Security Guide for security related instructions. This guide contains information about topics for advanced users.

2. More to Come

The System Administrators Guide is part of Red Hat, Inc's growing commitment to provide useful and timely support to Red Hat Enterprise Linux users. As new tools and applications are released, this guide will be expanded to include them.

2.1. Send in Your Feedback

If you find an error in the System Administrators Guide, or if you have thought of a way to make this manual better, we would love to hear from you! Please submit a report in Bugzilla (http://bugzilla.redhat.com/bugzilla/) against the component rh-sag.
Be sure to mention the manual's identifier:
rh-sag
By mentioning this manual's identifier, we know exactly which version of the guide you have.
If you have a suggestion for improving the documentation, try to be as specific as possible when describing it. If you have found an error, please include the section number and some of the surrounding text so we can find it easily.

Part II. File Systems

File system refers to the files and directories stored on a computer. A file system can have different formats called file system types. These formats determine how the information is stored as files and directories. Some file system types store redundant copies of the data, while some file system types make hard drive access faster. This part discusses the ext3, swap, RAID, and LVM file system types. It also discusses the parted utility to manage partitions and access control lists (ACLs) to customize file permissions.

Chapter 6. The ext3 File System

The default file system is the journaling ext3 file system.

6.1. Features of ext3

The ext3 file system is essentially an enhanced version of the ext2 file system. These improvements provide the following advantages:
Availability
After an unexpected power failure or system crash (also called an unclean system shutdown), each mounted ext2 file system on the machine must be checked for consistency by the e2fsck program. This is a time-consuming process that can delay system boot time significantly, especially with large volumes containing a large number of files. During this time, any data on the volumes is unreachable.
The journaling provided by the ext3 file system means that this sort of file system check is no longer necessary after an unclean system shutdown. The only time a consistency check occurs using ext3 is in certain rare hardware failure cases, such as hard drive failures. The time to recover an ext3 file system after an unclean system shutdown does not depend on the size of the file system or the number of files; rather, it depends on the size of the journal used to maintain consistency. The default journal size takes about a second to recover, depending on the speed of the hardware.
Data Integrity
The ext3 file system provides stronger data integrity in the event that an unclean system shutdown occurs. The ext3 file system allows you to choose the type and level of protection that your data receives. By default, the ext3 volumes are configured to keep a high level of data consistency with regard to the state of the file system.
Speed
Despite writing some data more than once, ext3 has a higher throughput in most cases than ext2 because ext3's journaling optimizes hard drive head motion. You can choose from three journaling modes to optimize speed, but doing so means trade-offs in regards to data integrity.
Easy Transition
It is easy to migrate from ext2 to ext3 and gain the benefits of a robust journaling file system without reformatting. Refer to Section 6.3, “Converting to an ext3 File System” for more on how to perform this task.
The following sections walk you through the steps for creating and tuning ext3 partitions. For ext2 partitions, skip the partitioning and formating sections below and go directly to Section 6.3, “Converting to an ext3 File System”.

6.2. Creating an ext3 File System

After installation, it is sometimes necessary to create a new ext3 file system. For example, if you add a new disk drive to the system, you may want to partition the drive and use the ext3 file system.
The steps for creating an ext3 file system are as follows:
  1. Create the partition using parted or fdisk.
  2. Format the partition with the ext3 file system using mkfs.
  3. Label the partition using e2label.
  4. Create the mount point.
  5. Add the partition to the /etc/fstab file.

6.3. Converting to an ext3 File System

The tune2fs program can add a journal to an existing ext2 file system without altering the data already on the partition. If the file system is already mounted while it is being transitioned, the journal is visible as the file .journal in the root directory of the file system. If the file system is not mounted, the journal is hidden and does not appear in the file system at all.

Note

A default installation of Red Hat Enterprise Linux uses ext3 for all file systems.
To convert an ext2 file system to ext3, log in as root and type,
/sbin/tune2fs -j <file_system>
where <file_system> is an appropriate LVM2 file system.
A valid LVM2 file system could be one of two types of entries:
  • A mapped device — A logical volume in a volume group, for example, /dev/mapper/VolGroup00-LogVol02.
  • A static device — A traditional storage volume, for example, /dev/hdbX, where hdb is a storage device name and X is the partition number.
Issue the df command to display mounted file systems. For more detailed information on the LVM file system, refer to Chapter 8, LVM Configuration.
For the remainder of this section, the sample commands use the following value:
 /dev/mapper/VolGroup00-LogVol02 
After doing this, be certain to change the partition type from ext2 to ext3 in the /etc/fstab file.
If you are transitioning your root file system, you must use an initrd image (or RAM disk) to boot. To create this, run the mkinitrd program. For information on using the mkinitrd command, type man mkinitrd. Also, make sure your GRUB configuration loads the initrd.
If you fail to make this change, the system still boots, but the file system is mounted as ext2 instead of ext3.

6.4. Reverting to an ext2 File System

Because ext3 is relatively new, some disk utilities do not yet support it. For example, you may need to shrink a partition with resize2fs, which does not yet support ext3. In this situation, it may be necessary to temporarily revert a file system to ext2.
To revert a partition, you must first unmount the partition by logging in as root and typing,
umount /dev/mapper/VolGroup00-LogVol02
Next, change the file system type to ext2 by typing the following command as root:
 /sbin/tune2fs -O ^has_journal /dev/mapper/VolGroup00-LogVol02
Check the partition for errors by typing the following command as root:
/sbin/e2fsck -y /dev/mapper/VolGroup00-LogVol02
Then mount the partition again as ext2 file system by typing:
mount -t ext2 /dev/mapper/VolGroup00-LogVol02/mount/point
In the above command, replace /mount/point with the mount point of the partition.
Next, remove the .journal file at the root level of the partition by changing to the directory where it is mounted and typing:
rm -f .journal
You now have an ext2 partition.
If you want to permanently change the partition to ext2, remember to update the /etc/fstab file.

Note

You can increase the size of an ext3 file system using ext2online. ext2online allows you to increase the size of an ext3 file system once it is mounted (online) and on a resizable logical volume. The root file system is set up by default on LVM2 logical volumes during installation.
Note that ext2online will only work on ext3 file systems. For more information, refer to man ext2online.

Chapter 7. Logical Volume Manager (LVM)

7.1. What is LVM?

LVM is a method of allocating hard drive space into logical volumes that can be easily resized instead of partitions.
With LVM, a hard drive or set of hard drives is allocated to one or more physical volumes. A physical volume cannot span over more than one drive.
The physical volumes are combined into logical volume groups, with the exception of the /boot/ partition. The /boot/ partition cannot be on a logical volume group because the boot loader cannot read it. If the root (/) partition is on a logical volume, create a separate /boot/ partition which is not a part of a volume group.
Since a physical volume cannot span over multiple drives, to span over more than one drive, create one or more physical volumes per drive.
Logical Volume Group

Figure 7.1. Logical Volume Group

The logical volume group is divided into logical volumes, which are assigned mount points, such as /home and / m and file system types, such as ext2 or ext3. When "partitions" reach their full capacity, free space from the logical volume group can be added to the logical volume to increase the size of the partition. When a new hard drive is added to the system, it can be added to the logical volume group, and partitions that are logical volumes can be expanded.
Logical Volumes

Figure 7.2. Logical Volumes

On the other hand, if a system is partitioned with the ext3 file system, the hard drive is divided into partitions of defined sizes. If a partition becomes full, it is not easy to expand the size of the partition. Even if the partition is moved to another hard drive, the original hard drive space has to be reallocated as a different partition or not used.
LVM support must be compiled into the kernel, and the default Red Hat kernel is compiled with LVM support.
To learn how to configure LVM during the installation process, refer to Chapter 8, LVM Configuration.

7.2. What is LVM2?

LVM version 2, or LVM2, is the default for Red Hat Enterprise Linux, which uses the device mapper driver contained in the 2.6 kernel. LVM2, which is almost completely compatible with the earlier LVM1 version, can be upgraded from versions of Red Hat Enterprise Linux running the 2.4 kernel.
Although upgrading from LVM1 to LVM2 is usually seamless, refer to Section 7.3, “Additional Resources” for further details on more complex requirements and upgrading scenarios.

7.3. Additional Resources

Use these sources to learn more about LVM.

7.3.1. Installed Documentation

  • rpm -qd lvm — This command shows all the documentation available from the lvm package, including man pages.
  • lvm help — This command shows all LVM commands available.

7.3.2. Useful Websites

Chapter 8. LVM Configuration

LVM can be configured during the graphical installation process, the text-based installation process, or during a kickstart installation. You can use the utilities from the lvm package to create your own LVM configuration post-installation, but these instructions focus on using Disk Druid during installation to complete this task.
Read Chapter 7, Logical Volume Manager (LVM) first to learn about LVM. An overview of the steps required to configure LVM include:
  • Creating physical volumes from the hard drives.
  • Creating volume groups from the physical volumes.
  • Creating logical volumes from the volume groups and assign the logical volumes mount points.

Note

Although the following steps are illustrated during a GUI installation, the same can be done during a text-based installation.
Two 9.1 GB SCSI drives (/dev/sda and /dev/sdb) are used in the following examples. They detail how to create a simple configuration using a single LVM volume group with associated logical volumes during installation.

8.1. Automatic Partitioning

On the Disk Partitioning Setup screen, select Automatically partition.
For Red Hat Enterprise Linux, LVM is the default method for disk partitioning. If you do not wish to have LVM implemented, or if you require RAID partitioning, manual disk partitioning through Disk Druid is required.
The following properties make up the automatically created configuration:
  • The /boot/ partition resides on its own non-LVM partition. In the following example, it is the first partition on the first drive (/dev/sda1). Bootable partitions cannot reside on LVM logical volumes.
  • A single LVM volume group (VolGroup00) is created, which spans all selected drives and all remaining space available. In the following example, the remainder of the first drive (/dev/sda2), and the entire second drive (/dev/sdb1) are allocated to the volume group.
  • Two LVM logical volumes (LogVol00 and LogVol01) are created from the newly created spanned volume group. In the following example, the recommended swap space is automatically calculated and assigned to LogVol01, and the remainder is allocated to the root file system, LogVol00.
Automatic LVM Configuration With Two SCSI Drives

Figure 8.1. Automatic LVM Configuration With Two SCSI Drives

Note

If enabling quotas are of interest to you, it may be best to modify the automatic configuration to include other mount points, such as /home/ or /var/, so that each file system has its own independent quota configuration limits.
In most cases, the default automatic LVM partitioning is sufficient, but advanced implementations could warrant modification or manual configuration of the LVM partition tables.

Note

If you anticipate future memory upgrades, leaving some free space in the volume group would allow for easy future expansion of the swap space logical volume on the system; in which case, the automatic LVM configuration should be modified to leave available space for future growth.

8.2. Manual LVM Partitioning

The following section explains how to manually configure LVM for Red Hat Enterprise Linux. Because there are numerous ways to manually configure a system with LVM, the following example is similar to the default configuration done in Section 8.1, “Automatic Partitioning”.
On the Disk Partitioning Setup screen, select Manually partition with Disk Druid.

8.2.1. Creating the /boot/ Partition

In a typical situation, the disk drives are new, or formatted clean. The following figure, Figure 8.2, “Two Blank Drives, Ready For Configuration”, shows both drives as raw devices with no partitioning configured.
Two Blank Drives, Ready For Configuration

Figure 8.2. Two Blank Drives, Ready For Configuration

Warning

The /boot/ partition cannot reside on an LVM volume group because the GRUB boot loader cannot read it.
  1. Select New.
  2. Select /boot from the Mount Point pulldown menu.
  3. Select ext3 from the File System Type pulldown menu.
  4. Select only the sda checkbox from the Allowable Drives area.
  5. Leave 100 (the default) in the Size (MB) menu.
  6. Leave the Fixed size (the default) radio button selected in the Additional Size Options area.
  7. Select Force to be a primary partition to make the partition be a primary partition. A primary partition is one of the first four partitions on the hard drive. If unselected, the partition is created as a logical partition. If other operating systems are already on the system, unselecting this option should be considered. For more information on primary versus logical/extended partitions, refer to the appendix section of the Installation Guide.
Refer to Figure 8.3, “Creation of the Boot Partition” to verify your inputted values:
Creation of the Boot Partition

Figure 8.3. Creation of the Boot Partition

Click OK to return to the main screen. The following figure displays the boot partition correctly set:
The /boot/ Partition Displayed

Figure 8.4. The /boot/ Partition Displayed

8.2.2. Creating the LVM Physical Volumes

Once the boot partition is created, the remainder of all disk space can be allocated to LVM partitions. The first step in creating a successful LVM implementation is the creation of the physical volume(s).
  1. Select New.
  2. Select physical volume (LVM) from the File System Type pulldown menu as shown in Figure 8.5, “Creating a Physical Volume”.
    Creating a Physical Volume

    Figure 8.5. Creating a Physical Volume

  3. You cannot enter a mount point yet (you can once you have created all your physical volumes and then all volume groups).
  4. A physical volume must be constrained to one drive. For Allowable Drives, select the drive on which the physical volume are created. If you have multiple drives, all drives are selected, and you must deselect all but one drive.
  5. Enter the size that you want the physical volume to be.
  6. Select Fixed size to make the physical volume the specified size, select Fill all space up to (MB) and enter a size in MBs to give range for the physical volume size, or select Fill to maximum allowable size to make it grow to fill all available space on the hard disk. If you make more than one growable, they share the available free space on the disk.
  7. Select Force to be a primary partition if you want the partition to be a primary partition.
  8. Click OK to return to the main screen.
Repeat these steps to create as many physical volumes as needed for your LVM setup. For example, if you want the volume group to span over more than one drive, create a physical volume on each of the drives. The following figure shows both drives completed after the repeated process:
Two Physical Volumes Created

Figure 8.6. Two Physical Volumes Created

8.2.3. Creating the LVM Volume Groups

Once all the physical volumes are created, the volume groups can be created:
  1. Click the LVM button to collect the physical volumes into volume groups. A volume group is basically a collection of physical volumes. You can have multiple logical volume groups, but a physical volume can only be in one volume group.

    Note

    There is overhead disk space reserved in the logical volume group. The summation of the physical volumes may not equal the size of the volume group; however, the size of the logical volumes shown is correct.
    Creating an LVM Volume Group

    Figure 8.7. Creating an LVM Volume Group

  2. Change the Volume Group Name if desired.
  3. All logical volumes inside the volume group must be allocated in physical extent units. By default, the physical extent is set to 32 MB; thus, logical volume sizes must be divisible by 32 MBs. If you enter a size that is not a unit of 32 MBs, the installation program automatically selects the closest size in units of 32 MBs. It is not recommended that you change this setting.
  4. Select which physical volumes to use for the volume group.

8.2.4. Creating the LVM Logical Volumes

Create logical volumes with mount points such as /, /home/, and swap space. Remember that /boot cannot be a logical volume. To add a logical volume, click the Add button in the Logical Volumes section. A dialog window as shown in Figure 8.8, “Creating a Logical Volume” appears.
Creating a Logical Volume

Figure 8.8. Creating a Logical Volume

Repeat these steps for each volume group you want to create.

Note

You may want to leave some free space in the logical volume group so you can expand the logical volumes later. The default automatic configuration does not do this, but this manual configuration example does — approximately 1 GB is left as free space for future expansion.
Pending Logical Volumes

Figure 8.9. Pending Logical Volumes

Click OK to apply the volume group and all associated logical volumes.
The following figure shows the final manual configuration:
Final Manual Configuration

Figure 8.10. Final Manual Configuration

Chapter 9. Redundant Array of Independent Disks (RAID)

9.1. What is RAID?

The basic idea behind RAID is to combine multiple small, inexpensive disk drives into an array to accomplish performance or redundancy goals not attainable with one large and expensive drive. This array of drives appears to the computer as a single logical storage unit or drive.
RAID is a method in which information is spread across several disks. RAID uses techniques such as disk striping (RAID Level 0), disk mirroring (RAID level 1), and disk striping with parity (RAID Level 5) to achieve redundancy, lower latency and/or to increase bandwidth for reading or writing to disks, and to maximize the ability to recover from hard disk crashes.
The underlying concept of RAID is that data may be distributed across each drive in the array in a consistent manner. To do this, the data must first be broken into consistently-sized chunks (often 32K or 64K in size, although different sizes can be used). Each chunk is then written to a hard drive in the RAID array according to the RAID level used. When the data is to be read, the process is reversed, giving the illusion that the multiple drives in the array are actually one large drive.

9.2. Who Should Use RAID?

Those who need to keep large quantities of data on hand (such as system administrators) would benefit by using RAID technology. Primary reasons to use RAID include:
  • Enhanced speed
  • Increased storage capacity using a single virtual disk
  • Lessened impact of a disk failure

9.3. Hardware RAID versus Software RAID

There are two possible RAID approaches: Hardware RAID and Software RAID.

9.3.1. Hardware RAID

The hardware-based array manages the RAID subsystem independently from the host and presents to the host only a single disk per RAID array.
An example of a Hardware RAID device would be one that connects to a SCSI controller and presents the RAID arrays as a single SCSI drive. An external RAID system moves all RAID handling "intelligence" into a controller located in the external disk subsystem. The whole subsystem is connected to the host via a normal SCSI controller and appears to the host as a single disk.
RAID controllers also come in the form of cards that act like a SCSI controller to the operating system but handle all of the actual drive communications themselves. In these cases, you plug the drives into the RAID controller just like you would a SCSI controller, but then you add them to the RAID controller's configuration, and the operating system never knows the difference.

9.3.2. Software RAID

Software RAID implements the various RAID levels in the kernel disk (block device) code. It offers the cheapest possible solution, as expensive disk controller cards or hot-swap chassis [2] are not required. Software RAID also works with cheaper IDE disks as well as SCSI disks. With today's fast CPUs, Software RAID performance can excel against Hardware RAID.
The MD driver in the Linux kernel is an example of a RAID solution that is completely hardware independent. The performance of a software-based array is dependent on the server CPU performance and load.
For information on configuring Software RAID during installation, refer to the Chapter 10, Software RAID Configuration.
For those interested in learning more about what Software RAID has to offer, here are the most important features:
  • Threaded rebuild process
  • Kernel-based configuration
  • Portability of arrays between Linux machines without reconstruction
  • Backgrounded array reconstruction using idle system resources
  • Hot-swappable drive support
  • Automatic CPU detection to take advantage of certain CPU optimizations

9.4. RAID Levels and Linear Support

RAID supports various configurations, including levels 0, 1, 4, 5, and linear. These RAID types are defined as follows:
  • Level 0 — RAID level 0, often called "striping," is a performance-oriented striped data mapping technique. This means the data being written to the array is broken down into strips and written across the member disks of the array, allowing high I/O performance at low inherent cost but provides no redundancy. The storage capacity of a level 0 array is equal to the total capacity of the member disks in a Hardware RAID or the total capacity of member partitions in a Software RAID.
  • Level 1 — RAID level 1, or "mirroring," has been used longer than any other form of RAID. Level 1 provides redundancy by writing identical data to each member disk of the array, leaving a "mirrored" copy on each disk. Mirroring remains popular due to its simplicity and high level of data availability. Level 1 operates with two or more disks that may use parallel access for high data-transfer rates when reading but more commonly operate independently to provide high I/O transaction rates. Level 1 provides very good data reliability and improves performance for read-intensive applications but at a relatively high cost. [3] The storage capacity of the level 1 array is equal to the capacity of one of the mirrored hard disks in a Hardware RAID or one of the mirrored partitions in a Software RAID.
  • Level 4 — Level 4 uses parity [4] concentrated on a single disk drive to protect data. It is better suited to transaction I/O rather than large file transfers. Because the dedicated parity disk represents an inherent bottleneck, level 4 is seldom used without accompanying technologies such as write-back caching. Although RAID level 4 is an option in some RAID partitioning schemes, it is not an option allowed in Red Hat Enterprise Linux RAID installations. [5] The storage capacity of Hardware RAID level 4 is equal to the capacity of member disks, minus the capacity of one member disk. The storage capacity of Software RAID level 4 is equal to the capacity of the member partitions, minus the size of one of the partitions if they are of equal size.
  • Level 5 — This is the most common type of RAID. By distributing parity across some or all of an array's member disk drives, RAID level 5 eliminates the write bottleneck inherent in level 4. The only performance bottleneck is the parity calculation process. With modern CPUs and Software RAID, that usually is not a very big problem. As with level 4, the result is asymmetrical performance, with reads substantially outperforming writes. Level 5 is often used with write-back caching to reduce the asymmetry. The storage capacity of Hardware RAID level 5 is equal to the capacity of member disks, minus the capacity of one member disk. The storage capacity of Software RAID level 5 is equal to the capacity of the member partitions, minus the size of one of the partitions if they are of equal size.
  • Linear RAID — Linear RAID is a simple grouping of drives to create a larger virtual drive. In linear RAID, the chunks are allocated sequentially from one member drive, going to the next drive only when the first is completely filled. This grouping provides no performance benefit, as it is unlikely that any I/O operations will be split between member drives. Linear RAID also offers no redundancy and, in fact, decreases reliability — if any one member drive fails, the entire array cannot be used. The capacity is the total of all member disks.


[2] A hot-swap chassis allows you to remove a hard drive without having to power-down your system.
[3] RAID level 1 comes at a high cost because you write the same information to all of the disks in the array, which wastes drive space. For example, if you have RAID level 1 set up so that your root (/) partition exists on two 40G drives, you have 80G total but are only able to access 40G of that 80G. The other 40G acts like a mirror of the first 40G.
[4] Parity information is calculated based on the contents of the rest of the member disks in the array. This information can then be used to reconstruct data when one disk in the array fails. The reconstructed data can then be used to satisfy I/O requests to the failed disk before it is replaced and to repopulate the failed disk after it has been replaced.
[5] RAID level 4 takes up the same amount of space as RAID level 5, but level 5 has more advantages. For this reason, level 4 is not supported.

Chapter 10. Software RAID Configuration

Software RAID can be configured during the graphical installation process, the text-based installation process, or during a kickstart installation. This chapter discusses how to configure software RAID during installation, using the Disk Druid interface.
Read Chapter 9, Redundant Array of Independent Disks (RAID) first to learn about RAID, the differences between hardware and software RAID, and the differences between RAID 0, 1, and 5. An overview of the steps required to configure RAID include:
  • Applying software RAID partitions to the physical hard drives.
    If you wish to have the boot partition (/boot/) reside on a RAID parition, it must be on a RAID 1 partition.
  • Creating RAID devices from the software RAID partitions.
  • Optional: Configuring LVM from the RAID devices. Refer to Chapter 8, LVM Configuration for more information on configuring LVM after first configuring RAID.
  • Creating file systems from the RAID devices.

Note

Although the following steps are illustrated during a GUI installation, the same can be done during a text-based installation.
Configuration of software RAID must be done manually in Disk Druid during the installation process.
Two 9.1 GB SCSI drives (/dev/sda and /dev/sdb) are used in the following examples. They detail how to create a simple RAID 1 configuration by implementing multiple RAID devices.
On the Disk Partitioning Setup screen, select Manually partition with Disk Druid.

10.1. Creating the RAID Partitions

In a typical situation, the disk drives are new or are formatted. Both drives are shown as raw devices with no partition configuration in Figure 10.1, “Two Blank Drives, Ready For Configuration”.
Two Blank Drives, Ready For Configuration

Figure 10.1. Two Blank Drives, Ready For Configuration

  1. In Disk Druid, choose RAID to enter the software RAID creation screen.
  2. Choose Create a software RAID partition to create a RAID partition as shown in Figure 10.2, “RAID Partition Options”. Note that no other RAID options (such as entering a mount point) are available until RAID partitions, as well as RAID devices, are created.
    RAID Partition Options

    Figure 10.2. RAID Partition Options

  3. A software RAID partition must be constrained to one drive. For Allowable Drives, select the drive on which RAID is to be created. If you have multiple drives, all drives are selected, and you must deselect all but one drive.
    Adding a RAID Partition

    Figure 10.3. Adding a RAID Partition

  4. Enter the size that you want the partition to be.
  5. Select Fixed size to make the partition the specified size, select Fill all space up to (MB) and enter a size in MBs to give range for the partition size, or select Fill to maximum allowable size to make it grow to fill all available space on the hard disk. If you make more than one partition growable, they share the available free space on the disk.
  6. Select Force to be a primary partition if you want the partition to be a primary partition. A primary partition is one of the first four partitions on the hard drive. If unselected, the partition is created as a logical partition. If other operating systems are already on the system, unselecting this option should be considered. For more information on primary versus logical/extended partitions, refer to the appendix section of the Installation Guide.
  7. Click OK to return to the main screen.
Repeat these steps to create as many partitions as needed for your RAID setup. Notice that all the partitions do not have to be RAID partitions. For example, you can configure only the /boot/ partition as a software RAID device, leaving the root partition (/), /home/, and swap as regular file systems. Figure 10.4, “RAID 1 Partitions Ready, Pre-Device and Mount Point Creation” shows successfully allocated space for the RAID 1 configuration (for /boot/), which is now ready for RAID device and mount point creation:
RAID 1 Partitions Ready, Pre-Device and Mount Point Creation

Figure 10.4. RAID 1 Partitions Ready, Pre-Device and Mount Point Creation

10.2. Creating the RAID Devices and Mount Points

Once you have all of your partitions created as software RAID partitions, the following steps create the RAID device and mount point:
  1. Select the RAID button on the Disk Druid main partitioning screen (refer to Figure 10.5, “RAID Options”).
  2. Figure 10.5, “RAID Options” appears. Select Create a RAID device.
    RAID Options

    Figure 10.5. RAID Options

  3. Next, Figure 10.6, “Making a RAID Device and Assigning a Mount Point” appears, where you can make a RAID device and assign a mount point.
    Making a RAID Device and Assigning a Mount Point

    Figure 10.6. Making a RAID Device and Assigning a Mount Point

  4. Enter a mount point.
  5. Choose the file system type for the partition. At this point you can either configure a dynamic LVM file system or a traditional static ext2/ext3 file system. For more information on configuring LVM on a RAID device, select physical volume (LVM) and then refer to Chapter 8, LVM Configuration. If LVM is not required, continue on with the following instructions.
  6. Select a device name such as md0 for the RAID device.
  7. Choose your RAID level. You can choose from RAID 0, RAID 1, and RAID 5. If you need assistance in determining which RAID level to implement, refer to Chapter 9, Redundant Array of Independent Disks (RAID).

    Note

    If you are making a RAID partition of /boot/, you must choose RAID level 1, and it must use one of the first two drives (IDE first, SCSI second). If you are not creating a seperate RAID partition of /boot/, and you are making a RAID partition for the root file system (/), it must be RAID level 1 and must use one of the first two drives (IDE first, SCSI second).
    The /boot/ Mount Error

    Figure 10.7. The /boot/ Mount Error

  8. The RAID partitions created appear in the RAID Members list. Select which of these partitions should be used to create the RAID device.
  9. If configuring RAID 1 or RAID 5, specify the number of spare partitions. If a software RAID partition fails, the spare is automatically used as a replacement. For each spare you want to specify, you must create an additional software RAID partition (in addition to the partitions for the RAID device). Select the partitions for the RAID device and the partition(s) for the spare(s).
  10. After clicking OK, the RAID device appears in the Drive Summary list.
  11. Repeat this chapter's entire process for configuring additional partitions, devices, and mount points, such as the root partition (/), /home/, or swap.
After completing the entire configuration, the figure as shown in Figure 10.8, “Final Sample RAID Configuration” resembles the default configuration, except for the use of RAID.
Final Sample RAID Configuration

Figure 10.8. Final Sample RAID Configuration

The figure as shown in Figure 10.9, “Final Sample RAID With LVM Configuration” is an example of a RAID and LVM configuration.
Final Sample RAID With LVM Configuration

Figure 10.9. Final Sample RAID With LVM Configuration

You can continue with your installation process. Refer to the Installation Guide for further instructions.

Chapter 11. Swap Space

11.1. What is Swap Space?

Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap space. While swap space can help machines with a small amount of RAM, it should not be considered a replacement for more RAM. Swap space is located on hard drives, which have a slower access time than physical memory.
Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions and swap files.
The size of your swap should be equal to twice your computer's physical RAM for up to 2 GB of physical RAM. For physical RAM above 2 GB, the size of your swap should be equal to the amount of physical RAM above 2 GB. The size of your swap should never be less than 32 MB.
Using this basic formula, a system with 2 GB of physical RAM would have 4 GB of swap, while one with 3 GB of physical RAM would have 5 GB of swap.

Note

Unfortunately, deciding on the amount of swap to allocate to Red Hat Enterprise Linux is more of an art than a science, so hard rules are not possible. Each system's most used applications should be accounted for when determining swap size.

Important

File systems and LVM2 volumes assigned as swap space cannot be in use when being modified. For example, no system processes can be assigned the swap space, as well as no amount of swap should be allocated and used by the kernel. Use the free and cat /proc/swaps commands to verify how much and where swap is in use.
The best way to achieve swap space modifications is to boot your system in rescue mode, and then follow the instructions (for each scenario) in the remainder of this chapter. Refer to Chapter 5, Basic System Recovery for instructions on booting into rescue mode. When prompted to mount the file system, select Skip.

11.2. Adding Swap Space

Sometimes it is necessary to add more swap space after installation. For example, you may upgrade the amount of RAM in your system from 128 MB to 256 MB, but there is only 256 MB of swap space. It might be advantageous to increase the amount of swap space to 512 MB if you perform memory-intense operations or run applications that require a large amount of memory.
You have three options: create a new swap partition, create a new swap file, or extend swap on an existing LVM2 logical volume. It is recommended that you extend an existing logical volume.

11.2.1. Extending Swap on an LVM2 Logical Volume

To extend an LVM2 swap logical volume (assuming /dev/VolGroup00/LogVol01 is the volume you want to extend):
  1. Disable swapping for the associated logical volume:
     # swapoff -v /dev/VolGroup00/LogVol01 
  2. Resize the LVM2 logical volume by 256 MB:
     # lvm lvresize /dev/VolGroup00/LogVol01 -L +256M 
  3. Format the new swap space:
     # mkswap /dev/VolGroup00/LogVol01 
  4. Enable the extended logical volume:
     # swapon -va 
  5. Test that the logical volume has been extended properly:
     # cat /proc/swaps # free 

11.2.2. Creating an LVM2 Logical Volume for Swap

To add a swap volume group (assuming /dev/VolGroup00/LogVol02 is the swap volume you want to add):
  1. Create the LVM2 logical volume of size 256 MB:
     # lvm lvcreate VolGroup00 -n LogVol02 -L 256M 
  2. Format the new swap space:
     # mkswap /dev/VolGroup00/LogVol02 
  3. Add the following entry to the /etc/fstab file:
     /dev/VolGroup00/LogVol02 swap swap defaults 0 0 
  4. Enable the extended logical volume:
     # swapon -va 
  5. Test that the logical volume has been extended properly:
     # cat /proc/swaps # free 

11.2.3. Creating a Swap File

To add a swap file:
  1. Determine the size of the new swap file in megabytes and multiply by 1024 to determine the number of blocks. For example, the block size of a 64 MB swap file is 65536.
  2. At a shell prompt as root, type the following command with count being equal to the desired block size:
    dd if=/dev/zero of=/swapfile bs=1024 count=65536
  3. Setup the swap file with the command:
    mkswap /swapfile
  4. To enable the swap file immediately but not automatically at boot time:
    swapon /swapfile
  5. To enable it at boot time, edit /etc/fstab to include the following entry:
    /swapfile          swap            swap    defaults        0 0
    
    The next time the system boots, it enables the new swap file.
  6. After adding the new swap file and enabling it, verify it is enabled by viewing the output of the command cat /proc/swaps or free.

11.3. Removing Swap Space

Sometimes it can be prudent to reduce swap space after installation. For example, say you downgraded the amount of RAM in your system from 1 GB to 512 MB, but there is 2 GB of swap space still assigned. It might be advantageous to reduce the amount of swap space to 1 GB, since the larger 2 GB could be wasting disk space.
You have three options: remove an entire LVM2 logical volume used for swap, remove a swap file, or reduce swap space on an existing LVM2 logical volume.

11.3.1. Reducing Swap on an LVM2 Logical Volume

To reduce an LVM2 swap logical volume (assuming /dev/VolGroup00/LogVol01 is the volume you want to extend):
  1. Disable swapping for the associated logical volume:
     # swapoff -v /dev/VolGroup00/LogVol01 
  2. Reduce the LVM2 logical volume by 512 MB:
     # lvm lvreduce /dev/VolGroup00/LogVol01 -L -512M 
  3. Format the new swap space:
     # mkswap /dev/VolGroup00/LogVol01 
  4. Enable the extended logical volume:
     # swapon -va 
  5. Test that the logical volume has been reduced properly:
     # cat /proc/swaps # free 

11.3.2. Removing an LVM2 Logical Volume for Swap

The swap logical volume cannot be in use (no system locks or processes on the volume). The easiest way to achieve this it to boot your system in rescue mode. Refer to Chapter 5, Basic System Recovery for instructions on booting into rescue mode. When prompted to mount the file system, select Skip.
To remove a swap volume group (assuming /dev/VolGroup00/LogVol02 is the swap volume you want to remove):
  1. Disable swapping for the associated logical volume:
     # swapoff -v /dev/VolGroup00/LogVol02 
  2. Remove the LVM2 logical volume of size 512 MB:
     # lvm lvremove /dev/VolGroup00/LogVol02 
  3. Remove the following entry from the /etc/fstab file:
     /dev/VolGroup00/LogVol02 swap swap defaults 0 0 
  4. Test that the logical volume has been extended properly:
     # cat /proc/swaps # free 

11.3.3. Removing a Swap File

To remove a swap file:
  1. At a shell prompt as root, execute the following command to disable the swap file (where /swapfile is the swap file):
     # swapoff -v /swapfile 
  2. Remove its entry from the /etc/fstab file.
  3. Remove the actual file:
     # rm /swapfile 

11.4. Moving Swap Space

To move swap space from one location to another, follow the steps for removing swap space, and then follow the steps for adding swap space.

Chapter 12. Managing Disk Storage

Introduction to different methods........

12.1. Standard Partitions using parted

Many users need to view the existing partition table, change the size of the partitions, remove partitions, or add partitions from free space or additional hard drives. The utility parted allows users to perform these tasks. This chapter discusses how to use parted to perform file system tasks.
If you want to view the system's disk space usage or monitor the disk space usage, refer to Section 39.3, “File Systems”.
You must have the parted package installed to use the parted utility. To start parted, at a shell prompt as root, type the command parted /dev/sda, where /dev/sda is the device name for the drive you want to configure. The (parted) prompt is displayed. Type help to view a list of available commands.
If you want to create, remove, or resize a partition, the device cannot be in use (partitions cannot be mounted, and swap space cannot be enabled). The partition table should not be modified while in use because the kernel may not properly recognize the changes. Data could be overwritten by writing to the wrong partition because the partition table and partitions mounted do not match. The easiest way to achieve this it to boot your system in rescue mode. Refer to Chapter 5, Basic System Recovery for instructions on booting into rescue mode. When prompted to mount the file system, select Skip.
Alternately, if the drive does not contain any partitions in use (system processes that use or lock the file system from being unmounted), you can unmount them with the umount command and turn off all the swap space on the hard drive with the swapoff command.
Table 12.1, “parted commands” contains a list of commonly used parted commands. The sections that follow explain some of them in more detail.

Table 12.1. parted commands

Command Description
check minor-num Perform a simple check of the file system
cp fromto Copy file system from one partition to another; from and to are the minor numbers of the partitions
help Display list of available commands
mklabel label Create a disk label for the partition table
mkfs minor-numfile-system-type Create a file system of type file-system-type
mkpart part-typefs-typestart-mbend-mb Make a partition without creating a new file system
mkpartfs part-typefs-typestart-mbend-mb Make a partition and create the specified file system
move minor-numstart-mbend-mb Move the partition
name minor-numname Name the partition for Mac and PC98 disklabels only
print Display the partition table
quit Quit parted
rescuestart-mbend-mb Rescue a lost partition from start-mb to end-mb
resize minor-numstart-mbend-mb Resize the partition from start-mb to end-mb
rm minor-num Remove the partition
select device Select a different device to configure
set minor-numflagstate Set the flag on a partition; state is either on or off

12.1.1. Viewing the Partition Table

After starting parted, type the following command to view the partition table:
print
A table similar to the following appears:
Disk geometry for /dev/sda: 0.000-8678.789 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031    101.975  primary   ext3        boot
2        101.975   5098.754  primary   ext3
3       5098.755   6361.677  primary   linux-swap
4       6361.677   8675.727  extended
5       6361.708   7357.895  logical   ext3


Disk geometry for /dev/hda: 0.000-9765.492 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031    101.975  primary   ext3        boot
2        101.975    611.850  primary   linux-swap  
3        611.851    760.891  primary   ext3        
4        760.891   9758.232  extended              lba
5        760.922   9758.232  logical   ext3
The first line displays the size of the disk, the second line displays the disk label type, and the remaining output shows the partition table.
In the partition table, the Minor number is the partition number. For example, the partition with minor number 1 corresponds to /dev/sda1. The Start and End values are in megabytes. The Type is one of primary, extended, or logical. The Filesystem is the file system type, which can be one of ext2, ext3, fat16, fat32, hfs, jfs, linux-swap, ntfs, reiserfs, hp-ufs, sun-ufs, or xfs. The Flags column lists the flags set for the partition. Available flags are boot, root, swap, hidden, raid, lvm, or lba.
In this example, minor number 1 refers to the /boot/ file system, minor number 2 refers to the root file system (/), minor number 3 refers to the swap, and minor number 5 refers to the /home/ file system.

Note

To select a different device without having to restart parted, use the select command followed by the device name such as /dev/sda. Then, you can view its partition table or configure it.

12.1.2. Creating a Partition

Warning

Do not attempt to create a partition on a device that is in use.
Before creating a partition, boot into rescue mode (or unmount any partitions on the device and turn off any swap space on the device).
Start parted, where /dev/sda is the device on which to create the partition:
parted /dev/sda
View the current partition table to determine if there is enough free space:
print
If there is not enough free space, you can resize an existing partition. Refer to Section 12.1.4, “Resizing a Partition” for details.

12.1.2.1. Making the Partition

From the partition table, determine the start and end points of the new partition and what partition type it should be. You can only have four primary partitions (with no extended partition) on a device. If you need more than four partitions, you can have three primary partitions, one extended partition, and multiple logical partitions within the extended. For an overview of disk partitions, refer to the appendix An Introduction to Disk Partitions in the Installation Guide.
For example, to create a primary partition with an ext3 file system from 1024 megabytes until 2048 megabytes on a hard drive type the following command:
mkpart primary ext3 1024 2048

Note

If you use the mkpartfs command instead, the file system is created after the partition is created. However, parted does not support creating an ext3 file system. Thus, if you wish to create an ext3 file system, use mkpart and create the file system with the mkfs command as described later. mkpartfs works for file system type linux-swap.
The changes start taking place as soon as you press Enter, so review the command before executing to it.
After creating the partition, use the print command to confirm that it is in the partition table with the correct partition type, file system type, and size. Also remember the minor number of the new partition so that you can label it. You should also view the output of
cat /proc/partitions
to make sure the kernel recognizes the new partition.

12.1.2.2. Formating the Partition

The partition still does not have a file system. Create the file system:
/sbin/mkfs -t ext3 /dev/sda6

Warning

Formatting the partition permanently destroys any data that currently exists on the partition.

12.1.2.3. Labeling the Partition

Next, give the partition a label. For example, if the new partition is /dev/sda6 and you want to label it /work:
e2label /dev/sda6 /work
By default, the installation program uses the mount point of the partition as the label to make sure the label is unique. You can use any label you want.

12.1.2.4. Creating the Mount Point

As root, create the mount point:
mkdir /work

12.1.2.5. Add to /etc/fstab

As root, edit the /etc/fstab file to include the new partition. The new line should look similar to the following:
LABEL=/work           /work                 ext3    defaults        1 2
The first column should contain LABEL= followed by the label you gave the partition. The second column should contain the mount point for the new partition, and the next column should be the file system type (for example, ext3 or swap). If you need more information about the format, read the man page with the command man fstab.
If the fourth column is the word defaults, the partition is mounted at boot time. To mount the partition without rebooting, as root, type the command:
mount /work

12.1.3. Removing a Partition

Warning

Do not attempt to remove a partition on a device that is in use.
Before removing a partition, boot into rescue mode (or unmount any partitions on the device and turn off any swap space on the device).
Start parted, where /dev/sda is the device on which to remove the partition:
parted /dev/sda
View the current partition table to determine the minor number of the partition to remove:
print
Remove the partition with the command rm. For example, to remove the partition with minor number 3:
rm 3
The changes start taking place as soon as you press Enter, so review the command before committing to it.
After removing the partition, use the print command to confirm that it is removed from the partition table. You should also view the output of
cat /proc/partitions
to make sure the kernel knows the partition is removed.
The last step is to remove it from the /etc/fstab file. Find the line that declares the removed partition, and remove it from the file.

12.1.4. Resizing a Partition

Warning

Do not attempt to resize a partition on a device that is in use.
Before resizing a partition, boot into rescue mode (or unmount any partitions on the device and turn off any swap space on the device).
Start parted, where /dev/sda is the device on which to resize the partition:
parted /dev/sda
View the current partition table to determine the minor number of the partition to resize as well as the start and end points for the partition:
print

Warning

The used space of the partition to resize must not be larger than the new size.
To resize the partition, use the resize command followed by the minor number for the partition, the starting place in megabytes, and the end place in megabytes. For example:
resize 3 1024 2048
After resizing the partition, use the print command to confirm that the partition has been resized correctly, is the correct partition type, and is the correct file system type.
After rebooting the system into normal mode, use the command df to make sure the partition was mounted and is recognized with the new size.

12.2. LVM Partition Management

The following commands can be found by issuing lvm help at a command prompt.

Table 12.2. LVM commands

Command Description
dumpconfig Dump the active configuration
formats List the available metadata formats
help Display the help commands
lvchange Change the attributes of logical volume(s)
lvcreate Create a logical volume
lvdisplay Display information about a logical volume
lvextend Add space to a logical volume
lvmchange Due to use of the device mapper, this command has been deprecated
lvmdiskscan List devices that may be used as physical volumes
lvmsadc Collect activity data
lvmsar Create activity report
lvreduce Reduce the size of a logical volume
lvremove Remove logical volume(s) from the system
lvrename Rename a logical volume
lvresize Resize a logical volume
lvs Display information about logical volumes
lvscan List all logical volumes in all volume groups
pvchange Change attributes of physical volume(s)
pvcreate Initialize physical volume(s) for use by LVM
pvdata Display the on-disk metadata for physical volume(s)
pvdisplay Display various attributes of physical volume(s)
pvmove Move extents from one physical volume to another
pvremove Remove LVM label(s) from physical volume(s)
pvresize Resize a physical volume in use by a volume group
pvs Display information about physical volumes
pvscan List all physical volumes
segtypes List available segment types
vgcfgbackup Backup volume group configuration
vgcfgrestore Restore volume group configuration
vgchange Change volume group attributes
vgck Check the consistency of a volume group
vgconvert Change volume group metadata format
vgcreate Create a volume group
vgdisplay Display volume group information
vgexport Unregister a volume group from the system
vgextend Add physical volumes to a volume group
vgimport Register exported volume group with system
vgmerge Merge volume groups
vgmknodes Create the special files for volume group devices in /dev/
vgreduce Remove a physical volume from a volume group
vgremove Remove a volume group
vgrename Rename a volume group
vgs Display information about volume groups
vgscan Search for all volume groups
vgsplit Move physical volumes into a new volume group
version Display software and driver version information

Chapter 13. Implementing Disk Quotas

Disk space can be restricted by implementing disk quotas which alert a system administrator before a user consumes too much disk space or a partition becomes full.
Disk quotas can be configured for individual users as well as user groups. This kind of flexibility makes it possible to give each user a small quota to handle "personal" files (such as email and reports), while allowing the projects they work on to have more sizable quotas (assuming the projects are given their own groups).
In addition, quotas can be set not just to control the number of disk blocks consumed but to control the number of inodes (data structures that contain information about files in UNIX file systems). Because inodes are used to contain file-related information, this allows control over the number of files that can be created.
The quota RPM must be installed to implement disk quotas.

13.1. Configuring Disk Quotas

To implement disk quotas, use the following steps:
  1. Enable quotas per file system by modifying the /etc/fstab file.
  2. Remount the file system(s).
  3. Create the quota database files and generate the disk usage table.
  4. Assign quota policies.
Each of these steps is discussed in detail in the following sections.

13.1.1. Enabling Quotas

As root, using a text editor, edit the /etc/fstab file. Add the usrquota and/or grpquota options to the file systems that require quotas:
/dev/VolGroup00/LogVol00 /         ext3    defaults        1 1
LABEL=/boot              /boot     ext3    defaults        1 2
none                     /dev/pts  devpts  gid=5,mode=620  0 0
none                     /dev/shm  tmpfs   defaults        0 0
none                     /proc     proc    defaults        0 0
none                     /sys      sysfs   defaults        0 0
/dev/VolGroup00/LogVol02 /home     ext3    defaults,usrquota,grpquota  1 2
/dev/VolGroup00/LogVol01 swap      swap    defaults        0 0
.
.
.
In this example, the /home file system has both user and group quotas enabled.

Note

The following examples assume that a separate /home partition was created during the installation of Red Hat Enterprise Linux. Although not ideal, the root (/) partition (the installation default created partition) can be used for setting quota policies in the /etc/fstab file.

13.1.2. Remounting the File Systems

After adding the usrquota and/or grpquota options, remount each file system whose fstab entry has been modified. If the file system is not in use by any process, use one of the following methods:
  • Issue the umount command followed by the mount command to remount the file system.
  • Issue the mount -o remount /home command to remount the file system.
If the file system is currently in use, the easiest method for remounting the file system is to reboot the system.

13.1.3. Creating the Quota Database Files

After each quota-enabled file system is remounted, the system is capable of working with disk quotas. However, the file system itself is not yet ready to support quotas. The next step is to run the quotacheck command.
The quotacheck command examines quota-enabled file systems and builds a table of the current disk usage per file system. The table is then used to update the operating system's copy of disk usage. In addition, the file system's disk quota files are updated.
To create the quota files (aquota.user and aquota.group) on the file system, use the -c option of the quotacheck command. For example, if user and group quotas are enabled for the /home file system, create the files in the /home directory:
quotacheck -cug /home
The -c option specifies that the quota files should be created for each file system with quotas enabled, the -u option specifies to check for user quotas, and the -g option specifies to check for group quotas.
If neither the -u or -g options are specified, only the user quota file is created. If only -g is specified, only the group quota file is created.
After the files are created, run the following command to generate the table of current disk usage per file system with quotas enabled:
quotacheck -avug
The options used are as follows:
  • a — Check all quota-enabled, locally-mounted file systems
  • v — Display verbose status information as the quota check proceeds
  • u — Check user disk quota information
  • g — Check group disk quota information
After quotacheck has finished running, the quota files corresponding to the enabled quotas (user and/or group) are populated with data for each quota-enabled locally-mounted file system such as /home.

13.1.4. Assigning Quotas per User

The last step is assigning the disk quotas with the edquota command.
To configure the quota for a user, as root in a shell prompt, execute the command:
 edquota username
Perform this step for each user who needs a quota. For example, if a quota is enabled in /etc/fstab for the /home partition (/dev/VolGroup00/LogVol02) and the command edquota testuser is executed, the following is shown in the editor configured as the default for the system:
Disk quotas for user testuser (uid 501):
  Filesystem                blocks     soft     hard    inodes   soft   hard
  /dev/VolGroup00/LogVol02  440436        0        0     37418      0      0

Note

The text editor defined by the EDITOR environment variable is used by edquota. To change the editor, set the EDITOR environment variable in your ~/.bash_profile file to the full path of the editor of your choice.
The first column is the name of the file system that has a quota enabled for it. The second column shows how many blocks the user is currently using. The next two columns are used to set soft and hard block limits for the user on the file system. The inodes column shows how many inodes the user is currently using. The last two columns are used to set the soft and hard inode limits for the user on the file system.
A hard limit is the absolute maximum amount of disk space that a user or group can use. Once this limit is reached, no further disk space can be used.
The soft limit defines the maximum amount of disk space that can be used. However, unlike the hard limit, the soft limit can be exceeded for a certain amount of time. That time is known as the grace period. The grace period can be expressed in seconds, minutes, hours, days, weeks, or months.
If any of the values are set to 0, that limit is not set. In the text editor, change the desired limits. For example:
Disk quotas for user testuser (uid 501):
  Filesystem                blocks     soft     hard   inodes   soft   hard
  /dev/VolGroup00/LogVol02  440436   500000   550000    37418      0      0
To verify that the quota for the user has been set, use the command:
quota testuser

13.1.5. Assigning Quotas per Group

Quotas can also be assigned on a per-group basis. For example, to set a group quota for the devel group (the group must exist prior to setting the group quota), use the command:
 edquota -g devel 
This command displays the existing quota for the group in the text editor:
Disk quotas for group devel (gid 505):
  Filesystem                blocks    soft     hard    inodes    soft    hard
  /dev/VolGroup00/LogVol02  440400       0        0     37418       0       0
Modify the limits, save the file, and then configure the quota.
To verify that the group quota has been set, use the command:
quota -g devel

13.1.6. Assigning Quotas per File System

To assign quotas based on each file system enabled for quotas, use the command:
 edquota -t 
Like the other edquota commands, this one opens the current quotas for the file system in the text editor:
Grace period before enforcing soft limits for users:
Time units may be: days, hours, minutes, or seconds
  Filesystem                       Block grace period  Inode grace period
  /dev/mapper/VolGroup00-LogVol02       7days                7days
Change the block grace period or inode grace period, save the changes to the file, and exit the text editor.

13.2. Managing Disk Quotas

If quotas are implemented, they need some maintenance — mostly in the form of watching to see if the quotas are exceeded and making sure the quotas are accurate. Of course, if users repeatedly exceeds their quotas or consistently reaches their soft limits, a system administrator has a few choices to make depending on what type of users they are and how much disk space impacts their work. The administrator can either help the user determine how to use less disk space or increase the user's disk quota if needed.

13.2.1. Enabling and Disabling

It is possible to disable quotas without setting them to be 0. To turn all user and group quotas off, use the following command:
quotaoff -vaug
If neither the -u or -g options are specified, only the user quotas are disabled. If only -g is specified, only group quotas are disabled.
To enable quotas again, use the quotaon command with the same options.
For example, to enable user and group quotas for all file systems, use the following command:
quotaon -vaug
To enable quotas for a specific file system, such as /home, use the following command:
quotaon -vug /home
If neither the -u or -g options are specified, only the user quotas are enabled. If only -g is specified, only group quotas are enabled.

13.2.2. Reporting on Disk Quotas

Creating a disk usage report entails running the repquota utility. For example, the command repquota /home produces this output:
*** Report for user quotas on device /dev/mapper/VolGroup00-LogVol02
Block grace time: 7days; Inode grace time: 7days
                        Block limits                File limits
User            used    soft    hard  grace    used  soft  hard  grace
----------------------------------------------------------------------
root      --      36       0       0              4     0     0
kristin   --     540       0       0            125     0     0
testuser  --  440400  500000  550000          37418     0     0
To view the disk usage report for all (option -a) quota-enabled file systems, use the command:
repquota -a
While the report is easy to read, a few points should be explained. The -- displayed after each user is a quick way to determine whether the block or inode limits have been exceeded. If either soft limit is exceeded, a + appears in place of the corresponding -; the first - represents the block limit, and the second represents the inode limit.
The grace columns are normally blank. If a soft limit has been exceeded, the column contains a time specification equal to the amount of time remaining on the grace period. If the grace period has expired, none appears in its place.

13.2.3. Keeping Quotas Accurate

Whenever a file system is not unmounted cleanly (due to a system crash, for example), it is necessary to run quotacheck. However, quotacheck can be run on a regular basis, even if the system has not crashed. Running the following command periodically keeps the quotas more accurate (the options used have been described in Section 13.1.1, “Enabling Quotas”):
quotacheck -avug
The easiest way to run it periodically is to use cron. As root, either use the crontab -e command to schedule a periodic quotacheck or place a script that runs quotacheck in any one of the following directories (using whichever interval best matches your needs):
  • /etc/cron.hourly
  • /etc/cron.daily
  • /etc/cron.weekly
  • /etc/cron.monthly
The most accurate quota statistics can be obtained when the file system(s) analyzed are not in active use. Thus, the cron task should be schedule during a time where the file system(s) are used the least. If this time is various for different file systems with quotas, run quotacheck for each file system at different times with multiple cron tasks.
Refer to Chapter 34, Automated Tasks for more information about configuring cron.

13.3. Additional Resources

For more information on disk quotas, refer to the following resources.

13.3.1. Installed Documentation

  • The quotacheck, edquota, repquota, quota, quotaon, and quotaoff man pages

Chapter 14. Access Control Lists

Files and directories have permission sets for the owner of the file, the group associated with the file, and all other users for the system. However, these permission sets have limitations. For example, different permissions cannot be configured for different users. Thus, Access Control Lists (ACLs) were implemented.
The Red Hat Enterprise Linux 4 kernel provides ACL support for the ext3 file system and NFS-exported file systems. ACLs are also recognized on ext3 file systems accessed via Samba.
Along with support in the kernel, the acl package is required to implement ACLs. It contains the utilities used to add, modify, remove, and retrieve ACL information.
The cp and mv commands copy or move any ACLs associated with files and directories.

14.1. Mounting File Systems

Before using ACLs for a file or directory, the partition for the file or directory must be mounted with ACL support. If it is a local ext3 file system, it can mounted with the following command:
 mount -t ext3 -o acl <device-name><partition>
For example:
 mount -t ext3 -o acl /dev/VolGroup00/LogVol02 /work 
Alternatively, if the partition is listed in the /etc/fstab file, the entry for the partition can include the acl option:
LABEL=/work      /work       ext3    acl        1 2
If an ext3 file system is accessed via Samba and ACLs have been enabled for it, the ACLs are recognized because Samba has been compiled with the --with-acl-support option. No special flags are required when accessing or mounting a Samba share.

14.1.1. NFS

By default, if the file system being exported by an NFS server supports ACLs and the NFS client can read ACLs, ACLs are utilized by the client system.
To disable ACLs on NFS shares when configuring the server, include the no_acl option in the /etc/exports file. To disable ACLs on an NFS share when mounting it on a client, mount it with the no_acl option via the command line or the /etc/fstab file.

14.2. Setting Access ACLs

There are two types of ACLs: access ACLs and default ACLs. An access ACL is the access control list for a specific file or directory. A default ACL can only be associated with a directory; if a file within the directory does not have an access ACL, it uses the rules of the default ACL for the directory. Default ACLs are optional.
ACLs can be configured:
  1. Per user
  2. Per group
  3. Via the effective rights mask
  4. For users not in the user group for the file
The setfacl utility sets ACLs for files and directories. Use the -m option to add or modify the ACL of a file or directory:
 setfacl -m <rules><files>
Rules (<rules>) must be specified in the following formats. Multiple rules can be specified in the same command if they are separated by commas.
u:<uid>:<perms>
Sets the access ACL for a user. The user name or UID may be specified. The user may be any valid user on the system.
g:<gid>:<perms>
Sets the access ACL for a group. The group name or GID may be specified. The group may be any valid group on the system.
m:<perms>
Sets the effective rights mask. The mask is the union of all permissions of the owning group and all of the user and group entries.
o:<perms>
Sets the access ACL for users other than the ones in the group for the file.
White space is ignored. Permissions (<perms>) must be a combination of the characters r, w, and x for read, write, and execute.
If a file or directory already has an ACL, and the setfacl command is used, the additional rules are added to the existing ACL or the existing rule is modified.
For example, to give read and write permissions to user andrius:
setfacl -m u:andrius:rw /project/somefile
To remove all the permissions for a user, group, or others, use the -x option and do not specify any permissions:
 setfacl -x <rules><files>
For example, to remove all permissions from the user with UID 500:
setfacl -x u:500 /project/somefile

14.3. Setting Default ACLs

To set a default ACL, add d: before the rule and specify a directory instead of a file name.
For example, to set the default ACL for the /share/ directory to read and execute for users not in the user group (an access ACL for an individual file can override it):
setfacl -m d:o:rx /share

14.4. Retrieving ACLs

To determine the existing ACLs for a file or directory, use the getfacl command:
getfacl <filename>
It returns output similar to the following:
# file: file
# owner: andrius
# group: andrius
user::rw-
user:smoore:r--
group::r--
mask::r--
other::r--
If a directory is specified, and it has a default ACL, the default ACL is also displayed such as:
# file: file
# owner: andrius
# group: andrius
user::rw-
user:smoore:r--
group::r--
mask::r--
other::r--
default:user::rwx
default:user:andrius:rwx
default:group::r-x
default:mask::rwx
default:other::r-x

14.5. Archiving File Systems With ACLs

Warning

The tar and dump commands do not backup ACLs.
The star utility is similar to the tar utility in that it can be used to generate archives of files; however, some of its options are different. Refer to Table 14.1, “Command Line Options for star for a listing of more commonly used options. For all available options, refer to the star man page. The star package is required to use this utility.

Table 14.1. Command Line Options for star

Option Description
-c Creates an archive file.
-n Do not extract the files; use in conjunction with -x to show what extracting the files does.
-r Replaces files in the archive. The files are written to the end of the archive file, replacing any files with the same path and file name.
-t Displays the contents of the archive file.
-u Updates the archive file. The files are written to the end of the archive if they do not exist in the archive or if the files are newer than the files of the same name in the archive. This option only work if the archive is a file or an unblocked tape that may backspace.
-x Extracts the files from the archive. If used with -U and a file in the archive is older than the corresponding file on the file system, the file is not extracted.
-help Displays the most important options.
-xhelp Displays the least important options.
-/ Do not strip leading slashes from file names when extracting the files from an archive. By default, they are striped when files are extracted.
-acl When creating or extracting, archive or restore any ACLs associated with the files and directories.

14.6. Compatibility with Older Systems

If an ACL has been set on any file on a given file system, that file system has the ext_attr attribute. This attribute can be seen using the following command:
tune2fs -l <filesystem-device>
A file system that has acquired the ext_attr attribute can be mounted with older kernels, but those kernels do not enforce any ACLs which have been set.
Versions of the e2fsck utility included in version 1.22 and higher of the e2fsprogs package (including the versions in Red Hat Enterprise Linux 2.1 and 4) can check a file system with the ext_attr attribute. Older versions refuse to check it.

14.7. Additional Resources

Refer to the follow resources for more information.

14.7.1. Installed Documentation

  • acl man page — Description of ACLs
  • getfacl man page — Discusses how to get file access control lists
  • setfacl man page — Explains how to set file access control lists
  • star man page — Explains more about the star utility and its many options

14.7.2. Useful Websites

Part III. Package Management

All software on a Red Hat Enterprise Linux system is divided into RPM packages which can be installed, upgraded, or removed. This part describes how to manage the RPM packages on a Red Hat Enterprise Linux system using graphical and command line tools.

Chapter 15. Package Management with RPM

The RPM Package Manager (RPM) is an open packaging system, available for anyone to use, which runs on Red Hat Enterprise Linux as well as other Linux and UNIX systems. Red Hat, Inc encourages other vendors to use RPM for their own products. RPM is distributable under the terms of the GPL.
For the end user, RPM makes system updates easy. Installing, uninstalling, and upgrading RPM packages can be accomplished with short commands. RPM maintains a database of installed packages and their files, so you can invoke powerful queries and verifications on your system. If you prefer a graphical interface, you can use the Package Management Tool to perform many RPM commands.
During upgrades, RPM handles configuration files carefully, so that you never lose your customizations — something that you cannot accomplish with regular .tar.gz files.
For the developer, RPM allows you to take software source code and package it into source and binary packages for end users. This process is quite simple and is driven from a single file and optional patches that you create. This clear delineation between pristine sources and your patches along with build instructions eases the maintenance of the package as new versions of the software are released.

Note

Because RPM makes changes to your system, you must be root to install, remove, or upgrade an RPM package.

15.1. RPM Design Goals

To understand how to use RPM, it can be helpful to understand RPM's design goals:
Upgradability
Using RPM, you can upgrade individual components of your system without completely reinstalling. When you get a new release of an operating system based on RPM (such as Red Hat Enterprise Linux), you do not need to reinstall on your machine (as you do with operating systems based on other packaging systems). RPM allows intelligent, fully-automated, in-place upgrades of your system. Configuration files in packages are preserved across upgrades, so you do not lose your customizations. There are no special upgrade files needed to upgrade a package because the same RPM file is used to install and upgrade the package on your system.
Powerful Querying
RPM is designed to provide powerful querying options. You can do searches through your entire database for packages or just for certain files. You can also easily find out what package a file belongs to and from where the package came. The files an RPM package contains are in a compressed archive, with a custom binary header containing useful information about the package and its contents, allowing you to query individual packages quickly and easily.
System Verification
Another powerful feature is the ability to verify packages. If you are worried that you deleted an important file for some package, verify the package. You are notified of any anomalies. At that point, you can reinstall the package if necessary. Any configuration files that you modified are preserved during reinstallation.
Pristine Sources
A crucial design goal was to allow the use of "pristine" software sources, as distributed by the original authors of the software. With RPM, you have the pristine sources along with any patches that were used, plus complete build instructions. This is an important advantage for several reasons. For instance, if a new version of a program comes out, you do not necessarily have to start from scratch to get it to compile. You can look at the patch to see what you might need to do. All the compiled-in defaults, and all of the changes that were made to get the software to build properly, are easily visible using this technique.
The goal of keeping sources pristine may only seem important for developers, but it results in higher quality software for end users, too.

15.2. Using RPM

RPM has five basic modes of operation (not counting package building): installing, uninstalling, upgrading, querying, and verifying. This section contains an overview of each mode. For complete details and options, try rpm --help or refer to Section 15.5, “Additional Resources” for more information on RPM.

15.2.1. Finding RPM Packages

Before using an RPM, you must know where to find them. An Internet search returns many RPM repositories, but if you are looking for RPM packages built by Red Hat, Inc, they can be found at the following locations:

15.2.2. Installing

RPM packages typically have file names like foo-1.0-1.i386.rpm. The file name includes the package name (foo), version (1.0), release (1), and architecture (i386). To install a package, log in as root and type the following command at a shell prompt:
rpm -Uvh foo-1.0-1.i386.rpm
If installation is successful, the following output is displayed:
Preparing...                ########################################### [100%]
   1:foo                    ########################################### [100%]
As you can see, RPM prints out the name of the package and then prints a succession of hash marks as the package is installed as a progress meter.
The signature of a package is checked automatically when installing or upgrading a package. The signature confirms that the package was signed by an authorized party. For example, if the verification of the signature fails, an error message such as the following is displayed:
error: V3 DSA signature: BAD, key ID 0352860f
If it is a new, header-only, signature, an error message such as the following is displayed:
error: Header V3 DSA signature: BAD, key ID 0352860f
If you do not have the appropriate key installed to verify the signature, the message contains the word NOKEY such as:
warning: V3 DSA signature: NOKEY, key ID 0352860f
Refer to Section 15.3, “Checking a Package's Signature” for more information on checking a package's signature.

Warning

If you are installing a kernel package, you should use rpm -ivh instead. Refer to Chapter 36, Manually Upgrading the Kernel for details.
Installing packages is designed to be simple, but you may sometimes see errors.

15.2.2.1. Package Already Installed

If the package of the same version is already installed, the following is displayed:
Preparing...                ########################################### [100%]
package foo-1.0-1 is already installed
If the same version you are trying to install is already installed, and you want to install the package anyway, you can use the --replacepkgs option, which tells RPM to ignore the error:
rpm -ivh --replacepkgs foo-1.0-1.i386.rpm
This option is helpful if files installed from the RPM were deleted or if you want the original configuration files from the RPM to be installed.

15.2.2.2. Conflicting Files

If you attempt to install a package that contains a file which has already been installed by another package or an earlier version of the same package, the following is displayed:
Preparing...                ########################################### [100%]
file /usr/bin/foo from install of foo-1.0-1 conflicts with file from package bar-2.0.20
To make RPM ignore this error, use the --replacefiles option:
rpm -ivh --replacefiles foo-1.0-1.i386.rpm

15.2.2.3. Unresolved Dependency

RPM packages can, essentially, depend on other packages, which means that they require other packages to be installed to run properly. If you try to install a package which has an unresolved dependency, output similar to the following is displayed:
error: Failed dependencies:
        bar.so.2 is needed by foo-1.0-1
    Suggested resolutions:
        bar-2.0.20-3.i386.rpm
If you are installing a package from the Red Hat Enterprise Linux CD-ROM set, it usually suggest the package(s) needed to resolve the dependency. Find the suggested package(s) on the Red Hat Enterprise Linux CD-ROMs or from the Red Hat FTP site (or mirror), and add it to the command:
rpm -ivh foo-1.0-1.i386.rpm bar-2.0.20-3.i386.rpm
If installation of both packages is successful, output similar to the following is displayed:
Preparing...                ########################################### [100%]
   1:foo                    ########################################### [ 50%]
   2:bar                    ########################################### [100%]
If it does not suggest a package to resolve the dependency, you can try the --redhatprovides option to determine which package contains the required file. You need the rpmdb-redhat package installed to use this option.
rpm -q --redhatprovides bar.so.2
If the package that contains bar.so.2 is in the installed database from the rpmdb-redhat package, the name of the package is displayed:
bar-2.0.20-3.i386.rpm
To force the installation anyway (which is not recommended since the package may not run correctly), use the --nodeps option.

15.2.3. Uninstalling

Uninstalling a package is just as simple as installing one. Type the following command at a shell prompt:
rpm -e foo

Note

Notice that we used the package namefoo, not the name of the original package filefoo-1.0-1.i386.rpm. To uninstall a package, replace foo with the actual package name of the original package.
You can encounter a dependency error when uninstalling a package if another installed package depends on the one you are trying to remove. For example:
error: Failed dependencies:
        foo is needed by (installed) bar-2.0.20-3.i386.rpm
To cause RPM to ignore this error and uninstall the package anyway, which may break the package depending on it, use the --nodeps option.

15.2.4. Upgrading

Upgrading a package is similar to installing one. Type the following command at a shell prompt:
rpm -Uvh foo-2.0-1.i386.rpm
As part of upgrading a package, RPM automatically uninstalls any old versions of the foo package. In fact, you may want to always use -U to install packages which works even when there are no previous versions of the package installed.

Note

You don't want to use the -U option for installing kernel packages because RPM replaces the previous kernel package. This does not affect a running system, but if the new kernel is unable to boot during your next restart, there would be no other kernel to boot instead.
Using the -i option adds the kernel to your GRUB boot menu (/etc/grub.conf). Similarly, removing an old, unneeded kernel removes the kernel from GRUB.
Because RPM performs intelligent upgrading of packages with configuration files, you may see a message like the following:
saving /etc/foo.conf as /etc/foo.conf.rpmsave
This message means that your changes to the configuration file may not be forward compatible with the new configuration file in the package, so RPM saved your original file and installed a new one. You should investigate the differences between the two configuration files and resolve them as soon as possible, to ensure that your system continues to function properly.
Upgrading is really a combination of uninstalling and installing, so during an RPM upgrade you can encounter uninstalling and installing errors, plus one more. If RPM thinks you are trying to upgrade to a package with an older version number, the output is similar to the following:
package foo-2.0-1 (which is newer than foo-1.0-1) is already installed
To force RPM to upgrade anyway, use the --oldpackage option:
rpm -Uvh --oldpackage foo-1.0-1.i386.rpm

15.2.5. Freshening

Freshening a package is similar to upgrading one. Type the following command at a shell prompt:
rpm -Fvh foo-1.2-1.i386.rpm
RPM's freshen option checks the versions of the packages specified on the command line against the versions of packages that have already been installed on your system. When a newer version of an already-installed package is processed by RPM's freshen option, it is upgraded to the newer version. However, RPM's freshen option does not install a package if no previously-installed package of the same name exists. This differs from RPM's upgrade option, as an upgrade does install packages, whether or not an older version of the package was already installed.
RPM's freshen option works for single packages or package groups. If you have just downloaded a large number of different packages, and you only want to upgrade those packages that are already installed on your system, freshening does the job. If you use freshening, you do not have to delete any unwanted packages from the group that you downloaded before using RPM.
In this case, issue the following command:
rpm -Fvh *.rpm
RPM automatically upgrades only those packages that are already installed.

15.2.6. Querying

Use the rpm -q command to query the database of installed packages. The rpm -q foo command displays the package name, version, and release number of the installed package foo:
foo-2.0-1

Note

To query a package, replace foo with the actual package name.
Instead of specifying the package name, use the following options with -q to specify the package(s) you want to query. These are called Package Selection Options.
  • -a queries all currently installed packages.
  • -f <file> queries the package which owns <file>. When specifying a file, you must specify the full path of the file (for example, /bin/ls).
  • -p <packagefile> queries the package <packagefile>.
There are a number of ways to specify what information to display about queried packages. The following options are used to select the type of information for which you are searching. These are called Information Query Options.
  • -i displays package information including name, description, release, size, build date, install date, vendor, and other miscellaneous information.
  • -l displays the list of files that the package contains.
  • -s displays the state of all the files in the package.
  • -d displays a list of files marked as documentation (man pages, info pages, READMEs, etc.).
  • -c displays a list of files marked as configuration files. These are the files you change after installation to adapt the package to your system (for example, sendmail.cf, passwd, inittab, etc.).
For the options that display lists of files, add -v to the command to display the lists in a familiar ls -l format.

15.2.7. Verifying

Verifying a package compares information about files installed from a package with the same information from the original package. Among other things, verifying compares the size, MD5 sum, permissions, type, owner, and group of each file.
The command rpm -V verifies a package. You can use any of the Package Verify Options listed for querying to specify the packages you wish to verify. A simple use of verifying is rpm -V foo, which verifies that all the files in the foo package are as they were when they were originally installed. For example:
  • To verify a package containing a particular file:
    rpm -Vf /usr/bin/vim
  • To verify ALL installed packages:
    rpm -Va
  • To verify an installed package against an RPM package file:
    rpm -Vp foo-1.0-1.i386.rpm
    This command can be useful if you suspect that your RPM databases are corrupt.
If everything verified properly, there is no output. If there are any discrepancies, they are displayed. The format of the output is a string of eight characters (a c denotes a configuration file) and then the file name. Each of the eight characters denotes the result of a comparison of one attribute of the file to the value of that attribute recorded in the RPM database. A single period (.) means the test passed. The following characters denote failure of certain tests:
  • 5 — MD5 checksum
  • S — file size
  • L — symbolic link
  • T — file modification time
  • D — device
  • U — user
  • G — group
  • M — mode (includes permissions and file type)
  • ? — unreadable file
If you see any output, use your best judgment to determine if you should remove or reinstall the package, or fix the problem in another way.

15.3. Checking a Package's Signature

If you wish to verify that a package has not been corrupted or tampered with, examine only the md5sum by typing the following command at a shell prompt (<rpm-file> with file name of the RPM package):
rpm -K --nosignature <rpm-file>
The message <rpm-file>: md5 OK is displayed. This brief message means that the file was not corrupted by the download. To see a more verbose message, replace -K with -Kvv in the command.
On the other hand, how trustworthy is the developer who created the package? If the package is signed with the developer's GnuPG key, you know that the developer really is who they say they are.
An RPM package can be signed using Gnu Privacy Guard (or GnuPG), to help you make certain your downloaded package is trustworthy.
GnuPG is a tool for secure communication; it is a complete and free replacement for the encryption technology of PGP, an electronic privacy program. With GnuPG, you can authenticate the validity of documents and encrypt/decrypt data to and from other recipients. GnuPG is capable of decrypting and verifying PGP 5.x files as well.
During installation, GnuPG is installed by default. That way you can immediately start using GnuPG to verify any packages that you receive from Red Hat. First, you must import Red Hat's public key.

15.3.1. Importing Keys

To verify Red Hat packages, you must import the Red Hat GPG key. To do so, execute the following command at a shell prompt:
rpm --import /usr/share/rhn/RPM-GPG-KEY
To display a list of all keys installed for RPM verification, execute the command:
rpm -qa gpg-pubkey*
For the Red Hat key, the output includes:
gpg-pubkey-db42a60e-37ea5438
To display details about a specific key, use rpm -qi followed by the output from the previous command:
rpm -qi gpg-pubkey-db42a60e-37ea5438

15.3.2. Verifying Signature of Packages

To check the GnuPG signature of an RPM file after importing the builder's GnuPG key, use the following command (replace <rpm-file> with filename of the RPM package):
rpm -K <rpm-file>
If all goes well, the following message is displayed: md5 gpg OK. That means that the signature of the package has been verified and that it is not corrupt.

15.4. Impressing Your Friends with RPM

RPM is a useful tool for both managing your system and diagnosing and fixing problems. The best way to make sense of all of its options is to look at some examples.
  • Perhaps you have deleted some files by accident, but you are not sure what you deleted. To verify your entire system and see what might be missing, you could try the following command:
    rpm -Va
    If some files are missing or appear to have been corrupted, you should probably either re-install the package or uninstall and then re-install the package.
  • At some point, you might see a file that you do not recognize. To find out which package owns it, enter:
    rpm -qf /usr/bin/ggv
    The output would look like the following:
    ggv-2.6.0-2
    
  • We can combine the above two examples in the following scenario. Say you are having problems with /usr/bin/paste. You would like to verify the package that owns that program, but you do not know which package owns paste. Enter the following command,
    rpm -Vf /usr/bin/paste
    and the appropriate package is verified.
  • Do you want to find out more information about a particular program? You can try the following command to locate the documentation which came with the package that owns that program:
    rpm -qdf /usr/bin/free
    The output would be similar to the following:
    /usr/share/doc/procps-3.2.3/BUGS
    /usr/share/doc/procps-3.2.3/FAQ
    /usr/share/doc/procps-3.2.3/NEWS
    /usr/share/doc/procps-3.2.3/TODO
    /usr/share/man/man1/free.1.gz
    /usr/share/man/man1/pgrep.1.gz
    /usr/share/man/man1/pkill.1.gz
    /usr/share/man/man1/pmap.1.gz
    /usr/share/man/man1/ps.1.gz
    /usr/share/man/man1/skill.1.gz
    /usr/share/man/man1/slabtop.1.gz
    /usr/share/man/man1/snice.1.gz
    /usr/share/man/man1/tload.1.gz
    /usr/share/man/man1/top.1.gz
    /usr/share/man/man1/uptime.1.gz
    /usr/share/man/man1/w.1.gz
    /usr/share/man/man1/watch.1.gz
    /usr/share/man/man5/sysctl.conf.5.gz
    /usr/share/man/man8/sysctl.8.gz
    /usr/share/man/man8/vmstat.8.gz
    
  • You may find a new RPM, but you do not know what it does. To find information about it, use the following command:
    rpm -qip crontabs-1.10-7.noarch.rpm
    The output would be similar to the following:
    Name        : crontabs                     Relocations: (not relocatable)
    Version     : 1.10                              Vendor: Red Hat, Inc
    Release     : 7                             Build Date: Mon 20 Sep 2004 05:58:10 PM EDT
    Install Date: (not installed)               Build Host: tweety.build.redhat.com
    Group       : System Environment/Base       Source RPM: crontabs-1.10-7.src.rpm
    Size        : 1004                             License: Public Domain
    Signature   : DSA/SHA1, Wed 05 Jan 2005 06:05:25 PM EST, Key ID 219180cddb42a60e
    Packager    : Red Hat, Inc <http://bugzilla.redhat.com/bugzilla>
    Summary     : Root crontab files used to schedule the execution of programs.
    Description :
    The crontabs package contains root crontab files. Crontab is the
    program used to install, uninstall, or list the tables used to drive the
    cron daemon. The cron daemon checks the crontab files to see when
    particular commands are scheduled to be executed. If commands are
    scheduled, then it executes them.
    
  • Perhaps you now want to see what files the crontabs RPM installs. You would enter the following:
    rpm -qlp crontabs-1.10-5.noarch.rpm
    The output is similar to the following:
    /etc/cron.daily
    /etc/cron.hourly
    /etc/cron.monthly
    /etc/cron.weekly
    /etc/crontab
    /usr/bin/run-parts
    
These are just a few examples. As you use it, you will find many more uses for RPM.

15.5. Additional Resources

RPM is an extremely complex utility with many options and methods for querying, installing, upgrading, and removing packages. Refer to the following resources to learn more about RPM.

15.5.1. Installed Documentation

  • rpm --help — This command displays a quick reference of RPM parameters.
  • man rpm — The RPM man page gives more detail about RPM parameters than the rpm --help command.

15.5.2. Useful Websites

Chapter 16. Red Hat Network

Red Hat Network is an Internet solution for managing one or more Red Hat Enterprise Linux systems. All Security Alerts, Bug Fix Alerts, and Enhancement Alerts (collectively known as Errata Alerts) can be downloaded directly from Red Hat using the Package Updater standalone application or through the RHN website available at https://rhn.redhat.com/.
Your RHN

Figure 16.1. Your RHN

Red Hat Network saves you time because you receive email when updated packages are released. You do not have to search the Web for updated packages or security alerts. By default, Red Hat Network installs the packages as well. You do not have to learn how to use RPM or worry about resolving software package dependencies; RHN does it all.
Red Hat Network features include:
  • Errata Alerts — learn when Security Alerts, Bug Fix Alerts, and Enhancement Alerts are issued for all the systems in your network
    Relevant Errata

    Figure 16.2. Relevant Errata

  • Automatic email notifications — Receive an email notification when an Errata Alert is issued for your system(s)
  • Scheduled Errata Updates — Schedule delivery of Errata Updates
  • Package installation — Schedule package installation on one or more systems with the click of a button
  • Package Updater — Use the Package Updater to download the latest software packages for your system (with optional package installation)
  • Red Hat Network website — Manage multiple systems, downloaded individual packages, and schedule actions such as Errata Updates through a secure Web browser connection from any computer

Warning

You must activate your Red Hat Enterprise Linux product before registering your system with Red Hat Network to make sure your system is entitled to the correct services. To activate your product, go to:
http://www.redhat.com/apps/activate/
After activating your product, register it with Red Hat Network to receive Errata Updates. The registration process gathers information about the system that is required to notify you of updates. For example, a list of packages installed on the system is compiled so you are only notified about updates that are relevant to your system.
The first time the system is booted, the Software Update Setup Assistant prompts you to register. If you did not register then, select Applications (the main menu on the panel) => System Tools => Package Updater on your desktop to start the registration process. Alternately, execute the command yum update from a shell prompt.
Registering with RHN

Figure 16.3. Registering with RHN

After registering, use one of the following methods to start receiving updates:
  • Select Applications (the main menu on the panel) => System Tools => Package Updater on your desktop
  • Execute the command yum from a shell prompt
  • Use the RHN website at https://rhn.redhat.com/
  • Click on the package icon when it appears in the panel to launch the Package Updater.
For more detailed instructions, refer to the documentation available at:
http://www.redhat.com/docs/manuals/RHNetwork/

Note

Red Hat Enterprise Linux includes a convenient panel icon that displays visible alerts when there is an update for your Red Hat Enterprise Linux system. This panel icon is not present if no updates are available.

Part V. System Configuration

Part of a system administrator's job is configuring the system for various tasks, types of users, and hardware configurations. This section explains how to configure a Red Hat Enterprise Linux system.

Chapter 27. Console Access

When normal (non-root) users log into a computer locally, they are given two types of special permissions:
  1. They can run certain programs that they would not otherwise be able to run
  2. They can access certain files (normally special device files used to access diskettes, CD-ROMs, and so on) that they would not otherwise be able to access
Since there are multiple consoles on a single computer and multiple users can be logged into the computer locally at the same time, one of the users has to essentially win the race to access the files. The first user to log in at the console owns those files. Once the first user logs out, the next user who logs in owns the files.
In contrast, every user who logs in at the console is allowed to run programs that accomplish tasks normally restricted to the root user. If X is running, these actions can be included as menu items in a graphical user interface. As shipped, the console-accessible programs include halt, poweroff, and reboot.

27.1. Disabling Shutdown Via Ctrl+Alt+Del

By default, /etc/inittab specifies that your system is set to shutdown and reboot in response to a Ctrl+Alt+Del key combination used at the console. To completely disable this ability, comment out the following line in /etc/inittab by putting a hash mark (#) in front of it:
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
Alternatively, you may want to allow certain non-root users the right to shutdown or reboot the system from the console using Ctrl+Alt+Del. You can restrict this privilege to certain users, by taking the following steps:
  1. Add the -a option to the /etc/inittab line shown above, so that it reads:
    ca::ctrlaltdel:/sbin/shutdown -a -t3 -r now
    
    The -a flag tells shutdown to look for the /etc/shutdown.allow file.
  2. Create a file named shutdown.allow in /etc. The shutdown.allow file should list the usernames of any users who are allowed to shutdown the system using Ctrl+Alt+Del. The format of the shutdown.allow file is a list of usernames, one per line, like the following:
    stephen
    jack
    sophie
    
According to this example shutdown.allow file, the users stephen, jack, and sophie are allowed to shutdown the system from the console using Ctrl+Alt+Del. When that key combination is used, the shutdown -a command in /etc/inittab checks to see if any of the users in /etc/shutdown.allow (or root) are logged in on a virtual console. If one of them is, the shutdown of the system continues; if not, an error message is written to the system console instead.
For more information on shutdown.allow, refer to the shutdown man page.

27.2. Disabling Console Program Access

To disable access by users to console programs, run the following command as root:
rm -f /etc/security/console.apps/*
In environments where the console is otherwise secured (BIOS and boot loader passwords are set, Ctrl+Alt+Delete is disabled, the power and reset switches are disabled, and so forth), you may not want to allow any user at the console to run poweroff, halt, and reboot, which are accessible from the console by default.
To remove these abilities, run the following commands as root:
rm -f /etc/security/console.apps/poweroffrm -f /etc/security/console.apps/haltrm -f /etc/security/console.apps/reboot

27.3. Defining the Console

The pam_console.so module uses the /etc/security/console.perms file to determine the permissions for users at the system console. The syntax of the file is very flexible; you can edit the file so that these instructions no longer apply. However, the default file has a line that looks like this:
<console>=tty[0-9][0-9]* vc/[0-9][0-9]* :[0-9]\.[0-9] :[0-9]
When users log in, they are attached to some sort of named terminal, either an X server with a name like :0 or mymachine.example.com:1.0, or a device like /dev/ttyS0 or /dev/pts/2. The default is to define that local virtual consoles and local X servers are considered local, but if you want to consider the serial terminal next to you on port /dev/ttyS1 to also be local, you can change that line to read:
<console>=tty[0-9][0-9]* vc/[0-9][0-9]* :[0-9]\.[0-9] :[0-9] /dev/ttyS1

27.4. Making Files Accessible From the Console

In /etc/security/console.perms, there is a section with lines like:
<floppy>=/dev/fd[0-1]* \
         /dev/floppy/* /mnt/floppy*
<sound>=/dev/dsp* /dev/audio* /dev/midi* \
        /dev/mixer* /dev/sequencer \
        /dev/sound/* /dev/beep \
/dev/snd/*
<cdrom>=/dev/cdrom* /dev/cdroms/* /dev/cdwriter* /mnt/cdrom*
You can add your own lines to this section, if necessary. Make sure that any lines you add refer to the appropriate device. For example, you could add the following line:
<scanner>=/dev/scanner /dev/usb/scanner*
(Of course, make sure that /dev/scanner is really your scanner and not, say, your hard drive.)
That is the first step. The second step is to define what is done with those files. Look in the last section of /etc/security/console.perms for lines similar to:
<console> 0660 <floppy> 0660 root.floppy
<console> 0600 <sound>  0640 root
<console> 0600 <cdrom>  0600 root.disk
and add a line like:
<console> 0600 <scanner> 0600 root
Then, when you log in at the console, you are given ownership of the /dev/scanner device with the permissions of 0600 (readable and writable by you only). When you log out, the device is owned by root and still has the permissions 0600 (now readable and writable by root only).

27.5. Enabling Console Access for Other Applications

To make other applications accessible to console users, a bit more work is required.
First of all, console access only works for applications which reside in /sbin/ or /usr/sbin/, so the application that you wish to run must be there. After verifying that, do the following steps:
  1. Create a link from the name of your application, such as our sample foo program, to the /usr/bin/consolehelper application:
    cd /usr/binln -s consolehelper foo
  2. Create the file /etc/security/console.apps/foo:
    touch /etc/security/console.apps/foo
  3. Create a PAM configuration file for the foo service in /etc/pam.d/. An easy way to do this is to start with a copy of the halt service's PAM configuration file, and then modify the file if you want to change the behavior:
    cp /etc/pam.d/halt /etc/pam.d/foo
Now, when /usr/bin/foo is executed, consolehelper is called, which authenticates the user with the help of /usr/sbin/userhelper. To authenticate the user, consolehelper asks for the user's password if /etc/pam.d/foo is a copy of /etc/pam.d/halt (otherwise, it does precisely what is specified in /etc/pam.d/foo) and then runs /usr/sbin/foo with root permissions.
In the PAM configuration file, an application can be configured to use the pam_timestamp module to remember (or cache) a successful authentication attempt. When an application is started and proper authentication is provided (the root password), a timestamp file is created. By default, a successful authentication is cached for five minutes. During this time, any other application that is configured to use pam_timestamp and run from the same session is automatically authenticated for the user — the user does not have to enter the root password again.
This module is included in the pam package. To enable this feature, the PAM configuration file in etc/pam.d/ must include the following lines:
auth sufficient /lib/security/pam_timestamp.so
session optional /lib/security/pam_timestamp.so
The first line that begins with auth should be after any other auth sufficient lines, and the line that begins with session should be after any other session optional lines.
If an application configured to use pam_timestamp is successfully authenticated from the Main Menu Button (on the Panel), the icon is displayed in the notification area of the panel if you are running the GNOME or KDE desktop environment. After the authentication expires (the default is five minutes), the icon disappears.
The user can select to forget the cached authentication by clicking on the icon and selecting the option to forget authentication.

27.6. The floppy Group

If, for whatever reason, console access is not appropriate for you and your non-root users are required access to your system's diskette drive, this can be done using the floppy group. Add the user(s) to the floppy group using the tool of your choice. For example, the gpasswd command can be used to add user fred to the floppy group:
gpasswd -a fred floppy
Now, user fred is able to access the system's diskette drive from the console.

Chapter 28. Date and Time Configuration

The Time and Date Properties Tool allows the user to change the system date and time, to configure the time zone used by the system, and to setup the Network Time Protocol (NTP) daemon to synchronize the system clock with a time server.
You must be running the X Window System and have root privileges to use the tool. There are three ways to start the application:
  • From the desktop, go to Applications (the main menu on the panel) => System Settings => Date & Time
  • From the desktop, right-click on the time in the toolbar and select Adjust Date and Time.
  • Type the command system-config-date, system-config-time, or dateconfig at a shell prompt (for example, in an XTerm or a GNOME terminal).

28.1. Time and Date Properties

As shown in Figure 28.1, “Time and Date Properties”, the first tabbed window that appears is for configuring the system date and time.
Time and Date Properties

Figure 28.1. Time and Date Properties

To change the date, use the arrows to the left and right of the month to change the month, use the arrows to the left and right of the year to change the year, and click on the day of the week to change the day of the week.
To change the time, use the up and down arrow buttons beside the Hour, Minute, and Second in the Time section.
Clicking the OK button applies any changes made to the date and time, the NTP daemon settings, and the time zone settings. It also exits the program.

28.2. Network Time Protocol (NTP) Properties

As shown in Figure 28.2, “NTP Properties”, the second tabbed window that appears is for configuring NTP.
NTP Properties

Figure 28.2. NTP Properties

The Network Time Protocol (NTP) daemon synchronizes the system clock with a remote time server or time source. The application allows you to configure an NTP daemon to synchronize your system clock with a remote server. To enable this feature, select Enable Network Time Protocol. This enables the NTP Servers list and other options. You can choose one of the predefined servers, edit a predefined server by clicking the Edit or add a new server name by clicking Add. Your system does not start synchronizing with the NTP server until you click OK. After clicking OK, the configuration is saved and the NTP daemon is started (or restarted if it is already running).
Clicking the OK button applies any changes made to the date and time, the NTP daemon settings, and the time zone settings. It also exits the program.

28.3. Time Zone Configuration

The third tabbed window that appears is for configuring the system time zone.
To configure the system time zone, click the Time Zone tab. The time zone can be changed by either using the interactive map or by choosing the desired time zone from the list below the map. To use the map, click on the desired region. The map zooms into the region selected, after which you may choose the city specific to your time zone. A red X appears and the time zone selection changes in the list below the map.
Alternatively, you can also use the list below the map. In the same way that the map lets you choose a region before choosing a city, the list of time zones is now a treelist, with cities and countries grouped within their specific continents. Non-geographic time zones have also been added to address needs in the scientific community.
Click OK to apply the changes and exit the program.
If your system clock is set to use UTC, select the System clock uses UTC option. UTC stands for the Universal Time, Coordinated, also known as Greenwich Mean Time (GMT). Other time zones are determined by adding or subtracting from the UTC time.

Chapter 29. Keyboard Configuration

The installation program allows users to configure a keyboard layout for their systems. To configure a different keyboard layout after installation, use the Keyboard Configuration Tool.
To start the Keyboard Configuration Tool, select Applications (the main menu on the panel) => System Settings => Keyboard, or type the command system-config-keyboard at a shell prompt.
Keyboard Configuration

Figure 29.1. Keyboard Configuration

Select a keyboard layout from the list (for example, U.S. English) and click OK. For changes to take effect, you should log out of your graphical desktop session and log back in.

Chapter 30. Mouse Configuration

The installation program allows users to select the type of mouse connected to the system. To configure a different mouse type for the system, use the Mouse Configuration Tool.
To start the Mouse Configuration Tool, type the command system-config-mouse at a shell prompt (for example, in an XTerm or GNOME terminal). If the X Window System is not running, the text-based version of the tool is started.
Mouse Configuration

Figure 30.1. Mouse Configuration

Select the new mouse type for the system. If the specific mouse model is not listed, select one of the Generic entries, based on the mouse's number of buttons and its interface. If there is not an exact match, select the generic match that is most compatible with the system and the mouse.

Note

Select the Generic - Wheel Mouse entry, with the proper mouse port, to enable the scroll button on the mouse.
The scroll button on a wheel mouse can be used as the middle mouse button for cutting text, pasting text, and other middle mouse button functions. If the mouse only has two buttons, select Emulate 3 buttons to use a two-button mouse as a three-button mouse. When this option enabled, clicking the two mouse buttons simultaneously emulates a middle mouse button click.
If a serial port mouse is selected, click the Serial devices button to configure the correct serial device number, such as /dev/ttyS0 for the mouse.
Click OK to save the new mouse type. The selection is written to the file /etc/sysconfig/mouse, and the console mouse service, gpm is restarted. The changes are also written to the X Window System configuration file /etc/X11/xorg.conf; however, the mouse type change is not automatically applied to the current X session. To enable the new mouse type, log out of the graphical desktop and log back in.

Note

To reset the order of the mouse buttons for a left-handed user, go to Applications (the main menu on the panel) => Preferences => Mouse, and select Left-handed mouse for the mouse orientation.

Chapter 31. X Window System Configuration

During installation, the system's monitor, video card, and display settings are configured. To change any of these settings after installation, use the X Configuration Tool.
To start the X Configuration Tool, go to Applications (the main menu on the panel) => Administration => Display, or type the command system-config-display at a shell prompt (for example, in an XTerm or GNOME terminal). If the X Window System is not running, a small version of X is started to run the program.
After changing any of the settings, log out of the graphical desktop and log back in to enable the changes.

31.1. Display Settings

The Settings tab allows users to change the resolution and color depth. The display of a monitor consists of tiny dots called pixels. The number of pixels displayed at one time is called the resolution. For example, the resolution 1024x768 means that 1024 horizontal pixels and 768 vertical pixels are used. The higher the resolution values, the more images the monitor can display at one time.
The color depth of the display determines how many possible colors are displayed. A higher color depth means more contrast between colors.
Display Settings

Figure 31.1. Display Settings

31.2. Display Hardware Settings

When the X Configuration Tool is started, it probes the monitor and video card. If the hardware is probed properly, the information for it is shown on the Hardware tab as shown in Figure 31.2, “Display Hardware Settings”.
Display Hardware Settings

Figure 31.2. Display Hardware Settings

To change the monitor type or any of its settings, click the corresponding Configure button. To change the video card type or any of its settings, click the Configure button beside its settings.

31.3. Dual Head Display Settings

If multiple video cards are installed on the system, dual head monitor support is available and is configured via the Dual head tab, as shown in Figure 31.3, “Dual Head Display Settings”.
Dual Head Display Settings

Figure 31.3. Dual Head Display Settings

To enable use of Dual head, check the Use dual head checkbox.
To configure the second monitor type, click the corresponding Configure button. You can also configure the other Dual head settings by using the corresponding drop-down list.
For the Desktop layout option, selecting Spanning Desktops allows both monitors to use an enlarged usable workspace. Selecting Individual Desktops shares the mouse and keyboard among the displays, but restricts windows to a single display.

Chapter 32. Users and Groups

The control of users and groups is a core element of Red Hat Enterprise Linux system administration.
Users can be either people (meaning accounts tied to physical users) or accounts which exist for specific applications to use.
Groups are logical expressions of organization, tying users together for a common purpose. Users within a group can read, write, or execute files owned by that group.
Each user and group has a unique numerical identification number called a userid (UID) and a groupid (GID), respectively.
A user who creates a file is also the owner and group owner of that file. The file is assigned separate read, write, and execute permissions for the owner, the group, and everyone else. The file owner can be changed only by the root user, and access permissions can be changed by both the root user and file owner.

32.1. User and Group Configuration

The User Manager allows you to view, modify, add, and delete local users and groups.
To use the User Manager, you must be running the X Window System, have root privileges, and have the system-config-users RPM package installed. To start the User Manager from the desktop, go to Applications (the main menu on the panel) => Administration => Users & Groups. You can also type the command system-config-users at a shell prompt (for example, in an XTerm or a GNOME terminal).
User Manager

Figure 32.1. User Manager

To view a list of local users on the system, click the Users tab. To view a list of local groups on the system, click the Groups tab.
To find a specific user or group, type the first few letters of the name in the Search filter field. Press Enter or click the Apply filter button. The filtered list is displayed.
To sort the users or groups, click on the column name. The users or groups are sorted according to the value of that column.
Red Hat Enterprise Linux reserves user IDs below 500 for system users. By default, User Manager does not display system users. To view all users, including the system users, go to Edit => Preferences and uncheck Hide system users and groups from the dialog box.

32.1.1. Adding a New User

To add a new user, click the Add User button. A window as shown in Figure 32.2, “New User” appears. Type the username and full name for the new user in the appropriate fields. Type the user's password in the Password and Confirm Password fields. The password must be at least six characters.

Note

It is advisable to use a much longer password, as this makes it more difficult for an intruder to guess it and access the account without permission. It is also recommended that the password not be based on a dictionary term; use a combination of letters, numbers and special characters.
Select a login shell. If you are not sure which shell to select, accept the default value of /bin/bash. The default home directory is /home/<username>/. You can change the home directory that is created for the user, or you can choose not to create the home directory by unselecting Create home directory.
If you select to create the home directory, default configuration files are copied from the /etc/skel/ directory into the new home directory.
Red Hat Enterprise Linux uses a user private group (UPG) scheme. The UPG scheme does not add or change anything in the standard UNIX way of handling groups; it offers a new convention. Whenever you create a new user, by default, a unique group with the same name as the user is created. If you do not want to create this group, unselect Create a private group for the user.
To specify a user ID for the user, select Specify user ID manually. If the option is not selected, the next available user ID above 500 is assigned to the new user. Because Red Hat Enterprise Linux reserves user IDs below 500 for system users, it is not advisable to manually assign user IDs 1-499.
Click OK to create the user.
New User

Figure 32.2. New User

To configure more advanced user properties, such as password expiration, modify the user's properties after adding the user. Refer to Section 32.1.2, “Modifying User Properties” for more information.

32.1.2. Modifying User Properties

To view the properties of an existing user, click on the Users tab, select the user from the user list, and click Properties from the menu (or choose File => Properties from the pulldown menu). A window similar to Figure 32.3, “User Properties” appears.
User Properties

Figure 32.3. User Properties

The User Properties window is divided into multiple tabbed pages:
  • User Data — Shows the basic user information configured when you added the user. Use this tab to change the user's full name, password, home directory, or login shell.
  • Account Info Select Enable account expiration if you want the account to expire on a certain date. Enter the date in the provided fields. Select Local password is locked to lock the user account and prevent the user from logging into the system.
  • Password Info — Displays the date that the user's password last changed. To force the user to change passwords after a certain number of days, select Enable password expiration and enter a desired value in the Days before change required: field. The number of days before the user's password expires, the number of days before the user is warned to change passwords, and days before the account becomes inactive can also be changed.
  • Groups — Allows you to view and configure the Primary Group of the user, as well as other groups that you want the user to be a member of.

32.1.3. Adding a New Group

To add a new user group, click the Add Group button. A window similar to Figure 32.4, “New Group” appears. Type the name of the new group to create. To specify a group ID for the new group, select Specify group ID manually and select the GID. Note that Red Hat Enterprise Linux also reserves group IDs lower than 500 for system groups.
New Group

Figure 32.4. New Group

Click OK to create the group. The new group appears in the group list.

32.1.4. Modifying Group Properties

To view the properties of an existing group, select the group from the group list and click Properties from the menu (or choose File => Properties from the pulldown menu). A window similar to Figure 32.5, “Group Properties” appears.
Group Properties

Figure 32.5. Group Properties

The Group Users tab displays which users are members of the group. Use this tab to add or remove users from the group. Click OK to save your changes.

32.2. User and Group Management Tools

Managing users and groups can be a tedious task; this is why Red Hat Enterprise Linux provides tools and conventions to make them easier to manage.
The easiest way to manage users and groups is through the graphical application, User Manager (system-config-users). For more information on User Manager, refer to Section 32.1, “User and Group Configuration”.
The following command line tools can also be used to manage users and groups:
  • useradd, usermod, and userdel — Industry-standard methods of adding, deleting and modifying user accounts
  • groupadd, groupmod, and groupdel — Industry-standard methods of adding, deleting, and modifying user groups
  • gpasswd — Industry-standard method of administering the /etc/group file
  • pwck, grpck — Tools used for the verification of the password, group, and associated shadow files
  • pwconv, pwunconv — Tools used for the conversion of passwords to shadow passwords and back to standard passwords

32.2.1. Command Line Configuration

If you prefer command line tools or do not have the X Window System installed, use this section to configure users and groups.

32.2.2. Adding a User

To add a user to the system:
  1. Issue the useradd command to create a locked user account:
    useradd <username>
  2. Unlock the account by issuing the passwd command to assign a password and set password aging guidelines:
    passwd <username>
Command line options for useradd are detailed in Table 32.1, “useradd Command Line Options”.

Table 32.1. useradd Command Line Options

Option Description
-c '<comment>' <comment> can be replaced with any string. This option is generally used to specify the full name of a user.
-d <home-dir> Home directory to be used instead of default /home/<username>/
-e <date> Date for the account to be disabled in the format YYYY-MM-DD
-f <days> Number of days after the password expires until the account is disabled. If 0 is specified, the account is disabled immediately after the password expires. If -1 is specified, the account is not be disabled after the password expires.
-g <group-name> Group name or group number for the user's default group. The group must exist prior to being specified here.
-G <group-list> List of additional (other than default) group names or group numbers, separated by commas, of which the user is a member. The groups must exist prior to being specified here.
-m Create the home directory if it does not exist.
-M Do not create the home directory.
-n Do not create a user private group for the user.
-r Create a system account with a UID less than 500 and without a home directory
-p <password> The password encrypted with crypt
-s User's login shell, which defaults to /bin/bash
-u <uid> User ID for the user, which must be unique and greater than 499

32.2.3. Adding a Group

To add a group to the system, use the command groupadd:
groupadd <group-name>
Command line options for groupadd are detailed in Table 32.2, “groupadd Command Line Options”.

Table 32.2. groupadd Command Line Options

Option Description
-g <gid> Group ID for the group, which must be unique and greater than 499
-r Create a system group with a GID less than 500
-f When used with -g <gid> and <gid> already exists, groupadd will choose another unique <gid> for the group.

32.2.4. Password Aging

For security reasons, it is advisable to require users to change their passwords periodically. This can be done when adding or editing a user on the Password Info tab of the User Manager.
To configure password expiration for a user from a shell prompt, use the chage command, followed by an option from Table 32.3, “chage Command Line Options”, followed by the username of the user.

Important

Shadow passwords must be enabled to use the chage command.

Table 32.3. chage Command Line Options

Option Description
-m <days> Specifies the minimum number of days between which the user must change passwords. If the value is 0, the password does not expire.
-M <days> Specifies the maximum number of days for which the password is valid. When the number of days specified by this option plus the number of days specified with the -d option is less than the current day, the user must change passwords before using the account.
-d <days> Specifies the number of days since January 1, 1970 the password was changed
-I <days> Specifies the number of inactive days after the password expiration before locking the account. If the value is 0, the account is not locked after the password expires.
-E <date> Specifies the date on which the account is locked, in the format YYYY-MM-DD. Instead of the date, the number of days since January 1, 1970 can also be used.
-W <days> Specifies the number of days before the password expiration date to warn the user.

Note

If the chage command is followed directly by a username (with no options), it displays the current password aging values and allows them to be changed.
You can configure a password to expire the first time a user logs in. This forces users to change passwords the first time they log in.

Note

This process will not work if the user logs in using the SSH protocol.
  1. Lock the user password — If the user does not exist, use the useradd command to create the user account, but do not give it a password so that it remains locked.
    If the password is already enabled, lock it with the command:
    usermod -L username
  2. Force immediate password expiration — Type the following command:
    chage -d 0 username
    This command sets the value for the date the password was last changed to the epoch (January 1, 1970). This value forces immediate password expiration no matter what password aging policy, if any, is in place.
  3. Unlock the account — There are two common approaches to this step. The administrator can assign an initial password or assign a null password.

    Warning

    Do not use the passwd command to set the password as it disables the immediate password expiration just configured.
    To assign an initial password, use the following steps:
    • Start the command line Python interpreter with the python command. It displays the following:
      Python 2.4.3 (#1, Jul 21 2006, 08:46:09)
      [GCC 4.1.1 20060718 (Red Hat 4.1.1-9)] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      >>>
      
    • At the prompt, type the following commands. Replace <password> with the password to encrypt and <salt> with a random combination of at least 2 of the following: any alphanumeric character, the slash (/) character or a dot (.):
      import crypt; print crypt.crypt("<password>","<salt>")
      The output is the encrypted password, similar to '12CsGd8FRcMSM'.
    • Press Ctrl-D to exit the Python interpreter.
    • At the shell, enter the following command (replacing <encrypted-password> with the encrypted output of the Python interpreter):
      usermod -p "<encrypted-password>" <username>
    Alternatively, you can assign a null password instead of an initial password. To do this, use the following command:
    usermod -p "" username

    Warning

    Using a null password, while convenient, is a highly unsecure practice, as any third party can log in first an access the system using the unsecure username. Always make sure that the user is ready to log in before unlocking an account with a null password.
    In either case, upon initial log in, the user is prompted for a new password.

32.2.5. Explaining the Process

The following steps illustrate what happens if the command useradd juan is issued on a system that has shadow passwords enabled:
  1. A new line for juan is created in /etc/passwd. The line has the following characteristics:
    • It begins with the username juan.
    • There is an x for the password field indicating that the system is using shadow passwords.
    • A UID greater than 499 is created. (Under Red Hat Enterprise Linux, UIDs and GIDs below 500 are reserved for system use.)
    • A GID greater than 499 is created.
    • The optional GECOS information is left blank.
    • The home directory for juan is set to /home/juan/.
    • The default shell is set to /bin/bash.
  2. A new line for juan is created in /etc/shadow. The line has the following characteristics:
    • It begins with the username juan.
    • Two exclamation points (!!) appear in the password field of the /etc/shadow file, which locks the account.

      Note

      If an encrypted password is passed using the -p flag, it is placed in the /etc/shadow file on the new line for the user.
    • The password is set to never expire.
  3. A new line for a group named juan is created in /etc/group. A group with the same name as a user is called a user private group. For more information on user private groups, refer to Section 32.1.1, “Adding a New User”.
    The line created in /etc/group has the following characteristics:
    • It begins with the group name juan.
    • An x appears in the password field indicating that the system is using shadow group passwords.
    • The GID matches the one listed for user juan in /etc/passwd.
  4. A new line for a group named juan is created in /etc/gshadow. The line has the following characteristics:
    • It begins with the group name juan.
    • An exclamation point (!) appears in the password field of the /etc/gshadow file, which locks the group.
    • All other fields are blank.
  5. A directory for user juan is created in the /home/ directory. This directory is owned by user juan and group juan. However, it has read, write, and execute privileges only for the user juan. All other permissions are denied.
  6. The files within the /etc/skel/ directory (which contain default user settings) are copied into the new /home/juan/ directory.
At this point, a locked account called juan exists on the system. To activate it, the administrator must next assign a password to the account using the passwd command and, optionally, set password aging guidelines.

32.3. Standard Users

Table 32.4, “Standard Users” lists the standard users configured in the /etc/passwd file by an Everything installation. The groupid (GID) in this table is the primary group for the user. See Section 32.4, “Standard Groups” for a listing of standard groups.

Table 32.4. Standard Users

User UID GID Home Directory Shell
root 0 0 /root /bin/bash
bin 1 1 /bin /sbin/nologin
daemon 2 2 /sbin /sbin/nologin
adm 3 4 /var/adm /sbin/nologin
lp 4 7 /var/spool/lpd /sbin/nologin
sync 5 0 /sbin /bin/sync
shutdown 6 0 /sbin /sbin/shutdown
halt 7 0 /sbin /sbin/halt
mail 8 12 /var/spool/mail /sbin/nologin
news 9 13 /etc/news
uucp 10 14 /var/spool/uucp /sbin/nologin
operator 11 0 /root /sbin/nologin
games 12 100 /usr/games /sbin/nologin
gopher 13 30 /var/gopher /sbin/nologin
ftp 14 50 /var/ftp /sbin/nologin
nobody 99 99 / /sbin/nologin
rpm 37 37 /var/lib/rpm /sbin/nologin
vcsa 69 69 /dev /sbin/nologin
dbus 81 81 / /sbin/nologin
ntp 38 38 /etc/ntp /sbin/nologin
canna 39 39 /var/lib/canna /sbin/nologin
nscd 28 28 / /sbin/nologin
rpc 32 32 / /sbin/nologin
postfix 89 89 /var/spool/postfix /sbin/nologin
mailman 41 41 /var/mailman /sbin/nologin
named 25 25 /var/named /bin/false
amanda 33 6 var/lib/amanda/ /bin/bash
postgres 26 26 /var/lib/pgsql /bin/bash
exim 93 93 /var/spool/exim /sbin/nologin
sshd 74 74 /var/empty/sshd /sbin/nologin
rpcuser 29 29 /var/lib/nfs /sbin/nologin
nsfnobody 65534 65534 /var/lib/nfs /sbin/nologin
pvm 24 24 /usr/share/pvm3 /bin/bash
apache 48 48 /var/www /sbin/nologin
xfs 43 43 /etc/X11/fs /sbin/nologin
gdm 42 42 /var/gdm /sbin/nologin
htt 100 101 /usr/lib/im /sbin/nologin
mysql 27 27 /var/lib/mysql /bin/bash
webalizer 67 67 /var/www/usage /sbin/nologin
mailnull 47 47 /var/spool/mqueue /sbin/nologin
smmsp 51 51 /var/spool/mqueue /sbin/nologin
squid 23 23 /var/spool/squid /sbin/nologin
ldap 55 55 /var/lib/ldap /bin/false
netdump 34 34 /var/crash /bin/bash
pcap 77 77 /var/arpwatch /sbin/nologin
radiusd 95 95 / /bin/false
radvd 75 75 / /sbin/nologin
quagga 92 92 /var/run/quagga /sbin/login
wnn 49 49 /var/lib/wnn /sbin/nologin
dovecot 97 97 /usr/libexec/dovecot /sbin/nologin

32.4. Standard Groups

Table 32.5, “Standard Groups” lists the standard groups configured by an Everything installation. Groups are stored in the /etc/group file.

Table 32.5. Standard Groups

Group GID Members
root 0 root
bin 1 root, bin, daemon
daemon 2 root, bin, daemon
sys 3 root, bin, adm
adm 4 root, adm, daemon
tty 5
disk 6 root
lp 7 daemon, lp
mem 8
kmem 9
wheel 10 root
mail 12 mail, postfix, exim
news 13 news
uucp 14 uucp
man 15
games 20
gopher 30
dip 40
ftp 50
lock 54
nobody 99
users 100
rpm 37
utmp 22
floppy 19
vcsa 69
dbus 81
ntp 38
canna 39
nscd 28
rpc 32
postdrop 90
postfix 89
mailman 41
exim 93
named 25
postgres 26
sshd 74
rpcuser 29
nfsnobody 65534
pvm 24
apache 48
xfs 43
gdm 42
htt 101
mysql 27
webalizer 67
mailnull 47
smmsp 51
squid 23
ldap 55
netdump 34
pcap 77
quaggavt 102
quagga 92
radvd 75
slocate 21
wnn 49
dovecot 97
radiusd 95

32.5. User Private Groups

Red Hat Enterprise Linux uses a user private group (UPG) scheme, which makes UNIX groups easier to manage.
A UPG is created whenever a new user is added to the system. A UPG has the same name as the user for which it was created and that user is the only member of the UPG.
UPGs make it safe to set default permissions for a newly created file or directory, allowing both the user and the group of that user to make modifications to the file or directory.
The setting which determines what permissions are applied to a newly created file or directory is called a umask and is configured in the /etc/bashrc file. Traditionally on UNIX systems, the umask is set to 022, which allows only the user who created the file or directory to make modifications. Under this scheme, all other users, including members of the creator's group, are not allowed to make any modifications. However, under the UPG scheme, this "group protection" is not necessary since every user has their own private group.

32.5.1. Group Directories

Many IT organizations like to create a group for each major project and then assign people to the group if they need to access that project's files. Using this traditional scheme, managing files has been difficult; when someone creates a file, it is associated with the primary group to which they belong. When a single person works on multiple projects, it is difficult to associate the right files with the right group. Using the UPG scheme, however, groups are automatically assigned to files created within a directory with the setgid bit set. The setgid bit makes managing group projects that share a common directory very simple because any files a user creates within the directory are owned by the group which owns the directory.
Let us say, for example, that a group of people need to work on files in the /usr/share/emacs/site-lisp/ directory. Some people are trusted to modify the directory, but certainly not everyone is trusted. First create an emacs group, as in the following command:
/usr/sbin/groupadd emacs
To associate the contents of the directory with the emacs group, type:
chown -R root.emacs /usr/share/emacs/site-lisp
Now, it is possible to add the proper users to the group with the gpasswd command:
/usr/bin/gpasswd -a <username> emacs
To allow users to create files within the directory, use the following command:
chmod 775 /usr/share/emacs/site-lisp
When a user creates a new file, it is assigned the group of the user's default private group. Next, set the setgid bit, which assigns everything created in the directory the same group permission as the directory itself (emacs). Use the following command:
chmod 2775 /usr/share/emacs/site-lisp
At this point, because the default umask of each user is 002, all members of the emacs group can create and edit files in the /usr/share/emacs/site-lisp/ directory without the administrator having to change file permissions every time users write new files.

32.6. Shadow Passwords

In multiuser environments it is very important to use shadow passwords (provided by the shadow-utils package). Doing so enhances the security of system authentication files. For this reason, the installation program enables shadow passwords by default.
The following lists the advantages pf shadow passwords have over the traditional way of storing passwords on UNIX-based systems:
  • Improves system security by moving encrypted password hashes from the world-readable /etc/passwd file to /etc/shadow, which is readable only by the root user.
  • Stores information about password aging.
  • Allows the use the /etc/login.defs file to enforce security policies.
Most utilities provided by the shadow-utils package work properly whether or not shadow passwords are enabled. However, since password aging information is stored exclusively in the /etc/shadow file, any commands which create or modify password aging information do not work.
The following is a list of commands which do not work without first enabling shadow passwords:
  • chage
  • gpasswd
  • /usr/sbin/usermod -e or -f options
  • /usr/sbin/useradd -e or -f options

32.7. Additional Resources

For more information about users and groups, and tools to manage them, refer to the following resources.

32.7.1. Installed Documentation

  • Related man pages — There are a number of man pages for the various applications and configuration files involved with managing users and groups. Some of the more important man pages have been listed here:
    User and Group Administrative Applications
    • man chage — A command to modify password aging policies and account expiration.
    • man gpasswd — A command to administer the /etc/group file.
    • man groupadd — A command to add groups.
    • man grpck — A command to verify the /etc/group file.
    • man groupdel — A command to remove groups.
    • man groupmod — A command to modify group membership.
    • man pwck — A command to verify the /etc/passwd and /etc/shadow files.
    • man pwconv — A tool to convert standard passwords to shadow passwords.
    • man pwunconv — A tool to convert shadow passwords to standard passwords.
    • man useradd — A command to add users.
    • man userdel — A command to remove users.
    • man usermod — A command to modify users.
    Configuration Files
    • man 5 group — The file containing group information for the system.
    • man 5 passwd — The file containing user information for the system.
    • man 5 shadow — The file containing passwords and account expiration information for the system.

Chapter 33. Printer Configuration

Printer Configuration Tool allows users to configure a printer. This tool helps maintain the printer configuration file, print spool directories, print filters, and printer classes.
Red Hat Enterprise Linux 4 uses the Common Unix Printing System (CUPS). If a system was upgraded from a previous Red Hat Enterprise Linux version that used CUPS, the upgrade process preserves the configured queues.
Using Printer Configuration Tool requires root privileges. To start the application, select Applications (the main menu on the panel) => Administration => Printing, or type the command system-config-printer at a shell prompt.
Printer Configuration Tool

Figure 33.1. Printer Configuration Tool

The following types of print queues can be configured:
  • AppSocket/HP JetDirect — a printer connected directly to the network through HP JetDirect or Appsocket interface instead of a computer.
  • Internet Printing Protocol (IPP) — a printer that can be accessed over a TCP/IP network via the Internet Printing Protocol (for example, a printer attached to another Red Hat Enterprise Linux system running CUPS on the network).
  • LPD/LPR Host or Printer — a printer attached to a different UNIX system that can be accessed over a TCP/IP network (for example, a printer attached to another Red Hat Enterprise Linux system running LPD on the network).
  • Networked Windows (SMB) — a printer attached to a different system which is sharing a printer over an SMB network (for example, a printer attached to a Microsoft Windows™ machine).
  • Networked JetDirect — a printer connected directly to the network through HP JetDirect instead of a computer.

Important

If you add a new print queue or modify an existing one, you must apply the changes for them to take effect.
Clicking the Apply button prompts the printer daemon to restart with the changes you have configured.
Clicking the Revert button discards unapplied changes.

33.1. Adding a Local Printer

To add a local printer, such as one attached through a parallel port or USB port on your computer, click the New Printer button in the main Printer Configuration Tool window to display the window in Figure 33.2, “Adding a Printer.
Adding a Printer

Figure 33.2. Adding a Printer

Click Forward to proceed.
Enter a unique name for the printer in the Printer Name field. The printer name can contain letters, numbers, dashes (-), and underscores (_); it must not contain any spaces.
You can also use the Description and Location fields to further distinguish this printer from others that may be configured on your system. Both of these fields are optional, and may contain spaces.
Click Forward to open the New Printer dialogue (refer to Figure 33.3, “Adding a Local Printer”). If the printer has been automatically detected, the printer model appears in Select Connection. Select the printer model and click Forward to continue.
If the device does not automatically appear, select the device to which the printer is connected (such as LPT #1 or Serial Port #1) in Select Connection.
Adding a Local Printer

Figure 33.3. Adding a Local Printer

Next, select the printer type. Refer to Section 33.5, “Selecting the Printer Model and Finishing” for details.

33.2. Adding an IPP Printer

An IPP printer is a printer attached to a different system on the same TCP/IP network. The system this printer is attached to may either be running CUPS or simply configured to use IPP.
If a firewall is enabled on the printer server, then the firewall should be configured to allow send / receive connections on the incoming UDP port 631. If a firewall is enabled on on the client (the system sending the print request) then the firewall must be allowed to accept and create connections through port 631.
You can add a networked IPP printer by clicking the New Printer button in the main Printer Configuration Tool window to display the window in Figure 33.2, “Adding a Printer. Enter the Printer Name (printer names cannot contain spaces and may contain letters, numbers, dashes (-), and underscores (_)), Description, and Location to distinguish this printer from others that you may configure on your system. Click Forward to proceed.
In the window shown in Figure 33.4, “Adding an IPP Printer”, enter the hostname of the IPP printer in the Hostname field as well as a unique name for the printer in the Printername field.
Adding an IPP Printer

Figure 33.4. Adding an IPP Printer

Click Forward to continue.
Next, select the printer type. Refer to Section 33.5, “Selecting the Printer Model and Finishing” for details.

33.3. Adding a Samba (SMB) Printer

You can add a Samba (SMB) based printer share by clicking the New Printer button in the main Printer Configuration Tool window to display the window in Figure 33.2, “Adding a Printer. Enter a unique name for the printer in the Printer Name field. The printer name can contain letters, numbers, dashes (-), and underscores (_); it must not contain any spaces.
You can also use the Description and Location fields to further distinguish this printer from others that may be configured on your system. Both of these fields are optional, and may contain spaces.
Adding a SMB Printer

Figure 33.5. Adding a SMB Printer

As shown in Figure 33.5, “Adding a SMB Printer”, available SMB shares are automatically detected and listed in the Share column. Click the arrow ( ) beside a Workgroup to expand it. From the expanded list, select a printer.
If the printer you are looking for does not appear in the list, enter the SMB address in the smb:// field. Use the format computer name/printer share. In Figure 33.5, “Adding a SMB Printer”, the computer name is dellbox, while the printer share is r2.
In the Username field, enter the username to access the printer. This user must exist on the SMB system, and the user must have permission to access the printer. The default user name is typically guest for Windows servers, or nobody for Samba servers.
Enter the Password (if required) for the user specified in the Username field.
You can then test the connection by clicking Verify. Upon successful verification, a dialog box appears confirming printer share accessibility.
Next, select the printer type. Refer to Section 33.5, “Selecting the Printer Model and Finishing” for details.

Warning

Samba printer usernames and passwords are stored in the printer server as unencrypted files readable by root and lpd. Thus, other users that have root access to the printer server can view the username and password you use to access the Samba printer.
As such, when you choose a username and password to access a Samba printer, it is advisable that you choose a password that is different from what you use to access your local Red Hat Enterprise Linux system.
If there are files shared on the Samba print server, it is recommended that they also use a password different from what is used by the print queue.

33.4. Adding a JetDirect Printer

To add a JetDirect or AppSocket connected printer share, click the New Printer button in the main Printer Configuration Tool window to display the window in Figure 33.2, “Adding a Printer. Enter a unique name for the printer in the Printer Name field. The printer name can contain letters, numbers, dashes (-), and underscores (_); it must not contain any spaces.
You can also use the Description and Location fields to further distinguish this printer from others that may be configured on your system. Both of these fields are optional, and may contain spaces.
Adding a JetDirect Printer

Figure 33.6. Adding a JetDirect Printer

Click Forward to continue.
Text fields for the following options appear:
  • Hostname — The hostname or IP address of the JetDirect printer.
  • Port Number — The port on the JetDirect printer that is listening for print jobs. The default port is 9100.
Next, select the printer type. Refer to Section 33.5, “Selecting the Printer Model and Finishing” for details.

33.5. Selecting the Printer Model and Finishing

Once you have properly selected a printer queue type, you can choose either option:
  • Select a Printer from database - If you select this option, choose the make of your printer from the list of Makes. If your printer make is not listed, choose Generic.
  • Provide PPD file - A PostScript Printer Description (PPD) file may also be provided with your printer. This file is normally provided by the manufacturer. If you are provided with a PPD file, you can choose this option and use the browser bar below the option description to select the PPD file.
Selecting a Printer Model

Figure 33.7. Selecting a Printer Model

After choosing an option, click Forward to continue. Figure 33.7, “Selecting a Printer Model” appears. You now have to choose the corresponding model and driver for the printer.
The recommended printed driver is automatically selected based on the printer model you chose. The print driver processes the data that you want to print into a format the printer can understand. Since a local printer is attached directly to your computer, you need a printer driver to process the data that is sent to the printer.
If you have a PPD file for the device (usually provided by the manufacturer), you can select it by choosing Provide PPD file. You can then browse the filesystem for the PPD file by clicking Browse.

33.5.1. Confirming Printer Configuration

The last step is to confirm your printer configuration. Click Apply to add the print queue if the settings are correct. Click Back to modify the printer configuration.
After applying the changes, print a test page to ensure the configuration is correct. Refer to Section 33.6, “Printing a Test Page” for details.

33.6. Printing a Test Page

After you have configured your printer, you should print a test page to make sure the printer is functioning properly. To print a test page, select the printer that you want to try out from the printer list, then click Print Test Page from the printer's Settings tab.
If you change the print driver or modify the driver options, you should print a test page to test the different configuration.

33.7. Modifying Existing Printers

To delete an existing printer, select the printer and click the Delete button on the toolbar. The printer is removed from the printer list once you confirm deletion of the printer configuration.
To set the default printer, select the printer from the printer list and click the Make Default Printer button in the Settings tab.

33.7.1. The Settings Tab

To change printer driver configuration, click the corresponding name in the Printer list and click the Settings tab.
You can modify printer settings such as make and model, make a printer the default, print a test page, change the device location (URI), and more.
Settings Tab

Figure 33.8. Settings Tab

33.7.2. The Policies Tab

To change settings in print output, click the Policies tab.
For example, to create a banner page (a page that describes aspects of the print job such as the originating printer, the username from the which the job originated, and the security status of the document being printed) click the Starting Banner or Ending Banner drop-menu and choose the option that best describes the nature of the print jobs (such as topsecret, classified, or confidential).
Policies Tab

Figure 33.9. Policies Tab

You can also configure the Error Policy of the printer, by choosing an option from the drop-down menu. You can choose to abort the print job, retry, or stop it.

33.7.3. The Access Control Tab

You can change user-level access to the configured printer by clicking the Access Control tab.
Add users using the text box and click the Add button beside it. You can then choose to only allow use of the printer to that subset of users or deny use to those users.
Access Control Tab

Figure 33.10. Access Control Tab

33.7.4. The Printer and Job OptionsTab

The Printer Options tab contains various configuration options for the printer media and output.
Printer Options Tab

Figure 33.11. Printer Options Tab

  • Page Size — Allows the paper size to be selected. The options include US Letter, US Legal, A3, and A4
  • Media Source — set to Automatic by default. Change this option to use paper from a different tray.
  • Media Type — Allows you to change paper type. Options include: Plain, thick, bond, and transparency.
  • Resolution — Configure the quality and detail of the printout (default is 300 dots per inch (dpi).
  • Toner Saving — Choose whether the printer uses less toner to conserve resources.
You can also configure printer job options using the Job Options tab. Use the drop-menu and choose the job options you wish to use, such as Landscape modes (horizontal or vertical printout), copies, or scaling (increase or decrease the size of the printable area, which can be used to fit an oversize print area onto a smaller physical sheet of print medium).

33.8. Managing Print Jobs

When you send a print job to the printer daemon, such as printing a text file from Emacs or printing an image from The GIMP, the print job is added to the print spool queue. The print spool queue is a list of print jobs that have been sent to the printer and information about each print request, such as the status of the request, the the job number, and more.
During the printing process, the Printer Status icon appears in the Notification Area on the panel. To check the status of a print job, double click the Printer Status, which displays a window similar to Figure 33.12, “GNOME Print Status”.
GNOME Print Status

Figure 33.12. GNOME Print Status

To cancel a specific print job listed in the GNOME Print Status, select it from the list and select Edit => Cancel Documents from the pulldown menu.
To view the list of print jobs in the print spool from a shell prompt, type the command lpq. The last few lines look similar to the following:

Example 33.1. Example of lpq output

Rank   Owner/ID              Class  Job Files       Size Time 
active user@localhost+902    A      902 sample.txt  2050 01:20:46
If you want to cancel a print job, find the job number of the request with the command lpq and then use the command lprm job number. For example, lprm 902 would cancel the print job in Example 33.1, “Example of lpq output”. You must have proper permissions to cancel a print job. You can not cancel print jobs that were started by other users unless you are logged in as root on the machine to which the printer is attached.
You can also print a file directly from a shell prompt. For example, the command lpr sample.txt prints the text file sample.txt. The print filter determines what type of file it is and converts it into a format the printer can understand.

33.9. Additional Resources

To learn more about printing on Red Hat Enterprise Linux, refer to the following resources.

33.9.1. Installed Documentation

  • map lpr — The manual page for the lpr command that allows you to print files from the command line.
  • man lprm — The manual page for the command line utility to remove print jobs from the print queue.
  • man mpage — The manual page for the command line utility to print multiple pages on one sheet of paper.
  • man cupsd — The manual page for the CUPS printer daemon.
  • man cupsd.conf — The manual page for the CUPS printer daemon configuration file.
  • man classes.conf — The manual page for the class configuration file for CUPS.

33.9.2. Useful Websites

Chapter 34. Automated Tasks

In Linux, tasks can be configured to run automatically within a specified period of time, on a specified date, or when the system load average is below a specified number. Red Hat Enterprise Linux is pre-configured to run important system tasks to keep the system updated. For example, the slocate database used by the locate command is updated daily. A system administrator can use automated tasks to perform periodic backups, monitor the system, run custom scripts, and more.
Red Hat Enterprise Linux comes with several automated tasks utilities: cron, at, and batch.

34.1. Cron

Cron is a daemon that can be used to schedule the execution of recurring tasks according to a combination of the time, day of the month, month, day of the week, and week.
Cron assumes that the system is on continuously. If the system is not on when a task is scheduled, it is not executed. To schedule one-time tasks, refer to Section 34.2, “At and Batch”.
To use the cron service, the vixie-cron RPM package must be installed and the crond service must be running. To determine if the package is installed, use the rpm -q vixie-cron command. To determine if the service is running, use the command /sbin/service crond status.

34.1.1. Configuring Cron Tasks

The main configuration file for cron, /etc/crontab, contains the following lines:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
The first four lines are variables used to configure the environment in which the cron tasks are run. The SHELL variable tells the system which shell environment to use (in this example the bash shell), while the PATH variable defines the path used to execute commands. The output of the cron tasks are emailed to the username defined with the MAILTO variable. If the MAILTO variable is defined as an empty string (MAILTO=""), email is not sent. The HOME variable can be used to set the home directory to use when executing commands or scripts.
Each line in the /etc/crontab file represents a task and has the following format:
minute   hour   day   month   dayofweek   command
  • minute — any integer from 0 to 59
  • hour — any integer from 0 to 23
  • day — any integer from 1 to 31 (must be a valid day if a month is specified)
  • month — any integer from 1 to 12 (or the short name of the month such as jan or feb)
  • dayofweek — any integer from 0 to 7, where 0 or 7 represents Sunday (or the short name of the week such as sun or mon)
  • command — the command to execute (the command can either be a command such as ls /proc >> /tmp/proc or the command to execute a custom script)
For any of the above values, an asterisk (*) can be used to specify all valid values. For example, an asterisk for the month value means execute the command every month within the constraints of the other values.
A hyphen (-) between integers specifies a range of integers. For example, 1-4 means the integers 1, 2, 3, and 4.
A list of values separated by commas (,) specifies a list. For example, 3, 4, 6, 8 indicates those four specific integers.
The forward slash (/) can be used to specify step values. The value of an integer can be skipped within a range by following the range with /<integer>. For example, 0-59/2 can be used to define every other minute in the minute field. Step values can also be used with an asterisk. For instance, the value */3 can be used in the month field to run the task every third month.
Any lines that begin with a hash mark (#) are comments and are not processed.
As shown in the /etc/crontab file, the run-parts script executes the scripts in the /etc/cron.hourly/, /etc/cron.daily/, /etc/cron.weekly/, and /etc/cron.monthly/ directories on an hourly, daily, weekly, or monthly basis respectively. The files in these directories should be shell scripts.
If a cron task is required to be executed on a schedule other than hourly, daily, weekly, or monthly, it can be added to the /etc/cron.d/ directory. All files in this directory use the same syntax as /etc/crontab. Refer to Example 34.1, “Crontab Examples” for examples.

Example 34.1. Crontab Examples

# record the memory usage of the system every monday 
# at 3:30AM in the file /tmp/meminfo
30 3 * * mon cat /proc/meminfo >> /tmp/meminfo
# run custom script the first day of every month at 4:10AM
10 4 1 * * /root/scripts/backup.sh
Users other than root can configure cron tasks by using the crontab utility. All user-defined crontabs are stored in the /var/spool/cron/ directory and are executed using the usernames of the users that created them. To create a crontab as a user, login as that user and type the command crontab -e to edit the user's crontab using the editor specified by the VISUAL or EDITOR environment variable. The file uses the same format as /etc/crontab. When the changes to the crontab are saved, the crontab is stored according to username and written to the file /var/spool/cron/username.
The cron daemon checks the /etc/crontab file, the /etc/cron.d/ directory, and the /var/spool/cron/ directory every minute for any changes. If any changes are found, they are loaded into memory. Thus, the daemon does not need to be restarted if a crontab file is changed.

34.1.2. Controlling Access to Cron

The /etc/cron.allow and /etc/cron.deny files are used to restrict access to cron. The format of both access control files is one username on each line. Whitespace is not permitted in either file. The cron daemon (crond) does not have to be restarted if the access control files are modified. The access control files are read each time a user tries to add or delete a cron task.
The root user can always use cron, regardless of the usernames listed in the access control files.
If the file cron.allow exists, only users listed in it are allowed to use cron, and the cron.deny file is ignored.
If cron.allow does not exist, users listed in cron.deny are not allowed to use cron.

34.1.3. Starting and Stopping the Service

To start the cron service, use the command /sbin/service crond start. To stop the service, use the command /sbin/service crond stop. It is recommended that you start the service at boot time. Refer to Chapter 19, Controlling Access to Services for details on starting the cron service automatically at boot time.

34.2. At and Batch

While cron is used to schedule recurring tasks, the at command is used to schedule a one-time task at a specific time and the batch command is used to schedule a one-time task to be executed when the systems load average drops below 0.8.
To use at or batch, the at RPM package must be installed, and the atd service must be running. To determine if the package is installed, use the rpm -q at command. To determine if the service is running, use the command /sbin/service atd status.

34.2.1. Configuring At Jobs

To schedule a one-time job at a specific time, type the command at time, where time is the time to execute the command.
The argument time can be one of the following:
  • HH:MM format — For example, 04:00 specifies 4:00 a.m. If the time is already past, it is executed at the specified time the next day.
  • midnight — Specifies 12:00 a.m.
  • noon — Specifies 12:00 p.m.
  • teatime — Specifies 4:00 p.m.
  • month-name day year format — For example, January 15 2002 specifies the 15th day of January in the year 2002. The year is optional.
  • MMDDYY, MM/DD/YY, or MM.DD.YY formats — For example, 011502 for the 15th day of January in the year 2002.
  • now + time — time is in minutes, hours, days, or weeks. For example, now + 5 days specifies that the command should be executed at the same time five days from now.
The time must be specified first, followed by the optional date. For more information about the time format, read the /usr/share/doc/at-<version>/timespec text file.
After typing the at command with the time argument, the at> prompt is displayed. Type the command to execute, press Enter, and type Ctrl+D. Multiple commands can be specified by typing each command followed by the Enter key. After typing all the commands, press Enter to go to a blank line and type Ctrl+D. Alternatively, a shell script can be entered at the prompt, pressing Enter after each line in the script, and typing Ctrl+D on a blank line to exit. If a script is entered, the shell used is the shell set in the user's SHELL environment, the user's login shell, or /bin/sh (whichever is found first).
If the set of commands or script tries to display information to standard out, the output is emailed to the user.
Use the command atq to view pending jobs. Refer to Section 34.2.3, “Viewing Pending Jobs” for more information.
Usage of the at command can be restricted. For more information, refer to Section 34.2.5, “Controlling Access to At and Batch” for details.

34.2.2. Configuring Batch Jobs

To execute a one-time task when the load average is below 0.8, use the batch command.
After typing the batch command, the at> prompt is displayed. Type the command to execute, press Enter, and type Ctrl+D. Multiple commands can be specified by typing each command followed by the Enter key. After typing all the commands, press Enter to go to a blank line and type Ctrl+D. Alternatively, a shell script can be entered at the prompt, pressing Enter after each line in the script, and typing Ctrl+D on a blank line to exit. If a script is entered, the shell used is the shell set in the user's SHELL environment, the user's login shell, or /bin/sh (whichever is found first). As soon as the load average is below 0.8, the set of commands or script is executed.
If the set of commands or script tries to display information to standard out, the output is emailed to the user.
Use the command atq to view pending jobs. Refer to Section 34.2.3, “Viewing Pending Jobs” for more information.
Usage of the batch command can be restricted. For more information, refer to Section 34.2.5, “Controlling Access to At and Batch” for details.

34.2.3. Viewing Pending Jobs

To view pending at and batch jobs, use the atq command. The atq command displays a list of pending jobs, with each job on a line. Each line follows the job number, date, hour, job class, and username format. Users can only view their own jobs. If the root user executes the atq command, all jobs for all users are displayed.

34.2.4. Additional Command Line Options

Additional command line options for at and batch include:

Table 34.1. at and batch Command Line Options

Option Description
-f Read the commands or shell script from a file instead of specifying them at the prompt.
-m Send email to the user when the job has been completed.
-v Display the time that the job is executed.

34.2.5. Controlling Access to At and Batch

The /etc/at.allow and /etc/at.deny files can be used to restrict access to the at and batch commands. The format of both access control files is one username on each line. Whitespace is not permitted in either file. The at daemon (atd) does not have to be restarted if the access control files are modified. The access control files are read each time a user tries to execute the at or batch commands.
The root user can always execute at and batch commands, regardless of the access control files.
If the file at.allow exists, only users listed in it are allowed to use at or batch, and the at.deny file is ignored.
If at.allow does not exist, users listed in at.deny are not allowed to use at or batch.

34.2.6. Starting and Stopping the Service

To start the at service, use the command /sbin/service atd start. To stop the service, use the command /sbin/service atd stop. It is recommended that you start the service at boot time. Refer to Chapter 19, Controlling Access to Services for details on starting the cron service automatically at boot time.

34.3. Additional Resources

To learn more about configuring automated tasks, refer to the following resources.

34.3.1. Installed Documentation

  • cron man page — overview of cron.
  • crontab man pages in sections 1 and 5 — The man page in section 1 contains an overview of the crontab file. The man page in section 5 contains the format for the file and some example entries.
  • /usr/share/doc/at-<version>/timespec contains more detailed information about the times that can be specified for cron jobs.
  • at man page — description of at and batch and their command line options.

Chapter 35. Log Files

Log files are files that contain messages about the system, including the kernel, services, and applications running on it. There are different log files for different information. For example, there is a default system log file, a log file just for security messages, and a log file for cron tasks.
Log files can be very useful when trying to troubleshoot a problem with the system such as trying to load a kernel driver or when looking for unauthorized log in attempts to the system. This chapter discusses where to find log files, how to view log files, and what to look for in log files.
Some log files are controlled by a daemon called syslogd. A list of log messages maintained by syslogd can be found in the /etc/syslog.conf configuration file.

35.1. Locating Log Files

Most log files are located in the /var/log/ directory. Some applications such as httpd and samba have a directory within /var/log/ for their log files.
You may notice multiple files in the log file directory with numbers after them. These are created when the log files are rotated. Log files are rotated so their file sizes do not become too large. The logrotate package contains a cron task that automatically rotates log files according to the /etc/logrotate.conf configuration file and the configuration files in the /etc/logrotate.d/ directory. By default, it is configured to rotate every week and keep four weeks worth of previous log files.

35.2. Viewing Log Files

Most log files are in plain text format. You can view them with any text editor such as Vi or Emacs. Some log files are readable by all users on the system; however, root privileges are required to read most log files.
To view system log files in an interactive, real-time application, use the Log Viewer. To start the application, go to Applications (the main menu on the panel) => System Tools => System Logs, or type the command system-logviewer at a shell prompt.
The application only displays log files that exist; thus, the list might differ from the one shown in Figure 35.1, “Log Viewer.
To filter the contents of the log file for keywords, type the keyword(s) in the Filter for text field, and click Filter. Click Reset to reset the contents.
Log Viewer

Figure 35.1. Log Viewer

By default, the currently viewable log file is refreshed every 30 seconds. To change the refresh rate, select Edit => Preferences from the pulldown menu. The window shown in Figure 35.2, “Log File Locations” appears. In the Log Files tab, click the up and down arrows beside the refresh rate to change it. Click Close to return to the main window. The refresh rate is changed immediately. To refresh the currently viewable file manually, select File => Refresh Now or press Ctrl+R.
On the Log Files tab in the Preferences, the log file locations can be modified. Select the log file from the list, and click the Edit button. Type the new location of the log file or click the Browse button to locate the file location using a file selection dialog. Click OK to return to the preferences, and click Close to return to the main window.
Log File Locations

Figure 35.2. Log File Locations

35.3. Adding a Log File

To add a log file to the list, select Edit => Preferences, and click the Add button in the Log Files tab.
Adding a Log File

Figure 35.3. Adding a Log File

Provide a name, description, and the location of the log file to add. After clicking OK, the file is immediately added to the viewing area, if the file exists.

35.4. Examining Log Files

Log Viewer can be configured to display an alert icon beside lines that contain key alert words and a warning icon beside lines that contain key warning words.
To add alerts words, select Edit => Preferences from the pulldown menu, and click on the Alerts tab. Click the Add button to add an alert word. To delete an alert word, select the word from the list, and click Delete.
The alert icon is displayed to the left of the lines that contains any of the alert words.
Alerts

Figure 35.4. Alerts

To add warning words, select Edit => Preferences from the pull-down menu, and click on the Warnings tab. Click the Add button to add a warning word. To delete a warning word, select the word from the list, and click Delete.
The warning icon is displayed to the left of the lines that contains any of the warning words.
Warning

Figure 35.5. Warning

Chapter 36. Manually Upgrading the Kernel

The Red Hat Enterprise Linux kernel is custom built by the Red Hat kernel team to ensure its integrity and compatibility with supported hardware. Before Red Hat releases a kernel, it must first pass a rigorous set of quality assurance tests.
Red Hat Enterprise Linux kernels are packaged in RPM format so that they are easy to upgrade and verify using the Red Hat User Agent, or the up2date command. The Red Hat User Agent automatically queries the Red Hat Network servers and determines which packages need to be updated on your machine, including the kernel. This chapter is only useful for those individuals that require manual updating of kernel packages, without using the up2date command.

Warning

Please note, that building a custom kernel is not supported by the Red Hat Global Services Support team, and therefore is not explored in this manual.

Note

Use of up2date is highly recommended by Red Hat for installing upgraded kernels.
For more information on Red Hat Network, the Red Hat User Agent, and up2date, refer to Chapter 16, Red Hat Network.

36.1. Overview of Kernel Packages

Red Hat Enterprise Linux contains the following kernel packages (some may not apply to your architecture):
  • kernel — Contains the kernel and the following key features:
    • Uniprocessor support for x86 and Athlon systems (can be run on a multi-processor system, but only one processor is utilized)
    • Multi-processor support for all other architectures
    • For x86 systems, only the first 4 GB of RAM is used; use the kernel-hugemem package for x86 systems with over 4 GB of RAM
  • kernel-devel — Contains the kernel headers and makefiles sufficient to build modules against the kernel package.
  • kernel-hugemem — (only for i686 systems) In addition to the options enabled for the kernel package, the key configuration options are as follows:
    • Support for more than 4 GB of RAM (up to 64 GB for x86)

      Note

      kernel-hugemem is required for memory configurations higher than 16 GB.
    • PAE (Physical Address Extension) or 3 level paging on x86 processors that support PAE
    • Support for multiple processors
    • 4GB/4GB split — 4GB of virtual address space for the kernel and almost 4GB for each user process on x86 systems
  • kernel-hugemem-devel — Contains the kernel headers and makefiles sufficient to build modules against the kernel-hugemem package.
  • kernel-smp — Contains the kernel for multi-processor systems. The following are the key features:
    • Multi-processor support
    • Support for more than 4 GB of RAM (up to 16 GB for x86)
    • PAE (Physical Address Extension) or 3 level paging on x86 processors that support PAE
  • kernel-smp-devel — Contains the kernel headers and makefiles sufficient to build modules against the kernel-smp package.
  • kernel-utils — Contains utilities that can be used to control the kernel or system hardware.
  • kernel-doc — Contains documentation files from the kernel source. Various portions of the Linux kernel and the device drivers shipped with it are documented in these files. Installation of this package provides a reference to the options that can be passed to Linux kernel modules at load time.
    By default, these files are placed in the /usr/share/doc/kernel-doc-<version>/ directory.

Note

The kernel-source package has been removed and replaced with an RPM that can only be retrieved from Red Hat Network. This *.src.rpm must then be rebuilt locally using the rpmbuild command. Refer to the latest distribution Release Notes, including all updates, at https://www.redhat.com/docs/manuals/enterprise/ for more information on obtaining and installing the kernel source package.

36.2. Preparing to Upgrade

Before upgrading the kernel, take a few precautionary steps. The first step is to make sure working boot media exists for the system in case a problem occurs. If the boot loader is not configured properly to boot the new kernel, the system cannot be booted into Red Hat Enterprise Linux without working boot media.
For example, to create a boot diskette, login as root, and type the following command at a shell prompt:
 /sbin/mkbootdisk `uname -r` 

Note

Refer to the mkbootdisk man page for more options. Creating bootable media via CD-Rs, CD-RWs, and USB flash drives are also supported given the system BIOS also supports it.
Reboot the machine with the boot media and verify that it works before continuing.
Hopefully, the media is not needed, but store it in a safe place just in case.
To determine which kernel packages are installed, execute the following command at a shell prompt:
 rpm -qa | grep kernel 
The output contains some or all of the following packages, depending on the system's architecture (the version numbers and packages may differ):
 kernel-2.6.9-5.EL kernel-devel-2.6.9-5.EL kernel-utils-2.6.9-5.EL kernel-doc-2.6.9-5.EL kernel-smp-2.6.9-5.EL kernel-smp-devel-2.6.9-5.EL kernel-hugemem-devel-2.6.9-5.EL 
From the output, determine which packages need to be download for the kernel upgrade. For a single processor system, the only required package is the kernel package. Refer to Section 36.1, “Overview of Kernel Packages” for descriptions of the different packages.
In the file name, each kernel package contains the architecture for which the package was built. The format is kernel-<variant>-<version>.<arch>.rpm, where <variant> is smp, utils, or so forth. The <arch> is one of the following:
  • x86_64 for the AMD64 architecture
  • ia64 for the Intel®Itanium™ architecture
  • ppc64 for the IBM®eServerpSeries™ architecture
  • ppc64 for the IBM®eServeriSeries™ architecture
  • s390 for the IBM®S/390® architecture
  • s390x for the IBM®eServerzSeries® architecture
  • x86 variant: The x86 kernels are optimized for different x86 versions. The options are as follows:
    • i686 for Intel®Pentium® II, Intel®Pentium® III, Intel®Pentium® 4, AMD Athlon®, and AMD Duron® systems

36.3. Downloading the Upgraded Kernel

There are several ways to determine if an updated kernel is available for the system.
If Red Hat Network was used to download and install the updated kernel, follow the instructions in Section 36.5, “Verifying the Initial RAM Disk Image” and Section 36.6, “Verifying the Boot Loader”, only do not change the kernel to boot by default. Red Hat Network automatically changes the default kernel to the latest version. To install the kernel manually, continue to Section 36.4, “Performing the Upgrade”.

36.4. Performing the Upgrade

After retrieving all of the necessary packages, it is time to upgrade the existing kernel. At a shell prompt, as root, change to the directory that contains the kernel RPM packages and follow these steps.

Important

It is strongly recommended that the old kernel is kept in case there are problems with the new kernel.
Use the -i argument with the rpm command to keep the old kernel. Do not use the -U option, since it overwrites the currently installed kernel, which creates boot loader problems. Issue the following command (the kernel version may vary):
 rpm -ivh kernel-2.6.9-5.EL.<arch>.rpm 
If the system is a multi-processor system, install the kernel-smp packages as well (the kernel version may vary):
 rpm -ivh kernel-smp-2.6.9-5.EL.<arch>.rpm 
If the system is i686-based and contains more than 4 GB of RAM, install the kernel-hugemem package built for the i686 architecture as well (the kernel version might vary):
 rpm -ivh kernel-hugemem-2.6.9-5.EL.i686.rpm 
The next step is to verify that the initial RAM disk image has been created. Refer to Section 36.5, “Verifying the Initial RAM Disk Image” for details.

36.5. Verifying the Initial RAM Disk Image

If the system uses the ext3 file system, a SCSI controller, or uses labels to reference partitions in /etc/fstab, an initial RAM disk is needed. The initial RAM disk allows a modular kernel to have access to modules that it might need to boot from before the kernel has access to the device where the modules normally reside.
On the Red Hat Enterprise Linux architectures other than IBM eServer iSeries, the initial RAM disk can be created with the mkinitrd command. However, this step is performed automatically if the kernel and its associated packages are installed or upgraded from the RPM packages distributed by Red Hat, Inc; thus, it does not need to be executed manually. To verify that it was created, use the command ls -l /boot to make sure the initrd-<version>.img file was created (the version should match the version of the kernel just installed).
On iSeries systems, the initial RAM disk file and vmlinux file are combined into one file, which is created with the addRamDisk command. This step is performed automatically if the kernel and its associated packages are installed or upgraded from the RPM packages distributed by Red Hat, Inc; thus, it does not need to be executed manually. To verify that it was created, use the command ls -l /boot to make sure the /boot/vmlinitrd-<kernel-version> file was created (the version should match the version of the kernel just installed).
The next step is to verify that the boot loader has been configured to boot the new kernel. Refer to Section 36.6, “Verifying the Boot Loader” for details.

36.6. Verifying the Boot Loader

The kernel RPM package configures the boot loader to boot the newly installed kernel (except for IBM eServer iSeries systems). However, it does not configure the boot loader to boot the new kernel by default.
It is always a good idea to confirm that the boot loader has been configured correctly. This is a crucial step. If the boot loader is configured incorrectly, the system does not boot into Red Hat Enterprise Linux properly. If this happens, boot the system with the boot media created earlier and try configuring the boot loader again.

36.6.1. x86 Systems

All x86 systems use GRUB as the boot loader, which includes all AMD64 systems.

36.6.1.1. GRUB

Confirm that the file /boot/grub/grub.conf contains a title section with the same version as the kernel package just installed (if the kernel-smp or kernel-hugemem package was installed, a section exists for it as well):
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/hda2
#          initrd /initrd-version.img
#boot=/dev/hda
default=1
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Red Hat Enterprise Linux (2.6.9-5.EL)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-5.EL ro root=LABEL=/
        initrd /initrd-2.6.9-5.EL.img
title Red Hat Enterprise Linux (2.6.9-1.906_EL)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-1.906_EL ro root=LABEL=/
        initrd /initrd-2.6.9-1.906_EL.img
If a separate /boot/ partition was created, the paths to the kernel and initrd image are relative to /boot/.
Notice that the default is not set to the new kernel. To configure GRUB to boot the new kernel by default, change the value of the default variable to the title section number for the title section that contains the new kernel. The count starts with 0. For example, if the new kernel is the first title section, set default to 0.
Begin testing the new kernel by rebooting the computer and watching the messages to ensure that the hardware is detected properly.

36.6.2. Itanium Systems

Itanium systems use ELILO as the boot loader, which uses /boot/efi/EFI/redhat/elilo.conf as the configuration file. Confirm that this file contains an image section with the same version as the kernel package just installed:
prompt
timeout=50
default=old

image=vmlinuz-2.6.9-5.EL
        label=linux
        initrd=initrd-2.6.9-5.EL.img
        read-only
        append="root=LABEL=/"
image=vmlinuz-2.6.9-1.906_EL
        label=old
        initrd=initrd-2.6.9-1.906.img
        read-only
        append="root=LABEL=/"
Notice that the default is not set to the new kernel. To configure ELILO to boot the new kernel, change the value of the default variable to the value of the label for the image section that contains the new kernel.
Begin testing the new kernel by rebooting the computer and watching the messages to ensure that the hardware is detected properly.

36.6.3. IBM S/390 and IBM eServer zSeries Systems

The IBM S/390 and IBM eServer zSeries systems use z/IPL as the boot loader, which uses /etc/zipl.conf as the configuration file. Confirm that the file contains a section with the same version as the kernel package just installed:
[defaultboot]
default=old
target=/boot/
[linux]
        image=/boot/vmlinuz-2.6.9-5.EL
        ramdisk=/boot/initrd-2.6.9-5.EL.img
        parameters="root=LABEL=/"
[old]
        image=/boot/vmlinuz-2.6.9-1.906_EL
        ramdisk=/boot/initrd-2.6.9-1.906_EL.img
        parameters="root=LABEL=/"
Notice that the default is not set to the new kernel. To configure z/IPL to boot the new kernel by default change the value of the default variable to the name of the section that contains the new kernel. The first line of each section contains the name in brackets.
After modifying the configuration file, run the following command as root to enable the changes:
/sbin/zipl
Begin testing the new kernel by rebooting the computer and watching the messages to ensure that the hardware is detected properly.

36.6.4. IBM eServer iSeries Systems

The /boot/vmlinitrd-<kernel-version> file is installed when you upgrade the kernel. However, you must use the dd command to configure the system to boot the new kernel:
  1. As root, issue the command cat /proc/iSeries/mf/side to determine the default side (either A, B, or C).
  2. As root, issue the following command, where <kernel-version> is the version of the new kernel and <side> is the side from the previous command:
     dd if=/boot/vmlinitrd-<kernel-version> of=/proc/iSeries/mf/<side>/vmlinux bs=8k 
Begin testing the new kernel by rebooting the computer and watching the messages to ensure that the hardware is detected properly.

36.6.5. IBM eServer pSeries Systems

IBM eServer pSeries systems use YABOOT as the boot loader, which uses /etc/aboot.conf as the configuration file. Confirm that the file contains an image section with the same version as the kernel package just installed:
boot=/dev/sda1
init-message=Welcome to Red Hat Enterprise Linux!
Hit <TAB> for boot options
 
partition=2
timeout=30
install=/usr/lib/yaboot/yaboot
delay=10
nonvram

image=/vmlinux--2.6.9-5.EL
        label=old
        read-only
        initrd=/initrd--2.6.9-5.EL.img
        append="root=LABEL=/"
 
image=/vmlinux-2.6.9-5.EL
        label=linux
        read-only
        initrd=/initrd-2.6.9-5.EL.img
        append="root=LABEL=/"
Notice that the default is not set to the new kernel. The kernel in the first image is booted by default. To change the default kernel to boot either move its image stanza so that it is the first one listed or add the directive default and set it to the label of the image stanza that contains the new kernel.
Begin testing the new kernel by rebooting the computer and watching the messages to ensure that the hardware is detected properly.

Chapter 37. Kernel Modules

The Linux kernel has a modular design. At boot time, only a minimal resident kernel is loaded into memory. Thereafter, whenever a user requests a feature that is not present in the resident kernel, a kernel module, sometimes referred to as a driver, is dynamically loaded into memory.
During installation, the hardware on the system is probed. Based on this probing and the information provided by the user, the installation program decides which modules need to be loaded at boot time. The installation program sets up the dynamic loading mechanism to work transparently.
If new hardware is added after installation and the hardware requires a kernel module, the system must be configured to load the proper kernel module for the new hardware. When the system is booted with the new hardware, the Kudzu program runs, detects the new hardware if it is supported, and configures the module for it. The module can also be specified manually by editing the module configuration file, /etc/modprobe.conf.

Note

Video card modules used to display the X Window System interface are part of the xorg-X11 packages, not the kernel; thus, this chapter does not apply to them.
For example, if a system included an SMC EtherPower 10 PCI network adapter, the module configuration file contains the following line:
alias eth0 tulip
If a second network card is added to the system and is identical to the first card, add the following line to /etc/modprobe.conf:
alias eth1 tulip
Refer to the Reference Guide for an alphabetical list of kernel modules and supported hardware for those modules.

37.1. Kernel Module Utilities

A group of commands for managing kernel modules is available if the module-init-tools package is installed. Use these commands to determine if a module has been loaded successfully or when trying different modules for a piece of new hardware.
The command /sbin/lsmod displays a list of currently loaded modules. For example:
Module                  Size  Used by
nfs                   218437  1
lockd                  63977  2 nfs
parport_pc             24705  1
lp                     12077  0
parport                37129  2 parport_pc,lp
autofs4                23237  2
i2c_dev                11329  0
i2c_core               22081  1 i2c_dev
sunrpc                157093  5 nfs,lockd
button                  6481  0
battery                 8901  0
ac                      4805  0
md5                     4033  1
ipv6                  232833  16
ohci_hcd               21713  0
e100                   39493  0
mii                     4673  1 e100
floppy                 58481  0
sg                     33377  0
dm_snapshot            17029  0
dm_zero                 2369  0
dm_mirror              22957  2
ext3                  116809  2
jbd                    71257  1 ext3
dm_mod                 54741  6 dm_snapshot,dm_zero,dm_mirror
ips                    46173  2
aic7xxx               148121  0
sd_mod                 17217  3
scsi_mod              121421  4 sg,ips,aic7xxx,sd_mod
For each line, the first column is the name of the module, the second column is the size of the module, and the third column is the use count.
The /sbin/lsmod output is less verbose and easier to read than the output from viewing /proc/modules.
To load a kernel module, use the /sbin/modprobe command followed by the kernel module name. By default, modprobe attempts to load the module from the /lib/modules/<kernel-version>/kernel/drivers/ subdirectories. There is a subdirectory for each type of module, such as the net/ subdirectory for network interface drivers. Some kernel modules have module dependencies, meaning that other modules must be loaded first for it to load. The /sbin/modprobe command checks for these dependencies and loads the module dependencies before loading the specified module.
For example, the command
 /sbin/modprobe e100 
loads any module dependencies and then the e100 module.
To print to the screen all commands as /sbin/modprobe executes them, use the -v option. For example:
 /sbin/modprobe -v e100 
Output similar to the following is displayed:
 /sbin/insmod /lib/modules/2.6.9-5.EL/kernel/drivers/net/e100.ko Using /lib/modules/2.6.9-5.EL/kernel/drivers/net/e100.ko Symbol version prefix 'smp_' 
The /sbin/insmod command also exists to load kernel modules; however, it does not resolve dependencies. Thus, it is recommended that the /sbin/modprobe command be used.
To unload kernel modules, use the /sbin/rmmod command followed by the module name. The rmmod utility only unloads modules that are not in use and that are not a dependency of other modules in use.
For example, the command
 /sbin/rmmod e100 
unloads the e100 kernel module.
Another useful kernel module utility is modinfo. Use the command /sbin/modinfo to display information about a kernel module. The general syntax is:
 /sbin/modinfo [options]<module>
Options include -d, which displays a brief description of the module, and -p, which lists the parameters the module supports. For a complete list of options, refer to the modinfo man page (man modinfo).

37.2. Persistent Module Loading

Kernel modules are usually loaded directly by the facility that requires them, which is given correct settings in the /etc/modprobe.conf file. However, it is sometimes necessary to explicitly force the loading of a module at boot time.
Red Hat Enterprise Linux checks for the existence of the /etc/rc.modules file at boot time, which contains various commands to load modules. The rc.modules should be used, and notrc.local because rc.modules is executed earlier in the boot process.
For example, the following commands configure loading of the foo module at boot time (as root):
# echo modprobe foo >> /etc/rc.modules
# chmod +x /etc/rc.modules

Note

This approach is not necessary for network and SCSI interfaces because they have their own specific mechanisms.

37.3. Additional Resources

For more information on kernel modules and their utilities, refer to the following resources.

37.3.1. Installed Documentation

  • lsmod man page — description and explanation of its output.
  • insmod man page — description and list of command line options.
  • modprobe man page — description and list of command line options.
  • rmmod man page — description and list of command line options.
  • modinfo man page — description and list of command line options.
  • /usr/share/doc/kernel-doc-<version>/Documentation/kbuild/modules.txt — how to compile and use kernel modules.

37.3.2. Useful Websites

Chapter 38. Mail Transport Agent (MTA) Configuration

A Mail Transport Agent (MTA) is essential for sending email. A Mail User Agent (MUA) such as Evolution, Mozilla Mail, Thunderbird, and Mutt, is used to read and compose email. When a user sends an email from an MUA, the message is handed off to the MTA, which sends the message through a series of MTAs until it reaches its destination.
Even if a user does not plan to send email from the system, some automated tasks or system programs might use the /bin/mail command to send email containing log messages to the root user of the local system.
Red Hat Enterprise Linux 4 provides three MTAs: Sendmail, Postfix, and Exim. If all three are installed, sendmail is the default MTA. The Mail Transport Agent Switcher allows for the selection of either sendmail, postfix, or exim as the default MTA for the system.
The system-switch-mail RPM package must be installed to use the text-based version of the Mail Transport Agent Switcher program. If you want to use the graphical version, the system-switch-mail-gnome package must also be installed.
To start the Mail Transport Agent Switcher, select Applications (the main menu on the panel) => Preferences => More Preferences => Mail Transport Agent Switcher, or type the command system-switch-mail at a shell prompt (for example, in an XTerm or GNOME terminal).
The program automatically detects if the X Window System is running. If it is running, the program starts in graphical mode as shown in Figure 38.1, “Mail Transport Agent Switcher. If X is not detected, it starts in text-mode. To force Mail Transport Agent Switcher to run in text-mode, use the command system-switch-mail-nox.
Mail Transport Agent Switcher

Figure 38.1. Mail Transport Agent Switcher

If you select OK to change the MTA, the selected mail daemon is enabled to start at boot time, and the unselected mail daemons are disabled so that they do not start at boot time. The selected mail daemon is started, and any other mail daemon is stopped; thus making the changes take place immediately.
For more information about email protocols and MTAs, refer to the Reference Guide.

Part VI. System Monitoring

System administrators also monitor system performance. Red Hat Enterprise Linux contains tools to assist administrators with these tasks.

Chapter 39. Gathering System Information

Before you learn how to configure your system, you should learn how to gather essential system information. For example, you should know how to find the amount of free memory, the amount of available hard drive space, how your hard drive is partitioned, and what processes are running. This chapter discusses how to retrieve this type of information from your Red Hat Enterprise Linux system using simple commands and a few simple programs.

39.1. System Processes

The ps ax command displays a list of current system processes, including processes owned by other users. To display the owner alongside each process, use the ps aux command. This list is a static list; in other words, it is a snapshot of what was running when you invoked the command. If you want a constantly updated list of running processes, use top as described below.
The ps output can be long. To prevent it from scrolling off the screen, you can pipe it through less:
ps aux | less
You can use the ps command in combination with the grep command to see if a process is running. For example, to determine if Emacs is running, use the following command:
ps ax | grep emacs
The top command displays currently running processes and important information about them including their memory and CPU usage. The list is both real-time and interactive. An example of output from the top command is provided as follows:
top - 15:02:46 up 35 min,  4 users,  load average: 0.17, 0.65, 1.00
Tasks: 110 total,   1 running, 107 sleeping,   0 stopped,   2 zombie
Cpu(s): 41.1% us,  2.0% sy,  0.0% ni, 56.6% id,  0.0% wa,  0.3% hi,  0.0% si
Mem:    775024k total,   772028k used,     2996k free,    68468k buffers
Swap:  1048568k total,      176k used,  1048392k free,   441172k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 4624 root      15   0 40192  18m 7228 S 28.4  2.4   1:23.21 X
 4926 mhideo    15   0 55564  33m 9784 S 13.5  4.4   0:25.96 gnome-terminal
 6475 mhideo    16   0  3612  968  760 R  0.7  0.1   0:00.11 top
 4920 mhideo    15   0 20872  10m 7808 S  0.3  1.4   0:01.61 wnck-applet
    1 root      16   0  1732  548  472 S  0.0  0.1   0:00.23 init
    2 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
    3 root       5 -10     0    0    0 S  0.0  0.0   0:00.03 events/0
    4 root       6 -10     0    0    0 S  0.0  0.0   0:00.02 khelper
    5 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 kacpid
   29 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 kblockd/0
   47 root      16   0     0    0    0 S  0.0  0.0   0:01.74 pdflush
   50 root      11 -10     0    0    0 S  0.0  0.0   0:00.00 aio/0
   30 root      15   0     0    0    0 S  0.0  0.0   0:00.05 khubd
   49 root      16   0     0    0    0 S  0.0  0.0   0:01.44 kswapd0
To exit top, press the q key.
Table 39.1, “Interactive top commands” contains useful interactive commands that you can use with top. For more information, refer to the top(1) manual page.

Table 39.1. Interactive top commands

Command Description
Space Immediately refresh the display
h Display a help screen
k Kill a process. You are prompted for the process ID and the signal to send to it.
n Change the number of processes displayed. You are prompted to enter the number.
u Sort by user.
M Sort by memory usage.
P Sort by CPU usage.
If you prefer a graphical interface for top, you can use the GNOME System Monitor. To start it from the desktop, select System => Administration => System Monitor or type gnome-system-monitor at a shell prompt (such as an XTerm). Select the Process Listing tab.
The GNOME System Monitor allows you to search for a process in the list of running processes. Using the Gnome System Monitor, you can also view all processes, your processes, or active processes.
The Edit menu item allows you to:
  • Stop a process.
  • Continue or start a process.
  • End a processes.
  • Kill a process.
  • Change the priority of a selected process.
  • Edit the System Monitor preferences. These include changing the interval seconds to refresh the list and selecting process fields to display in the System Monitor window.
The View menu item allows you to:
  • View only active processes.
  • View all processes.
  • View my processes.
  • View process dependencies.
  • Hide a process.
  • View hidden processes.
  • View memory maps.
  • View the files opened by the selected process.
To stop a process, select it and click End Process. Alternatively you can also stop a process by selecting it, clicking Edit on your menu and selecting Stop Process.
To sort the information by a specific column, click on the name of the column. This sorts the information by the selected column in ascending order. Click on the name of the column again to toggle the sort between ascending and descending order.
GNOME System Monitor

Figure 39.1. GNOME System Monitor

39.2. Memory Usage

The free command displays the total amount of physical memory and swap space for the system as well as the amount of memory that is used, free, shared, in kernel buffers, and cached.
             total       used       free     shared    buffers     cached
 Mem:        645712     549720      95992          0     176248     224452
 -/+ buffers/cache:     149020     496692
 Swap:      1310712          0    1310712
The command free -m shows the same information in megabytes, which are easier to read.
             total       used       free     shared    buffers     cached 
Mem:           630        536         93          0        172        219 
-/+ buffers/cache:        145        485 
Swap:         1279          0       1279
If you prefer a graphical interface for free, you can use the GNOME System Monitor. To start it from the desktop, go to System => Administration => System Monitor or type gnome-system-monitor at a shell prompt (such as an XTerm). Click on the Resources tab.
GNOME System Monitor - Resources tab

Figure 39.2. GNOME System Monitor - Resources tab

39.3. File Systems

The df command reports the system's disk space usage. If you type the command df at a shell prompt, the output looks similar to the following:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       11675568   6272120   4810348  57% / /dev/sda1
	                 100691      9281     86211  10% /boot
none                     322856         0    322856   0% /dev/shm
By default, this utility shows the partition size in 1 kilobyte blocks and the amount of used and available disk space in kilobytes. To view the information in megabytes and gigabytes, use the command df -h. The -h argument stands for human-readable format. The output looks similar to the following:
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                        12G  6.0G  4.6G  57% / /dev/sda1
			99M  9.1M   85M  10% /boot 
none 			316M     0  316M   0% /dev/shm
In the list of mounted partitions, there is an entry for /dev/shm. This entry represents the system's virtual memory file system.
The du command displays the estimated amount of space being used by files in a directory. If you type du at a shell prompt, the disk usage for each of the subdirectories is displayed in a list. The grand total for the current directory and subdirectories are also shown as the last line in the list. If you do not want to see the totals for all the subdirectories, use the command du -hs to see only the grand total for the directory in human-readable format. Use the du --help command to see more options.
To view the system's partitions and disk space usage in a graphical format, use the Gnome System Monitor by clicking on System => Administration => System Monitor or type gnome-system-monitor at a shell prompt (such as an XTerm). Select the File Systems tab to view the system's partitions. The figure below illustrates the File Systems tab.
GNOME System Monitor - File Systems

Figure 39.3. GNOME System Monitor - File Systems

39.4. Hardware

If you are having trouble configuring your hardware or just want to know what hardware is in your system, you can use the Hardware Browser application to display the hardware that can be probed. To start the program from the desktop, select System (the main menu on the panel) => Administration => Hardware or type hwbrowser at a shell prompt. As shown in Figure 39.4, “Hardware Browser, it displays your CD-ROM devices, diskette drives, hard drives and their partitions, network devices, pointing devices, system devices, and video cards. Click on the category name in the left menu, and the information is displayed.
Hardware Browser

Figure 39.4. Hardware Browser

The Device Manager application can also be used to display your system hardware. This application can be started by selecting System (the main menu on the panel) => Administration => Hardware like the Hardware Browser. To start the application from a terminal, type hal-device-manager. Depending on your installation preferences, the graphical menu above may start this application or the Hardware Browser when clicked. The figure below illustrates the Device Manager window.
Device Manager

Figure 39.5. Device Manager

You can also use the lspci command to list all PCI devices. Use the command lspci -v for more verbose information or lspci -vv for very verbose output.
For example, lspci can be used to determine the manufacturer, model, and memory size of a system's video card:
00:00.0 Host bridge: ServerWorks CNB20LE Host Bridge (rev 06)
00:00.1 Host bridge: ServerWorks CNB20LE Host Bridge (rev 06) 
00:01.0 VGA compatible controller: S3 Inc. Savage 4 (rev 04) 
00:02.0 Ethernet controller: Intel Corp. 82557/8/9 [Ethernet Pro 100] (rev 08) 
00:0f.0 ISA bridge: ServerWorks OSB4 South Bridge (rev 50) 
00:0f.1 IDE interface: ServerWorks OSB4 IDE Controller 
00:0f.2 USB Controller: ServerWorks OSB4/CSB5 OHCI USB Controller (rev 04) 
01:03.0 SCSI storage controller: Adaptec AIC-7892P U160/m (rev 02) 
01:05.0 RAID bus controller: IBM ServeRAID Controller
The lspci is also useful to determine the network card in your system if you do not know the manufacturer or model number.

39.5. Additional Resources

To learn more about gathering system information, refer to the following resources.

39.5.1. Installed Documentation

  • ps --help — Displays a list of options that can be used with ps.
  • top manual page — Type man top to learn more about top and its many options.
  • free manual page — type man free to learn more about free and its many options.
  • df manual page — Type man df to learn more about the df command and its many options.
  • du manual page — Type man du to learn more about the du command and its many options.
  • lspci manual page — Type man lspci to learn more about the lspci command and its many options.
  • /proc/ directory — The contents of the /proc/ directory can also be used to gather more detailed system information.

Chapter 40. OProfile

OProfile is a low overhead, system-wide performance monitoring tool. It uses the performance monitoring hardware on the processor to retrieve information about the kernel and executables on the system, such as when memory is referenced, the number of L2 cache requests, and the number of hardware interrupts received. On a Red Hat Enterprise Linux system, the oprofile RPM package must be installed to use this tool.
Many processors include dedicated performance monitoring hardware. This hardware makes it possible to detect when certain events happen (such as the requested data not being in cache). The hardware normally takes the form of one or more counters that are incremented each time an event takes place. When the counter value, essentially rolls over, an interrupt is generated, making it possible to control the amount of detail (and therefore, overhead) produced by performance monitoring.
OProfile uses this hardware (or a timer-based substitute in cases where performance monitoring hardware is not present) to collect samples of performance-related data each time a counter generates an interrupt. These samples are periodically written out to disk; later, the data contained in these samples can then be used to generate reports on system-level and application-level performance.
OProfile is a useful tool, but be aware of some limitations when using it:
  • Use of shared libraries — Samples for code in shared libraries are not attributed to the particular application unless the --separate=library option is used.
  • Performance monitoring samples are inexact — When a performance monitoring register triggers a sample, the interrupt handling is not precise like a divide by zero exception. Due to the out-of-order execution of instructions by the processor, the sample may be recorded on a nearby instruction.
  • opreport does not associate samples for inline functions' properlyopreport uses a simple address range mechanism to determine which function an address is in. Inline function samples are not attributed to the inline function but rather to the function the inline function was inserted into.
  • OProfile accumulates data from multiple runs — OProfile is a system-wide profiler and expects processes to start up and shut down multiple times. Thus, samples from multiple runs accumulate. Use the command opcontrol --reset to clear out the samples from previous runs.
  • Non-CPU-limited performance problems — OProfile is oriented to finding problems with CPU-limited processes. OProfile does not identify processes that are asleep because they are waiting on locks or for some other event to occur (for example an I/O device to finish an operation).

40.1. Overview of Tools

Table 40.1, “OProfile Commands” provides a brief overview of the tools provided with the oprofile package.

Table 40.1. OProfile Commands

Command Description
op_help
Displays available events for the system's processor along with a brief description of each.
op_import
Converts sample database files from a foreign binary format to the native format for the system. Only use this option when analyzing a sample database from a different architecture.
opannotate Creates annotated source for an executable if the application was compiled with debugging symbols. Refer to Section 40.5.3, “Using opannotate for details.
opcontrol
Configures what data is collected. Refer to Section 40.2, “Configuring OProfile” for details.
opreport
Retrieves profile data. Refer to Section 40.5.1, “Using opreport for details.
oprofiled
Runs as a daemon to periodically write sample data to disk.

40.2. Configuring OProfile

Before OProfile can be run, it must be configured. At a minimum, selecting to monitor the kernel (or selecting not to monitor the kernel) is required. The following sections describe how to use the opcontrol utility to configure OProfile. As the opcontrol commands are executed, the setup options are saved to the /root/.oprofile/daemonrc file.

40.2.1. Specifying the Kernel

First, configure whether OProfile should monitor the kernel. This is the only configuration option that is required before starting OProfile. All others are optional.
To monitor the kernel, execute the following command as root:
opcontrol --setup --vmlinux=/usr/lib/debug/lib/modules/`uname -r`/vmlinux

Note

The debuginfo package must be installed (which contains the uncompressed kernel) in order to monitor the kernel.
To configure OProfile not to monitor the kernel, execute the following command as root:
opcontrol --setup --no-vmlinux
This command also loads the oprofile kernel module, if it is not already loaded, and creates the /dev/oprofile/ directory, if it does not already exist. Refer to Section 40.6, “Understanding /dev/oprofile/ for details about this directory.

Note

Even if OProfile is configured not to profile the kernel, the SMP kernel still must be running so that the oprofile module can be loaded from it.
Setting whether samples should be collected within the kernel only changes what data is collected, not how or where the collected data is stored. To generate different sample files for the kernel and application libraries, refer to Section 40.2.3, “Separating Kernel and User-space Profiles”.

40.2.2. Setting Events to Monitor

Most processors contain counters, which are used by OProfile to monitor specific events. As shown in Table 40.2, “OProfile Processors and Counters”, the number of counters available depends on the processor.

Table 40.2. OProfile Processors and Counters

Processor cpu_type Number of Counters
Pentium Pro i386/ppro 2
Pentium II i386/pii 2
Pentium III i386/piii 2
Pentium 4 (non-hyper-threaded) i386/p4 8
Pentium 4 (hyper-threaded) i386/p4-ht 4
Athlon i386/athlon 4
AMD64 x86-64/hammer 4
Itanium ia64/itanium 4
Itanium 2 ia64/itanium2 4
TIMER_INT timer 1
IBM eServer iSeries and pSeries timer 1
ppc64/power4 8
ppc64/power5 6
ppc64/970 8
IBM eServer S/390 and S/390x timer 1
IBM eServer zSeries timer 1
Use Table 40.2, “OProfile Processors and Counters” to verify that the correct processor type was detected and to determine the number of events that can be monitored simultaneously. timer is used as the processor type if the processor does not have supported performance monitoring hardware.
If timer is used, events cannot be set for any processor because the hardware does not have support for hardware performance counters. Instead, the timer interrupt is used for profiling.
If timer is not used as the processor type, the events monitored can be changed, and counter 0 for the processor is set to a time-based event by default. If more than one counter exists on the processor, the counters other than counter 0 are not set to an event by default. The default events monitored are shown in Table 40.3, “Default Events”.

Table 40.3. Default Events

Processor Default Event for Counter Description
Pentium Pro, Pentium II, Pentium III, Athlon, AMD64 CPU_CLK_UNHALTED The processor's clock is not halted
Pentium 4 (HT and non-HT) GLOBAL_POWER_EVENTS The time during which the processor is not stopped
Itanium 2 CPU_CYCLES CPU Cycles
TIMER_INT (none) Sample for each timer interrupt
ppc64/power4 CYCLES Processor Cycles
ppc64/power5 CYCLES Processor Cycles
ppc64/970 CYCLES Processor Cycles
The number of events that can be monitored at one time is determined by the number of counters for the processor. However, it is not a one-to-one correlation; on some processors, certain events must be mapped to specific counters. To determine the number of counters available, execute the following command:
cat /dev/oprofile/cpu_type
The events available vary depending on the processor type. To determine the events available for profiling, execute the following command as root (the list is specific to the system's processor type):
op_help
The events for each counter can be configured via the command line or with a graphical interface. For more information on the graphical interface, refer to Section 40.8, “Graphical Interface”. If the counter cannot be set to a specific event, an error message is displayed.
To set the event for each configurable counter via the command line, use opcontrol:
 opcontrol --event=<event-name>:<sample-rate>
Replace <event-name> with the exact name of the event from op_help, and replace <sample-rate> with the number of events between samples.

40.2.2.1. Sampling Rate

By default, a time-based event set is selected. It creates a sample every 100,000 clock cycles per processor. If the timer interrupt is used, the timer is set to whatever the jiffy rate is and is not user-settable. If the cpu_type is not timer, each event can have a sampling rate set for it. The sampling rate is the number of events between each sample snapshot.
When setting the event for the counter, a sample rate can also be specified:
opcontrol --event=<event-name>:<sample-rate>
Replace <sample-rate> with the number of events to wait before sampling again. The smaller the count, the more frequent the samples. For events that do not happen frequently, a lower count may be needed to capture the event instances.

Warning

Be extremely careful when setting sampling rates. Sampling too frequently can overload the system, causing the system to appear as if it is frozen or causing the system to actually freeze.

40.2.2.2. Unit Masks

If the cpu_type is not timer, unit masks may also be required to further define the event.
Unit masks for each event are listed with the op_help command. The values for each unit mask are listed in hexadecimal format. To specify more than one unit mask, the hexadecimal values must be combined using a bitwise or operation.
opcontrol --event=<event-name>:<sample-rate>:<unit-mask>

40.2.3. Separating Kernel and User-space Profiles

By default, kernel mode and user mode information is gathered for each event. To configure OProfile not to count events in kernel mode for a specific counter, execute the following command:
opcontrol --event=<event-name>:<sample-rate>:<unit-mask>:0
Execute the following command to start profiling kernel mode for the counter again:
opcontrol --event=<event-name>:<sample-rate>:<unit-mask>:1
To configure OProfile not to count events in user mode for a specific counter, execute the following command:
opcontrol --event=<event-name>:<sample-rate>:<unit-mask>:<kernel>:0
Execute the following command to start profiling user mode for the counter again:
opcontrol --event=<event-name>:<sample-rate>:<unit-mask>:<kernel>:1
When the OProfile daemon writes the profile data to sample files, it can separate the kernel and library profile data into separate sample files. To configure how the daemon writes to sample files, execute the following command as root:
 opcontrol --separate=<choice>
<choice> can be one of the following:
  • none — do not separate the profiles (default)
  • library — generate per-application profiles for libraries
  • kernel — generate per-application profiles for the kernel and kernel modules
  • all — generate per-application profiles for libraries and per-application profiles for the kernel and kernel modules
If --separate=library is used, the sample file name includes the name of the executable as well as the name of the library.

40.3. Starting and Stopping OProfile

To start monitoring the system with OProfile, execute the following command as root:
opcontrol --start
Output similar to the following is displayed:
Using log file /var/lib/oprofile/oprofiled.log
Daemon started.
Profiler running.
The settings in /root/.oprofile/daemonrc are used.
The OProfile daemon, oprofiled, is started; it periodically writes the sample data to the /var/lib/oprofile/samples/ directory. The log file for the daemon is located at /var/lib/oprofile/oprofiled.log.
To stop the profiler, execute the following command as root:
opcontrol --shutdown

40.4. Saving Data

Sometimes it is useful to save samples at a specific time. For example, when profiling an executable, it may be useful to gather different samples based on different input data sets. If the number of events to be monitored exceeds the number of counters available for the processor, multiple runs of OProfile can be used to collect data, saving the sample data to different files each time.
To save the current set of sample files, execute the following command, replacing <name> with a unique descriptive name for the current session.
opcontrol --save=<name>
The directory /var/lib/oprofile/samples/name/ is created and the current sample files are copied to it.

40.5. Analyzing the Data

Periodically, the OProfile daemon, oprofiled, collects the samples and writes them to the /var/lib/oprofile/samples/ directory. Before reading the data, make sure all data has been written to this directory by executing the following command as root:
opcontrol --dump
Each sample file name is based on the name of the executable. For example, the samples for the default event on a Pentium III processor for /bin/bash becomes:
\{root\}/bin/bash/\{dep\}/\{root\}/bin/bash/CPU_CLK_UNHALTED.100000
The following tools are available to profile the sample data once it has been collected:
  • opreport
  • opannotate
Use these tools, along with the binaries profiled, to generate reports that can be further analyzed.

Warning

The executable being profiled must be used with these tools to analyze the data. If it must change after the data is collected, backup the executable used to create the samples as well as the sample files.
Samples for each executable are written to a single sample file. Samples from each dynamically linked library are also written to a single sample file. While OProfile is running, if the executable being monitored changes and a sample file for the executable exists, the existing sample file is automatically deleted. Thus, if the existing sample file is needed, it must be backed up, along with the executable used to create it before replacing the executable with a new version. Refer to Section 40.4, “Saving Data” for details on how to backup the sample file.

40.5.1. Using opreport

The opreport tool provides an overview of all the executables being profiled.
The following is part of an example output:
Profiling through timer interrupt
          TIMER:0|
  samples|      %|
------------------
    25926 97.5212 no-vmlinux
      359  1.3504 pi
       65  0.2445 Xorg
       62  0.2332 libvte.so.4.4.0
       56  0.2106 libc-2.3.4.so
       34  0.1279 libglib-2.0.so.0.400.7
       19  0.0715 libXft.so.2.1.2
       17  0.0639 bash
        8  0.0301 ld-2.3.4.so
        8  0.0301 libgdk-x11-2.0.so.0.400.13
        6  0.0226 libgobject-2.0.so.0.400.7
        5  0.0188 oprofiled
        4  0.0150 libpthread-2.3.4.so
        4  0.0150 libgtk-x11-2.0.so.0.400.13
        3  0.0113 libXrender.so.1.2.2
        3  0.0113 du
        1  0.0038 libcrypto.so.0.9.7a
        1  0.0038 libpam.so.0.77
        1  0.0038 libtermcap.so.2.0.8
        1  0.0038 libX11.so.6.2
        1  0.0038 libgthread-2.0.so.0.400.7
        1  0.0038 libwnck-1.so.4.9.0
Each executable is listed on its own line. The first column is the number of samples recorded for the executable. The second column is the percentage of samples relative to the total number of samples. The third column is the name of the executable.
Refer to the opreport man page for a list of available command line options, such as the -r option used to sort the output from the executable with the smallest number of samples to the one with the largest number of samples.

40.5.2. Using opreport on a Single Executable

To retrieve more detailed profiled information about a specific executable, use opreport:
 opreport <mode><executable>
<executable> must be the full path to the executable to be analyzed. <mode> must be one of the following:
-l
List sample data by symbols. For example, the following is part of the output from running the command opreport -l /lib/tls/libc-<version>.so:
samples  %        symbol name
12       21.4286  __gconv_transform_utf8_internal
5         8.9286  _int_malloc
4         7.1429  malloc
3         5.3571  __i686.get_pc_thunk.bx
3         5.3571  _dl_mcount_wrapper_check
3         5.3571  mbrtowc
3         5.3571  memcpy
2         3.5714  _int_realloc
2         3.5714  _nl_intern_locale_data
2         3.5714  free
2         3.5714  strcmp
1         1.7857  __ctype_get_mb_cur_max
1         1.7857  __unregister_atfork
1         1.7857  __write_nocancel
1         1.7857  _dl_addr
1         1.7857  _int_free
1         1.7857  _itoa_word
1         1.7857  calc_eclosure_iter
1         1.7857  fopen@@GLIBC_2.1
1         1.7857  getpid
1         1.7857  memmove
1         1.7857  msort_with_tmp
1         1.7857  strcpy
1         1.7857  strlen
1         1.7857  vfprintf
1         1.7857  write
The first column is the number of samples for the symbol, the second column is the percentage of samples for this symbol relative to the overall samples for the executable, and the third column is the symbol name.
To sort the output from the largest number of samples to the smallest (reverse order), use -r in conjunction with the -l option.
-i <symbol-name>
List sample data specific to a symbol name. For example, the following output is from the command opreport -l -i __gconv_transform_utf8_internal /lib/tls/libc-<version>.so:
samples  %        symbol name
12       100.000  __gconv_transform_utf8_internal
The first line is a summary for the symbol/executable combination.
The first column is the number of samples for the memory symbol. The second column is the percentage of samples for the memory address relative to the total number of samples for the symbol. The third column is the symbol name.
-d
List sample data by symbols with more detail than -l. For example, the following output is from the command opreport -l -d __gconv_transform_utf8_internal /lib/tls/libc-<version>.so:
vma      samples  %        symbol name
00a98640 12       100.000  __gconv_transform_utf8_internal
00a98640 1         8.3333
00a9868c 2        16.6667
00a9869a 1         8.3333
00a986c1 1         8.3333
00a98720 1         8.3333
00a98749 1         8.3333
00a98753 1         8.3333
00a98789 1         8.3333
00a98864 1         8.3333
00a98869 1         8.3333
00a98b08 1         8.3333
The data is the same as the -l option except that for each symbol, each virtual memory address used is shown. For each virtual memory address, the number of samples and percentage of samples relative to the number of samples for the symbol is displayed.
-x<symbol-name>
Exclude the comma-separated list of symbols from the output.
session:<name>
Specify the full path to the session or a directory relative to the /var/lib/oprofile/samples/ directory.

40.5.3. Using opannotate

The opannotate tool tries to match the samples for particular instructions to the corresponding lines in the source code. The resulting files generated should have the samples for the lines at the left. It also puts in a comment at the beginning of each function listing the total samples for the function.
For this utility to work, the executable must be compiled with GCC's -g option. By default, Red Hat Enterprise Linux packages are not compiled with this option.
The general syntax for opannotate is as follows:
 opannotate --search-dirs <src-dir> --source <executable>
The directory containing the source code and the executable to be analyzed must be specified. Refer to the opannotate man page for a list of additional command line options.

40.6. Understanding /dev/oprofile/

The /dev/oprofile/ directory contains the file system for OProfile. Use the cat command to display the values of the virtual files in this file system. For example, the following command displays the type of processor OProfile detected:
cat /dev/oprofile/cpu_type
A directory exists in /dev/oprofile/ for each counter. For example, if there are 2 counters, the directories /dev/oprofile/0/ and dev/oprofile/1/ exist.
Each directory for a counter contains the following files:
  • count — The interval between samples.
  • enabled — If 0, the counter is off and no samples are collected for it; if 1, the counter is on and samples are being collected for it.
  • event — The event to monitor.
  • kernel — If 0, samples are not collected for this counter event when the processor is in kernel-space; if 1, samples are collected even if the processor is in kernel-space.
  • unit_mask — Defines which unit masks are enabled for the counter.
  • user — If 0, samples are not collected for the counter event when the processor is in user-space; if 1, samples are collected even if the processor is in user-space.
The values of these files can be retrieved with the cat command. For example:
cat /dev/oprofile/0/count

40.7. Example Usage

While OProfile can be used by developers to analyze application performance, it can also be used by system administrators to perform system analysis. For example:
  • Determine which applications and services are used the most on a systemopreport can be used to determine how much processor time an application or service uses. If the system is used for multiple services but is under performing, the services consuming the most processor time can be moved to dedicated systems.
  • Determine processor usage — The CPU_CLK_UNHALTED event can be monitored to determine the processor load over a given period of time. This data can then be used to determine if additional processors or a faster processor might improve system performance.

40.8. Graphical Interface

Some OProfile preferences can be set with a graphical interface. To start it, execute the oprof_start command as root at a shell prompt.
After changing any of the options, save them by clicking the Save and quit button. The preferences are written to /root/.oprofile/daemonrc, and the application exits. Exiting the application does not stop OProfile from sampling.
On the Setup tab, to set events for the processor counters as discussed in Section 40.2.2, “Setting Events to Monitor”, select the counter from the pulldown menu and select the event from the list. A brief description of the event appears in the text box below the list. Only events available for the specific counter and the specific architecture are displayed. The interface also displays whether the profiler is running and some brief statistics about it.
OProfile Setup

Figure 40.1. OProfile Setup

On the right side of the tab, select the Profile kernel option to count events in kernel mode for the currently selected event, as discussed in Section 40.2.3, “Separating Kernel and User-space Profiles”. If this option is unselected, no samples are collected for the kernel.
Select the Profile user binaries option to count events in user mode for the currently selected event, as discussed in Section 40.2.3, “Separating Kernel and User-space Profiles”. If this option is unselected, no samples are collected for user applications.
Use the Count text field to set the sampling rate for the currently selected event as discussed in Section 40.2.2.1, “Sampling Rate”.
If any unit masks are available for the currently selected event, as discussed in Section 40.2.2.2, “Unit Masks”, they are displayed in the Unit Masks area on the right side of the Setup tab. Select the checkbox beside the unit mask to enable it for the event.
On the Configuration tab, to profile the kernel, enter the name and location of the vmlinux file for the kernel to monitor in the Kernel image file text field. To configure OProfile not to monitor the kernel, select No kernel image.
OProfile Configuration

Figure 40.2. OProfile Configuration

If the Verbose option is selected, the oprofiled daemon log includes more information.
If Per-application kernel samples files is selected, OProfile generates per-application profiles for the kernel and kernel modules as discussed in Section 40.2.3, “Separating Kernel and User-space Profiles”. This is equivalent to the opcontrol --separate=kernel command. If Per-application shared libs samples files is selected, OProfile generates per-application profiles for libraries. This is equivalent to the opcontrol --separate=library command.
To force data to be written to samples files as discussed in Section 40.5, “Analyzing the Data”, click the Flush profiler data button. This is equivalent to the opcontrol --dump command.
To start OProfile from the graphical interface, click Start profiler. To stop the profiler, click Stop profiler. Exiting the application does not stop OProfile from sampling.

40.9. Additional Resources

This chapter only highlights OProfile and how to configure and use it. To learn more, refer to the following resources.

40.9.1. Installed Docs

  • /usr/share/doc/oprofile-<version>/oprofile.htmlOProfile Manual
  • oprofile man page — Discusses opcontrol, opreport, opannotate, and op_help

40.9.2. Useful Websites

http://oprofile.sourceforge.net/ — Contains the latest documentation, mailing lists, IRC channels, and more.

Part VII. Appendix

Appendix A. Revision History

Revision History
Revision 1.0-1.33.402Fri Oct 25 2013Rüdiger Landmann
Rebuild with Publican 4.0.0
Revision 1.0-1.33July 24 2012Ruediger Landmann
Rebuild for Publican 3.0
Revision 1.0-1Thu Sep 18 2008Don Domingo
migrated to new automated build system

Index

Symbols

/dev/oprofile/, Understanding /dev/oprofile/
/dev/shm, File Systems
/etc/auto.master, Mounting NFS File Systems using autofs
/etc/exports, Exporting NFS File Systems
/etc/fstab, Converting to an ext3 File System, Mounting NFS File Systems using /etc/fstab
/etc/fstab file
enabling disk quotas with, Enabling Quotas
/etc/hosts, Managing Hosts
/etc/httpd/conf/httpd.conf, Apache HTTP Server Configuration
/etc/sysconfig/dhcpd, Starting and Stopping the Server
/proc/ directory, Installed Documentation
/var/spool/cron, Configuring Cron Tasks

A

Access Control Lists (see ACLs)
ACLs
access ACLs, Setting Access ACLs
additional resources, Additional Resources
archiving with, Archiving File Systems With ACLs
default ACLs, Setting Default ACLs
getfacl, Retrieving ACLs
mounting file systems with, Mounting File Systems
mounting NFS shares with, NFS
on ext3 file systems, Access Control Lists
retrieving, Retrieving ACLs
setfacl, Setting Access ACLs
setting
access ACLs, Setting Access ACLs
with Samba, Access Control Lists
adding
group, Adding a Group
user, Command Line Configuration
Apache HTTP Server (see HTTP Configuration Tool)
additional resources, Additional Resources
related books, Related Books
securing, An Overview of Certificates and Security
APXS, An Overview of Security-Related Packages
at, At and Batch
additional resources, Additional Resources
authconfig (see Authentication Configuration Tool)
authentication, Authentication Configuration
Authentication Configuration Tool, Authentication Configuration
authentication, Authentication
Kerberos support, Authentication
LDAP support, Authentication
MD5 passwords, Authentication
shadow passwords, Authentication
SMB support, Authentication
Winbind, Authentication
command line version, Command Line Version
user information, User Information
cache, User Information
Hesiod, User Information
LDAP, User Information
NIS, User Information
Winbind, User Information
autofs, Mounting NFS File Systems using autofs
/etc/auto.master, Mounting NFS File Systems using autofs
Automated Tasks, Automated Tasks

B

batch, At and Batch
additional resources, Additional Resources
boot media, Preparing to Upgrade
boot partition, Creating the /boot/ Partition
booting
emergency mode, Booting into Emergency Mode
rescue mode, Booting into Rescue Mode
single-user mode, Booting into Single-User Mode

C

CA (see secure server)
chage command
forcing password expiration with, Password Aging
chkconfig, chkconfig
color depth, Display Settings
command line options
printing from, Managing Print Jobs
configuration
console access, Console Access
NFS, Network File System (NFS)
console
making files accessible from, Making Files Accessible From the Console
console access
configuring, Console Access
defining, Defining the Console
disabling, Disabling Console Program Access
enabling, Enabling Console Access for Other Applications
Cron, Automated Tasks
cron
additional resources, Additional Resources
configuration file, Configuring Cron Tasks
example crontabs, Configuring Cron Tasks
user-defined tasks, Configuring Cron Tasks
crontab, Configuring Cron Tasks
CtrlAltDel
shutdown, disabling, Disabling Shutdown Via Ctrl+Alt+Del
CUPS, Printer Configuration

D

date configuration, Time and Date Properties
dateconfig (see Time and Date Properties Tool)
Demilitarized Zone, DMZs and IPTables
devel package, An Overview of Security-Related Packages
df, File Systems
DHCP, Dynamic Host Configuration Protocol (DHCP)
additional resources, Additional Resources
client configuration, Configuring a DHCP Client
command line options, Starting and Stopping the Server
connecting to, Configuring a DHCP Client
dhcpd.conf, Configuration File
dhcpd.leases, Starting and Stopping the Server
dhcrelay, DHCP Relay Agent
global parameters, Configuration File
group, Configuration File
options, Configuration File
reasons for using, Why Use DHCP?
Relay Agent, DHCP Relay Agent
server configuration, Configuring a DHCP Server
shared-network, Configuration File
starting the server, Starting and Stopping the Server
stopping the server, Starting and Stopping the Server
subnet, Configuration File
dhcpd.conf, Configuration File
dhcpd.leases, Starting and Stopping the Server
dhcrelay, DHCP Relay Agent
disk quotas, Implementing Disk Quotas
additional resources, Additional Resources
assigning per file system, Assigning Quotas per File System
assigning per group, Assigning Quotas per Group
assigning per user, Assigning Quotas per User
disabling, Enabling and Disabling
enabling, Configuring Disk Quotas, Enabling and Disabling
/etc/fstab, modifying, Enabling Quotas
creating quota files, Creating the Quota Database Files
quotacheck, running, Creating the Quota Database Files
grace period, Assigning Quotas per User
hard limit, Assigning Quotas per User
management of, Managing Disk Quotas
quotacheck command, using to check, Keeping Quotas Accurate
reporting, Reporting on Disk Quotas
soft limit, Assigning Quotas per User
disk storage (see disk quotas)
parted (see parted)
diskless environment, Diskless Environments
adding hosts, Adding Hosts
Network Booting Tool, Finish Configuring the Diskless Environment
NFS configuration, Configuring the NFS Server
overview, Diskless Environments
display
settings for X, Display Settings
DMZ (see Demilitarized Zone)
documentation
finding installed, Impressing Your Friends with RPM
DSA keys
generating, Generating a DSA Key Pair for Version 2
DSOs
loading, An Overview of Security-Related Packages
du, File Systems
Dynamic Host Configuration Protocol (see DHCP)

E

e2fsck, Reverting to an ext2 File System
e2label, Labeling the Partition
emergency mode, Booting into Emergency Mode
Ethernet connection (see network configuration)
exim, Mail Transport Agent (MTA) Configuration
expiration of password, forcing, Password Aging
exporting NFS file Systems, Exporting NFS File Systems
exports, Exporting NFS File Systems
ext2
reverting from ext3, Reverting to an ext2 File System
ext2online, Reverting to an ext2 File System
ext3
converting from ext2, Converting to an ext3 File System
creating, Creating an ext3 File System
features, Features of ext3
ext3 file system
resizing, Reverting to an ext2 File System

F

feedback, Send in Your Feedback
file systems, File Systems
ext2 (see ext2)
ext3 (see ext3)
LVM (see LVM)
NFS (see NFS)
findsmb, Command Line
firewall configuration (see Security Level Configuration Tool)
firewall types, Firewalls
network address translation (NAT), Firewalls
packet filter, Firewalls
proxy, Firewalls
firewalls, Firewalls
additional resources, Additional Resources
and connection tracking, IPTables and Connection Tracking
and malicious software, Malicious Software and Spoofed IP Addresses
policies, Basic Firewall Policies
stateful, IPTables and Connection Tracking
types, Firewalls
Firewalls
iptables, Netfilter and IPTables
floppy group, use of, The floppy Group
free, Memory Usage
ftp, Why Use OpenSSH?

G

getfacl, Retrieving ACLs
GNOME System Monitor, System Processes
gnome-system-monitor, System Processes
GnuPG
checking RPM package signatures, Checking a Package's Signature
group configuration
adding groups, Adding a New Group
filtering list of groups, User and Group Configuration
groupadd, Adding a Group
modify users in groups, Modifying Group Properties
modifying group properties, Modifying Group Properties
viewing list of groups, User and Group Configuration
groups (see group configuration)
additional resources, Additional Resources
installed documentation, Installed Documentation
floppy, use of, The floppy Group
GID, Users and Groups
introducing, Users and Groups
shared directories, Group Directories
standard, Standard Groups
tools for management of
groupadd, User and Group Management Tools, User Private Groups
system-config-users, User Private Groups
User Manager, User and Group Management Tools
user private, User Private Groups

H

hardware
viewing, Hardware
Hardware Browser, Hardware
Hardware RAID (see RAID)
hesiod, User Information
HTTP Configuration Tool
directives (see HTTP directives)
error log, Logging
modules, Apache HTTP Server Configuration
transfer log, Logging
HTTP directives
DirectoryIndex, Site Configuration
ErrorDocument, Site Configuration
ErrorLog, Logging
Group, Server Settings
HostnameLookups, Logging
KeepAlive, Performance Tuning
KeepAliveTimeout, Performance Tuning
Listen, Basic Settings
LogFormat, Logging
LogLevel, Logging
MaxClients, Performance Tuning
MaxKeepAliveRequests, Performance Tuning
Options, Site Configuration
ServerAdmin, Basic Settings
ServerName, Basic Settings
TimeOut, Performance Tuning
TransferLog, Logging
User, Server Settings
httpd, Apache HTTP Server Configuration
hwbrowser, Hardware

I

information
about your system, Gathering System Information
insmod, Kernel Module Utilities
installation
kickstart (see kickstart installations)
LVM, LVM Configuration
PXE (see PXE installations)
software RAID, Software RAID Configuration
Internet connection (see network configuration)
introduction, Introduction
ip6tables, IPv6
iptables, Netfilter and IPTables, Activating the IPTables Service
additional resources, Additional Resources
and DMZs, DMZs and IPTables
and malicious software, Malicious Software and Spoofed IP Addresses
chains, IPTables Command Syntax
FORWARD, FORWARD and NAT Rules
INPUT, Common IPTables Filtering
OUTPUT, Common IPTables Filtering
POSTROUTING, Postrouting and IP Masquerading
PREROUTING, Prerouting, DMZs and IPTables
connection tracking, IPTables and Connection Tracking
states, IPTables and Connection Tracking
policies, Basic Firewall Policies
rules, Saving and Restoring IPTables Rules
common, Common IPTables Filtering
forwarding, FORWARD and NAT Rules
NAT, Postrouting and IP Masquerading, DMZs and IPTables
restoring, Saving and Restoring IPTables Rules
saving, Saving and Restoring IPTables Rules
stateful inspection, IPTables and Connection Tracking
states, IPTables and Connection Tracking
using, Using IPTables
ISDN connection (see network configuration)

K

Kerberos, Authentication
kernel
downloading, Downloading the Upgraded Kernel
large memory support, Overview of Kernel Packages
modules, Kernel Modules
multiple processor support, Overview of Kernel Packages
upgrading, Manually Upgrading the Kernel
kernel modules
/etc/rc.modules, Persistent Module Loading
listing, Kernel Module Utilities
loading, Kernel Module Utilities
persistent loading, Persistent Module Loading
unload, Kernel Module Utilities
keyboard
configuring, Keyboard Configuration
Keyboard Configuration Tool, Keyboard Configuration
keyboards, Keyboard Configuration
configuration, Keyboard Configuration
kickstart
how the file is found, Starting a Kickstart Installation
Kickstart Configurator, Kickstart Configurator
%post script, Post-Installation Script
%pre script, Pre-Installation Script
authentication options, Authentication
basic options, Basic Configuration
boot loader, Boot Loader Options
boot loader options, Boot Loader Options
Display configuration, Display Configuration
firewall configuration, Firewall Configuration
installation method selection, Installation Method
interactive, Basic Configuration
keyboard, Basic Configuration
language, Basic Configuration
language support, Basic Configuration
mouse, Basic Configuration
network configuration, Network Configuration
package selection, Package Selection
partitioning, Partition Information
software RAID, Creating Software RAID Partitions
preview, Kickstart Configurator
reboot, Basic Configuration
root password, Basic Configuration
encrypt, Basic Configuration
saving, Saving the File
SELinux configuration, SELinux Configuration
text mode installation, Basic Configuration
time zone, Basic Configuration
kickstart file
%include, Kickstart Options
%post, Post-installation Script
%pre, Pre-installation Script
auth, Kickstart Options
authconfig, Kickstart Options
autopart, Kickstart Options
autostep, Kickstart Options
bootloader, Kickstart Options
CD-ROM-based, Creating Kickstart Boot Media
clearpart, Kickstart Options
cmdline, Kickstart Options
creating, Kickstart Options
device, Kickstart Options
diskette-based, Creating Kickstart Boot Media
driverdisk, Kickstart Options
firewall, Kickstart Options
firstboot, Kickstart Options
flash-based, Creating Kickstart Boot Media
format of, Creating the Kickstart File
halt, Kickstart Options
ignoredisk, Kickstart Options
include contents of another file, Kickstart Options
install, Kickstart Options
installation methods, Kickstart Options
interactive, Kickstart Options
keyboard, Kickstart Options
lang, Kickstart Options
langsupport, Kickstart Options
logvol, Kickstart Options
mouse, Kickstart Options
network, Kickstart Options
network-based, Making the Kickstart File Available on the Network, Making the Installation Tree Available
options, Kickstart Options
partitioning examples, Advanced Partitioning Example
package selection specification, Package Selection
part, Kickstart Options
partition, Kickstart Options
post-installation configuration, Post-installation Script
poweroff, Kickstart Options
pre-installation configuration, Pre-installation Script
raid, Kickstart Options
reboot, Kickstart Options
rootpw, Kickstart Options
selinux, Kickstart Options
shutdown, Kickstart Options
skipx, Kickstart Options
text, Kickstart Options
timezone, Kickstart Options
upgrade, Kickstart Options
volgroup, Kickstart Options
what it looks like, Creating the Kickstart File
xconfig, Kickstart Options
zerombr, Kickstart Options
kickstart installations, Kickstart Installations
CD-ROM-based, Creating Kickstart Boot Media
diskette-based, Creating Kickstart Boot Media
file format, Creating the Kickstart File
file locations, Making the Kickstart File Available
flash-based, Creating Kickstart Boot Media
installation tree, Making the Installation Tree Available
LVM, Kickstart Options
network-based, Making the Kickstart File Available on the Network, Making the Installation Tree Available
starting, Starting a Kickstart Installation
from a boot CD-ROM, Starting a Kickstart Installation
from CD-ROM #1 with a diskette, Starting a Kickstart Installation

L

LDAP, User Information, Authentication
loading kernel modules, Kernel Modules
log files, Log Files
(see also Log Viewer)
description, Log Files
examining, Examining Log Files
locating, Locating Log Files
rotating, Locating Log Files
syslogd, Log Files
viewing, Viewing Log Files
Log Viewer
alerts, Examining Log Files
filtering, Viewing Log Files
log file locations, Viewing Log Files
refresh rate, Viewing Log Files
searching, Viewing Log Files
logical volume, What is LVM?, Creating the LVM Logical Volumes
logical volume group, What is LVM?
Logical Volume Manager (see LVM)
logrotate, Locating Log Files
lpd, Printer Configuration
lsmod, Kernel Module Utilities
lspci, Hardware
LVM, Logical Volume Manager (LVM)
additional resources, Additional Resources
configuring LVM during installation, LVM Configuration
explanation of, What is LVM?
installing
automatic partitioning, Automatic Partitioning, Manual LVM Partitioning
creating a logical volume, Creating the LVM Logical Volumes
creating physical volumes, Creating the LVM Physical Volumes
creating the boot partition, Creating the /boot/ Partition
creating volume groups, Creating the LVM Volume Groups
logical volume, What is LVM?, Creating the LVM Logical Volumes
logical volume group, What is LVM?
physical extent, Creating the LVM Volume Groups
physical volume, What is LVM?, Creating the LVM Physical Volumes
volume groups, Creating the LVM Volume Groups
with kickstart, Kickstart Options
lvm
LVM tools and utilities, LVM Partition Management
LVM2
explanation of, What is LVM2?

M

Mail Transport Agent (see MTA)
Mail Transport Agent Switcher, Mail Transport Agent (MTA) Configuration
starting in text mode, Mail Transport Agent (MTA) Configuration
Mail User Agent, Mail Transport Agent (MTA) Configuration
Master Boot Record, Unable to Boot into Red Hat Enterprise Linux
reinstalling, Reinstalling the Boot Loader
MD5 passwords, Authentication
memory usage, Memory Usage
mkfs, Formating the Partition
mkpart, Making the Partition
modem connection (see network configuration)
modprobe, Kernel Module Utilities
modprobe.conf, Kernel Modules
monitor
settings for dual head, Dual Head Display Settings
settings for X, Display Hardware Settings
mounting
NFS file systems, Mounting NFS File Systems
MTA
setting default, Mail Transport Agent (MTA) Configuration
switching with Mail Transport Agent Switcher, Mail Transport Agent (MTA) Configuration
MUA, Mail Transport Agent (MTA) Configuration

N

NAT (see Network Address Translation)
neat (see network configuration)
Netfilter, Netfilter and IPTables
additional resources, Additional Resources
Netfilter 6, IPv6
Network Address Translation, FORWARD and NAT Rules
with iptables, FORWARD and NAT Rules
Network Administration Tool (see network configuration)
Network Booting Tool, PXE Boot Configuration
pxeboot, Command Line Configuration
pxeos, Command Line Configuration
using with diskless environments, Finish Configuring the Diskless Environment
using with PXE installations, PXE Boot Configuration
network configuration
device aliases, Device Aliases
DHCP, Establishing an Ethernet Connection
Ethernet connection, Establishing an Ethernet Connection
activating, Establishing an Ethernet Connection
ISDN connection, Establishing an ISDN Connection
activating, Establishing an ISDN Connection
logical network devices, Working with Profiles
managing /etc/hosts, Managing Hosts
managing DNS Settings, Managing DNS Settings
managing hosts, Managing Hosts
modem connection, Establishing a Modem Connection
activating, Establishing a Modem Connection
overview, Overview
PPPoE connection, Establishing an xDSL Connection
profiles, Working with Profiles
activating, Working with Profiles
restoring from file, Saving and Restoring the Network Configuration
saving to file, Saving and Restoring the Network Configuration
static IP, Establishing an Ethernet Connection
token ring connection, Establishing a Token Ring Connection
activating, Establishing a Token Ring Connection
wireless connection, Establishing a Wireless Connection
activating, Establishing a Wireless Connection
xDSL connection, Establishing an xDSL Connection
activating, Establishing an xDSL Connection
Network Device Control, Working with Profiles
Network File System (see NFS)
Network Time Protocol (see NTP)
NFS
/etc/fstab, Mounting NFS File Systems using /etc/fstab
additional resources, Additional Resources
autofs (see autofs)
command line configuration, Command Line Configuration
configuration, Network File System (NFS)
diskless environment, configuring for, Configuring the NFS Server
exporting, Exporting NFS File Systems
hostname formats, Hostname Formats
mounting, Mounting NFS File Systems
over TCP, Using TCP
starting the server, Starting and Stopping the Server
status of the server, Starting and Stopping the Server
stopping the server, Starting and Stopping the Server
NFS Server Configuration Tool, Exporting NFS File Systems
NIS, User Information
NTP
configuring, Network Time Protocol (NTP) Properties
ntpd, Network Time Protocol (NTP) Properties
ntpd, Network Time Protocol (NTP) Properties
ntsysv, ntsysv

O

O'Reilly & Associates, Inc., Related Books
O'Reilly &Associates, Inc., Related Books
opannotate (see OProfile)
opcontrol (see OProfile)
OpenLDAP, User Information, Authentication
openldap-clients, User Information
OpenSSH, OpenSSH
additional resources, Additional Resources
client, Configuring an OpenSSH Client
scp, Using the scp Command
sftp, Using the sftp Command
ssh, Using the ssh Command
DSA keys
generating, Generating a DSA Key Pair for Version 2
generating key pairs, Generating Key Pairs
RSA keys
generating, Generating an RSA Key Pair for Version 2
RSA Version 1 keys
generating, Generating an RSA Key Pair for Version 1.3 and 1.5
server, Configuring an OpenSSH Server
/etc/ssh/sshd_config, Configuring an OpenSSH Server
starting and stopping, Configuring an OpenSSH Server
ssh-add, Configuring ssh-agent
ssh-agent, Configuring ssh-agent
with GNOME, Configuring ssh-agent with GNOME
ssh-keygen
DSA, Generating a DSA Key Pair for Version 2
RSA, Generating an RSA Key Pair for Version 2
RSA Version 1, Generating an RSA Key Pair for Version 1.3 and 1.5
OpenSSL
additional resources, Additional Resources
opreport (see OProfile)
OProfile, OProfile
/dev/oprofile/, Understanding /dev/oprofile/
additional resources, Additional Resources
configuring, Configuring OProfile
separating profiles, Separating Kernel and User-space Profiles
events
sampling rate, Sampling Rate
setting, Setting Events to Monitor
monitoring the kernel, Specifying the Kernel
opannotate, Using opannotate
opcontrol, Configuring OProfile
--no-vmlinux, Specifying the Kernel
--start, Starting and Stopping OProfile
--vmlinux=, Specifying the Kernel
opreport, Using opreport
on a single executable, Using opreport on a Single Executable
oprofiled, Starting and Stopping OProfile
log file, Starting and Stopping OProfile
op_help, Setting Events to Monitor
overview of tools, Overview of Tools
reading data, Analyzing the Data
saving data, Saving Data
starting, Starting and Stopping OProfile
unit mask, Unit Masks
oprofiled (see OProfile)
oprof_start, Graphical Interface
op_help, Setting Events to Monitor

P

Package Updater, Red Hat Network
packages
dependencies, Unresolved Dependency
determining file ownership with, Impressing Your Friends with RPM
finding deleted files from, Impressing Your Friends with RPM
freshening with RPM, Freshening
installing, Installing
locating documentation for, Impressing Your Friends with RPM
obtaining list of files, Impressing Your Friends with RPM
preserving configuration files, Upgrading
querying, Querying
querying uninstalled, Impressing Your Friends with RPM
removing, Uninstalling
tips, Impressing Your Friends with RPM
upgrading, Upgrading
verifying, Verifying
pam_smbpass, Encrypted Passwords
pam_timestamp, Enabling Console Access for Other Applications
parted, Standard Partitions using parted
creating partitions, Creating a Partition
overview, Standard Partitions using parted
removing partitions, Removing a Partition
resizing partitions, Resizing a Partition
selecting device, Viewing the Partition Table
table of commands, Standard Partitions using parted
viewing partition table, Viewing the Partition Table
partition table
viewing, Viewing the Partition Table
partitions
creating, Creating a Partition
formating
mkfs, Formating the Partition
labeling
e2label, Labeling the Partition
making
mkpart, Making the Partition
removing, Removing a Partition
resizing, Resizing a Partition
viewing list, Viewing the Partition Table
password
aging, Password Aging
forcing expiration of, Password Aging
passwords
shadow, Shadow Passwords
PCI devices
listing, Hardware
physical extent, Creating the LVM Volume Groups
physical volume, What is LVM?, Creating the LVM Physical Volumes
pixels, Display Settings
postfix, Mail Transport Agent (MTA) Configuration
PPPoE, Establishing an xDSL Connection
Pre-Execution Environment, PXE Network Installations
printconf (see printer configuration)
printer configuration, Printer Configuration
adding
CUPS (IPP) printer, Adding an IPP Printer
IPP printer, Adding an IPP Printer
JetDirect printer, Adding a JetDirect Printer
local printer, Adding a Local Printer
Samba (SMB) printer, Adding a Samba (SMB) Printer
cancel print job, Managing Print Jobs
CUPS, Printer Configuration
default printer, Modifying Existing Printers
delete existing printer, Modifying Existing Printers
IPP printer, Adding an IPP Printer
JetDirect printer, Adding a JetDirect Printer
local printer, Adding a Local Printer
managing print jobs, Managing Print Jobs
networked CUPS (IPP) printer, Adding an IPP Printer
printing from the command line, Managing Print Jobs
Samba (SMB) printer, Adding a Samba (SMB) Printer
test page, Printing a Test Page
viewing print spool, command line, Managing Print Jobs
Printer Configuration Tool (see printer configuration)
printtool (see printer configuration)
processes, System Processes
ps, System Processes
PXE, PXE Network Installations
PXE installations, PXE Network Installations
adding hosts, Adding PXE Hosts
boot message, custom, Adding a Custom Boot Message
configuration, PXE Boot Configuration
Network Booting Tool, PXE Boot Configuration
overview, PXE Network Installations
performing, Performing the PXE Installation
setting up the network server, Setting up the Network Server
pxeboot, Command Line Configuration
pxeos, Command Line Configuration

Q

quotacheck, Creating the Quota Database Files
quotacheck command
checking quota accuracy with, Keeping Quotas Accurate
quotaoff, Enabling and Disabling
quotaon, Enabling and Disabling

R

RAID, Redundant Array of Independent Disks (RAID)
configuring software RAID during installation, Software RAID Configuration
explanation of, What is RAID?
Hardware RAID, Hardware RAID versus Software RAID
installing
creating the boot partition, Creating the RAID Partitions
creating the mount points, Creating the RAID Devices and Mount Points
creating the RAID devices, Creating the RAID Devices and Mount Points
creating the RAID partitions, Creating the RAID Partitions
level 0, RAID Levels and Linear Support
level 1, RAID Levels and Linear Support
level 4, RAID Levels and Linear Support
level 5, RAID Levels and Linear Support
levels, RAID Levels and Linear Support
reasons to use, Who Should Use RAID?
Software RAID, Hardware RAID versus Software RAID
RAM, Memory Usage
rcp, Using the scp Command
Red Hat Network, Red Hat Network
Red Hat Package Manager (see RPM)
Red Hat RPM Guide, Related Books
rescue mode
definition of, Booting into Rescue Mode
utilities available, Booting into Rescue Mode
resize2fs, Reverting to an ext2 File System
resolution, Display Settings
RHN (see Red Hat Network)
rmmod, Kernel Module Utilities
RPM, Package Management with RPM
additional resources, Additional Resources
book about, Related Books
checking package signatures, Checking a Package's Signature
dependencies, Unresolved Dependency
design goals, RPM Design Goals
determining file ownership with, Impressing Your Friends with RPM
documentation with, Impressing Your Friends with RPM
file conflicts
resolving, Conflicting Files
finding deleted files with, Impressing Your Friends with RPM
freshen, Freshening
freshening packages, Freshening
GnuPG, Checking a Package's Signature
installing, Installing
md5sum, Checking a Package's Signature
preserving configuration files, Upgrading
querying, Querying
querying for file list, Impressing Your Friends with RPM
querying uninstalled packages, Impressing Your Friends with RPM
tips, Impressing Your Friends with RPM
uninstalling, Uninstalling
upgrading, Upgrading
using, Using RPM
verifying, Verifying
website, Useful Websites
RSA keys
generating, Generating an RSA Key Pair for Version 2
RSA Version 1 keys
generating, Generating an RSA Key Pair for Version 1.3 and 1.5
runlevel 1, Booting into Single-User Mode
runlevels, Runlevels

S

Samba, Samba
additional resources, Additional Resources
configuration, Configuring a Samba Server, Command Line Configuration
default, Configuring a Samba Server
smb.conf, Samba
encrypted passwords, Encrypted Passwords
findsmb, Command Line
graphical configuration, Graphical Configuration
adding a share, Adding a Share
configuring server settings, Configuring Server Settings
managing Samba users, Managing Samba Users
list of active connections, Starting and Stopping the Server
pam_smbpass, Encrypted Passwords
reasons for using, Why Use Samba?
share
connecting to via the command line, Command Line
connecting to with Nautilus, Connecting to a Samba Share
mounting, Mounting the Share
smbclient, Command Line
starting the server, Starting and Stopping the Server
status of the server, Starting and Stopping the Server
stopping the server, Starting and Stopping the Server
syncing passwords with passwd, Encrypted Passwords
with Windows NT 4.0, 2000, ME, and XP, Encrypted Passwords
scp (see OpenSSH)
secure server
accessing, Accessing The Server
books, Related Books
certificate
authorities, Types of Certificates
choosing a CA, Types of Certificates
creation of request, Generating a Certificate Request to Send to a CA
moving it after an upgrade, Using Pre-Existing Keys and Certificates
pre-existing, Using Pre-Existing Keys and Certificates
self-signed, Creating a Self-Signed Certificate
test vs. signed vs. self-signed, Types of Certificates
testing, Testing The Certificate
connecting to, Accessing The Server
explanation of security, An Overview of Certificates and Security
installing, Apache HTTP Secure Server Configuration
key
generating, Generating a Key
packages, An Overview of Security-Related Packages
port numbers, Accessing The Server
providing a certificate for, An Overview of Certificates and Security
security
explanation of, An Overview of Certificates and Security
upgrading from, Using Pre-Existing Keys and Certificates
URLs, Accessing The Server
URLs for, Accessing The Server
websites, Useful Websites
security, Controlling Access to Services
security level (see Security Level Configuration Tool)
Security Level Configuration Tool
enabling and disabling, Enabling and Disabling the Firewall
iptables service, Activating the IPTables Service
saving, Saving the Settings
setting custom ports, Other Ports
trusted services, Trusted Services
sendmail, Mail Transport Agent (MTA) Configuration
services
controlling access to, Controlling Access to Services
Services Configuration Tool, Services Configuration Tool
setfacl, Setting Access ACLs
Setup Agent
via Kickstart, Kickstart Options
sftp (see OpenSSH)
shadow passwords, Authentication
overview of, Shadow Passwords
shutdown
disablingCtrlAltDel, Disabling Shutdown Via Ctrl+Alt+Del
single-user mode, Booting into Single-User Mode
SMB, Samba, Authentication
smb.conf, Samba
smbclient, Command Line
smbstatus, Starting and Stopping the Server
Software RAID (see RAID)
ssh (see OpenSSH)
ssh-add, Configuring ssh-agent
ssh-agent, Configuring ssh-agent
with GNOME, Configuring ssh-agent with GNOME
star, Archiving File Systems With ACLs
striping
RAID fundamentals, What is RAID?
swap space, Swap Space
creating, Adding Swap Space
expanding, Adding Swap Space
explanation of, What is Swap Space?
file
creating, Creating a Swap File, Removing a Swap File
LVM2
creating, Creating an LVM2 Logical Volume for Swap
extending, Extending Swap on an LVM2 Logical Volume
reducing, Reducing Swap on an LVM2 Logical Volume
removing, Removing an LVM2 Logical Volume for Swap
moving, Moving Swap Space
recommended size, What is Swap Space?
removing, Removing Swap Space
syslogd, Log Files
system analysis
OProfile (see OProfile)
system information
file systems, File Systems
/dev/shm, File Systems
gathering, Gathering System Information
hardware, Hardware
memory usage, Memory Usage
processes, System Processes
currently running, System Processes
system recovery, Basic System Recovery
common problems, Common Problems
forgetting the root password, Root Password
hardware/software problems, Hardware/Software Problems
reinstalling the boot loader, Reinstalling the Boot Loader
unable to boot into Red Hat Enterprise Linux, Unable to Boot into Red Hat Enterprise Linux
system-config-authentication (see Authentication Configuration Tool)
system-config-date (see Time and Date Properties Tool)
system-config-display (see X Configuration Tool)
system-config-httpd (see HTTP Configuration Tool)
system-config-keyboard, Keyboard Configuration
system-config-kickstart (see Kickstart Configurator)
system-config-mouse (see Mouse Configuration Tool)
system-config-netboot, PXE Boot Configuration
system-config-network (see network configuration)
system-config-network-cmd, Network Configuration, Working with Profiles, Saving and Restoring the Network Configuration
system-config-printer (see printer configuration)
system-config-selinux (see Security Level Configuration Tool)
system-config-time (see Time and Date Properties Tool)
system-config-users (see user configuration and group configuration)
system-logviewer (see Log Viewer)
system-switch-mail (see Mail Transport Agent Switcher)
system-switch-mail-nox (see Mail Transport Agent Switcher)

T

TCP wrappers, TCP Wrappers
telinit, Runlevels
telnet, Why Use OpenSSH?
tftp, PXE Network Installations
time configuration, Time and Date Properties
synchronize with NTP server, Network Time Protocol (NTP) Properties
time zone configuration, Time Zone Configuration
timetool (see Time and Date Properties Tool)
token ring connection (see network configuration)
top, System Processes
tune2fs
converting to ext3 with, Converting to an ext3 File System
reverting to ext2 with, Reverting to an ext2 File System

U

user configuration
adding users, Adding a New User
adding users to groups, Modifying User Properties
changing full name, Modifying User Properties
changing home directory, Modifying User Properties
changing login shell, Modifying User Properties
changing password, Modifying User Properties
command line configuration, Command Line Configuration
passwd, Adding a User
useradd, Adding a User
filtering list of users, User and Group Configuration
locking user accounts, Modifying User Properties
modify groups for a user, Modifying User Properties
modifying users, Modifying User Properties
password
forcing expiration of, Password Aging
password expiration, Modifying User Properties
setting user account expiration, Modifying User Properties
viewing list of users, User and Group Configuration
User Manager (see user configuration)
user private groups (see groups)
and shared directories, Group Directories
useradd command
user account creation using, Command Line Configuration
users (see user configuration)
/etc/passwd, Standard Users
additional resources, Additional Resources
installed documentation, Installed Documentation
introducing, Users and Groups
standard, Standard Users
tools for management of
User Manager, User and Group Management Tools
useradd, User and Group Management Tools
UID, Users and Groups

V

VeriSign
using existing certificate, Using Pre-Existing Keys and Certificates
video card
settings for dual head, Dual Head Display Settings
settings for X, Display Hardware Settings
volume group, What is LVM?
volume groups, Creating the LVM Volume Groups

W

Windows
file and print sharing, Samba
Windows 2000
connecting to shares using Samba, Encrypted Passwords
Windows 98
connecting to shares using Samba, Encrypted Passwords
Windows ME
connecting to shares using Samba, Encrypted Passwords
Windows NT 4.0
connecting to shares using Samba, Encrypted Passwords
Windows XP
connecting to shares using Samba, Encrypted Passwords

X

X Configuration Tool
display settings, Display Settings
dual head display settings, Dual Head Display Settings
hardware settings, Display Hardware Settings
X Window System
configuration, X Window System Configuration
xDSL connection (see network configuration)
xinetd, xinetd

Legal Notice

Copyright © 2008 Red Hat, Inc.
This document is licensed by Red Hat under the Creative Commons Attribution-ShareAlike 3.0 Unported License. If you distribute this document, or a modified version of it, you must provide attribution to Red Hat, Inc. and provide a link to the original. If the document is modified, all Red Hat trademarks must be removed.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.