
- •About the Author
- •Credits
- •How This Book Is Organized
- •Part I: Linux Basics
- •Part II: Installation
- •Part III: Configuration
- •Part IV: Administration
- •Part V: Maintaining the Linux System
- •How Each Chapter Is Structured
- •How to Use This Book
- •Conventions Used in This Book
- •What is Linux?
- •The origin of UNIX
- •Who started Linux?
- •Understanding Open Source
- •Understanding Closed Source
- •Understanding Artistic License
- •Is Freeware really free?
- •Is Shareware never free?
- •A comparison and contrast of licensing methods
- •The Growth of Linux
- •Linux on a Personal Computer
- •Graphical installation
- •Hardware detection
- •Graphical user interface
- •Linux limitations on the PC
- •Linux succeeds on the PC
- •Linux on workstations
- •Linux on servers
- •Summary
- •Assessment Questions
- •Scenarios
- •Answers to Chapter Questions
- •Assessment Questions
- •Scenarios
- •Linux Kernel
- •Kernel versions
- •Kernel availability
- •Linux Distributions
- •Beehive
- •BlueCat
- •Caldera OpenLinux
- •Debian
- •Corel
- •DragonLinux
- •Elfstone
- •Gentoo
- •Hard Hat Linux
- •KRUD
- •LinuxPPC
- •Mandrake
- •Phat Linux
- •Slackware
- •StormLinux
- •SuSE
- •TurboLinux
- •Yellow Dog Linux
- •Mini and Specialty Distributions
- •Astaro
- •KYZO
- •FlightLinux
- •NetMAX
- •Packages and Packaging Solutions
- •Red Hat Package Manager
- •Debian Package Management System
- •Tarball
- •Linux Resources
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Assessment Questions
- •Scenarios
- •Linux In the Real World
- •Word Processing
- •Spreadsheets and databases
- •Web browsing
- •File transfer
- •More, more, and more applications
- •The Server and DNS
- •A Linux Web server
- •Linux e-mail server
- •File servers
- •Proxy, news, and search servers
- •FTP servers
- •Firewalls
- •Determining Linux Roles and Services
- •Comparing Linux with other operating systems
- •Hardware compatibility
- •Summary
- •Assessment Questions
- •Scenarios
- •Answers to Chapter Questions
- •Assessment Questions
- •Scenarios
- •Installing Linux
- •Final Preparations for Installation
- •Verification
- •Package selection
- •Final hardware verification
- •Pre-installation partitioning planning
- •Installing Linux
- •Text or GUI installation
- •Basic setup of Linux
- •Selecting the machine type
- •Partitioning the hard disk drive
- •Installing a boot manager
- •Creating the Boot Diskette
- •Networking
- •Additional installation information
- •Accounts and passwords
- •Additional packages to install
- •GUI installation
- •Obtaining video card information
- •Configuring the X windows system
- •Selecting the windows manager or desktop environment
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Answers to Assessment Questions
- •Scenarios
- •Alternative to the GUI Installation
- •Command Line installation
- •Install the Linux system
- •Network installations of Linux
- •Review of a Linux Installation
- •Installation media
- •Initial selections
- •Installation type or class
- •Disk partitioning and formatting
- •Installing LILO
- •Network configuration
- •User accounts
- •Authentication methods
- •Package selection and installation
- •A Dual-Boot Installation of Linux
- •Linux with Microsoft Windows
- •Linux with Microsoft Windows NT and 2000
- •Linux and Solaris
- •Linux and other operating systems
- •Installing Additional Software with gzip and tar
- •Installing Additional Software with RPM
- •Removing software with RPM
- •Upgrading software with RPM
- •Query the RPM software
- •Verify the RPM software
- •Verify the package files
- •Upgrading the Kernel
- •Upgrading a Linux Kernel
- •System Log Files
- •The Final Test of the Installation
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •What is the X Window System?
- •The X Window System
- •X Client and Server communications
- •X Window Manager
- •Configuring X Window Systems
- •Custom X Window System Programs
- •Manual Configuration of the X Window System
- •Documentation
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Basic Network Services
- •TCP/IP Protocol Suite
- •Connection protocols needed
- •Other network protocols
- •Configuring Basic Network Services
- •Host name
- •IP addressing
- •DHCP
- •Netmask
- •Hardware resources
- •Routing and gateways
- •PPP, SLIP and PLIP connections
- •Server Tasks with
- •IP aliases for virtual hosts
- •Apache Web Server
- •Samba File Server
- •Home directories
- •Disk shares
- •Configuring Client Services
- •SMB/CIFS
- •NIS client configuration
- •NFS client configuration
- •Configuring Internet Services
- •Web browser
- •POP and SMTP
- •TFTP
- •SNMP
- •Remote Access
- •Rlogin
- •Telnet
- •OpenSSH
- •Documentation
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Adding Hardware
- •Memory
- •Swap
- •Adding a hard drive
- •Video and monitor
- •Printers
- •Configuration files
- •Setting environment variables
- •BASH
- •Documentation
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Basic User and Group Administration
- •What are users and groups?
- •Creating users
- •Change user information
- •Deleting users
- •Creating groups
- •Getting Around Linux
- •Navigating Linux
- •Common file and directory commands
- •Setting File and Directory Permissions
- •Mounting and Managing File Systems
- •Mount
- •Umount
- •Mounted file systems
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Multi-User Environment
- •The creation of Virtual Consoles
- •The Linux Terminal Server Project
- •Configurations for remote systems
- •Monitoring remote connections
- •Common Shell Commands
- •Basic shell scripts
- •Caution using root access
- •Navigating the GUI interface
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Linux Runlevels
- •init
- •Shutting down Linux
- •Managing Linux Services
- •Configuring Linux Printing
- •lpd daemon
- •/etc/printcap
- •Printing management
- •Using the vi Editor
- •vi operation modes
- •Editing text files
- •Using the
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Disk and File System Management
- •Repairing Partitions
- •System Automation and Scheduling
- •cron
- •Core Dumps
- •Analyzing core dumps
- •GNU Debugger
- •Managing Networking Interfaces
- •Installing System Packages and Patches
- •Compressed archive
- •Debian Package Installer
- •Slackware Package Installation
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Linux Processes
- •Core services versus non-critical services
- •Process administration
- •Process control
- •Monitoring Log Files
- •Maintaining Documentation
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Linux Security
- •Securing the Environment
- •Location
- •Environment
- •System Security
- •System/user files
- •Permissions
- •Log auditing
- •Backups
- •Linux Security Best Practices
- •Network security
- •Firewall
- •System security
- •Securing a Web server
- •Securing an FTP server
- •FTP program version
- •FTP configuration files
- •Process security
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Disaster Recovery Planning
- •Types of data
- •Frequency and Scheduling
- •Storage and media types
- •Recovering data
- •Offsite storage
- •Linux Backup Tools and Commands
- •Third party tools
- •Tape devices
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Identifying the Problem
- •Methodology and Best Practices
- •Troubleshooting Resources
- •Documentation resources
- •Internet resources
- •System Log Files
- •Tools for Log Files
- •Output to another file
- •Locating files
- •Process Configuration and Management
- •Stopping, Starting, and Restarting Processes
- •Configuration Files
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Examining the Startup Process
- •Boot process steps
- •Analyzing Boot Process Errors
- •Common Boot Problems
- •Using System Status Tools
- •File System Check
- •System Resource Commands
- •Using the System Boot Disk
- •Types of boot disks
- •Creating a boot disk
- •Creating a rescue/utility disk
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Common User Problems
- •Login problems
- •File and directory permissions
- •Printing problems
- •Mail problems
- •Software Package Problems
- •Package dependencies
- •Software and version conflicts
- •Backup and Restore Errors
- •Backup hardware
- •Backup software
- •File restore errors
- •Application Failures
- •Log files
- •Process and daemon errors
- •Web server errors
- •Telnet
- •Mail services
- •Basic Networking Troubleshooting
- •Networking connectivity
- •Network hardware problems
- •Summary
- •Assessment Questions
- •Scenarios
- •Lab Exercises
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •Mainboard Components
- •BIOS
- •System memory
- •System Resources
- •I/O addresses
- •Direct memory access
- •Laptop Considerations
- •PCMCIA
- •Linux Peripheral Configuration
- •Installing and Configuring SCSI Devices
- •SCSI definitions
- •SCSI technologies
- •SCSI cabling and termination
- •SCSI device configuration
- •Linux SCSI devices
- •ATA/IDE Devices
- •IDE drive configuration
- •Linux ATA/IDE Drive configuration
- •Linux Support for Other Devices
- •IEEE 1394 (Firewire)
- •Summary
- •Assessment Questions
- •Scenarios
- •Answers to Chapter Questions
- •Chapter Pre-test
- •Assessment Questions
- •Scenarios
- •What’s on the CD-ROM
- •System Requirements
- •Using the CD with Microsoft Windows
- •Using the CD with Linux
- •Microsoft Windows applications
- •Linux applications
- •Troubleshooting
- •Sample Exam
- •Exam Questions
- •Exam Answers
- •Taking a CompTIA Exam
- •How to register for an exam
- •What to expect at the testing center
- •Your exam results
- •If you don’t receive a passing score
- •About the Linux + Exam
- •Preparing for the Linux+ Exam
- •For More Information
- •Preamble
- •No Warranty
- •Glossary
- •Index
Какую работу нужно написать?

