Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

The image cannot be display ed.

Your computer may not hav e enough memory to open the image, or the image may hav e been corrupted. Restart your computer, and then open the file again. If the red x still appears, y ou may hav e to delete the image and then insert it again.

The image cannot be display ed. Your computer may not hav e enough memory to open the image, or the image may hav e been corrupted. Restart your computer, and then open the file again. If the red x still appears, y ou may hav e to delete the image and then insert it again.

Chapter 2

Installation Preparation
CERTIFICATION OBJECTIVES
2.01 2.02 Planning the Installation Intel CPU Hardware Selection and Configuration

Packages to Be Installed ................................................................................................................................ Partitioning the Drive ................................................................................................................................ Hardware Compatibility................................................................................................................................ RAM Sizing and Cache Issues................................................................................................................................ Disk Subsystems (IDE, EIDE, and SCSI)................................................................................................ IRQ Settings ................................................................................................................................ IRQs and Standard Serial Ports................................................................................................................................ Serial and Other Interface Mice ................................................................................................................................ PC Card (PCMCIA) ................................................................................................................................

One of the strong points of Red Hat Linux is its easy installation. There are several different methods of installation, and each of them is automated to a considerable degree. However, before the actual installation, some preparation is necessary. CERTIFICATION OBJECTIVE 2.01

Planning the Installation


Before any software can be installed, the computer has to be able to recognize the hardware it will be using. The installation process will ask you about your hardware, so have this data ready before you start. You should know the make and model number for each of the following pieces of hardware, if you have them: SCSI controllers Network interface cards (NIC) Video cards Sound cards You might also need other information, such as the base I/O address and interrupt that each piece of hardware uses. Later in this chapter, well

discuss hardware compatibility for Linux.

Packages to Be Installed
Red Hat Linux comes conveniently bundled with an array of preconfigured software packages. Most likely, you will not need to install all of these packages, and for security reasons (or office policy) it is a good idea not to. Your boss might not appreciate the office network being used to serve personal Web pages from each employee's installation of an Apache Web server. Also, every computer on your network doesn't need to run the innd network news service. Limit the packages you install to only the ones you need. If other packages are required later, they can be installed easily enough with the rpm tool.

Partitioning the Drive


It is recommended that you make several partitions when preparing your hard drive to install Linux. This is a good idea for various reasons. First, Red Hat Linux runs two filesystems: a Linux native filesystem, and a Linux swap space. Second, if you want to install Red Hat Linux and another operating system on the same computer, you will have to create separate partitions for each. The following section discusses more advantages of making partitions. Stability and Security The Linux native filesystem is usually divided among many hard drive partitions. The recommended configuration is a separate partition for each of these directories: /, /usr, /tmp, /var, and /home as well as separate partitions for corporate data, database services, and even the Web and FTP sites if they are expected to be large. Partitioning the hard drive in this manner keeps system, application, and user files isolated from each other. This aids in protecting the file space that the Linux kernel and the rest of your applications use. Files cannot grow across partitions. Therefore, an application that uses huge amounts of disk space, such as a newsgroup server, will not be able to use up all of the disk space needed by the Linux kernel. Another advantage is that if a bad spot develops on the hard drive, it will be easier to restore a single partition than the entire system. Stability is improved. Security, also, is improved. Multiple partitions give you the ability to mount some filesystems as read-only. For example, if there is no reason for any user (even root) to write to the /usr directory, mounting that partition as read-only will help protect those files from being tampered with. While there are many incentives to partitioning your disk space, it might

not be desirable for you. For single-user systems, or where disk space is scarce, a simpler filesystem layout would be called for. For example, if the /var directory is on its own partition of 300MB, only 100MB might be used. That makes 200MB of wasted disk space. As of RH 7.x, both the web and ftp document roots have been added to /var. These may add additional disk space requirements for /var. Currently, there is no easy way to resize Linux partitions. Therefore, a lot of careful consideration should be put into whether you want to partition your disk space, and how to do it. How Much Space Is Required? You should size your Linux partitions according to your needs and the function of the computer. For example, a mail server will require more space for the /var directory because the mail spool resides in /var/spool/mail. You may even want to create a separate partition just to accommodate /var/spool/mail. As of RH 7.x, both the web and ftp document roots have been added to /var. These may add additional disk space requirements for /var. Generally, the root partition is a relatively modest size, and the rest is split up depending on system use. Example: File Server If the Linux system you are installing is to be a file server, then your filesystem could look something like Table 2-1. Filesystem /dev/sda1 /dev/sda5 /dev/sda6 /dev/sda7 /dev/sda8 /dev/sda9 Size (MB) 400 2000 300 60 1000 3000 Mounted on / /var /usr Swap space /home /home/shared

Table 1: Example Disk Partition Scheme for a Linux File Server

