BUY THIS BOOK

Safari Books Online

What is this?

Looking to Reprint this content?


Learning Red Hat Linux
Learning Red Hat Linux By Bill McCarty
September 1999
Pages: 386

Cover | Table of Contents | Colophon


Table of Contents

Chapter 1: Why Run Linux?
This chapter introduces you to the upstart operating system Linux. It helps you determine whether Linux is right for you, by surveying the features and performance that Linux offers. It demonstrates that choosing Linux is a practical—even wise—decision for many computer users. The chapter also helps you feel at home with Linux and other Linux users, by introducing you to the history and culture of Linux. Finally, it points you to some popular gathering places on the Internet where you can correspond with other Linux users, get up-to-the-minute Linux news and information, and obtain free technical support.
Perhaps you learned about Linux from a trusted friend, whose enthusiasm and ready answers convinced you to learn more about Linux, or perhaps an article or anecdote that mentioned Linux simply sparked your curiosity. In any case, you may find it interesting to learn what other computer users, ranging from PC hobbyist to guru, have accomplished by using Linux:
  • Tired of slow telephone modem transfer rates, a PC owner leases a cable modem that provides high-speed transfers. He installs the new modem in a Linux system that routes packets to and from the computers of other family members. Now the entire family can simultaneously surf the Web at warp speed.
  • Struggling to complete a dissertation, a graduate student determines that most of his problems stem from bugs and inadequate features of his word processing program. Dumping Microsoft Windows and Microsoft Word, he loads Linux onto his computer and uses free text processing software he downloads from the Web. In contrast to the frequent system hangs and lost work he experienced with Windows, his new system runs for over 100 days before needing to be shutdown for installation of new hardware.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Linux at Home and at Work