510 |
Part VI Troubleshooting and Maintaining System Hardware |
on separate partitions from the Linux system, such as a dual boot system. For example, you may have Linux and Windows 98 operating on the same system. LILO tells the system the location of the kernel image and begins to load it.
4.Boot prompt: After LILO has finished loading, you are given the following prompt:
boot:
Press the tab key to see a list of operating systems that have been configured with LILO. Choose Linux (it may be the default) to enable the boot loader to start loading the kernel image file specified in the /etc/lilo.conf file.
5.Kernel initializes: At this point, the kernel is uncompressed and loaded into memory. The kernel then initializes the processor, memory, and console and console settings. From there, the kernel starts the disk bus subsystems, networking is initialized, and hardware device drivers are loaded.
6.init process: After hardware and device initialization has been completed, the kernel spawns the first Linux process, which is init. The init process is the “father” of all processes in a Linux system. It reads your startup configuration file in /etc/inittab, and brings the system up to the appropriate runlevel.
7.Startup scripts execute: As part of the init process initialization, the appropriate scripts for the designated runlevel are run. These scripts start the necessary processes and services for the runlevel, mount your file systems, and initiate the console sessions.
8.Login: At this point, your system is completely loaded. To begin working on the system, enter your username and password to gain access.
For the exam, know the general boot-up process and what happens at each step.
Analyzing Boot Process Errors
6.11 Take appropriate action on boot errors (e.g., LILO, bootstrap)
In order to fully understand problems with the boot process, you must be able to analyze the existing data up to the point where the boot process halted. By carefully analyzing error messages and log files of your boot process, you can quickly narrow down the point of failure. Interpreting boot errors, warnings, and informational messages is an extremely important aspect of troubleshooting, that allows you to reduce the time it takes to solve a problem.
Common Boot Problems
After you know the steps in the boot-up process, you should examine some of the common problems that are related to each step.