The /usr filesystem is large enough to have Samba installed, as well as X11, if that is desired. Most of the disk space has been allocated to /var, for the log files, FTP and HTTPD services, to /home, for users' own files, and to /home/shared, for common files. Of course, this is only an example. The amount of disk space you allocate for file sharing will depend on factors such as the number of users and the type of files they work on. Linux Swap Space Normally, Linux can use a maximum 4GB of swap space. This 4GB can be spread over a maximum of eight partitions. Note that each swap partition is restricted to a maximum of 2GB. There is no authoritative formula for deciding how much swap space

should be made, but you can make an estimate based on the typical UNIX rule of thumb, swap space should be two to three times the amount of RAM. Disk space is very cheap compared to RAM. The maximum amount of memory your system will use is the sum of all of the memory requirements of every program that you will ever run at once. You probably have no idea how much memory you absolutely need. You should buy as much memory as you can afford. The price of memory is CHEAP compared to your time in the long run trying to tune an underpowered system. Linux will comfortably run in 32MB of RAM; 64MB is better, while 128MB of RAM and above are magical! Linux was able to address 1GB of RAM for systems running with Pentium 1 and below CPUs. Linux kernel 2.2 was able to address 4GB of RAM (using the Enterprise kernel) with newer Pentium II and higher systems. With the new 2.4 kernel in Red Hat 7.1, Linux has extended its memory capabilities on Pentium II and higher systems to 64GB of RAM. The total amount of addressable space for any one program to use is the sum of available RAM and swap space. In general, Linux utilities are usually small but for something like a database service, which can load huge tables into memory and might possibly use all the available memory while doing so. The same goes for video productions, high-end graphics applications that create cartoons and GIS systems to name a few. You must have some swap space, as suggested earlier; two to three times the amount of RAM is common. Linux actively uses swap as additional RAM space for programsand not just when physical memory is full. Pages of memory that haven't been used for a significant amount of time will be swapped out in an attempt to utilize as much physical memory as possible. Essentially, you do NOT want your system to be using swap consistently. You should add more RAM if swapping is being used heavily. Swap space is on disk, which runs five to six orders of magnitude slower than RAM, so it is a significant performance hit. That said, you still must have swap space for those unexpected events when the system needs more memory space. Keep in mind, too, the installation will attempt to put the swap partition close to the front of the disk for whatever speed improvement it can get. Another way to speed up swapping is to place swap partitions strategically. You arent limited to having one swap partition in one place. This is especially useful if you are using more than one hard disk on more than one controller. You could put some swap space on a hard disk on each controller. If one controller is busy, then another can be used for swapping. Also, where you put the swap space on the hard disk can affect performance. If the data being used most often is at the beginning of the disk, but your swap space exists at the end, the drive has to work harder to move between the data and swap space. Keeping your swap space close to your busy data will result in more efficient use of your

hard drive. BIOS Limits Be aware that some computers, built before 1998, may have a BIOS (Basic Input/Output System) that, at bootup (under DOS), limits access to hard disks beyond their 1024 cylinder. A common effect of this problem is your computer's inability to see any partitions past the first 512MB of disk space at boot time. If this limitation affects your computer, do not place any bootable partitions after this barrier or the BIOS will not be able to access them and your Linux operating system will not be able to load. Partitioning Utilities There are many disk-partitioning utilities for Linuxeven utilities that do not run under Linux. Two of the main utilities that come packaged with Red Hat 7.x are fdisk/cfdisk and (during the installation steps only) Disk Druid. (Note: cfdisk is similar to fdisk, but with a full screen interface). They all work towards the same end, but Red Hat recommends you use Disk Druid during the installation. It is safer to use than fdisk, and it has a graphical interface that makes its use easier. Both fdisk and cfdisk are available once Linux is installed. Partitioning Naming Conventions UNIX is notorious for creating weird file names for hardware, and no one standard has been used by all the UNIX versions. Linux, meanwhile, has been using a simple standard for disk drives: disk device names have three letters, then a number. The first letter identifies the controller type (h is for IDE/EIDE, s is for SCSI). The second letter is d for disk, the third letter is for the sequential disk controller starting with a. This means the first IDE drive would be hda, the next would be hdb, then hdc and hdd. The partitions are numbered starting from 1, but due to the DOS world, they may not be sequential, depending on how they were created. Under this rule, the partitions would be /dev/hda1, /dev/hda2, /dev/hda3, .../dev/hda16 for the first IDE drive, then /dev/hdb1.../dev/hda16 for the second drive, and so one For SCSI drives, the name is sda for the first disk on the first controller. The partitions are /dev/sda1, /dev/sda2... /dev/sda15 (only 15 maximum partitions with SCSI, whereas IDE can have 16). The second disk on the same SCSI controller would be sdaa{1,2,..15}, and so on. The second controller would have sdb{1-15} for the first disk, then sdba{1-15} for the second disk on the second controller, and so on. In RH 7.x, there are 2048 configured SCSI devices. The number of disks and partitions already configured depends on the version and distribution of Linux.

EXERCISE 21

