Posts

Showing posts from April, 2010

Uninstalling RMP

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 make RPM ignore this error and uninstall the package anyway (which may break the package dependent on it) use the --nodeps option.

Unresolved Dependency

RPM packages may sometimes depend on other packages, which mean 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 suggests the package(s) needed to resolve the dependency. Find the suggested package(s) on the Red Hat Enterprise Linux CD- ROMs or from Red Hat Network, 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 dependenc

Conflicting Files

If you attempt to install a package that contains a file which has already been installed by another 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

Package Already Installed

If a package of the same name and version is already installed, the following output is displayed: Preparing... ########################################### [100%] package foo-1.0-1 is already installed However, if 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.

Installing RPM

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 -ivh foo-1.0-1.i386.rpm Alternatively, the following command can also be used: rpm -Uvh foo-1.0-1.i386.rpm If the 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 a progress meter while the package is installed. 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 signa

Finding RPM Packages

Before using any RPM packages, 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, they can be found at the following locations: The Red Hat Enterprise Linux CD-ROMs The Red Hat Errata Page available at http://www.redhat.com/apps/support/errata/ Red Hat Network

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.

RPM Design Goals

The RPM Package Manager (RPM) is an open packaging system, 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 distributed under the terms of the GPL. The utility works only with packages built for processing by the rpm package. 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. Important When installing a package, please ensure it is compatible with your operating system and architecture. This can usually be determined by checking the package name. During upgrades, RPM handles configuration files carefully, so that you never lose your customizations —

Useful Websites For Linux

Refer to the follow resources for more information. http://acl.bestbits.at/ — Website for ACLs

Compatibility with Older Systems

If an ACL has been set on any file on a given file system that files system has the ext_attr attribute. This attribute can be seen using the following command: tune2fs -l 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.

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. The star package is required to use this utility. The command line options for Star are as follows

Retrieving ACLs

To determine the existing ACLs for a file or directory, use the getfacl command. In the example below, the getfacl is used to determine the existing ACLs for a file. getfacl home/john/picture.png The above command returns the following output: # file: home/john/picture.png # owner: john # group: john user::rw- group::r-- other::r-- If a directory with a default ACL is specified, the default ACL is also displayed as illustrated below. john@main /]$ getfacl home/sales/# file: home/sales/ # owner: john # group: john user::rw- user:barryg:r-- group::r-- mask::r-- other::r-- default:user::rwx default:user:john:rwx default:group::r-x default:mask::rwx default:other::r-x

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

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: Per user Per group Via the effective rights mask 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 ( ) must be specified in the following formats. Multiple rules can be specified in the same command if they are separated by commas. u: : 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: : 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: Sets the effecti

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.

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 be mounted with the following command: mount -t ext3 -o acl 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.

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 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 Warning A partition cannot be made larger than the space available on the device 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

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.

Standard Partitions using parted

The utility parted allows users to: View the existing partition table Change the size of existing partitions Add partitions from free space or additional hard drives By default, the parted package is included when installing Red Hat Enterprise Linux. To start parted, log in as root and type the command parted /dev/sda at a shell prompt (where /dev/sda is the device name for the drive you want to configure). A device containing a partition must not be in use if said partition is to be removed or resized. Similarly, when creating a new partition on a device, said device must not be in use. For a device to not be in use, none of the partitions on the device can be mounted, and any swap space on the device must not be enabled. As well, the partition table should not be modified while it is in use because the kernel may not properly recognize the changes. If the partition table does not match the actual state of the mounted partitions, information could be written to the wrong partit

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.

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

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 is to boot your system in rescue mode. Refer to 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

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

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.

Creating a Swap File

To add a swap file: 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. 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 Setup the swap file with the command: mkswap /swapfile To enable the swap file immediately but not automatically at boot time: swapon /swapfile 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. 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.

Creating an LVM2 Logical Volume for Swap

In our example we assume /dev/VolGroup00/LogVol02 is the swap volume you want to add. To add a swap volume group please 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

Extending Swap on an LVM2 Logical Volume

In our example we assume /dev/VolGroup00/LogVol01 is the volume you want to extend. To extend an LVM2 swap logical volume please 1. Disable the 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

Extending / Adding Swap Space

Sometimes it happens that you want to add more swap space even 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. It is recommended that you extend an existing logical volume. To extend or add swap space, basically you have three options: create a new swap partition create a new swap file extend swap on an existing LVM2 logical volume

What is Swap Space?

It’s an area on disk that temporarily holds a process memory image. When physical memory demand is sufficiently low, process memory images are brought back into physical memory from the swap area on disk. Having sufficient swap space enables the system to keep some physical memory free at all times. This type of memory management is often referred to as virtual memory and allows the total number of processes to exceed physical memory. Virtual memory enables the execution of a process within physical memory only as needed. Swap space can be a dedicated swap partition (recommended), a swap file, or a combination of swap partitions and swap files. Space allocation criteria should be equal to 2x physical RAM for up to 2 GB of physical RAM, and then an additional 1x physical RAM for any amount above 2 GB, but never less than 32 MB. Simply if, Memory in Ram is 512MB then Swap Space will be 512*2 = 1024MB Or if M = Amount of RAM in GB, and S = Amount of swap in GB, then If M <> S = M *2