Chapter 17 Troubleshooting the Boot Process |
511 |
Hardware
Any sort of hardware problem will most likely occur during the BIOS initialization process because the BIOS must examine these systems before loading the operating system. This is called the POST (Power-On Self Test). The POST routing examines all internal and external hardware for faults and proper configuration. The following is a list of common components that may fail, along with the error messages or warnings that you may encounter.
Motherboard: Typically, if you boot up your system and get no response at all except for a number of beeps from the systemboard, then you have a hardware problem with the systemboard circuitry. The beeps from the systemboard are in a sequence, which you can look up in the manual to determine which component — including the video subsystem, cache, memory, or CPU — may be faulty.
Memory: The POST routine performs checksum tests on the memory, and if any part of the memory addresses fail, it may halt the boot process altogether.
Peripherals: The system checks for the presence of a keyboard, mouse, and any other input devices. These devices aren’t needed for full operation — especially if you can use the network to connect to the machine or serial port — but sometimes a faulty keyboard or mouse can lock up a system.
Hard Drive subsystems: The system examines the hard drives and disk drive controllers, which may be SCSI or IDE. The system checks that they are using proper addresses that don’t conflict with each other.
Other Cards and Peripherals: At this time, any other cards and peripherals you have may be tested, such as SCSI cards, or network cards. Any type of IRQ or IO address conflict may render the device inoperable, and these can be detected in the POST process
Software
Software processes take over from the hardware checking routines after the BIOS has examined the master boot record (MBR) of the machine for a boot loader. The following sections explore some of the most common problems that can occur at boot time.
MBR
The BIOS loads the master boot record of the first boot hard drive. If it can’t find a hard drive, an “Operating system not present error” results. If there is a drive that contains Linux, BIOS loads LILO (the Linux Loader boot manager). If your MBR has become corrupt — as is often the case if you happen to get a virus from a diskette or Windows partition — you can reset it by booting from a DOS disk and using the fdisk/mbr to wipe the master boot record. Then, you must reinstall LILO by booting into your system with a boot disk, mounting your root partition, and running LILO again.