Partitioning Exercise Although you probably have never had to do this on a basic MS Windows-oriented computer, for a real server system, one thats Windows- or UNIX-oriented, you should pre-plan your disk usage and partitions very carefully. 1. On a piece of paper, draw a rectangle to represent each hard drive on your computer. 2. Label them in order just as Linux would (e.g., Hard Drive 1: /dev/hda, Hard Drive 2: /dev/sda, Hard Drive 3: /dev/sdb). 3. Use this diagram to plan your Linux partitions visually. Using this method, you can organize your data, keeping system or users' files together, as well as strategically plan where to place your swap partition(s).

CERTIFICATION OBJECTIVE 2.02

Intel CPU Hardware Selection and Configuration


You have to be very careful not to choose any hardware that Linux does not yet support. Unfortunately for Linux, hardware manufacturers are still targeting the Microsoft Windows market. In order for hardware drivers to come available for Linux, either the manufacturers have to recognize the Linux market and produce drivers, or a third party has to do it. The latter brings up one of Linux's strong points. There is a vast community of Linux users, many of whom produce drivers for Linux and distribute them freely on the Internet. If a certain piece of hardware is popular, you can be certain that Linux support for that piece of hardware will pop up somewhere on the Internet and will be incorporated into Linux distributions, such as Red Hat Linux. Be careful when purchasing a new computer to use with Linux. Though Linux has come a long way the last few years, and you should have little problem installing it on most modern PCs,. you shouldnt assume Linux will run on any PC, especially if it is a laptop or some new state-of-the-art machine. The latest and greatest existing technology may not be supported under Linux (not yet, anyway). The hardware may also be targeted for specific operating systems and configurations. Winmodems and Winprinters are examples of hardware that will not work with Linux because they are targeted for MS Windows. Integrated hardware (e.g., video chips that share system RAM) and parallel port devices (other than printers) are other pieces of hardware you should be wary of. While there may be ways to make these types of hardware work, the process of actually making them work may cause more frustration than they're worth. Last years' model is an ideal choice; it is cheap and more likely to be supported. When it comes to laptops, your chances are best with

brand names. Unless it has been proven that Linux will run on a newer machine, choosing an older model might be a better choice. Linux will run very well on lower-end computers. This is one of Linux's strong points over other operating systems, such as Microsoft's Windows NT. Linux runs fine on 32MB of RAM, although more is always better, especially if you want to run any applications.

Hardware Compatibility
You are not left without help or resources when choosing the right hardware for Linux. There are many places you can turn to for help, including mailing lists and newsgroups. Perhaps the best places to look are the LDP (Linux Documentation Project) or the Red Hat Hardware List. The LDP is a global effort to produce reliable documentation for all aspects of the Linux operating system, including hardware compatibility. Within the LDP, you can find the Linux Hardware HOWTO. Linux Hardware HOWTO The Linux Hardware HOWTO is a document listing most of the hardware components supported by Linux. Its updated irregularly with added hardware support, so it is a relatively up-to-date source of information. The latest version of the Linux Hardware HOWTO is supplied on the 3rd CD-ROM of RH 7.x in PDF format and in various languages. The location is /HOWTO/Hardware-HOWTO. A more current listing can be found on the Red Hat Web site under Support --> Hardware. It may also be found at http://users.bart.nl/~patrickr/hardware-howto/HardwareHOWTO.html, within the LDP, which can be found at Sun Microsystems' Sunsite at http://metalab.unc.edu/LDP/HOWTO/Hardware-HOWTO.html or any mirror sites of Sunsite. The Red Hat Hardware List The Red Hat Hardware List specifies name brand hardware that has been tested with Red Hat Linux. Red Hat will provide installation support for any hardware listed as supported. There is also an unsupported list. This list does not necessarily mean the specified hardware will not run Linux; it simply means Red Hat will not provide installation support for that hardware. There is a list for Intel, Alpha, and Sparc architectures. Like the LDP, the Red Hat Hardware List is kept up-to-date by volunteers. If you want to check if any of the latest hardware (such as USB) will run on your Linux system, it's probably best to consult the Red Hat support site first, then maybe LDP's Linux Hardware HOWTO. However, if you want the option of being able to contact Red Hat for support, you should stay within the supported list of the Red Hat

Hardware List. EXERCISE 22 Hardware Compatibility 1. On the Web, visit http:// www.ibiblio.org/Linux. Once there, find the Linux Hardware Compatibility HOWTO. Take note of its date (it should be posted near the top). How current is it? 2. Research the topology of the network you are on and try to find a mirror of the Linux Documentation Project closest to you on the Internet.

RAM Sizing and Cache Issues