Useful Websites For Linux

http://www.gnu.org/software/grub/ The home page of the GNU GRUB project. This site contains information concerning the state of GRUB development and an FAQ. http://kbase.redhat.com/faq/FAQ_43_4053.shtm Details booting operating systems other than Linux. http://www.linuxgazette.com/issue64/kohli.html An introductory article discussing the configuration of GRUB on a system from scratch, including an overview of GRUB command line options.

Installed Documentation

/usr/share/doc/grub- / This directory contains good information about using and configuring GRUB, where corresponds to the version of the GRUB package installed. info grub The GRUB info page contains a tutorial, a user reference manual, a programmer reference manual, and a FAQ document about GRUB and its usage.

Additional Resources

This chapter is only intended as an introduction to GRUB. Consult the following resources to discover more about how GRUB works.

Changing Runlevels at Boot Time

Under Red Hat Enterprise Linux, it is possible to change the default runlevel at boot time. To change the runlevel of a single boot session, use the following instructions: When the GRUB menu bypass screen appears at boot time, press any key to enter the GRUB menu (within the first three seconds). Press the a key to append to the kernel command. Add at the end of the boot options line to boot to the desired runlevel.For example, the following entry would initiate a boot process into runlevel 3: grub append> ro root=/dev/VolGroup00/LogVol00 rhgb quiet 3

Configuration File Directives

The following are directives commonly used in the GRUB menu configuration file: chainloader Loads the specified file as a chain loader. Replace with the absolute path to the chain loader. If the file is located on the first sector of the specified partition, use the blocklist notation, +1. color Allows specific colors to be used in the menu, where two colors are configured as the foreground and background. Use simple color names such as red/black. For example: color red/black green/blue default= Replace with the default entry title number to be loaded if the menu interface times out. fallback= Replace with the entry title number to try if the first attempt fails. Hiddenmenu Prevents the GRUB menu interface from being displayed, loading the default entry when the timeout period expires. The user can see the standard GRUB menu by pressing the Esc key. initrd Enables users to specify an initial RAM disk to use when booting. Replace with the absolute path to the initial RA

Configuration File Structure

The GRUB menu interface configuration file is /boot/grub/grub.conf. The commands to set the global preferences for the menu interface are placed at the top of the file, followed by stanzas for each operating kernel or operating system listed in the menu. The following is a very basic GRUB menu configuration file designed to boot either Red Hat Enterprise Linux or Microsoft Windows 2000: default=0 timeout=10 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux Server (2.6.18-2.el5PAE) root (hd0,0) kernel /boot/vmlinuz-2.6.18-2.el5PAE ro root=LABEL=/1 rhgb quietinitrd /boot/initrd-2.6.18-2.el5PAE.img # section to load Windows title Windows rootnoverify (hd0,0) chainloader +1 This file configures GRUB to build a menu with Red Hat Enterprise Linux default operating system and sets it to autoboot after 10 seconds. Two sections are given, one for each operating system entry, with commands specific to the system disk partition table. Note Note that

GRUB Menu Configuration File

The configuration file (/boot/grub/grub.conf), which is used to create the list of operating systems to boot in GRUB's menu interface, essentially allows the user to select a pre-set group of commands to execute.

GRUB Commands

GRUB allows a number of useful commands in its command line interface. Some of the commands accept options after their name; these options should be separated from the command and other options on that line by space characters. The following is a list of useful commands: Boot Boots the operating system or chain loader that was last loaded. chainloader Loads the specified file as a chain loader. If the file is located on the first sector of the specified partition, use the blocklist notation, +1, instead of the file name. The following is an example chainloader command: chainloader +1 Displaymem It displays the current use of memory, based on information from the BIOS. This is useful to determine how much RAM a system has prior to booting it. initrd It enables users to specify an initial RAM disk to use when booting. An initrd is necessary when the kernel needs certain modules in order to boot properly, such as when the root partition is formatted with the ext3 file system. The followin

Interfaces Load Order

When GRUB loads its second stage boot loader, it first searches for its configuration file. Once found, the menu interface bypass screen is displayed. If a key is pressed within three seconds, GRUB builds a menu list and displays the menu interface. If no key is pressed, the default kernel entry in the GRUB menu is used. If the configuration file cannot be found, or if the configuration file is unreadable, GRUB loads the command line interface, allowing the user to type commands to complete the boot process. If the configuration file is not valid, GRUB prints out the error and asks for input. This helps the user see precisely where the problem occurred. Pressing any key reloads the menu interface, where it is then possible to edit the menu option and correct the problem based on the error reported by GRUB. If the correction fails, GRUB reports an error and reloads the menu interface.