Perhaps you learned about Linux from a trusted friend, whose enthusiasm and ready answers convinced you to learn more about Linux, or perhaps an article or anecdote that mentioned Linux simply sparked your curiosity. In any case, you may find it interesting to learn what other computer users, ranging from PC hobbyist to guru, have accomplished by using Linux:
  • Tired of slow telephone modem transfer rates, a PC owner leases a cable modem that provides high-speed transfers. He installs the new modem in a Linux system that routes packets to and from the computers of other family members. Now the entire family can simultaneously surf the Web at warp speed.
  • Struggling to complete a dissertation, a graduate student determines that most of his problems stem from bugs and inadequate features of his word processing program. Dumping Microsoft Windows and Microsoft Word, he loads Linux onto his computer and uses free text processing software he downloads from the Web. In contrast to the frequent system hangs and lost work he experienced with Windows, his new system runs for over 100 days before needing to be shutdown for installation of new hardware.
  • Considered among the world's best, the experienced graphics artists at Digital Domain have generated visual effects for such films as Apollo 13, Dante's Peak, The Fifth Element, Interview with the Vampire, and True Lies. But when director James Cameron selected Digital Domain to conjure visual effects for Titanic, the artists faced a task of unprecedented size and complexity. Concerned to obtain enormous computing power at the lowest cost, they purchased 160 DEC Alpha computers. Most DEC Alpha users run Microsoft Windows NT or Digital Unix as an operating system. However, Digital Domain chose to run Linux on 105 of their new computers. If you've seen
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
What is Linux?
Linux is an operating system, a software program that controls your computer. Most vendors load an operating system onto the hard drive of a PC before delivering the PC, so, unless the hard drive of your PC has failed, you may not understand the function of an operating system.
An operating system solves several problems arising from hardware variation. As you're aware, no two PC models (or models of other computers, for that matter) have identical hardware. For example, some PCs have an IDE hard drive, whereas others have a SCSI hard drive. Some PCs have one hard drive, others have two or more. Most PCs have a CD-ROM drive, but some do not. Some PCs have an Intel Pentium CPU, whereas others have an AMD K-6, and so on. Suppose that, in a world without operating systems, you're programming a new PC application, perhaps a new multimedia word processor. Your application must cope with all the possible variations of PC hardware. As a result, it becomes bulky and complex. Users don't like it because it consumes too much hard drive space, takes a long time to load, and—because of its size and complexity—has more bugs than it should.
Operating systems solve this problem by providing a single standard way for applications to access hardware devices. When an operating system exists, applications can be more compact, because they share the commonly used code for accessing the hardware. Applications can also be more reliable because this code is written only once, and by expert programmers, rather than by application programmers.
As you'll soon learn, operating systems do many other things as well; for example, they generally provide a filesystem so that you can store and retrieve data, and a user interface so that you can control the operation of your computer. However, if you think of a computer's operating system as its subconscious mind, you won't be far off the mark. It's the computer's conscious mind—applications such as word processors and spreadsheets—that do useful work. But, without the subconscious—the operating system—the computer would cease breathing and applications would not function.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Reasons to Choose or Not Choose Linux
Here are several reasons for running Linux. The more of these that are true of you, the likelier you are to be happy in running Linux:
You want a stable and reliable computing platform.
No other popular operating system is more stable and reliable than Linux. If you're tired of crashes and hangs and the lost time and data they entail, you're a candidate for Linux.
You want a high performance computing platform.
Linux can coax blazingly fast performance out of hardware below the minimum required to load and run other popular operating systems. And, with ample memory and a fast CPU, Linux goes toe-to-toe with anything Microsoft or other vendors offer. If speed is your thing, Linux is your hot rod.
You need a low-cost or free operating system.
If you're someone on a budget, such as a student, or if you need to set up many systems, the low cost of Linux will let you reserve your hard-earned capital for hardware or other resources. Linux is the best operating system value on the planet.
You're a heavy network or Internet user.
If you use networks, especially the Internet, Linux's advanced support for TCP/IP may light up your life. Linux makes it easy to construct firewalls that protect your system against hackers or routers that let several computers share a single network connection.
You want to learn Unix or TCP/IP networking.
The best way—perhaps the only way—to learn more about Unix or TCP/IP networking (or computers generally) is through hands-on experience. Whether you're interested in such experience owing to personal curiosity or career ambition (system administrators are often handsomely paid), Linux affords you the opportunity to gain such experience at low cost, without leaving the comfort of your home.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Linux Resources on the Internet
This section points you to up-to-the-minute information about Linux available though web pages and Internet newsgroups. You may find this information helpful in completing your installation of Linux and you'll certainly find it helpful in using your Linux system.
Table 1.5 lists the URLs of some popular Linux web pages. Check these out to get the latest information about Linux. Perhaps the most useful is the home page of the Linux Documentation Project. There, you can find almost anything you want to know about Linux. The Linux Documentation Project web site includes a search engine that makes it easy to find what you need.
Table 1.5: Recommended Linux Web Pages
Web page
URL
Eric S. Raymond's Linux Reading List HOWTO
http://metalab.unc.edu/LDP/HOWTO/Reading-List-HOWTO.html
Gary Singleton's Gary's Place: Linux News Tips and Links
http://gary.singleton.net/
Joshua Go's Linux Guide
http://jgo.local.net/LinuxGuide/
Linux Documentation Project
http://metalab.unc.edu/linux/
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 2: Preparing to Install Linux
This chapter presents information you need to know and tasks you need to perform before installing Linux. It helps you make certain that your IBM-compatible PC meets the minimum hardware requirements for Linux. It shows you how to document your system configuration so that you can respond to questions presented by the Linux install procedure. It also describes the three types of Red Hat Linux installations (for most new users of Linux, the workstation installation type is the most appropriate). Finally, it shows you how to prepare your hard disk for Linux.
Linux supports a wide range of PC hardware; but not even Linux supports every known device and system. Your PC must meet certain minimum requirements in order to run Linux. The following sections present these minimum requirements; however, for the latest and most complete information, you should check Red Hat's web site at http://www.redhat.com/hardware/. Red Hat's web site will also help you determine whether Linux supports all the devices installed in your system.
Linux does not support the Intel 286 and earlier processors. However, it fully supports the Intel 80386, 80486, Pentium, Pentium Pro, Pentium II, and Pentium III processors. Nevertheless, some users feel that their 80386 Linux systems respond sluggishly, particularly when running X. So, if you want optimum performance, you should install Linux on a PC having an 80486 processor or better.
Linux also supports non-Intel processors such as the Cyrix 6x86 and the AMD K5 and K6. Most Linux users have systems that use Intel chips; if your system uses a non-Intel chip, you may find it somewhat more difficult to resolve possible problems.
Red Hat reports that some AMD K6 systems freeze during the Linux install. Some users have solved this problem by updating their system BIOS or replacing their system motherboards. The author's Linux system uses an AMD K6 and has presented no special problems.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Minimum Hardware Requirements
Linux supports a wide range of PC hardware; but not even Linux supports every known device and system. Your PC must meet certain minimum requirements in order to run Linux. The following sections present these minimum requirements; however, for the latest and most complete information, you should check Red Hat's web site at http://www.redhat.com/hardware/. Red Hat's web site will also help you determine whether Linux supports all the devices installed in your system.
Linux does not support the Intel 286 and earlier processors. However, it fully supports the Intel 80386, 80486, Pentium, Pentium Pro, Pentium II, and Pentium III processors. Nevertheless, some users feel that their 80386 Linux systems respond sluggishly, particularly when running X. So, if you want optimum performance, you should install Linux on a PC having an 80486 processor or better.
Linux also supports non-Intel processors such as the Cyrix 6x86 and the AMD K5 and K6. Most Linux users have systems that use Intel chips; if your system uses a non-Intel chip, you may find it somewhat more difficult to resolve possible problems.
Red Hat reports that some AMD K6 systems freeze during the Linux install. Some users have solved this problem by updating their system BIOS or replacing their system motherboards. The author's Linux system uses an AMD K6 and has presented no special problems.
Linux supports the standard ISA, EISA, PCI, and VESA (VLB) system buses used on most IBM-compatible PCs. Linux recently gained support for IBM's MCA bus, used in IBM's PS/2 series of computers. However, at the time of this writing, Red Hat has not announced support for the MCA bus. If you have an IBM PS/2, you may be unable to install Red Hat Linux (check the Red Hat web site for the latest available information on support for the MCA bus).
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Collecting Information About Your System
In order to be able to complete the installation procedure smoothly, you should collect certain information about your system before beginning the installation. Often the installation utility will be able to determine your system configuration automatically but when it fails to do so, you must be prepared to supply the needed information. Otherwise, you'll be forced to terminate the installation procedure, obtain the information, and restart the installation.
Table 2.1 specifies the configuration information you need. To obtain this information, you can consult your system documentation and the documentation for any devices installed by you. If your documentation is missing or incomplete, you may need to contact your hardware vendor or manufacturer. Alternatively, you may be able to find the needed information on the manufacturer's web site; use a search engine such as Yahoo! or AltaVista to discover the URL of the web site.
Table 2.1: Configuration Information Needed to Install Linux
Device
Information needed
Hard Drive(s)
The number, size, and type of each hard drive.
Which hard drive is first, second, and so on
Which adapter type (IDE or SCSI) is used by each drive.
For each IDE drive, whether or not the BIOS is set for LBA mode
RAM memory
The amount of installed RAM
CD-ROM Drive(s)
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Installation Types
Red Hat Linux defines three installation types: Workstation, Server, and Custom.
If you're new to Linux, the workstation installation type is probably the most appropriate for you, especially if you currently run Microsoft Windows. In that case, the workstation installation procedure will automatically configure your system to dual boot—whenever you start your system, a Linux utility known as LILO will give you the choice of starting Microsoft Windows or Linux. Both operating systems can reside on a single system. A workstation installation requires about 600 MB of free disk space.
The server installation type automatically removes all existing data from your hard disk. You should use it when you want your system to run only Linux. A server installation requires about 1.6 GB of free disk space.
The server installation type destroys all data on your hard drive. Do not perform a server installation if you want to preserve any data on your system.
The custom installation type gives you complete control over the installation process. You specify whether to configure your system for dual boot, what software packages to install, and so on. The custom install is covered in detail in the next chapter, but a workstation or server install can offer a quick way to get started unless you need to preserve data on the target machine.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Preparing Your Hard Disk
To prepare your hard disk for installing Linux, you must allocate the space in which Linux will reside. You'll learn how to do so in this section. First, you'll learn how hard disks are organized, then you'll learn how to view the structure of a hard disk. Finally, you'll learn how to alter the structure of a hard disk.
Let's start by reviewing facts you've probably learned by working with Microsoft Windows. Most operating systems, including Microsoft Windows 95 and Windows 98, manage hard disk drives by dividing their storage space into units known as partitions. So that you can access a partition, Windows 95 and Windows 98 associate a drive letter (such as C: or D:) with it. Before you can store data on a partition, you must format it. Formatting a partition organizes the associated space into what is called a filesystem, which provides space for storing the names and attributes of files as well as the data they contain. Microsoft Windows supports several types of filesystems, such as FAT and FAT32, a newer filesystem type that provides more efficient storage, launches programs faster, and supports very large hard disk drives.
Partitions comprise the logical structure of a disk drive, the way humans and most computer programs understand the structure. However, disk drives have an underlying physical structure that more closely resembles the actual structure of the hardware. Figure 2.3 shows the logical and physical structure of a disk drive.
Figure 2.3: The structure of a hard disk
Mechanically, a hard disk is constructed of platters that resemble the phonograph records found in a old-fashioned juke box. Each platter is associated with a read/write
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 3: Installing Linux
In this chapter, you'll learn how to install Linux by following a simple, step-by-step procedure. Most users will be able to complete the installation procedure without difficulty; however, the chapter includes a section that describes how you can obtain help if you encounter installation problems. Once you successfully complete the installation procedure, you'll have your own working Linux system.
To install Linux, you follow a simple, step-by-step procedure that has three main phases:
  • Installing the operating system and applications
  • Configuring devices and services
  • Completing the installation