Accessing a disk is relatively slow when compared to accessing memory. To optimize the use of memory, the Linux kernel keeps track of files that have already been loaded. Should a request for one of these loaded files be received, the operating system will use the cached copy rather than going to the disk. For example, when a command such as ls is executed, the binary image for that command is copied into memory. If ls is called again, then the binary is retrieved from memory instead of performing another slow disk read. Write-Through versus Write-Back Buffer Cache There are two types of buffer caches. One type is write-through. With write-through buffer cache, any changes to blocks of data in the cache are written to disk at once. Early MS-DOS OS versions used this immediate writing of data to disk style of memory management. The second type is write-back buffer cache and is used by most multiuser operating systems such as Linux, UNIX, NT, and VMS to name a few. This second type is also referred to as lazy write. The system maintains the file changes in memory and when there are some free CPU cycles, writes all file changes to the disk. The actual writes to the disk are done at a later time, usually in the background, so as not to slow down other programs. While write-through cache is less efficient in terms of CPU cycles, write-back cache is more susceptible to errors. If the operating system is trashed, or power is suddenly cut, and any changes to the writeback buffer cache have not been written back to disk, the data changes stored in this buffer cache are lost. Whenever this happens, Linux automatically performs a file system check during bootup. As long as a proper shutdown procedure is followed to allow Linux to sync buffer cache to disk, Linux takes care of the cache automatically. Buffer Cache Size and Available Memory Linux automatically uses all free memory as cache and dynamically resizes the buffer cache as processes are started or stopped in memory. The system daemon bdflush is used to flush any dirty buffers (buffers where data has changed) back to disk. At any time, you can force all

unwritten data to be written to disk by using the sync command (usually invoked at least three times to ensure buffers are clean. Typically this is done during rescue mode when a minimal Linux is in memory and you want to ensure any file changes you have made are absolutely written to disk; hence the three times rule.) When Linux boots, a daemon named update is started in the background. Update runs bdflush and performs a sync command every 30 seconds.

Disk Subsystems (IDE, EIDE, and SCSI)


These systems are set up and initialized before the operating system is loaded. After Linux has loaded, the settings for the disk subsystems can be modified or dealt with through software. However, in order for Linux to be loaded in the first place, the computer's BIOS has to be able to recognize the hardware that makes up these subsystems. IDE and EIDE IDE stands for Integrated Drive Electronics. It is on the IBM PC ISA 16-bit bus standard, and was adopted as a standard by ANSI in 1990 as an Advanced Technology Attachment (ATA). A setback to IDE was that it could only access 504MB of disk space. To work around this, Enhanced IDE (EIDE) was created. As well as being able to support hard disks larger that 504MB, EIDE also improved access speeds to hard drives. Support was added for additional hard disks, Direct Memory Access (DMA), and ATA Packet Interface devices (ATAPI), such as CD-ROMs and tape drives. ANSI adopted EIDE as a standard in 1994 as Advanced Technology Attachment-2 (ATA-2 or Fast ATA). Another issue with Intel systems is that BIOS reports only 1024 cylinders on a disk no matter how many actual cylinders there are, which can affect both IDE or SCSI. This is a limitation inherent in older BIOS systems. In this case, you must put your /boot file system within the first 1024 cylinders, or the boot loader will be unable to boot your system because BIOS will not be able to supply the correct cylinder count. Most modern PCs manufactured after 1995 have a built-in fix called Logical Block Addressing, or LBA. A system that can report LBA, will adjust the cylinder, head, and sector numbers such that the entire disk is available using these logical addresses. In general, only on relatively old machines would this ever occur.
The image cannot be display ed. Your computer may not hav e enough memory to open the image, or the image may hav e been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may hav e to delete the image and then insert it again.

Problems due to hardware limitations are common and difficult to troubleshoot if you don't know about them. Familiarize yourself with as many hardware limitations as you can, including the 1024 cylinder limit inherent in some older PC models.

SCSI The Small Computer System Interface (SCSI), developed by Apple Computer, allows your computer to interface to disk drives, CD-ROMs,

tape drives, printers, and scanners. SCSI is faster and more flexible than EIDE, with support for 7, 15 or even 32 devices, depending on the SCSI bus width. Data transfer speeds for SCSI range from 5 to 160 or 320 MB per second. SCSI controllers are not common on most modern-day desktop PCs as SCSI disks are usually more expensive. The major PC vendors, however, will almost always provide SCSI disks and controllers for their high-end server products as the larger number of devices and faster bus speeds make them a better choice. Disk or Partition? A disk drive requires a partition table. The partition is a logical sequence of cylinders on the disk, while a cylinder represents all the sectors that can be read by all heads with one movement of the arm that contains all these heads. You can create one partition with all the cylinders, or you can create up to 16 total partitions on an IDE drive where only 15 are usable, making for a total of 15 partitions for SCSI with all 15 usable. The extended partition on an IDE-type drive cannot be used as a regular partition because it maintains the list of logical partitions within it only.
The image cannot be display ed. Your computer may not hav e enough memory to open the image, or the image may hav e been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may hav e to delete the image and then insert it again.

Only 15 of the 16 IDE partitions are usable; all 15 being SCSI.