GRUB Interfaces

GRUB features three interfaces which provide different levels of functionality. Each of these interfaces allows users to boot the Linux kernel or another operating system. The interfaces are as follows: Note The following GRUB interfaces can only be accessed by pressing any key within the three seconds of the GRUB menu bypass screen. Menu Interface This is the default interface shown when GRUB is configured by the installation program. A menu of operating systems or preconfigured kernels are displayed as a list, ordered by name. Use the arrow keys to select an operating system or kernel version and press the Enter key to boot it. If you do nothing on this screen, then after the time out period expires GRUB will load the default option. Press the e key to enter the entry editor interface or the c key to load a command line interface. Menu Entry Editor Interface To access the menu entry editor, press the e key from the boot loader menu. The GRUB commands for that entry are displayed her

The Root File System and GRUB

The use of the term root file system has a different meaning in regard to GRUB. It is important to remember that GRUB's root file system has nothing to do with the Linux root file system. The GRUB root file system is the top level of the specified device. For example, the image file (hd0,0)/grub/splash.xpm.gz is located within the /grub/ directory at the top-level (or root) of the (hd0,0) partition (which is actually the /boot/ partition for the system). Next, the kernel command is executed with the location of the kernel file as an option. Once the Linux kernel boots, it sets up the root file system that Linux users are familiar with. The original GRUB root file system and its mounts are forgotten; they only existed to boot the kernel file.

File Names and Block lists

When typing commands to GRUB that reference a file, such as a menu list, it is necessary to specify an absolute file path immediately after the device and partition numbers. The following illustrates the structure of such a command: ( , ) In this example, replace with hd, fd, or nd. Replace number> with the integer for the device. Replace with an absolute path relative to the top-level of the device. It is also possible to specify files to GRUB that do not actually appear in the file system, such as a chain loader that appears in the first few blocks of a partition. To load such files, provide a blocklist that specifies block by block where the file is located in the partition. Since a file is often comprised of several different sets of blocks, blocklists use a special syntax. Each block containing the file is specified by an offset number of blocks, followed by the number of blocks from that offset point. Block offsets The following is a sample are listed sequentially in a comm

GRUB Terminology

One of the most important things to understand before using GRUB is how the program refers to devices, such as hard drives and partitions. This information is particularly important when configuring GRUB to boot multiple operating systems. Device Names When referring to a specific device with GRUB, do so using the following format (note that the parentheses and comma are very important syntactically): ( , ) The specifies the type of device from which GRUB boots. The two most common options are hd for a hard disk or fd for a 3.5 diskette. A lesser used device type is also available called nd for a network disk. Instructions on configuring GRUB to boot over the network are available online at http://www.gnu.org/software/grub/manual/. The is the BIOS device number. The primary IDE hard drive is numbered 0 and a secondary IDE hard drive is numbered 1. This syntax is roughly equivalent to that used for devices by the kernel. For example, the a in hda for the kernel is analogous to the 0

Installing GRUB

If GRUB was not installed during the installation process, it can be installed afterward. Once installed, it automatically becomes the default boot loader. Before installing GRUB, make sure to use the latest GRUB package available or use the GRUB package from the installation CD-ROMs. For instructions on installing packages, refer to the chapter titled Package Management with RPM in the Red Hat Enterprise Linux Deployment Guide. Once the GRUB package is installed, open a root shell prompt and run the command : /sbin/grub-install , where is the location that the GRUB Stage 1 Boot loader should be installed. For example, the following command installs GRUB to the MBR of the master IDE device on the primary IDE bus: /sbin/grub-install /dev/hda The next time the system boots, the GRUB graphical boot loader menu appears before the kernel loads into memory. Important If GRUB is installed on a RAID 1 array, the system may become unbootable in the event of disk failure. An unsupported workaro

Features of GRUB

1.GRUB contains several features that make it preferable to other boot loaders available, for the x86 architecture. Below is a partial list of some of the more important features: 2. GRUB provides a true command-based, pre-OS environment on x86 machines. This feature affords the user maximum flexibility in loading operating systems with specified options or gathering information aboutthe system. For years, many non-x86 architectures have employed pre-OS environments that allow system booting from a command line. 3. GRUB supports Logical Block Addressing (LBA) mode. LBA places the addressing conversion used to find files in the hard drive's firmware, and is used on many IDE and all SCSI hard devices. Before LBA, boot loaders could encounter the 1024-cylinder BIOS limitation, where the BIOS could not find a file after the 1024 cylinder head of the disk. LBA support allows GRUB to boot operating systems from partitions beyond the 1024-cylinder limit, so long as the system BIOS suppo

GRUB and the x86 Boot Process

