- •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
Chapter 8 User Environment Settings 267
Adding a hard drive
After you have installed the drive, add a hard drive to mirror the creation of the swap partition. To physically install a hard drive, you must plan several items, including:
Determine the type of hard drive that you need — usually IDE (Integrated Drive Electronics) or SCSI (Small Computer System Interface)
Determine the current settings of devices in use. For IDE, this includes the channel (primary or secondary) and device on channel (master or slave). For SCSI, the ID’s used are 0-15 for wide SCSI or 0-7 for narrow devices.
Select an unused ID for the new hard drive
Plan the file system for the new hard drive
Install the new hard drive
Partition and format the file system for the new hard drive
Mount the newly created file system
By using this general guide for installing a hard drive, the configuration can proceed simply and easily. The use of IDE or SCSI can be seen with formatting disk tools that identify disks as hda or sda; “h” represents IDE, and “s” represents SCSI disks.
The selection of the settings for the drive, however, is a bit more complicated. You must first select a free device ID while avoiding any current devices attached to the system. Normally, IDE devices are simpler because they have only two devices attached to one cable. You have three options for addressing IDE devices: Master, slave, and cable select. When adding devices to an IDE cable, the existing device is most often a master device. You can only determine this, however, by actually verifying the ID in use.
Don’t be fooled by the system detection of the hard drive during system initialization. When a hard drive is installed as the only device, it is often automatically detected as the master device. However, if you attach a second device, a jumper must be installed to assign the drive as master or slave. If you don’t do this, the first drive or both of the drives will not be detected by the system.
To verify the device ID’s, you need to physically look at the device’s jumpers, which are similar to the one shown in Figure 8-1.
268 Part III Configuration
Master |
Slave |
Cable |
|
|
Select |
Figure 8-1: A Device Jumper
Most drives have a jumper map label attached to make the task of determining the ID a little easier. Figure 8-1 shows only three jumpers, but often more options are available to allow the disk to be configured for older systems that may not support the features of the drive. Master devices are usually bootable on the primary IDE channel. Some systems can boot from other devices, but for the sake of consistency, the master drive on the primary IDE controller is the boot device for IDE systems. However, it is best to verify the device mapping, such as hda or hdb, to ensure that the hardware ID matches the system identification.
See Chapter 5 for more information about verifying hard drive ID and Linux identification.
After you have determined the system and the current device’s ID, you can add the new hard drive. For this example, assume that the current drive is the master on the primary IDE controller and that the new drive is the slave on the primary IDE controller. Using correct ESD (electro-static discharge) protection methods — usually, you use a grounding strap — place the jumper over the correct set of pins to assign the drive to slave status. Insert the drive into the system and attach to the cable.
Verify that the cable is not “cable select” by inspecting the cable for breaks. A break usually consists of a small hole in the cable, and is used to automatically assign addresses to devices. If the system is using “cable select,” both devices should set to use cable select.
After you have configured the IDE device, what should you do about SCSI? SCSI devices, like IDE, also are configured with separate device ID’s. SCSI is most often used in servers, but can also be used on workstations. Basic wide SCSI configuration uses up to 16 IDs to identify SCSI devices; one of these devices is used for the SCSI controller. Most newer SCSI devices can be configured by setting the ID number on a special numbered switch. Some SCSI devices use jumpers to set the ID of the device, and they use a binary system to identify the number. The 4 jumpers
Chapter 8 User Environment Settings 269
are representatives of the place markers 0, 2, 4, 8 (and are labeled as such) in the binary math scheme; reading from left to right the numbers are as follows: 8, 4, 2, 0. Table 8-2 demonstrates how this works.
Table 8-2
SCSI ID’s
Binary Number |
SCSI ID |
Jumpers used |
Linux ID |
|
|
|
|
0000 |
0 |
: : : : |
sda |
|
|
|
|
0001 |
1 |
: : : | |
sdb |
|
|
|
|
0010 |
2 |
: : | : |
sdc |
|
|
|
|
0011 |
3 |
: : | | |
sdd |
|
|
|
|
0100 |
4 |
: | : : |
sde |
|
|
|
|
0101 |
5 |
: | : | |
sdf |
|
|
|
|
0110 |
6 |
: | | : |
sdg |
|
|
|
|
0111 |
7 |
: | | | |
sdh |
|
|
|
|
1000 |
8 |
| : : : |
sdi |
|
|
|
|
1001 |
9 |
| : : | |
sdj |
|
|
|
|
1010 |
10 |
| : | : |
sdk |
|
|
|
|
1011 |
11 |
| : | | |
sdl |
|
|
|
|
1100 |
12 |
| | : : |
sdm |
|
|
|
|
1101 |
13 |
| | : | |
sdn |
|
|
|
|
1110 |
14 |
| | | : |
sdo |
|
|
|
|
1111 |
15 |
| | | | |
sdp |
|
|
|
|
Narrow SCSI devices use only three jumpers, so only the information shown up to “7” in the table applies. Using this information to verify the SCSI IDs is often a fairly simple task; however, not all SCSI drives use an easy-to-set jumper pattern. Always verify IDE and SCSI jumpers with the drive manufacturer. Select an unused ID and add the SCSI drive to the system in the same manner as you would add an IDE device. (Note one exception to this: SCSI devices can have many more IDE devices on one controller.) After you have installed the hard drive into the system, it must be configured in order for Linux to use it. You can configure the hard drive by using a disk-partitioning tool, such as cfdisk.
See Chapter 5 for more information about using cfdisk.
270 Part III Configuration
Unlike the original Linux installation, in which filesystems are created automatically, you need to make a filesystem on your new hard drives manually. On some systems you can use a setup utility, but most often you will use manual configuration. The mkfs command is used to build a Linux file system on a device — usually a hard drive partition. The use of mkfs is performed with the switches shown in Table 8-3.
|
Table 8-3 |
|
Switches used with mkfs |
|
|
Switch |
Description |
|
|
-V |
Produce verbose output, including all file system-specific commands |
|
that are executed. |
|
|
-t fstype |
Specifies the type of file system to be built. If it is not specified, the |
|
default file system type (currently ext2) is used. |
|
|
fs-options |
File system-specific options to be passed to the real file system |
|
builder. Although not guaranteed, most file system builders support |
|
the following options. |
|
|
fs -c |
Check the device for bad blocks before building the file system. |
|
|
fs -l filename |
Read the bad blocks list from filename. |
|
|
fs -v |
Produce verbose output. |
|
|
The standard command used to create a file system looks similar to this:
mkfs [-V] [-t fstype] [fs-options] filesys [blocks]
When this command completes, the mkfs program returns an exit code with 0 on success and 1 on failure. After this program is used, the file system is created and must be mounted, which you do by using the mount command, and can be automounted by using the fstab file. This allows the new hard drive to be used and completes the installation of the hard drive.
Video and monitor
3.10 Reconfigure boot loader (e.g., LILO)
When video cards and monitors are installed on the Linux system you usually are only required to reconfigure the X Window System by using Linux video configuration tools such as XF86config. However, you may experience situations in which you desire more complex configurations, including an update of the XF86 program or the Desktop Environment. You may want to perform these configurations in order to provide the best support of the newly installed video card.
Chapter 8 User Environment Settings 271
See Chapter 5 for more information about installing and upgrading software.
You can install any necessary modules by using the following information, according to the Linux HOW TO. You need to decide what to compile into the kernel such as which modules to include. You will make the actual choices during the compilation, during the second stage of the following sequence of instructions:
cd /usr/src/linux make menuconfig
make dep clean modules modules_install zImage
After you have completed these commands, you need to map out the module dependencies, which you can do by using the following command:
depmod -a
At this point, you need to add the newly created kernel to the boot menu of LILO, by adding the following lines to the lilo.conf file, which is normally located at
/etc/lilo.conf:
image=/usr/src/linux/arch/i386/boot/zImage
label=new
alias=n read-only vga=ask optional
A complex lilo.conf may look something like this:
boot=/dev/hda
map=/boot/map
install=/boot/boot.b
vga=normal
default=linux
keytable=/boot/us.klt
lba32 prompt timeout=50
message=/boot/message menu-scheme=wb:bw:wb:bw image=/boot/vmlinuz
label=linux
root=/dev/hda1
initrd=/boot/initrd.img append=” quiet” vga=788
read-only
272 Part III Configuration
image=/boot/vmlinuz label=linux-nonfb root=/dev/hda1 initrd=/boot/initrd.img read-only
image=/boot/vmlinuz
label=failsafe
root=/dev/hda1
initrd=/boot/initrd.img append=” failsafe” read-only
other=/dev/hdb1
label=windows
table=/dev/hdb map-drive=0x80
to=0x81 map-drive=0x81
to=0x80
other=/dev/fd0
label=floppy unsafe
Use care when editing this file or you risk losing access to one of your other operating systems that are defined in LILO. Next, using a text editor, create a new file called /etc/rc.d/init.d/modules.init, which is the most common name used in most Linux distributions, that will be used to configure modules into the kernel. Enter the following text in the new file:
#Modules initialisation.
#Start up the module auto-loading daemon. /sbin/kerneld
#Mount all currently unmounted auto-mounted partitions. /sbin/mount -a
Then, the following commands are used to enable the newly created file:
cd /etc/rc.d
chmod 755 init.d/* cd rc3.d
ln -s ../init.d/modules.init 05modules.init
You can now reboot the system and use the new kernel with the new modules. Some distributions require a different configuration, so be sure to verify the location of the files and the commands to use for your specific distribution. The preceding commands should work with most Red Hat and Debian-based distributions. You can use this method with other devices, such as Ethernet cards and modems. After you have installed any of these devices, you must configure them by using the tool for the device; netconfig or linuxconf work well for network devices.