Primary, Extended, and Logical Partitions You are limited to making only four primary partitions on each hard disk. To work around this, the extended partition was developed. Within an extended partition, logical partitions can be created. IDE disks can have up to 16 total partitions (3 primary and 1 extended, containing up to 12 logical partitions), whereas SCSI disks are limited to 15. Unfortunately, with the Intel PC, partition-naming conventions are neither simple nor straightforward. All logical partitions created within the extended partition have device names that range from 5 to 16 (or 15 for SCSI) no matter how many primary partitions are configured. If, for instance, you have one IDE disk and you create a single primary partition, it would be device hda1. If you then created an extended partition, technically it would be hda2 and unusable as a file system. Within this extended partition, hda2, you must create at least one logical partition, the name of which would be hda5. Names are not sequential for these devices. Even worse is when you create a primary partition, then create an extended partition into which you generate one logical partition. If you then created a second primary partition from some free space, the IDE drive would renumber the partitions and your bootup process would fail entirely as it would be pointed to the wrong partition due to the internal name change.

The image cannot be display ed. Your computer may not hav e enough memory to open the image, or the image may hav e been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may hav e to delete the image and then insert it again.

You should know the names of the devices, as well as the starting name and number of any logical partitions created on any basic disk drive. Also be aware of the idiosyncrasies when creating partitions on IDE type drives.

Cylinder/Head/Sector Geometry and Remapping The size of a hard drive is determined by its geometry. The geometry includes the number of cylinders, heads, and sectors available on the hard disk. Together, these numbers make up an address on the hard disk. Normally, the geometry your BIOS will support is limited to 1024 cylinders, 256 heads, and 63 sectors. All modern-day disk drives use 512 bytes per sector. So 1024 cylinders times 256 heads times 63 sectors times 512 bytes equals about 8GB (gigabytes) or 8000MB. If your hard disk is larger than 504MB, and you have an old BIOS that reports this disk has just 1024 cylinders, your computer will not be able to address the entire hard disk. Most modern-day PCs bypass this problem by using Logical Block Addressing (LBA) for your hard disks.
The image cannot be display ed. Your computer may not hav e enough memory to open the image, or the image may hav e been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may hav e to delete the image and then insert it again.

Since SCSI devices have their own BIOS, this limitation does not affect SCSI hard disks.

Logical Block Addressing (LBA) If your computer was manufactured after 1994, then you will likely be able to select LBA mode for your hard disks in your computer's CMOS. LBA involves a special way of addressing sectors. Instead of referring to a cylinder, head, and sector for a location on the hard disk, each sector is assigned a unique number from 0 to N-1, where N is the number of sectors on the disk. LBA mode allows geometry translation, which means that the BIOS can be fooled into believing the hard disk's geometry is acceptable. Example A hard disk with 2048 cylinders, 16 heads, and 63 sectors is installed in a machine. Without using LBA, the 1024 cylinder limit has been exceeded, so the DOS-based boot loader will not be able to address any cylinders past 1024 on this hard disk. By using LBA mode, the BIOS reports to DOS that the hard disk has 32 heads instead of 16. This changes the geometry to 1024 cylinders, 32 heads, and 63 sectorswithin the BIOS limits. The new geometry has the same storage capacity as before, and it can be accessed entirely through LBA mode translation. Multiple Controllers It is possible and desirable to use more than one disk controller interface card at the same time on the same PC. This is a common method to

increase throughput on your system by reducing your read/write bottlenecks to the only disk. You can use both SCSI and EIDE controllers in the same machine, but there are a few snags you should be aware of. The BIOS can only access the first two EIDE hard drives at boot time. Also, SCSI disks may not be accessible if EIDE drives are installed. The BIOS might have a setting to allow you to boot from SCSI hard disks. Make sure you understand which drives the BIOS will be able to access at boot time, because if you install the boot sector to a drive that cannot be accessed, Linux will not be able to boot. When your computer boots, the BIOS assigns a number to each drive letter it sees. The order in which the BIOS assigns them might not be the same order that Linux does. This can confuse LILO and cause it to fail. Example Your computer is set up to boot Linux from a SCSI disk, and the BIOS assigns the number 0x80 to /dev/sda (the SCSI disk) and 0x81 to /dev/hda (the first EIDE drive). Linux, however, assigns 0x80 to /dev/hda, 0x81 to /dev/hdb (the second EIDE disk), and 0x82 to the SCSI disk. There is a disagreement between the BIOS and LILO. LILO will not find the boot sector on /dev/sda and, therefore, will not be able to boot Linux. When you run /sbin/lilo in Linux, you will get the message BIOS-Drive 0x82 may not be accessible. (See the section on configuring LILO in Chapter 4, Basic Configuration and Administration, for more information. Look up the bios= option for /etc/lilo.conf.) RAID and MD Systems RAID (Redundant Array of Independent (or Inexpensive) Disks) can be set up in Linux using either hardware or software. The tradeoffs between them are performance versus price. Hardware implementations are more expensive than software implementations, but typically provide higher performance. The hardware implementation of RAID uses a RAID controller connected to an array of several hard disks. A driver must be installed to be able to use the controller. Linux, meanwhile, offers a software solution to RAID with the md kernel patch. You should use Linux kernel 2.0.36 or a recent 2.2.x version. Once RAID is configured on your system, Linux can use it just as it would any other block device. RAID can be set up with many different configurations, called levels. The following are a few basic RAID levels that RAID patches for Linux support: RAID0