GRUB loads itself into memory in the following stages: 1. The Stage 1 or primary boot loader is read into memory by the BIOS from the MBR1. The primary boot loader exists on less than 512 bytes ofdisk space within the MBR and is capable of loading either the Stage 1.5 or Stage 2 boot loader. 2. The Stage 1.5 boot loader is read into memory by the Stage 1 boot loader, if necessary. Some hardware requires an intermediate step to get to the Stage 2 boot loader. This is sometimes true when the /boot/ partition is above the 1024 cylinder head of the hard drive or when using LBA mode. The Stage 1.5 boot loader is found either on the /boot/ partition or on a small part of the MBR and the /boot/ partition. 3. The Stage 2 or secondary boot loader is read into memory. The secondary boot loader displays the GRUB menu and command environment. This interface allows the user to select which kernel or operating system to boot, pass arguments to the kernel, or look at system parameters. 4. The sec

GRUB

The GNU GRand Unified Boot loader (GRUB) is a program which enables the selection of the installed operating system or kernel to be loaded at system boot time. It also allows the user to pass arguments to the kernel.

Boot Loaders and System Architecture

Each architecture is capable of running Red Hat Enterprise Linux that uses a different boot loader. The following table lists the boot loaders available for each architecture: Architecture Boot Loaders AMD® AMD64 GRUB IBM®eServer™System i™ OS/400® IBM®eServer™System p™ YABOOT IBM®System z® z/IPL IBM®System z® z/IPL Intel®Itanium™ ELILO X86 GRUB This chapter discusses commands and configuration options for the GRUB boot loader included with Red Hat Enterprise Linux, for the x86 architecture.

Apache-based httpd service/Sendmail Hangs During Startup

If you are having trouble with the Apache-based httpd service or Sendmail hanging at startup, make sure the following line is in the /etc/hosts file: 127.0.0.1 localhost.localdomain localhost

Problems with Sound Configuration

If, for some reason, you do not hear sound and know that you do have a sound card installed, you can run the Sound Card Configuration Tool (system-config- soundcard) utility. To use the Sound Card Configuration Tool, choose Main Menu => System =>Administration => Soundcard Detection in GNOME, or Main Menu => Administration =>Soundcard Detection in KDE. A small text box pops up prompting you for your root password. You can also type the system-config-soundcard command at a shell prompt to launch the Sound Card Configuration Tool. If you are not root, it prompts you for the root password to continue. If the Sound Card Configuration Tool does not work (if the sample does not play and you still do not have audio sounds), it is likely that your sound card is not yet supported in Red Hat Enterprise Linux.

Press Enter to boot.

If you are not sure how to set up your printer or are having trouble getting it to work properly, try using the Printer Configuration Tool. Type the system-config- printer command at a shell prompt to launch the Printer Configuration Tool. If you are not root, it prompts you for the root password to continue.

Is Your RAM Not Being Recognized?

Sometimes, the kernel does not recognize all of your memory (RAM). You can check this with the cat /proc/meminfo command. Verify that the displayed quantity is the same as the known amount of RAM in your system. If they are not equal, add the following line to the /boot/grub/grub.conf: mem=xxM Replace xx with the amount of RAM you have in megabytes. In /boot/grub/grub.conf, the above example would look similar to the following: # NOTICE: You have a /boot partition. This means that # all kernel paths are relative to /boot/ default=0 timeout=30 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=/dev/hda3 mem=128M Once you reboot, the changes made to grub.conf are reflected on your system. Once you have loaded the GRUB boot screen, type e for edit. You are presented with a list of items in the configuration file for the boot label you have selected. Choose the line that starts with kernel and type e to edit t

Problems When You Try to Log In

If you did not create a user account in the Setup Agent, log in as root and use the password you assigned to root. If you cannot remember your root password, boot your system as linux single. Itanium users must enter boot commands with elilo followed by the boot command. If you are using an x86-based system and GRUB is your installed boot loader, type e for edit when the GRUB boot screen has loaded. You are presented with a list of items in the configuration file for the boot label you have selected. Choose the line that starts with kernel and type e to edit this boot entry. At the end of the kernel line, add: o Single o Press Enter to exit edit mode. o Once the boot loader screen has returned, type b to boot the system. Once you have booted into single user mode and have access to the # prompt, you must type passwd root, which allows you to enter a new password for root. At this point you can type shutdown -r now to reboot the system with the new root password. If you cannot rememb

Problems with the X Server Crashing and Non-Root Users

If you are having trouble with the X server crashing when anyone other than root logs in, you may have a full file system (or, a lack of available hard drive space).To verify that this is the problem you are experiencing, run the following command: df -h The df command should help you diagnose which partition is full. For additional information about df and an explanation of the options available (such as the -h option used in this example), refer to the df man page by typing man df at a shell prompt. A key indicator is 100% full or a percentage above 90% or 95% on a partition. The /home/ and /tmp/ partitions can sometimes fill up quickly with user files. You can make some room on that partition by removing old files. After you free up some disk space, try running X as the user that was unsuccessful before.