This section describes the procedure for installing the operating system and applications. The following sections describe the remaining phases.
Although the Linux installation procedure is generally troublefree, errors or malfunctions that occur during the installation of an operating system can result in loss of data. You should not begin the installation procedure until you have backed up all data on your system and determined that your backup is error-free.
Like other modern Linux distributions, Red Hat Linux includes a screen-based install program that simplifies the installation and initial configuration of Linux. However, the install program works somewhat differently than a typical Microsoft Windows application. For instance, it does not support use of a mouse or other pointing device; all input is via the keyboard. So that you can make effective use of the install program, the next three sections describe the user-interface controls used by the install program, present the special keystrokes recognized by the install program, and explain the use of Linux's virtual consoles.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Installing the Operating System and Applications
To install Linux, you follow a simple, step-by-step procedure that has three main phases:
  • Installing the operating system and applications
  • Configuring devices and services
  • Completing the installation
This section describes the procedure for installing the operating system and applications. The following sections describe the remaining phases.
Although the Linux installation procedure is generally troublefree, errors or malfunctions that occur during the installation of an operating system can result in loss of data. You should not begin the installation procedure until you have backed up all data on your system and determined that your backup is error-free.
Like other modern Linux distributions, Red Hat Linux includes a screen-based install program that simplifies the installation and initial configuration of Linux. However, the install program works somewhat differently than a typical Microsoft Windows application. For instance, it does not support use of a mouse or other pointing device; all input is via the keyboard. So that you can make effective use of the install program, the next three sections describe the user-interface controls used by the install program, present the special keystrokes recognized by the install program, and explain the use of Linux's virtual consoles.