Reads and writes to the hard disks are done in parallel, increasing performance, but filling up all hard drives equally. Since there is no redundancy at this level, a failure of any one of the drives will result in total data loss. This level is used for speed increases. The limit to the speed of a RAID0 system is the bus speed that connects to the disks. RAID0 is also called Striping without parity, providing access to 100 percent of all disks used, while offering better performance with no recovery. RAID1 This level mirrors information to two or more other disks. If one disk is damaged/removed, all data will still be intact and accessible from the other disk(s) available. Also, if any spare disks exist in the system, they can be used as another mirror to replace a missing or damaged drive. While performance may actually be decreased in this level (writes), reliability is greatly increased. RAID level 1 provides the least usable space, as all disks participating in the mirror contain a complete copy of the data. However, recovery is very good as is read performance. RAID4 This level requires three or more disks. Like RAID0, data reads and writes are done in parallel to all disks. One of the disks in the set maintains only parity information on all the data. If one drive fails, then the parity information can be used to reconstruct the data. Reliability is improved, but since parity information is updated with every write operation, the parity disk can be a bottleneck on the system. RAID5 RAID5 works on three or more disks, with optional spare disks. With this level, several disks can be combined with both performance and reliability increases. Unlike RAID4, parity information is striped across all the disks. Instead of dedicating one disk to store the parity information, it is distributed evenly across all disks. If one disk fails, the data can be reconstructed onto a spare disk or from the parity information. In either case, there is no stoppage of the RAID system, all data is still available even with one disk failed. RAID level 5 is the preferred choice in most cases: the performance is good, the recovery is high, and the cost is second best. You lose one disk out of the set essentially to parity, so with 5 disks in RAID level 5, you get 80 percent utilization for data, and 20 percent for parity (recovery) information. With 32 disks, you get 31 of 32 disks for about 96 percent utilization.

The image cannot be display ed. Your computer may not hav e enough memory to open the image, or the image may hav e been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may hav e to delete the image and then insert it again.

The RAID system should be designed as hot-swappable. This means that if a disk were to fail, the local administrator could just pull that bad disk out of the drive enclosure while everything is still running, replace it with a new drive, and the system would automatically rebuild the data onto the new disk. This is a very powerful, but relatively expensive, capability.

Linear Mode Linear mode is combining one or more disks to work as one larger device. There is no redundancy in linear modethe disks are simply filled up in the order they appear (e.g., disk 1, disk 2, and so on). The only performance gain linear mode will experience is when several users access data residing on different disks.
The image cannot be display ed. Your computer may not hav e enough memory to open the image, or the image may hav e been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may hav e to delete the image and then insert it again.

The exam may use examples from any level of RAID, including a combination of several different levels into one solution.

IRQ Settings
An interrupt request (IRQ) is a signal that is sent by a peripheral device (NIC, Video, Mouse, Modem, Serial Port, or other) to the CPU to request some processing time. Each device you attach to a computer may need its own IRQ value. This value is unique to each device (except for possibly PCI devices; to be explained later) so as not to confuse the computer. The Intel architecture is limited to using only 16 IRQs (0-15) of which usually IRQs 5, 7, 9, 10, 11, and 12 are available with a bare bones system. Typically sound cards use 5; a printer uses 7; video cards, bus mouses, and network cards each need 1leaving a total of 1. (Maybe!) Planning the IRQ Layout-Standard IRQs Some IRQs are reserved by the motherboard to control devices such as the hard disk controller and real-time clock. Do not use these interrupts, or there will be conflicts! In Linux, you can check /proc/interrupts to see which interrupts are being used. Any interrupt that is not assigned is a valid candidate for a new device to use. However, there is a standard IRQ layout you can follow (shown in Table 2-2). IRQ 0 1 2 3 4 5 6 Assigned to Nonmaskable interrupt (NMI)detects parity errors System timer Cascade for controller 2 Serial port 2, 4 Serial port 1, 3 Parallel port 2 Floppy diskette controller

7 8 9 10 11 12 13 14 15

Parallel port 1 Real-time clock Redirected to IRQ2 Not assigned (usually used for a network card) Not assigned PS/2 mouse, if installed Coprocessor Hard disk controller 1 Hard disk controller 2

Table 2: Standard IRQ Layout for PCs

