- •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
92 |
Part II Installation |
Selecting the machine type
2.4 Select packages based on the machine’s “role” (e.g., Workstation, Server, Custom)
After these basic configurations have been completed, most distributions will ask for the type of installation that the installer desires. Most installers use the format shown in Figure 4-5.
Figure 4-5: The Red Hat installation type screen
The options you can choose are a Workstation, Server System, Laptop, Custom System or Upgrade. The following sections break these down:
Workstations
Workstation configurations are generally the best choice for end users who do not need all the server applications installed. The Workstation installation includes the standard software packages that are needed to perform daily tasks. This includes software to perform Web browsing, to create documents and spreadsheets, and to retrieve e-mail. Some Workstation class packages allow the installation of commercial software to be included with the installation of Linux. Selecting a Workstation installation does not, however, limit the system to this role, but it does use a configuration that is meant for workstations.
Chapter 4 Installing Linux |
93 |
Installation classes, such as workstation, are predetermined configurations in some Linux distributions and may limit or provide no options during the installation.
The pre-configuration usually includes not only the default software packages, but also some workstation-specific features, such as the hard drive partitioning and the security level the system starts at. Because additional packages can be added to the workstation, users can change the role of the system to provide services that are normally provided by a server.
Server Systems
By selecting Server at this point in the installation process, the installer is selecting basic features and configuration of a server. This includes the partitioning of the hard drive (including packages for providing services that a server can supply) and customized priorities for running applications. The selection of a Server configuration does not limit the system to this role, but does configure it to perform the tasks that a server is called upon to perform.
Laptops
Although Linux excels at performing on a server, Linux has had difficulty performing on a laptop. This is changing for many reasons, one of which is the standardization of laptop hardware, which has enabled Linux to provide better support for laptops. As a result, Linux has created a custom installation that provides for the needs of laptop hardware, including special hardware support, advanced power management, and a minimized volume of software to be installed.
Custom Systems
Customized Systems range from the most minimized system to the most complete installation of Linux. This option allows the installer to configure virtually every feature of the Linux installation. More advanced users may desire this installation method to achieve the most customized installation possible. This option also requires the most knowledge of how to configure Linux.
Upgrades
The final installation option is the ability to upgrade the existing installation of the Linux operating system. This is usually best used on the same distribution of Linux, because structural differences may exist between different distributions, which can cause unreliable upgrading.
Whether you choose a Workstation, Server, Laptop, Custom, or Upgrade installation the subsequent screens for disk partitioning will vary depending on your selection, so select the appropriate options as required.
94 |
Part II Installation |
Partitioning the hard disk drive
1.4 Determine how storage space will be allocated to file systems. (e.g., partition schemes)
2.5Select appropriate options for partitions based on pre-installation choices (e.g., FDISK, third party partitioning software)
2.6Partition according to your pre-installation plan using fdisk (e.g., /boot, / , /usr, /var/home, SWAP)
2.7Configure file systems (e.g., (ext2) or (ext3) or REISER)
The next step in your installation is to partition the hard drive. This is performed automatically for Workstation, Server, and Laptop installation classes. The automatic configuration standards that can be set up by selecting a Workstation, Laptop, or Server class, however, usually won’t work if the hard drive has an existing partition. At this point in the installation, or if a custom installation has been selected, a manual configuration of the partition must be performed. Disk Druid and fdisk are the usual partition utilities that are offered at this point, but others may be presented depending on your distribution. Disk Druid is the recommended tool for most users and is an easy-to-use and capable partitioning tool. Disk Druid is illustrated in Figure 4-6.
Figure 4-6: Hard Drive Partitioning with Disk Druid screen
Chapter 4 Installing Linux |
95 |
The other major tool that is used for partitioning is fdisk. fdisk offers fast and easy-to-manage tools for partitioning. The most common partition file system types are ext2 or Linux native, Linux swap, and the newer Reiser File System or ReiserFS. Linux, however, also supports the following partitions: DOS FAT 16, Win98 FAT32, Linux RAID, Linux Logical Volume Manager, BSD/386, NetBSD, Solaris Boot Partition, UNIX System V, and virtually every other partition type available.
For the exam, it’s important to know the major Linux partition file systems, which include ext2, ext3, Linux swap, and ReiserFS. You should also understand the interaction that Linux has with the other major file systems in Microsoft and UNIX worlds.
These partition file system options are important for dual boot systems or on systems that are used to test potential operating systems. The Reiser File System may be the preferred partition type to use for a Linux-only system. Because the ReiserFS is a journaling file system, it allows for faster recovery from unexpected problems, such as power outage. It also uses a method to write to the hard drive that is faster and more secure. You can better understand the benefit of the ReiserFS if you know a little about how the ext2 file system writes information to a hard drive.
The ext2 partition first caches the data, and then writes it to the hard drive. If a power outage occurs while the system is operating, the file system can become corrupted because some of the data in the cache may not have been written to the drive. The next time Linux boots, it should detect this corruption, and run the fsck utility to correct any damage that was done.
The ReiserFS method adds additional safety by performing file writes in a more intelligent fashion. The ReiserFS system uses the following method:
1.Cache the data in RAM
2.Perform a preparatory command to write the data to the hard drive
3.Write the data to the hard drive
4.Verify the write to the hard drive
5.Clear the cache
96 |
Part II Installation |
If a power failure occurs, the journaling system is able to detect partially written data and can “back out” the data upon power restoration. By using this method, the Reiser file system prevents most of the data corruption that can occur, and therefore does not usually run fsck when an unexpected power loss is experienced. Therefore, because of the journaling capabilities, the ReiserFS is usually considered to be better than ext2. Another benefit of the ReiserFS is that it uses fast balanced trees. Balanced trees provide more robust performance and a sophisticated algorithmic file system. This method allows even small 100 byte files to be written into one block, while other file systems place each file into their own block. This speeds the handling of small files and saves space. Another space-saving feature of the ReiserFS is that it doesn’t use fixed space for the allocation for inodes — which are data structures that hold information about files in a Unix file system — thus saving approximately six percent of the overall disk space.
Each file contains an inode, and files are uniquely identified in the file system by their inode numbers. Each inode contains the following information:
device where the inode resides
locking information
mode and type of file
number of links to the file
owner’s user and group IDs
number of bytes in the file
access and modification times
time that the inode was last modified
addresses of the file’s blocks on disk
Yet another advanced feature of the ReiserFS is that it uses plug-in based, objectoriented, balanced tree algorithms. This allows the plug-in based objects to improve performance of the ReiserFS as newer algorithms are created to resolve issues found in the current objects. Therefore, monthly updates can improve performance of an already good file system. This is now the recommended file system and should be used on most modern installations of Linux — unless a specific reason dictates otherwise. The ext3 file system — once thought to be the next journaling system for Linux but is still in development — may never be used because the ReiserFS has found a home on most systems.
Chapter 4 Installing Linux |
97 |
After you have selected the file system, you must create the individual file structure. Workstations generally employ a basic structure that includes a / (slash) partition, a /home partition, and a swap partition (a variant of this is to also include a /usr partition). The most basic structure is a / and swap partition. The size of these partitions should be determined by the size of the hard drive, but given the low price of hard drives, installers can use a size structure similar to the information presented in Table 4-5.
Table 4-5
Simple workstation partition
Partition |
Size |
Notes |
|
|
|
/ |
500 MB |
Usually this is enough space |
|
|
|
/usr |
2900 MB |
Often has many subdirectories |
|
|
|
/home |
12000 MB |
Lots of space for users |
|
|
|
Swap |
256 MB |
Determined by the amount of system memory |
|
|
|
This table shows a simple structure that could be used. Each individual system needs to be sized according to the needs of the server, which often include the preceding structures and an additional partition of /var. This structure changes the sizes of the partitions to a partition scheme similar to the one demonstrated in Table 4-6.
Table 4-6
Simple server partition
Partition |
Size |
Notes |
|
|
|
/ |
256MB |
Usually this is enough space |
|
|
|
/usr |
2900MB |
Often has many subdirectories |
|
|
|
/home |
6900MB |
Lots of space for users |
|
|
|
/var |
5500MB |
Need for large system logs |
|
|
|
Swap |
384MB |
Determined by the amount of system |
|
|
memory, the recommended minimum is |
|
|
equal to the RAM in the system |
|
|
|
98 |
Part II Installation |
After you have determined and entered the partitioning using either Disk Druid or fdisk, the partitions need to be activated. To do this, the partition table must be written to the hard drive. Until this point, all of the information that has been entered exists only in memory. After you have committed the partition to the hard drive, the existing data on a hard drive will be lost, and the new partitions will be placed on the drive. Also up to this point, a reboot of the system will return the system to its previous state. After the partition is written, a new operating system must be installed. When this decision has been made, the screen shown in Figure 4-7 — or one like it — will be presented.
Figure 4-7: The Red Hat “choose partitions to format” screen
On this screen, you can select the partitions to be written, plus you are given the option to test the hard drive for bad blocks while the formatting is being done. I recommend taking this action on all but the most trusted hard drives because even brand new drives may have been damaged in shipping or installation. This is the final opportunity to abandon the installation without changing the existing system. To continue from this point will complete the partitioning of the system and its preparation for the installation of Linux.