Section 3.1.1.1: User-interface controls

Figure 3.1 shows a typical screen displayed by the install program. This screen includes the following elements:
A main window
The install program runs in a full screen window. The upper right corner of the window displays the name of the current installation step. In Figure 3.1, the current step is "Setup filesystems." You cannot minimize or change the size of the install program's main window.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Configuring Devices and Services
To help you configure devices and services, the install program presents a series of dialog boxes that let you configure:
  • A mouse
  • The X Window System
  • Networking
  • The system clock
  • Services
  • Printers
If you're unable to configure one or more devices or services during installation, you'll be able to configure them later.
Next, the install program probes your system to locate a mouse. If the install program successfully finds and identifies your mouse, it presents one or two simple dialog boxes like those shown in Figure 3.20 and Figure 3.21. These ask you to confirm the install program's findings and possibly select from several options. Simply make the appropriate choices and continue to the next step.
Figure 3.20: The Configure Mouse dialog box
Figure 3.21: The Mouse Port dialog box
If the install program cannot find and identify your mouse, it presents a Configure Mouse dialog box, which lists supported mouse types. If you can find your mouse or an exact equivalent, highlight the appropriate choice; otherwise, highlight one of the "Generic" entries, whichever best resembles the type of interface and number of buttons of your mouse. If you followed the procedure given in Chapter 2, you know whether your mouse uses a serial interface or PS/2 interface. If not, the shape of the connector is a somewhat reliable guide: A round connector indicates a PS/2 interface whereas a rounded rectangular connector indicates a serial mouse.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Completing the Installation
Once you've skipped or completed the printer configuration dialog, you're ready to complete the installation of Linux. This involves:
  • Setting a password for the system administrator
  • Configuring your system to boot