IRQs and the PCI Architecture A common problem with PCs today is having more devices than available interrupts. PCI devices can get around this predicament by sharing an IRQ, accomplished using the PCI bus. The PCI bus is independent of the processor, so PCI devices can have their own internal interrupts that determine which device will send an IRQ to the processor. However, your BIOS must support PCI sharing for it to work. If it does, you should be able to turn it on through your computers CMOS. Most modern PCs manufactured after 1998 contain PCI buses. Plug-and-Play With Plug-and-Play devices, computer users do not have to tell the computer the device is there. The operating system should be able to recognize the device and set it up automatically. Plug-and-Play has been available for Macintosh computers for quite some time, and has been incorporated into Microsoft's Windows operating systems. Linux is a little behind on this technology, though it is able to configure both ISA PnP devices (isapnp utility) as well as PCI PnP (Plug-and-Play). The kudzu utility looks for any hardware changes at bootup and allows you to configure them. Most PnP technology is driven by non-UNIX operating systems (Microsoft Windows and MacOS) and Linux is starting to play along with them. Plug-and-Play Support in Linux The unfortunate truth is that Linux doesn't handle Plug-and-Play very well. The main problem lies with Plug-and-Play support for devices that run on an ISA bus. ISA is an old technology from older IBM PCs, created without Plug-and-Play in mind, so support for it is very complicated. Red Hat includes some utilities to help handle ISA Plugand-Play devices. These utilities (e.g., isapnp and pnpdump) are kept in a package named isapnptools. You should be able to find this package in rpm format with your Red Hat installation. The newer, faster bus technology, PCI, is a different story. As Linux

loads, device drivers can easily find their devices if they are PCI. This makes Plug-and-Play much easier for hardware that runs on a PCI bus. However, there still may be conflicts with the ISA bus. Support for PnP devices is improving, so the outlook is hopeful. Just keep in mind that you will probably have more trouble configuring an ISA device than a PCI. Handling Jumperless Cards Some cards have no jumpers; instead, information regarding which port, IRQ, and I/O address it uses is stored in a ROM chip on the card. With these cards is usually shipped a program that will allow you to change the settings. Alas, it is a Microsoft world, and these utilities usually need DOS to run. If you have a card that works like this, you'll need a DOS boot disk or partition to be able to configure them. If you are not licensed to use MS-DOS or Windows, there are some possible alternatives. The FreeDOS Project (http://freedos.org) is an effort to create a free version of DOS that is compatible with MS-DOS. Within Linux, there is an MS Windows Emulator called WINE that is capable of running some Windows programs with varying degrees of success. All in all, a better solution is to try to use hardware that does not need to be configured this way.

IRQs and Standard Serial Ports


The standard serial ports in Linux are /dev/ttyS0, /dev/ttyS1, /dev/ttyS2, and /dev/ttyS3 (COM1 through COM4, respectively). In your BIOS settings, the serial ports are normally set as ttyS0 and ttyS2 to IRQ 4, and ttyS1 and ttyS3 at IRQ 3. With Linux kernel 2.2 and above, there is the ability to share these interrupts. For kernel versions earlier than 2.2, you will need to assign unique IRQs to each serial port you use. This can be done at boot time by using the setserial utility and modifying the /etc/rc.d/rc.serial file similar to the following (assuming, of course, that all these interrupts are available):
/sbin/setserial /sbin/setserial /sbin/setserial /sbin/setserial /dev/ttyS0 /dev/ttyS1 /dev/ttyS2 /dev/ttyS3 irq irq irq irq 3 4 5 9 # # # # dumb terminal serial mouse first modem second modem

Serial and Other Interface Mice


For your mouse to work, you will need to know what interface and protocol it uses. Serial mice interface to a serial port, while PS/2 mice have a port and IRQ set aside. There is also another type of interface called a busmouse. Linux supports three standard busmouse-oriented protocols: Inport (Microsoft), Logitech, and ATI-XL. In order for a

PS/2 mouse to work, support has to be compiled into the Linux kernel or compiled as a module. Serial Mice To use a serial mouse, you might need to assign it an IRQ if you are using more than three serial devices. Otherwise, it's just a matter of selecting the correct protocol for the mouse to use. Common protocols are Microsoft, for Microsoft mice; and Logitech, for Logitech mice. The connector for a serial mouse is rectangular with 9 or 25 pins, and plugs into a serial post. The device file for serial mice is a linked file from /dev/mouse to whatever serial port it is using (e.g., /dev/ttyS0). PS/2 Mice A PS/2 mouse (used on newer PCs and most laptops) has its own port and uses IRQ 12. A PS/2 mouse uses a 6-pin mini DIN connector and communicates using the PS/2 protocol. The device file for PS/2 mice is /dev/psaux. Busmouse You can usually identify a busmouse from its round 9-pin connector. The mice usually plug into a card, which might have jumper settings or software (for DOS) to set IRQs and base I/O addresses. While most busmice use the BusMouse protocol, some older mice use other protocols, such as MouseSystems or Logitech. The device files for Inport, Logitech, and ATI-XL busmice are /dev/inportbm, /dev/logibm, and /dev/atibm, respectively. The Red Hat installation process will ask you for information about your mouse. Know what kind of mouse you have! Later, you can modify your mouse settings by using the XF86Setup tool for X11, or the mouseconfig tool for using the mouse in console mode. EXERCISE 23 Your Computer's CMOS Settings Look through your computer's CMOS settings. To get into the CMOS settings, you normally have to press a key soon after you power on your computer. This key is commonly the DELETE or F1 key on your keyboard. Browse through the menus and try to locate the areas where the following information is kept: Your hard drive information: Take note of the "translation mode" your hard drive is using (e.g., CHS, Large, or LBA). Locate the IRQ settings that your motherboard assigns to your serial and parallel ports, real-time clock, and hard disk controllers. Can you change any of these settings? (Be careful that you don't save your changes!)