Problems with the X Window System (GUI)

If you are having trouble getting X (the X Window System) to start, you may not have installed it during your installation. If you want X, you can either install the packages from the Red Hat Enterprise Linux CD-ROMs or perform an upgrade. If you elect to upgrade, select the X Window System packages, and choose GNOME, KDE, or both, during the upgrade package selection process.

Booting into a Graphical Environment

If you have installed the X Window System but are not seeing a graphical desktop environment once you log into your Red Hat Enterprise Linux system, you can start the X Window System graphical interface using the command startx. Once you enter this command and press Enter, the graphical desktop environment is displayed. Note, however, that this is just a one-time fix and does not change the log in process for future log ins. To set up your system so that you can log in at a graphical login screen, you must edit one file, /etc/inittab, by changing just one number in the runlevel section. When you are finished, reboot the computer. The next time you log in, you are presented with a graphical login prompt. Open a shell prompt. If you are in your user account, become root by typing the su command. Now, type gedit /etc/inittab to edit the file with gedit. The file /etc/inittab opens. Within the first screen, a section of the file which looks like the following appears: # Default runlevel. T

Trouble with the Graphical GRUB Screen on an x86-based System?

If you are experiencing problems with GRUB, you may need to disable the graphical boot screen. To do this, become the root user and edit the /boot/grub/grub.conf file. Within the grub.conf file, comment out the line which begins with splashimage by inserting the # character at the beginning of the line. Press Enter to exit the editing mode. Once the boot loader screen has returned, type b to boot the system. Once you reboot, the grub.conf file is reread and any changes you have made take effect. You may re-enable the graphical boot screen by uncommenting (or adding) the above line back into the grub.conf file.

Are You Seeing Python Errors?