512 |
Part VI Troubleshooting and Maintaining System Hardware |
LILO
At this point, LILO takes over the boot process and presents you with options regarding which operating systems are present and can be loaded. The system prints the word LILO on the screen as it initializes. Each letter that appears indicates that a certain process has been started. The first letter “L” indicates that it has moved itself into a proper area of memory. As this process finishes, the letter “I” displays and the second stage begins the secondary boot loader code. The second letter “L” displays when special descriptors are initiated to load the kernel. After the process has completed, the final letter “O” displays. You can troubleshoot boot problems with LILO by noting the number of letters that were displayed before the process halted. Table 17-1 shows a list of possible LILO
error codes and their causes.
|
Table 17-1 |
|
LILO Error Codes |
|
|
LILO Prompt |
Error Description |
|
|
L (n) |
Indicates a disk error code |
|
|
LI |
Second stage boot loader loaded, but not run. Kernel cannot be found. |
|
|
LIL |
Descriptor table unable to be read |
|
|
LIL? |
Second stage boot loader loaded at incorrect address |
|
|
LIL- |
Corrupt descriptor table |
|
|
LILO |
The LILO process ran successfully |
|
|
The most common error message usually occurs when LILO prints only the first two letters “LI” and then freezes. This usually means that LILO can’t run the second stage of the boot loader because it can’t find the kernel image specified in the LILO configuration file, which is /etc/lilo.conf.
The lilo.conf file is used to configure LILO with the operating systems that can be loaded and their location. A typical Linux /etc/lilo.conf looks similar to the following example:
boot=/dev/hda
map=/boot/map
install=/boot/boot.b prompt
timeout=50
message=/boot/message
lba32
default=linux
image=/boot/vmlinuz-2.4.0-0.43.6 label=linux

Chapter 17 Troubleshooting the Boot Process |
513 |
initrd=/boot/initrd-2.4.0-0.43.6.img read-only
root=/dev/hda5
The kernel image is located in /boot/vmlinuz-2.4.0-0.43.6 on partition /dev/hda5. If it can’t find this image, the LILO boot loader will fail when it tries to load the Linux system. Therefore, if you need to change the location of the kernel image, you will have to use a boot disk to mount the partition, fix the /etc/lilo.conf file, run LILO to activate the changes, and reboot.
A dual-boot system with Windows contains an extra section to identify where the Windows partition is located:
other=/dev/hda1
label=windows
table=/dev/hda
This section of the lilo.conf file tells the system that the Windows partition can be found on /dev/hda1.
When installing a dual-boot system with Windows, always install Windows first, and Linux second. If you install in reverse order, Windows will overwrite LILO and the MBR.
Kernel initialization and init process
The last steps of the boot process are kernel initialization and the beginning of the init process. The kernel loads into memory and initializes. Then the init
process (which is the “father” of all processes in a syste) begins by loading the various services and mounting the hard drives.
The main problem that you will run into at this stage is a system inability to mount one or more of the file systems on your Linux partitions. This problem will occur either because of a corrupted file system — in which you will have to run the fsck (File System Check) utility to fix any errors and inconsistencies — or because your location of the file systems is incorrect in your /etc/fstab file.
The /etc/fstab file is consulted whenever the mount command is started. The table lists the different file systems that are located on each partition, and gives options on how they are loaded. A typical /etc/fstab looks something like this:
/dev/hda1 /dos |
msdos |
defaults |
0 |
3 |
|
|
|
/dev/hda5 /boot |
ext2 |
defaults |
1 |
2 |
|
|
|
/dev/hda6 / |
ext2 |
defaults |
1 1 |
|
|
|
|
/dev/hda7 swap |
swap |
defaults |
0 0 |
|
|
|
|
/dev/fd0 /mnt/floppy ext2 user,noauto |
|
0 0 |
|||||
/dev/hdc /cdrom |
iso9660 user,ro,noauto |
0 |
0 |
||||
none |
/proc |
proc defaults |
0 0 |
|
|
|
|
none |
/dev/pts |
devpts |
gid=5,mode=620 |
0 |
0 |
|