Find out if your CMOS supports PCI sharing (for IRQs). If it does, is it turned on or off on your computer?

PC Card (PCMCIA)
Linux has one package that deals exclusively with PC cards called Card Services. This package includes all the kernel modules you'll need to manage PCMCIA cards and a set of drivers for specific cards. The package also includes a daemon that handles the hot-swapping of most card types. While development of the Card Services package is ongoing, there is often a period where there is no support for new technologies. For this reason, the latest laptop on the market is often not a good choice for a Linux installation. Support for Linux on most name brand laptops is now common. In fact, several name brand PC manufacturers offer some distribution of Linux as an optional configuration. Supported Chip Sets This list is frequently updated. A current list of supported chip sets can be obtained from the LDP's PCMCIA-HOWTO. Supported Cards The Card Services package comes bundled with a file named SUPPORTED.CARDS. Also, you can check the LDP's PCMCIAHOWTO or the Red Hat Hardware Compatibility List for supported cards.
The image cannot be display ed. Your computer may not hav e enough memory to open the image, or the image may hav e been corrupted. Restart your computer, and then open the file again. If the red x still appears, you may hav e to delete the image and then insert it again.

During your career as a computer professional, there will be times youll be asked to research a specific product or technology. To get an idea of how hard or easy this can be, call a local or international computer reseller or manufacturer and inquire about their latest laptop. Ask them if it supports Linux. What kind of answer do you get? Ask them if they have any earlier models that will. Do you believe the answers you receive are reliable? Check out the company's Web page, if you can, and find out if they provide any information about the product on the Internet. Doing this kind of research can be very trying, with or without success. Before deciding what kind of hardware you want to install Linux on, you should have a good understanding of what will and will not work. Start early and build a good base of reliable references you can use to find out new computer information. There are Web sites, such as Sunsite's Metalab (and mirrors), as well as magazines like Sys Admin Magazine and PC Magazine, to help you stay informed.

Now that you have a better idea of your computers settings, here are a few scenarios to ponder:

SCENARIOS AND SOLUTIONS


You are using Linux and Apache to run a Web server on a LAN for a small office. Several of the employees who work in that office are responsible for updating various parts of the Web site. However, all of these people are Windows users, and are not experienced in using shell accounts. What package could you install to give these employees the easiest access to the files they need on the Web server? You have run out of disk space for your /home directory! What are the steps you should take to move this data to the new hard drive you just installed? One possibility is to install an ftp daemon, but for Windows connectivity, the Samba package would make the employees' work easier and more transparent. Users do not have to know how to use a shell account (and an editor such as emacs or vi) or an ftp client. The directories that contain the files they need could be mounted directly to their Windows desktop or separate drive letter.

First, you will have to prepare the new drive to accommodate the new /home filesystem. Use fdisk to create a partition with enough space for your /home directory. Use mke2fs to create the filesystem and then mount the partition somewhere temporarily (e.g., /mnt/tmp). Copy all your data from /home to the new partition (e.g., cp -a /home/* /mnt/tmp). Unmount both filesystems, then remount /home to the new partition. Edit /etc/fstab to reflect the new /home location as well.

CERTIFICATION SUMMARY
Planning your Linux installation makes the process an easier one. You can imagine how frustrating it would be to begin the installation, and then discover something wrong; for example, a piece of hardware isn't supported, or you installed LILO in the wrong place and now Linux will not boot. Being prepared for this will help lessen your grief. You should now know enough to be able to decide which hardware will fit your needs. Moreover, you should be able to find resources that help you make well-informed decisions about what hardware will work with Linux. Organization is the key to experiencing success with Linux. And it makes you look good.

LAB QUESTION
You are interested in further researching RAID on your new Linux server, but you cannot find any help in the man pages. You need to load up the Documentation CD-ROM and then find the HOWTO on RAID, as well as the RAID information in the Linux Reference Guide.

LAB ANSWER
Most of the help you need will be on the Documentation CD as follows:

# man raid no manual entry for raid (stick the Documentation CD into the drive, then) # mount /dev/hdd /mnt/cdrom # assuming hdd is your CD Drive # cd /mnt/cdrom/HOWTOs/ # ls *RAID* Software-RAID-HOWTO Root-RAID-HOWTO # less Software-RAID-Howto # xpdf /mnt/cdrom/docs/pdf-en/rhl71rg*.pdf # xpdf /mnt/cdrom/docs/pdf-en/rhl71ig*.pdf

You might also like