The user who administers a Linux system is known as root. To protect your system against mischief and misadventure, you should protect the root user's login with a password. To help you do so, the install program presents the Root Password dialog box, shown in Figure 3.35. Simply choose a password and type it in each text field. Then, select the Ok button and press Enter. You'll need to use this password when you log in after booting Linux for the first time.
Figure 3.35: The Root Password dialog box
Next, the installation program shows the Authentication Configuration dialog box, shown in Figure 3.36. Disable the NIS option and enable both the Use Shadow Passwords and MD5 Passwords options. Select Ok and press Enter.
Figure 3.36: The Authentication Configuration dialog box
The install program next gives you the opportunity to create a boot diskette, by presenting the Bootdisk dialog box shown in Figure 3.37. You should take the opportunity, because a boot diskette will let you boot your Linux system even if the bootloader fails to install properly and even if the system boot information is damaged. To create a boot diskette, select Yes and press Enter. The install program will prompt you to insert a blank diskette in your system's diskette drive. Insert the diskette, select the Ok button, and press
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Getting Help
If your system fails to boot, or if you're unable to complete the Linux installation process, don't despair. The help you need is probably close by, in one of these sources:
  • Linux FAQs (Frequently Asked Questions)
  • Linux HOWTOs
  • The Red Hat mailing list
  • Usenet newsgroups
The following sections describe these sources and explain how to access and use them. You should generally consult them in the order specified.
Linux FAQs present commonly asked questions and answers. The Red Hat Linux Installation Support FAQ is available online at http://www.redhat.com/support/docs/rhl/RedHat-FAQ/RedHat-FAQ.html. Also useful is the Red Hat Linux 5.2 Errata, found online at http://www.redhat.com/corp/support/errata/rh52-errata-general.html.
You can find additional FAQs on the CD-ROM diskette, in the /Doc/Faq directory. You can also find these FAQs online at http://metalab.unc.edu/linux/intro.html. The main Linux FAQ is known simply as the Linux FAQ. You can find it on-line at http://metalab.unc.edu/linux/FAQ/Linux-FAQ.html.
Linux HOWTOs address specific topics of interest to Linux users. They're found on the CD-ROM diskette in the /Doc/Howto directory. You can also find them online at http://metalab.unc.edu/linux/intro.html. At this point in your Linux experience, you'll probably find the Installation-HOWTO useful. Use it to find workarounds for your installation and configuration problems.
The HOWTOs are generally available in plain text format. You can use Microsoft Windows WordPad, or another text editor of your choice, to access them.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 4: Issuing Linux Commands
This chapter shows you how to begin using your Linux system. It shows you how to boot your system, log in, issue commands, log out, and shut down your system. It also explains how to use the man command, which provides help on using other commands. The chapter describes how Linux organizes data as filesystems, directories, and files and how you can work with removable media, such as diskettes. It describes how to query the status of your system. And, finally, it explains how to use pico, a simple text editor.
This section introduces you to the cycle of Linux system use. If you're a user of Microsoft Windows, you're accustomed to a pattern of system use that forms a cycle:
  • Boot the system
  • Identify yourself to the system
  • Use the system
  • Shutdown the system
