- •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
514 |
Part VI Troubleshooting and Maintaining System Hardware |
If the file contains an invalid entry, it won’t mount the file system properly. In this case, you will need to edit the /etc/fstab file to fix the error. If this happens with the root partition, you will have to mount it manually, and then make your change to the file.
Any error messages that occur during the boot process are logged to the file
/var/log/dmesg.
Using System Status Tools
6.5 Use system status tools to examine system resources and statuses (e.g., fsck, setserial)
You have a number of tools at your disposal for help in troubleshooting your Linux system. These tools allow you to check the status of your hardware and software, and can greatly shorten the troubleshooting process by narrowing down the source of the problem.
File System Check
6.8 Use disk utilities to solve file system problems (e.g., mount, umount)
Depending on the type of boot process problem that you are troubleshooting, you may have to use special utilities to rescue your disk from a corrupted state. Disk data can be easily damaged by file systems that are not unmounted properly — a situation that can result from a power failure or improper shutdown. You can use these special utilities to quickly analyze and fix any inconsistencies in your file systems, thus restoring them to a normal state.
The most important utility you will need for repairing your Linux system is the fsck utility. This program will check your file system for errors and inconsistencies, and can repair them while it is running.
During a normal shutdown procedure, the file systems are properly closed and unmounted before the machine shuts down. If Linux is improperly shut down because of a power failure or because someone uses the on/off switch, the file systems and disk tables may become corrupt. If your file systems are not unmounted properly, fsck will run automatically at the next boot-up to attempt to fix the errors.
fsck is actually a front-end for more specific utilities. For example, Linux uses the ext2 file system, so when fsck is invoked to check this system, it will run the e2fsck utility.
Chapter 17 Troubleshooting the Boot Process |
515 |
The following is the syntax for using the fsck command:
fsck [option] device
For example, if you need to run a file system check on /dev/hda1, use this command:
fsck /dev/hda1
The file system must be unmounted in order to run properly. If the file system was mounted and in use, the contents would be constantly changing and fsck would not be able to examine it properly.
If you need to check the root file system, you must either boot into the system by using a boot floppy disk or run the check in single-user mode.
Options for fsck
You can use a number of options with fsck, which is shown in Table 17-2.
Table 17-2
fsck Options
sSerialize fsck operations. Use this option if you want to check multiple file systems in order.
-t Specifies the type of file system to be checked (for example, ext2).
-A Walk through the /etc/fstab file and try to check all file systems in one run. -C Display completion/progress bars.
-N Don’t execute, just show what would be done if the file system check was run. -T Don’t show the title on startup.
-V Produce verbose output, including all file system-specific commands that are executed.
-a Automatically repair the file system without any questions. -r Interactively repair the file system (ask for confirmations).
You may receive a message stating that you must manually run fsck on a file system. If you receive this message, fsck was unable to fix the problem normally. Therefore, you must use a more specific utility. You may also receive an error message stating that the superblock is damaged and could not be read. The superblock is a special area that contains pointers to where the file systems are located on the disk. In this case, you have to specifically use the e2fsck and pass the superblock parameter manually.
e2fsck -b 8193 /dev/hda
516 |
Part VI Troubleshooting and Maintaining System Hardware |
Know how to properly use the fsck command to check file systems.
System Resource Commands
The following are some commands that can help you examine your current resources and where they are being used. This is helpful when troubleshooting your system for resource conflicts, or over use. For example, if one of your processes uses too much memory, it may cause other programs or even your whole system to crash.
Top
You can use the top command to check current resource usage. This utility lets you see on one screen how much memory and CPU resources you are currently using. This screen also displays the resource usage by each program and process. Figure 17-1 shows a screenshot from the output of the top command.
Figure 17-1: Output of top command
If one of your processes is not working properly, it may be using up all of your available CPU and memory resources. If this is the case, kill the process and restart it.
Setserial
You can use the setserial utility to obtain information about your serial port resource usage, such as IRQ and IO addresses. A device uses an IRQ (Interrupt Request) to signal the CPU that it has a request that needs processing. The IO
Chapter 17 Troubleshooting the Boot Process |
517 |
address is a special address reserved in memory for a particular device. If any of these addresses conflict with another device, it may disable them or cause erratic behavior. You can use setserial to examine your serial ports and ensure that no conflicts exist.
By default, the Linux system loads serial ports COM1-4 with the default and IRQ values. You can change these settings if you need to set up a device with a nonstandard IRQ or IO address.
For example, the following is the default configuration of the first serial port, COM1:
setserial /dev/ttyS0
The output should look something like this:
ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
The four default com ports are listed in Table 17-3.
Table 17-3
Linux Serial Port Settings
PORT |
Device |
IRQ |
IO Address |
|
|
|
|
COM1 |
ttyS0 |
4 |
0x03f8 |
|
|
|
|
COM2 |
ttyS1 |
3 |
0x02f8 |
|
|
|
|
COM3 |
ttyS2 |
4 |
0x03e8 |
|
|
|
|
COM4 |
ttyS3 |
3 |
0x02e8 |
|
|
|
|
If you need to set a serial port with different settings to be compatible with a certain device, you can use the setserial command to change them. Just remember that the device needs to have the settings or it won’t work.
For example, if you need to set COM4 to a different IRQ, you can use the following command:
setserial /dev/ttyS3 irq 10
This command sets the COM4 serial port to use IRQ 10.