- •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
146 Part II Installation
Package selection and installation
Finally, select only those packages that are required for the machine to provide the desired service. By limiting the number of installed packages, the number of potential security vulnerabilities will also be limited. Therefore, when installing a workstation, don’t install everything because doing so opens the systems to the security risk of a Web server — even if the workstation is not using the software to provide Web pages.
A Dual-Boot Installation of Linux
Linux can accomplish most tasks quite easily, but some software programs will only run on a different operating system. In these situations, you may want to create a system that will be able to use two operating systems. This is called a dual-boot system, which Linux supports very well. You will probably encounter some issues when creating a dual-boot system, but planning can resolve these issues. The most important rule to follow when creating a dual-boot system is to use a method that doesn’t destroy the data already existing on the HDD. The best way to accomplish this is to create an installation path. Some systems work extremely well with Linux, but others are not so Linux-friendly. The ability to establish a dual-boot system is a growing need and a skill that any installer should consider learning.
Linux with Microsoft Windows
Linux can be installed with most Microsoft products fairly easily, which is due to the ability of Linux to use the FAT16 and FAT32 partition types.
Linux does not support FAT32 before the 2.0.34 kernel release. If you are using an older version of Linux, verify that the kernel is at least at this level if you want FAT32 support. This level of support allows operating systems to share files.
These types of partitions are used for Microsoft Windows 9x, ME, DOS, and Windows 3.1, and allow LILO to be installed with options to boot both Linux and these Microsoft products. The task of creating a dual-boot system on a PC with Microsoft Windows 9X already installed is fairly straightforward:
1.Begin installing Linux on a Microsoft Windows 9X system.
2.When prompted, place LILO in the MBR or in the Linux root partition’s boot sector.
3.If LILO is installed in the MBR, it will read the existing operating system partition(s) and create a DOS or Windows menu item.
Chapter 5 Advanced Installation 147
4.If it is installed on the root partition of Linux, the root partition of Linux must be set as the active partition to boot from.
Before attempting to create any dual-boot system (or before installing or using another operating system, partitioning software, or boot manager), be sure to back up all data on the existing operating system. If the configuration fails or is done improperly, the existing operating system may be rendered useless and all data may be lost.
The LILO menu item allows the previously installed version of Microsoft Windows to be selected when booting the system. Sometimes, however, this fails to work, so the root user in Linux — the file /etc/lilo.conf — must be edited. The file looks something like this:
boot=/dev/hda
map=/boot/map
install=/boot/boot.b prompt
timeout=50
message=/boot/message linear
default=linux
image=/boot/vmlinuz-2.4.2-2 label=linux
read-only root=/dev/hda7
You will need to add lines to the file to enable the ability to boot a separate Windows partition. Before adding these in, you will need to ascertain which hard drive and partition contains Windows. Table 5-2 outlines the way that Linux identifies the various hard drive types.
Table 5-2 |
|
Linux HDD Identification |
|
|
|
Disk Locations |
Linux Disk Identification |
|
|
Primary IDE controller-drive 0 or Master |
/dev/hda or hda |
|
|
Primary IDE controller-drive 1 or Slave |
/dev/hdb or hdb |
|
|
Secondary IDE controller-drive 0 or Master |
/dev/hdc or hdc |
|
|
Secondary IDE controller-drive 1 or Slave |
/dev/hdd or hdd |
|
|
SCSI Controller-SCSI ID 0 |
/dev/sda or sda |
|
|
SCSI Controller-SCSI ID 1 |
/dev/sdb or sdb |
|
|
SCSI Controller-SCSI ID 2 |
/dev/sdc or sdc |
|
|
148 Part II Installation
This hard drive identification table is an excellent place to start when you are attempting to determine hard drive naming in Linux. This table is only a basic one, however, because it only takes into account single IDE or SCSI controllers. The partitions contained on the disk are numbered 1-X, where X is the total number of partitions. Therefore, in the preceding example of the /etc/lilo.conf, the hard drive is /dev/hda or the master Primary IDE controller. Microsoft Windows 9X is installed on the first partition of this drive, or hda1. To add Microsoft Windows to the LILO menu, simply add the following lines:
other=/dev/hda1
label=windows
You can boot Microsoft Windows from LILO by typing windows at the LILO boot prompt. This method also works if Microsoft Windows 9X has been added to a Linux PC. You may have to reinstall LILO to be able to boot the system, but this is a situation that you are prepared for if you created the bootable diskette during the installation of Linux. From this diskette, you are capable of restoring LILO if it was damaged during the installation of Microsoft Windows.
Linux with Microsoft Windows NT and 2000
Dual booting with Windows NT and 2000 is more complicated. If you use a FAT16 or FAT32 partition for the Microsoft Windows NT or 2000 operating system, then the method used for Microsoft Windows 9X should work. If, however, NTFS is the file system that you use, the NT boot loader is not compatible with LILO in the MBR. This means that LILO must not be installed in the MBR or the Microsoft operating system won’t boot. To get around this situation, install LILO in the root partition of Linux and on a diskette. Complete the installation of Linux and reboot the system with the diskette that you used to boot Linux. After you are in Linux, use the following commands to copy a binary image of the boot sector to a blank diskette:
mount -t msdos /dev/fd0 /mnt/floppy
dd if=/dev/hda5 bs=512 count=1 of=/mnt/floppy/linux.bin
Then, remove the floppy and reboot the system into Microsoft Windows NT or 2000. You will need to edit the file boot.ini at this point. Open boot.ini in a plain text editor, such as notepad, and add the following line:
c:\linux.bin=”Linux”
Save the file boot.ini and exit the text editor. Then, copy the file linux.bin from the floppy to the HDD in the root directory of the Microsoft Windows HDD. This allows the startup menu of Microsoft Windows NT or 2000 to display the Linux line and gives it the linux.bin file, which contains directions detailing where to boot this operating system. This should allow Linux to dual-boot with Microsoft Windows NT or 2000.
Chapter 5 Advanced Installation 149
Linux and Solaris
You can easily dual-boot Linux with Solaris. To create a dual-boot between Linux and Solaris:
1.Install Linux on the system. Create partition 8 for Linux root, and partition 7 for Linux swap, leaving partition 1 for SunOS root and partition 2 for SunOS swap.
2.Install SILO (Sparc Improved Boot Loader), which is the LILO equivalent in the Sun platform world, in the Linux root partition.
3.Allow SILO to create an entry in nvalias to allow the system to boot.
4.Boot the system to verify that the Linux installation was successful.
5.Halt the system and proceed to install Solaris. When the Solaris installer asks if data should be preserved, do so to save the Linux partitions.
6.Continue to install Solaris in partition 0 (the first partition that was created).
7.Answer “yes” when the installation program inquires about making the new root partition the default boot in NVRAM. Then continue the installation as usual. After the installation is complete, the system prompts you to be rebooted into Solaris. Do this to verify the installation of the Solaris operating system, and then halt the system.
8.Enter the “show-disks” to list the disk paths that are needed to dual-boot the system. You also need the path formats for the disk, which you can obtain with the “devalias” command. With this information, enter the following to allow the system to dual-boot on an IDE system with one disk:
nvalias linux <disk_path_from_above>@0,0:h nvalias solaris <disk_path_from_above>@0,0:a
(to boot Solaris by default) setenv boot-device disk:a
(to boot Linux by default) setenv boot-device disk:h
This configuration allows Linux to dual-boot with the Solaris operating system.
Linux and other operating systems
Linux can be configured in many ways to dual-boot with other operating systems. The one major responsibility to keep in mind is to always back up the data on the existing operating system to protect it — just in case anything goes wrong. Dualbooting a system with Linux and other operating systems allows you to run multiple operating system on one computer. This is helpful if you have certain applications or tools that only can run in one particular operating system.