The cycle of Linux system use is similar, even though you perform the tasks somewhat differently.
Most Linux users boot their system from its hard drive. Of course, if you made a boot diskette during system installation, you can use it to boot your system.
First, you must prepare your system for booting. If your system is running, you must shut it down by following the proper procedure for shutting down the operating system that's active. For example, if you're running Microsoft Windows, click Start Shut Down and select the Shut Down option in the Shut Down dialog box. Press OK to begin the system shutdown. After a few seconds, Windows displays a screen telling you that it's safe to turn off power to your system. Turn off the power or, if your system automatically powers down, wait a few seconds until the system powers itself down.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
The System Use Cycle
This section introduces you to the cycle of Linux system use. If you're a user of Microsoft Windows, you're accustomed to a pattern of system use that forms a cycle:
  • Boot the system
  • Identify yourself to the system
  • Use the system
  • Shutdown the system
The cycle of Linux system use is similar, even though you perform the tasks somewhat differently.
Most Linux users boot their system from its hard drive. Of course, if you made a boot diskette during system installation, you can use it to boot your system.
First, you must prepare your system for booting. If your system is running, you must shut it down by following the proper procedure for shutting down the operating system that's active. For example, if you're running Microsoft Windows, click Start Shut Down and select the Shut Down option in the Shut Down dialog box. Press OK to begin the system shutdown. After a few seconds, Windows displays a screen telling you that it's safe to turn off power to your system. Turn off the power or, if your system automatically powers down, wait a few seconds until the system powers itself down.
Next, you must set your system to boot from the desired device. To boot your system from its hard drive, remove any floppy diskette from your system's floppy drive. To boot your system from a floppy diskette, insert your Linux boot diskette into your system's floppy drive.
Now, you're ready to boot your system. Switch your system on (or press your system's reset button, if your system is powered on) and watch as it performs its self test. Shortly thereafter, you should see a boot: prompt on the system's monitor. If you like, you can list the available boot configurations stored on the boot device by pressing
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Working with the Linux Command Prompt
To make Linux commands easy to use, they share a simple, common structure. This section describes their common structure and explains how you can obtain helpful information on the commands available to you.
Linux commands share the common form:
               command option(s) argument(s)
            
The command identifies the command you want Linux to execute. The name of a Linux command almost always consists of lowercase letters and digits. Remember that, unlike Microsoft Windows, Linux is case sensitive; be sure to type each character of a command in the proper case.
Most commands let you specify options or arguments. However, in any given case, you may not need to do so. For example, typing the w command without options and arguments causes Linux to display a list of current users.
Options modify the way that a command works. Most options consist of a single letter, prefixed by a dash. Often, you can specify more than one option; when you do so, you separate each option with a space or tab. For example, the -h option of the w command causes the output of the command to omit the header lines that give the time and the names of the fields. Typing:
[root@desktop /root]# w -h
            
prints a list of users without the header lines.
Arguments specify filenames or other targets that direct the action of the command. For example, the w command lets you specify a userid as an argument, which causes the command to list only logins that pertain to the specified userid. Typing:
[root@desktop /root]# w root
            
prints a list of current logins by the root user. Some commands let you specify a series of arguments; you must separate each argument with a space or tab.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
How Linux Organizes Data
In order to make the most effective use of your Linux system, you must understand how Linux organizes data. If you're familiar with Microsoft Windows or another operating system, you'll find it easy to learn how Linux organizes data, because most operating systems organize data in rather similar ways. This section explains how Linux organizes data. It also introduces you to several important Linux commands that work with directories and files.
Linux receives data from, sends data to, and stores data on devices. A device usually corresponds to a hardware unit, such as a keyboard or serial port. However, a device may have no hardware counterpart: the kernel creates several pseudodevices that you can access as devices but that have no physical existence. Moreover, a single hardware unit may correspond to several devices—for example, Linux defines each partition of a disk drive as a distinct device. Table 4.2 describes some typical Linux devices; not every system provides all these devices and some systems provide devices not shown in the table.
Table 4.2: Typical Linux Devices
Device
Description
atibm
Bus mouse
audio
Sound card
cdrom
CD-ROM drive
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Working with Devices
This section presents commands that work with devices. You'll learn how to mount and unmount devices and how to format a floppy diskette.
You cannot access a hard drive partition, CD-ROM, or floppy diskette until the related device or partition is mounted. Mounting a device checks the status of the device and readies it for access. Linux can be configured to automatically mount a device or partition when it boots; but you must manually mount other devices and partitions.
If a device uses removable media, the media may not be present when the system boots. If the system is configured to automatically mount such a device and the media is not present, an error occurs. Therefore, devices that use removable media are not generally configured for automatic mounting.
Before you can remove media from a device, you must unmount it. The system also unmounts devices when it shuts down. Mounting and unmounting devices is a privileged operation; generally, only the root user can manually mount and unmount devices.
To mount a device or partition, you use the mount command, which has the following pattern:
mount options device directory
            