During some upgrades or installations of Red Hat Enterprise Linux, the installation program (also known as anaconda) may fail with a Python or traceback error. This error may occur after the selection of individual packages or while trying to save the upgrade log in the /tmp/directory. The error may look similar to: Traceback (innermost last): File "/var/tmp/anaconda- 7.1//usr/lib/anaconda/iw/progress_gui.py", line 20, in run rc = self.todo.doInstall () File "/var/tmp/anaconda-7.1//usr/lib/anaconda/todo.py", line 1468, in doInstall self.fstab.savePartitions () File "fstab.py", line 221, in savePartitions sys.exit(0) SystemExit: 0 Local variables in innermost frame: self: sys: ToDo object: (itodo ToDo p1 (dp2 S'method' p3 (iimage CdromInstallMethod p4 (dp5 S'progressWindow' p6 This error occurs in some systems where links to /tmp/ are symbolic to other locations or have been changed since creation. These symbolic or changed links are in

Other Partitioning Problems for Itanium System Users

If you are using Disk Druid to create partitions, but cannot move to the next screen, you probably have not created all the partitions necessary for Disk Druid's dependencies to be satisfied. You must have the following partitions as a bare minimum: A /boot/efi/ partition of type VFAT A / (root) partition A partition of type swap Tip When defining a partition's type as swap, you do not have to assign it a mount point. Disk Druid automatically assigns the mount point for you.

Other Partitioning Problems

If you are using Disk Druid to create partitions, but cannot move to the next screen, you probably have not created all the partitions necessary for Disk Druid's dependencies to be satisfied. You must have the following partitions as a bare minimum: A / (root) partition A partition of type swap Tip When defining a partition's type as swap, do not assign it a mount point. Disk Druid automatically assigns the mount point for you.

Using Remaining Space

You have a swap and a / (root) partition created, and you have selected the root partition to use the remaining space, but it does not fill the hard drive. If your hard drive is more than 1024 cylinders, you must create a /boot partition if you want the / (root) partition to use all of the remaining space on your hard drive.

Trouble with Partition Tables

The partition table on device hda was unreadable. To create new partitions it must be initialized, causing the loss of ALL DATA on this drive. you may not have a partition table on that drive or the partition table on the drive may not be recognizable by the partitioning software used in the installation program. Users who have used programs such as EZ-BIOS have experienced similar problems, causing data to be lost (assuming the data was not backed up before the installation began) that could not be recovered. No matter what type of installation you are performing, backups of the existing data on your systems should always be made.

Saving Traceback Messages Without a Diskette Drive

If you receive a traceback error message during installation, you can usually save it to a diskette. If you do not have a diskette drive available in your system, you can scp the error message to a remote system. When the traceback dialog appears, the traceback error message is automatically written to a file named /tmp/anacdump.txt. Once the dialog appears, switch over to a new tty (virtual console) by pressing the keys Ctrl-Alt-F2 and scp the message written to /tmp/anacdump.txt to a known working remote system.

No devices found to install Red Hat Enterprise Linux Error Message

If you receive an error message stating No devices found to install Red Hat Enterprise Linux, there is probably a SCSI controller that is not being recognized by the installation program. You can also refer to the Red Hat Hardware Compatibility List, available online at: http://hardware.redhat.com/hcl/

Problems with Booting into the Graphical Installation

There are some video cards that have trouble booting into the graphical installation program. If the installation program does not run using its default settings, it tries to run in a lower resolution mode. If that still fails, the installation program attempts to run in text mode. One possible solution is to try using the resolution= boot option. This option may be most helpful for laptop users. Another solution to try is the driver= option to specify the driver that should be loaded for your video card. If this works, it should be reported as a bug as the installer has failed to autodetect your videocard. Note To disable frame buffer support and allow the installation program to run in text mode, try using the nofb boot option. This command may be necessary for accessibility with some screen reading hardware.

Is Your System Displaying Signal 11 Errors?

A signal 11 errors, commonly know as a segmentation fault, means that the program accessed a memory location that was not assigned to it. A signal 11 error may be due to a bug in one of the software programs that is installed, or faulty hardware. If you receive a fatal signal 11 error during your installation, it is probably due to a hardware error in memory on your system's bus. Like other operating systems, Red Hat Enterprise Linux places its own demands on your system's hardware. Some of this hardware may not be able to meet those demands, even if they work properly under another OS. Ensure that you have the latest installation updates and images from Red Hat. Review the online errata to see if newer versions are available. If the latest images still fail, it may be due to a problem with your hardware. Commonly, these errors are in your memory or CPU-cache. A possible solution for this error is turning off the CPU-cache in the BIOS, if your system supports this. You could al

You are Unable to Boot Red Hat Enterprise Linux

If you have performed an installation and cannot boot your system properly, you may need to reinstall and create your partitions differently. Some BIOSes do not support booting from RAID cards. At the end of an installation, a text-based screen showing the boot loader prompt (for example GRUB) and a flashing cursor may be all that appears. If this is the case, you must repartition your system.Whether you choose automatic or manual partitioning, you must install your /boot partition outside of the RAID array, such as on a separate hard drive. An internal hard drive is necessary to use for partition creation with problematic RAID cards. You must also install your preferred boot loader (GRUB or LILO) on the MBR of a drive that is outside of the RAID array. This should be the same drive that hosts the /boot/ partition. Once these changes have been made, you should be able to finish your installation and boot the system properly.

Removing Red Hat Enterprise Linux

To uninstall Red Hat Enterprise Linux from your x86-based system, you must remove the Red Hat Enterprise Linux boot loader information from your master boot record (MBR). Note It is always a good idea to backup any data that you have on your system(s). Mistakes do happen and can result in the loss all of your data. In DOS and Windows, use the Windows fdisk utility to create a new MBR with the undocumented flag /mbr. This ONLY rewrites the MBR to boot the primary DOS partition. The command should look like the following: fdisk /mbr If you need to remove Linux from a hard drive and have attempted to do this with the default DOS (Windows) fdisk, you will experience the Partitions exist but they do not exist problem. The best way to remove non-DOS partitions is with a tool that understands partitions other than DOS. To begin, insert the Red Hat Enterprise Linux CD #1 and boot your system. Once you have booted off the CD, a boot prompt appears. At the boot prompt, type: Linux rescue. This s

Using a Startup Script

It is recommended that you configure the ELILO Boot Manager to boot Red Hat Enterprise Linux automatically. However, if you require additional commands to be executed before starting the ELILO boot loader, you can create a startup script named startup.nsh. The last command should be elilo to boot into Linux. The startup.nsh script should be in the /boot/efi partition (/boot/efi/startup.nsh) and contain the following text: echo -off your set of commands elilo You can either create this file after booting into Red Hat Enterprise Linux or use the editor built into the EFI shell. To use the EFI shell, at the Shell> prompt, change devices to the system partition (mounted as /boot/efi in Linux). For example, if fs0 is the system boot partition, type fs0: at the EFI Shell prompt. Type ls to make sure you are in the correct partition. Then type edit startup.nsh. Type the contents of the file and save it. The next time the system boots, EFI detects the startup.nsh file and use it to boot the

Booting Red Hat Enterprise Linux Automatically

After installing Red Hat Enterprise Linux you can type elilo and any boot options at the EFI Shell prompt each time you wish to boot your Itanium system. However, if you wish to configure your system to boot into Red Hat Enterprise Linux automatically, you need to configure the EFI Boot Manager. To configure the EFI Boot Manager (may vary slightly depending on your hardware): 1. Boot the Itanium system and choose Boot option maintenance menu from the EFI Boot Manager menu. 2. Choose Add a Boot Option from the Main Menu. 3. Select the system partition that is mounted as /boot/efi/ in Linux. 4. Select the elilo.efi file. 5. At the Enter New Description: prompt, type Red Hat Enterprise Linux 5, or any name that you want to appear on the EFI Boot Manager menu. 6. At the Enter Boot Option Data Type: prompt, enter N for No Boot Option if you do not want to pass options to the ELILO boot loader. This option works for most cases. If you want to pass options to the boot loader, you can co

Post-Installation Boot Loader Options

In addition to specifying a kernel to load, you can also enter other boot options such as single for single user mode or mem=1024M to force Red Hat Enterprise Linux to use 1024 MB of memory. To pass options to the boot loader, enter the following at the EFI Shell prompt (replace linux with the label name of the kernel you want to boot and option with the boot options you want to pass to the kernel): elilo linux option

Itanium Systems — Booting Your Machine and Post- Installation Setup

This section describes how to boot your Itanium into Red Hat Enterprise Linux and how to set your EFI console variables so that Red Hat Enterprise Linux is automatically booted when the machine is powered on. After you reboot your system at the end of the installation program, type the following command to boot into Red Hat Enterprise Linux: elilo After you type elilo, the default kernel listed in the /boot/efi/elilo.conf configuration file is loaded. (The first kernel listed in the file is the default). If you want to load a different kernel, type the label name of the kernel from the file /boot/efi/elilo.conf after the elilo command. For example, to load the kernel named linux, type: elilo linux If you do not know the names of the installed kernels, you can view the /boot/efi/elilo.conf file in EFI with the following instructions: At the Shell>prompt, change devices to the system partition (mounted as /boot/efi in Linux). For example, if fs0 is the system boot partition, type fs0:

Installation Complete

Congratulations! Your Red Hat Enterprise Linux installation is now complete! The installation program prompts you to prepare your system for reboot. Remember to remove any installation media if it is not ejected automatically upon reboot. After your computer's normal power-up sequence has completed, the graphical boot loader prompt appears at which you can do any of the following things: Press Enter — causes the default boot entry to be booted. Select a boot label, followed by Enter — causes the boot loader to boot the operating system corresponding to the boot label. Do nothing — after the boot loader's timeout period, (by default, five seconds) the boot loader automatically boots the default boot entry. Do whatever is appropriate to boot Red Hat Enterprise Linux. One or more screens of messages should scroll by. Eventually, a login: prompt or a GUI login screen (if you installed the X Window System and chose to start X automatically) appears. The first time you start your Re

Installing Packages

At this point there is nothing left for you to do until all the packages have been installed. How quickly this happens depends on the number of packages you have selected and your computer's speed.

Preparing to Install

A screen preparing you for the installation of Red Hat Enterprise Linux now appears. For your reference, a complete log of your installation can be found in /root/install.log once you reboot your system. Warning If, for some reason, you would rather not continue with the installation process, this is your last opportunity to safely cancel the process and reboot your machine. Once you press the Next button, partitions are written and packages are installed. If you wish to abort the installation, you should reboot now before any existing information on any hard drive is rewritten. To cancel this installation process, press your computer's Reset button or use the Control-Alt-Delete key combination to restart your machine.

Package Group Selection

Now that you have made most of the choices for your installation, you are ready to confirm the default package selection or customize packages for your system. The Package Installation Defaults screen appears and details the default package set for your Red Hat Enterprise Linux installation. This screen varies depending on the version of Red Hat Enterprise Linux you are installing. If you choose to accept the current package list. To customize your package set further, select the Customize now option on the screen.Clicking Next takes you to the Package Group Selection screen. You can select package groups, which group components together according to function (for example, X Window System and Editors), individual packages, or a combination of the two. Note Users of Itanium systems who want support for developing or running 32-bit applications are encouraged to select the Compatibility Arch Support and Compatibility Arch Development Support packages to install architecure specific supp

Set Root Password

Setting up a root account and password is one of the most important steps during your installation. Your root account is similar to the administrator account used on Windows NT machines. The root account is used to install packages, upgrade RPMs, and perform most system maintenance. Logging in as root gives you complete control over your system. Note The root user (also known as the superuser) has complete access to the entire system; for this reason, logging in as the root user is best done only to perform system maintenance or administration. Use the root account only for system administration. Create a non-root account for your general use and su - to root when you need to fix something quickly. These basic rules minimize the chances of a typo or an incorrect command doing damage to your system. Tip To become root, type su - at the shell prompt in a terminal window and then press Enter. Then, enter the root password and press Enter. The installation program prompts you to set a roo

Time Zone Configuration

Set your time zone by selecting the city closest to your computer's physical location. Click on the map to zoom in to a particular geographical region of the world. From here there are two ways for you to select your time zone: Using your mouse, click on the interactive map to select a specific city (represented by a yellow dot). A red X appears indicating your selection. You can also scroll through the list at the bottom of the screen to select your time zone. Using your mouse, click Tip To change your time zone configuration after you have completed the installation, use the Time and Date Properties Tool. Type the system-config-date command in a shell prompt to launch the Time and Date Properties Tool. If you are not root, it prompts you for the root password to continue. To run the Time and Date Properties Tool as a text-based application, use the command timeconfig.

SMP Motherboards and GRUB

In previous versions of Red Hat Enterprise Linux there were two different kernel versions, a uniprocessor version and an SMP version. In Red Hat Enterprise Linux 5.0.0 the kernel is SMP-enabled by default and will take advantage of multiple core, hyperthreading, and multiple CPU capabilities when they are present. This same kernel can run on single CPUs with a single core and no hyperthreading

Alternative Boot Loaders

If you do not wish to use a boot loader, you have several alternatives: LOADLIN: You can load Linux from MS-DOS. Unfortunately, this requires a copy of the Linux kernel (and an initial RAM disk, if you have a SCSI adapter) to be available on an MS-DOS partition. The only way to accomplish this is to boot your Red Hat Enterprise Linux system using some other method (for example, from a boot CD-ROM) and then copy the kernel to an MS-DOS partition. LOADLIN is available from ftp://metalab.unc.edu/pub/Linux/system/boot/dualboot/ And associated mirror sites. SYSLINUX: SYSLINUX is an MS-DOS program very similar to LOADLIN. It is also available from ftp://metalab.unc.edu/pub/Linux/system/boot/loaders/ and associated mirror sites. Commercial boot loaders: You can load Linux using commercial boot loaders. For example, System Commander and Partition Magic are able to boot Linux (but still require GRUB to be installed in your Linux root partition). Note Boot loaders such as LOADLIN and System C

Advanced Boot Loader Configuration

Now that you have chosen which boot loader to install, you can also determine where you want the boot loader to be installed. You may install the boot loader in one of two places: The master boot record (MBR) This is the recommended place to install a boot loader, unless the MBR already starts another operating system loader, such as System Commander. The MBR is a special area on your hard drive that is automatically loaded by your computer's BIOS, and is the earliest point at which the boot loader can take control of the boot process. In case if you install it in the MBR, when your machine boots, GRUB presents a boot prompt. You can then boot Red Hat Enterprise Linux or any other operating system that you have configured the boot loader to boot. The first sector of your boot partition This is recommended if you are already using another boot loader on your system. In this case, your other boot loader takes control first. You can then configure that boot loader to start GRUB, which

x86, AMD64, and Intel® 64 Boot Loader Configuration

To boot the system without boot media, you usually need to install a boot loader. A boot loader is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the operating system kernel software. The kernel, in turn, initializes the rest of the operating system. GRUB (Grand Unified Bootloader), which is installed by default, is a very powerful boot loader. GRUB can load a variety of free operating systems, as well as proprietary operating systems with chain-loading (the mechanism for loading unsupported operating systems, such as DOS or Windows, by loading another boot loader). If you do not want to install GRUB as your boot loader, click Change boot loader, where you can choose not to install a boot loader at all. If you already have a boot loader that can boot Red Hat Enterprise Linux and do not want to overwrite your current boot loader, choose Do not install a boot loader by clicking on the Change boot loader button. Cauti

Deleting a Partition

To delete a partition, highlight it in the Partitions section and click the Delete button. Confirm the deletion when prompted.

Editing Partitions

To edit a partition, select the Edit button or double-click on the existing partition. Note If the partition already exists on your disk, you can only change the partition's mount point. To make any other changes, you must delete the partition and recreate it.

File System Types

Red Hat Enterprise Linux allows you to create different partition types, based on the file system they will use. The following is a brief description of the different file systems available, and how they can be utilized. ext2 An ext2 file system supports standard UNIX file types (regular files, directories, symbolic links, etc). It provides the ability to assign long file names, up to 255 characters. ext3 The ext3 file system is based on the ext2 file system and has one main advantage — journaling. Using a journaling file system reduces time spent recovering a file system after a crash as there is no need to fsck the file system. The ext3 file system is selected by default and is highly recommended. physical volume (LVM) Creating one or more physical volume (LVM) partitions allows you to create an LVM logical volume. LVM can improve performance when using physical disks. For more information regarding LVM, refer to the Red Hat Enterprise Linux Deployment Guide. software RAID Creati

Recommended Partitioning Scheme

Unless you have a reason for doing otherwise, we recommend that you create the following partitions for Itanium systems: A /boot/efi/ partition (100 MB minimum) — the partition mounted on /boot/efi/ contains all the installed kernels, the initrd images, and ELILO configuration files. Warning You must create a /boot/efi/ partition of type VFAT and at least 100 MB in size as the first primary partition. A swap partition (at least 256 MB) — swap partitions are used to support virtual memory. In other words, data is written to a swap partition when there is not enough RAM to store the data your system is processing. If you are unsure about what size swap partition to create, make it twice the amount of RAM on your machine. It must be of type swap. Creation of the proper amount of swap space varies depending on a number of factors including the following (in descending order of importance): The applications running on the machine. The amount of physical RAM installed on the machine. The