The mount command provides many options. However, you can generally use the mount command without any options; consult the manual page to learn about the available options.
The reason you can use the mount command without options is that the file /etc/fstab describes your system's devices and the type of filesystem each is likely to contain. If you add a new device to your system, you may need to revise the contents of /etc/fstab or specify appropriate options when you mount the device.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Useful Linux Programs
This section presents several programs you may find helpful in working with your Linux system. You'll learn several commands that report system status and you'll learn how to use pico, a simple text editor.
Table 4.6: Floppy Drive Designators
Designation
Meaning
/dev/fd0
3.5-inch diskette in a: (1.44 MB)
/dev/fd0d360
5.25-inch diskette in a: (360 kB)
/dev/fd0D720
3.5-inch diskette in a: (720 kB)
/dev/fd0h1200
5.25-inch diskette in a: (1.2 MB)
/dev/fd0H1440
3.5-inch diskette in a: (1.44 MB)
/dev/fd0H2880
3.5-inch diskette in a: (2.88 MB)
/dev/fd1
3.5-inch diskette in b: (1.44 MB)
/dev/fd1d360
5.25-inch diskette in
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 5: Installing and Configuring the X Window System
This chapter helps you install, configure, and use the X Window System (often known simply as X). If your graphics card is of a common variety and you correctly specified its characteristics during the Linux installation procedure, the install program may have successfully installed and configured X. Otherwise, you'll need to install and configure X by using the more sophisticated procedures given in this chapter. Once X is up and running, you can choose how to start X. This chapter explains your options and also gives some tips on optimizing the performance of X.
X is the standard graphical user interface for Linux. Like other graphical user interfaces such as Microsoft Windows and Mac OS, X lets you interact with programs by using a mouse (or other pointing device) to point and click, providing a simple means of communicating with your computer.
Originally implemented as a collaborative effort of Digital Equipment Corporation and Massachusetts Institute of Technology, X was first released in 1987. Subsequently, the X Consortium, Inc. became responsible for the continued development and publication of X.
Despite its age, X is a remarkable and very modern software system: a cross-platform, network-oriented, graphical user interface. It runs on a wide variety of platforms, including essentially every variety of Unix. X Clients are available for use, for example, under Windows 3.x, 9x, and NT. The sophisticated networking capabilities of X let you run a program on one computer while viewing the graphical output on another computer, connected to the first via a network. With the advent of the Internet, which interconnected a sizable fraction of the computers on the planet, X achieved a new height of importance and power.
Most Linux users run XFree86, a freely available software system compatible with X. XFree86 was developed by the XFree86 software team, which began work in 1992. In 1994, The XFree86 Project assumed responsibility for ongoing research and development of XFree86.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
What is X?
X is the standard graphical user interface for Linux. Like other graphical user interfaces such as Microsoft Windows and Mac OS, X lets you interact with programs by using a mouse (or other pointing device) to point and click, providing a simple means of communicating with your computer.
Originally implemented as a collaborative effort of Digital Equipment Corporation and Massachusetts Institute of Technology, X was first released in 1987. Subsequently, the X Consortium, Inc. became responsible for the continued development and publication of X.
Despite its age, X is a remarkable and very modern software system: a cross-platform, network-oriented, graphical user interface. It runs on a wide variety of platforms, including essentially every variety of Unix. X Clients are available for use, for example, under Windows 3.x, 9x, and NT. The sophisticated networking capabilities of X let you run a program on one computer while viewing the graphical output on another computer, connected to the first via a network. With the advent of the Internet, which interconnected a sizable fraction of the computers on the planet, X achieved a new height of importance and power.
Most Linux users run XFree86, a freely available software system compatible with X. XFree86 was developed by the XFree86 software team, which began work in 1992. In 1994, The XFree86 Project assumed responsibility for ongoing research and development of XFree86.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Installing X
Getting a proper X Window System up and running used to be a real challenge on Linux, almost a rite of passage. Today, device drivers are available for a much wider array of hardware, and configuration tools to assist in the setup process have greatly improved. While still tricky at times—especially with unusual hardware—X setup and configuration is no longer the daunting process it once was, and should be relatively easy.
You'll go through two stages before you have X successfully running. The first stage involves installing the needed programs that enable X to run. These can be grouped into several categories:
  • Basic XFree86 program
  • X servers
  • Window Managers
  • Applications
  • Fonts
This stage is very straightforward and may well have been done as part of the basic installation process, if you selected the relevant X packages during that step.
In the second stage you configure X to run properly on your system. This is a matter of identifying an X server compatible with your graphics card, and tuning the server for your graphics card. If you have a common card and all the documentation for it, this second stage will be relatively simple. Missing information makes the process harder, but not impossible.
As shown in Appendix C, X consists of many RPM packages. Consequently, the easiest way to install X is to install the X Window System component during the installation procedure. If you omitted the X Window System component, you should consider redoing the installation procedure, as this may be the simplest way to install X. However, if you prefer, you can use the information in Appendix C to install X without redoing the installation.
Once you've installed the necessary packages, you're ready to configure X. The first step is to establish a symbolic link to the X server you want to use. RPM installed your X server in the directory
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Configuration Using Xconfigurator
A configuration file named XF86Config controls the operation of X. Linux places this file in the /etc/X11 directory. You can edit this file by using pico or another text editor; but it's much easier to use Xconfigurator, which asks a few questions about your system and then builds the file for you.
To launch Xconfigurator, log in as root and type the command:
Xconfigurator
Xconfigurator displays its opening screen, shown in Figure 5.1. The configuration process that ensues is very similar to the one performed by the install program; but, as you'll see, there are a few differences, mostly minor. Select the Ok button and press Enter to continue.
Xconfigurator overwrites the contents of the XF86Config file. If you already have a working X setup, you should create a backup copy of XF86Config before running Xconfigurator.
Figure 5.1: The Xconfigurator Welcome dialog box
As shown in Figure 5.2, Xconfigurator probes your system to determine the characteristics of your video card. If the probe fails, you should suspect that you installed an X server that's not compatible with your video card; install the proper server and try running Xconfigurator again. If the probe succeeded, you can select the Ok button and press Enter.
Figure 5.2: The PCI Probe dialog box
Xconfigurator may present a dialog box that asks you to specify your video card. If so, consult Figure 5.2 and select the video card that most nearly resembles the video card installed in your system.
Xconfigurator may also ask you to specify the amount of memory installed on your video card by presenting a dialog box like that shown in Figure 5.3. If so, specify the proper amount of memory, select the Ok button, and press
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Configuration Using xf86config
Xconfigurator is not always able to successfully probe a system. The xf86config utility, though somewhat less convenient to use, is more often successful. If Xconfigurator failed to properly configure your system to use X, you can follow the instructions in this section to configure your system by using xf86config. If you successfully configured your system you can skip to the next section, which shows you how to launch X.
To launch xf86config, log in as root and type the command:
xf86config
Figure 5.11 shows the beginning of the xf86config dialog. As you can see, unlike Xconfigurator, xf86config is a text-mode program; it does not support use of the mouse and it presents its questions teletype-style, using black-and-white text.
In working with xf86config, you may find that your Backspace key doesn't work as expected. If so, use Ctrl-Backspace instead.
Figure 5.11: The beginning of the xf86config dialog
When you press Enter, xf86config asks you to confirm that the PATH is correctly set, as shown in Figure 5.12. The install program should have properly configured the PATH. Press Enter to continue.
Figure 5.12: Confirming the PATH
Next, xf86config asks you to specify the type of mouse attached to your system, as shown in Figure 5.13. Type the number associated with your choice, and press Enter. For non-mouse pointing devices found on many laptops, you should most likely select PS/2 Mouse.
Figure 5.13: Specifying the mouse type
If you selected the Logitech MouseMan mouse, you should enable its third button by responding
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Starting and Stopping X
Content preview·