LPI Linux Certification in a Nutshell - LightNovelsOnl.com
You're reading novel online at LightNovelsOnl.com. Please use the follow button to get notifications about your favorite novels and its latest chapters so you can come back anytime and won't miss anything.
LPI Linux Certification in a Nutsh.e.l.l.
by James Stanger, Adam Haeder, Stephen Schneiter, and Bruno Gomes Pessanha.
Preface
Certification of professionals is a time-honored tradition in many fields, including medicine and law. As small computer systems and networks proliferated over the last decade, Novell and Microsoft produced extremely popular technical certification products for their respective operating system and network technologies. These two programs are often cited as having popularized a certification market for products that had previously been highly specialized and relatively rare. These programs have become so popular that a huge training and preparation industry has formed to service a constant stream of new certification candidates.
Certification programs, offered by vendors such as Sun and Hewlett-Packard, have existed in the Unix world for some time. However, since Solaris and HP-UX aren't commodity products, those programs don't draw the crowds that the PC platform does. Linux, however, is different. Linux is both a commodity operating system and is PC-based, and its popularity continues to grow at a rapid pace. As Linux deployment increases, so too does the demand for qualified and certified Linux system administrators.
A number of programs such as the Linux Professional Inst.i.tute (LPI), the Red Hat Certified Engineer (RHCE) program, and CompTIA's Linux+ have formed to service this new market. Each of these programs seeks to provide objective measurements of a Linux administrator's skills, but they approach the problem in different ways.
The RHCE program requires that candidates pa.s.s multiple exam modules, including two hands-on and one written, whose goals are to certify individuals to use their brand of products. The Linux+ program requires a single exam and is focused at entry-level candidates with six months' experience. LPI's program is a job-based certification and currently consists of three levels; this book focuses on the most basic level.
The Linux Professional Inst.i.tute The Linux Professional Inst.i.tute is a nonprofit organization formed with the single goal of providing a standard for vendor-neutral certification. This goal is being achieved by certifying Linux administrators through a modified open source development process. LPI seeks input from the public for its exam Objectives and questions, and anyone is welcome to partic.i.p.ate. It has both paid and volunteer staff and receives funding from some major names in the computer industry. The result is a vendor-neutral, publicly developed program that is offered at a reasonable price. is a nonprofit organization formed with the single goal of providing a standard for vendor-neutral certification. This goal is being achieved by certifying Linux administrators through a modified open source development process. LPI seeks input from the public for its exam Objectives and questions, and anyone is welcome to partic.i.p.ate. It has both paid and volunteer staff and receives funding from some major names in the computer industry. The result is a vendor-neutral, publicly developed program that is offered at a reasonable price.
LPI currently organizes its most popular Linux Professional Inst.i.tute Certification (LPIC) series in three levels. This book covers the LPIC Level 1 Exams 101 and 102.
Level 1 is aimed at junior to midlevel Linux administrators with about two years of practical system administration experience. The Level 1 candidate should be comfortable with Linux at the command line as well as capable of performing simple tasks, including system installation and troubleshooting. Level 1 certification is required prior to obtaining Level 2 certification status.
All of LPI's exams are based on a published set of technical Objectives. These technical Objectives are posted on LPI's website and for your convenience printed at the beginning of each chapter within this book. Each Objective set forth by LPI is a.s.signed a numeric weight, which acts as an indicator of the importance of the Objective. Weights run between 1 and 8, with higher numbers indicating more importance. An Objective carrying a weight of 1 can be considered relatively unimportant and isn't likely to be covered in much depth on the exam. Objectives with larger weights are sure to be covered on the exam, so you should study these closely. The weights of the Objectives are provided at the beginning of each chapter.
LPI offers its exams through Pearson VUE, Thomson Prometric, and at on-site locations at special Linux events, such as trade shows. Before registering for any of these testing methods, you need to obtain an LPI ID number by registering directly with LPI. To obtain your LPI ID, visit http://www.lpi.org/register.html. Once you've received your LPI ID, you may continue your registration by registering with a testing center or special event. You can link to any of these registration options through LPI's website.
In Vue and Prometric testing centers, the exams are delivered using a PC-based automated examination program. As of this writing, the exams are available in English, j.a.panese, Chinese (both Traditional and Simplified), German, Spanish, Portuguese, and French. Exam questions are presented in three different styles: multiple-choice single-answer, multiple-choice multiple-answer, and fill-in-the-blank. However, the majority of the questions on the exams are multiple-choice single-answer. Also, with the multiple-choice questions, the candidate is told exactly how many answers are correct.
For security purposes, multiple forms of each exam are available at testing centers to help minimize memorization and brain dumps of exams if candidates take them multiple times. Due to this, actual question numbers may vary slightly. LPI's psychometric team develops these forms and adjusts the scoring appropriately so all forms are equally difficult. The scores are between 200 and 800, and pa.s.sing score is 500.
Acknowledgments
For the third edition, we thank reviewers Don Corbet, Jon La.r.s.en, Gregor Purdy, Rick Rezinas, G. Matt Rice, and Craig Wolf.
Adam Haeder dedicates his work to Tina, Erin, Ethan, Stanley, and Stefon: the reason I work so late into the night.
Bruno dedicates his work to his grandfather, Oswaldo Cabral Pessanha, in memoriam.
Chapter1.LPI Exams
LPI Exam 101 is one of two exams required for the LPIC Level 1 (officially referred to as LPIC 1) certification. In total, ten major Topic areas are specified for Level 1; this exam tests your knowledge on four of them.
Exam Topics are numbered using the topic.objective topic.objective notation (e.g., 101.1, 101.2, 102.1). The 100 series topics represent LPI Level 1 certification topics, which are unique to all levels of LPI exams (e.g., 101, 102, 201, 202, etc.). The objective number represents the Objectives that are a.s.sociated with the Topic area (e.g., 1, 2, 3, 4, and so on). notation (e.g., 101.1, 101.2, 102.1). The 100 series topics represent LPI Level 1 certification topics, which are unique to all levels of LPI exams (e.g., 101, 102, 201, 202, etc.). The objective number represents the Objectives that are a.s.sociated with the Topic area (e.g., 1, 2, 3, 4, and so on).
The Level 1 Topics are distributed between the two exams to create tests of similar length and difficulty without subject matter overlap. As a result, there's no requirement for or advantage to taking them in sequence, the only caveat being that you cannot be awarded an LPIC 2 or higher certifications until you pa.s.s the requirements for the lower-level certification.
Each Topic contains a series of Objectives covering specific areas of expertise. Each of these Objectives is a.s.signed a numeric weight, which acts as an indicator of the importance of the Objective. Weights typically run between 1 and 8, with higher numbers indicating more importance. An Objective carrying a weight of 1 can be considered relatively unimportant and isn't likely to be covered in much depth on the exam. Objectives with larger weights are sure to be covered more heavily on the exam, so you should study these Topics closely. The weights of the Objectives are provided at the beginning of each Topic section. In the current version of LPI exams, all of the weighting totals for each exam add up to 60. With 60 questions per exam, this means that the weighting is exactly equivalent to how many questions the Objective will have in the exam.
The Topics for Exam 101 are listed in Table1-1 Table1-1.
Table1-1.LPI Topics for Exam 101
Name Number of objectives Description System Architecture 3 These Objectives cover all the fundamentals of configuring common types of hardware on the system, managing the boot process, and modifying the runlevels of the system and the shut down or reboot process from the command line.
Linux Installation and Package Management 5 Objectives for this Topic include the basics of getting any LSB-compliant Linux distribution installed and installing applications. Some of the basics include part.i.tioning hard drives, installing your choice of boot managers, managing shared libraries, and using Debian's dpkg and and apt apt family of commands and RPM and Yellowdog Updater Modified (YUM) package management systems. family of commands and RPM and Yellowdog Updater Modified (YUM) package management systems.
GNU and Unix Commands 8 This heavily weighted Topic addresses the most utilized command-line tools used on standard Linux systems as well as most commercial Unix systems. The Objectives detail working on a command line, processing text streams using command-line tools, managing files, manipulating text with pipes and redirects, monitoring system processes, managing task priorities, using regular expressions, and editing files with vi, lilo lilo, syslog, and runlevels.
Devices, Linux Filesystems, and the Filesystem Hierarchy Standard 8 Objectives for this Topic include the creation of part.i.tions and filesystems, filesystem integrity, mounting, quotas, permissions, owners.h.i.+p, links, and file location tasks.
As you can see from Table1-1 Table1-1, the Topic numbers a.s.signed by the LPI are not necessarily sequential. This is due to various modifications made by the LPI to its exam program as it developed. The Topic numbers serve only as reference and are not used on the exam.
Exam 101 lasts a maximum of 90 minutes and contains exactly 60 questions. The exam is administered using a custom application on a PC in a private room with no notes or other reference material. The majority of the exam is made up of multiple-choice single-answer questions. These questions have only one correct answer and are answered using radio b.u.t.tons. Some of them present a scenario needing administrative action. Others seek appropriate commands for a particular task or proof of understanding of a particular concept. Some people may get an exam with an additional 20 items. These items are used to test new questions and don't count as part of the score. An additional 30 minutes is provided in this case, and there is no indication which items are unscored.
About 10 percent of the exam questions are multiple-choice multiple-answer questions, which are answered using checkboxes. These questions specify that they have multiple correct responses, each of which must be checked to get the item correct. There is no partial credit for partially answered items. This is probably the most difficult question style because the possibility of multiple answers increases the likelihood of forgetting to include an answer, even though the candidate is told in the question exactly how many answers to select. But they also are a good test of your knowledge of Unix commands, since an incorrect response on any one of the possible answers causes you to miss the entire question.
The exam also has fill-in-the-blank questions. These questions provide a one-line text area input box for you to fill in your answer. These questions check your knowledge of concepts such as important files and commands, plus common facts that you are expected to be aware of. Don't let this scare you, however, since most of these items accept a variety of answers. Unless specified otherwise, they are not case-sensitive and do not require full paths in your answers.
Chapter2.Exam 101 Study Guide
The first part of this book contains a section for each of the four Topics found on LPI Exam 101. Each section details certain Objectives, which are described here and on the LPI website.
Exam Preparation LPI Exam 101 is thorough, but you should find it fairly straightforward if you have a solid foundation in Linux concepts. You won't come across questions intended to trick you, and you're unlikely to find ambiguous questions.
Exam 101 mainly tests your knowledge of facts, including commands and their common options, important file locations, configuration syntax, and common procedures. Your recollection of these details, regardless of your level of Linux administration experience, will directly influence your results.
For clarity, the material in the following sections is presented in the same order as the LPI Topics and Objectives. However, you may choose to study the Topics in any order you wish. To a.s.sist you with your preparation, Table2-1 Table2-1 through through Table2-4 Table2-4 list the Topics and Objectives found on Exam 101. Objectives within each Topic occupy rows of the corresponding table, including the Objective's number, description, and weight. The LPI a.s.signs a list the Topics and Objectives found on Exam 101. Objectives within each Topic occupy rows of the corresponding table, including the Objective's number, description, and weight. The LPI a.s.signs a weight weight for each Objective to indicate the relative importance of that Objective on the exam on a scale of 1 to 8. We recommend that you use the weights to prioritize what you decide to study in preparation for the exams. After you complete your study of each Objective, simply check it off here to measure and organize your progress. for each Objective to indicate the relative importance of that Objective on the exam on a scale of 1 to 8. We recommend that you use the weights to prioritize what you decide to study in preparation for the exams. After you complete your study of each Objective, simply check it off here to measure and organize your progress.
Table2-1.System architecture (Topic 101)
Objective Weight Description 1 2 Determine and Configure Hardware settings 2 3 Boot the System 3 3 Change Runlevels and Shut Down or Reboot System
Table2-2.Linux installation and package management (Topic 102)
Objective Weight Description 1 2 Design Hard Disk Layout 2 2 Install a Boot Manager 3 1 Manage Shared Libraries 4 3 Use Debian Package Management 5 3 Use RPM and YUM Package Management
Table2-3.GNU and Unix commands (Topic 103)
Objective Weight Description 1 4 Work on the Command Line 2 3 Process Text Streams Using Filters 3 4 Perform Basic File Management 4 4 Use Streams, Pipes, and Redirects 5 4 Create, Monitor, and Kill Processes 6 2 Modify Process Execution Priorities 7 2 Search Text Files Using Regular Expressions 8 3 Perform Basic File Editing Operations Using vi or vim
Table2-4.Devices, Linux filesystems, and the Filesystem Hierarchy Standard (Topic 104)
Objective Weight Description 1 2 Create Part.i.tions and Filesystems 2 2 Maintain the Integrity of Filesystems 3 3 Control Filesystem Mounting and Unmounting 4 1 Set and View Disk Quotas 5 3 Manage File Permissions and Owners.h.i.+p 6 2 Create and Change Hard and Symbolic Links 7 2 Find System Files and Place Files in the Correct Location
Chapter3.System Architecture (Topic 101.1)
This Topic requires general knowledge of fundamental PC architecture facts that you must know before attempting any operating system installation. It includes this Objective: Objective 1: Determine and Configure Hardware Settings Candidates should be able to determine and configure fundamental system hardware. Weight: 2.
Objective 1: Determine and Configure Hardware Settings Setting up a PC for Linux (or any other operating system) requires some familiarity with the devices installed in the system and their configuration. Items to be aware of include modems, serial and parallel ports, network adapters, SCSI adapters, hard drives, USB controllers, and sound cards. Many of these devices, particularly older ones, require manual configuration of some kind to avoid conflicting resources. The rest of the configuration for the system hardware is done in the PC's firmware, or Basic Input/Output System (BIOS).
BIOS The firmware located in a PC, commonly called the BIOS, is responsible for bringing all of the system hardware to a state at which it is ready to boot an operating system. Systems vary, but this process usually includes system initialization, the testing of memory and other devices, and ultimately locating an operating system from among several storage devices. In addition, the BIOS provides a low-level system configuration interface, allowing the user to choose such things as boot devices and resource a.s.signments. Quite a few BIOS firmware vendors provide customized versions of their products for various PC system architectures. Exams do require an understanding of the basics. For example, a laptop BIOS may differ significantly from a desktop system of similar capability from the same manufacturer. Due to these variations, it's impossible to test specifics, but the LPIC Level 1 exams do require an understanding of the basics.
At boot time, most PCs display a method of entering the BIOS configuration utility, usually by entering a specific keystroke during startup. Once the utility is started, a menu-based screen in which system settings can be configured appears. Depending on the BIOS vendor, these will include settings for disks, memory behavior, on-board ports (such as serial and parallel ports), and the clock, as well as many others.
Date and time One of the basic functions of the BIOS is to manage the on-board hardware clock. This clock is initially set in the BIOS configuration by entering the date and time in the appropriate fields. Once set, the internal clock keeps track of time and makes the time available to the operating system. The operating system can also set the hardware clock, which is often useful if an accurate external time reference, such as an NTPD server (see Chapter16 Chapter16), is available on the network while the system is running.
Disks and boot devices Another fundamental configuration item required in BIOS settings is the selection of storage devices. Newer systems are able to detect and properly configure much of this hardware automatically. However, older BIOS versions require manual configuration. This may include the selection of floppy disk sizes and disk drive parameters.
Most PCs have at least three bootable media types: an internal hard disk (IDE or SCSI, or perhaps both), a CD-ROM drive (again IDE or SCSI), and a floppy disk. After initialization, the BIOS seeks an operating system (or an operating system loader, such as the Linux Loader [LILO]) on one or more of these media. By default, many BIOS configurations enable booting from the floppy or CD-ROM first, then the hard disk, but the order is configurable in the BIOS settings.
In addition to these default media types, many server motherboard BIOS (as well as high-end system motherboards) support booting from a network device such as a NIC with a bootable ROM. This is often used when booting diskless workstations such as Linux-based terminals.
On the ExamYou should be familiar with the general configuration requirements and layout of the BIOS configuration screens for a typical PC.
Using the /proc filesystem When adding new hardware to an existing Linux system, you may wish to verify which resources the existing devices are using. The /proc /proc filesystem, the kernel's status repository, contains this information. The filesystem, the kernel's status repository, contains this information. The proc proc files, files, interrupts interrupts, dma dma, and ioports ioports, show how system resources are currently utilized. (These files may not show devices unless their device files/drivers are open/active. This may make the problem harder to find if you're experiencing resource conflicts.) The following is an example of /proc/interrupts /proc/interrupts from a dual-CPU system with an Adaptec dual-AIC7895 SCSI controller: from a dual-CPU system with an Adaptec dual-AIC7895 SCSI controller: #cat/proc/interrupts CPU0CPU1 0:986639890XT-PICtimer 1:3469834858IO-APIC-edgekeyboard 2:00XT-PICcascade 5:71417908IO-APIC-edgeMSSoundSystem 6:67IO-APIC-edgefloppy 8:1809827418140354IO-APIC-edgertc 10:32348673237313IO-APIC-levelaic7x.x.x,eth0 11:3635IO-APIC-levelaic7x.x.x 12:233140216205IO-APIC-edgePS/2Mouse 13:10XT-PICfpu 15:4411843935IO-APIC-edgeide1 NMI:0 ERR:0 In this example, you can see that interrupt 5 is used for the sound system, so it isn't available for a second parallel port. The two SCSI controllers are using interrupts 10 and 11, respectively, while the Ethernet controller shares interrupt 10. You may also notice that only one of the two standard IDE interfaces is enabled in the system BIOS, freeing interrupt 14 use for another device.
Here are the /proc/dma /proc/dma and and /proc/ioports /proc/ioports files from the same system: files from the same system: #cat/proc/dma 0:MSSoundSystem 1:MSSoundSystem 2:floppy 4:cascade #cat/proc/ioports 0000-001f:dma1 0020-003f:pic1 0040-005f:timer 0060-006f:keyboard 0070-007f:rtc 0080-008f:dmapagereg 00a0-00bf:pic2 00c0-00df:dma2 00f0-00ff:fpu 0170-0177:ide1 02f8-02ff:serial(auto) 0370-0371:OPL3-SAx 0376-0376:ide1 0388-0389:mpu401 03c0-03df:vga+ 03f0-03f5:floppy 03f7-03f7:floppyDIR 03f8-03ff:serial(auto) 0530-0533:WSSconfig 0534-0537:MSSoundSystem e800-e8be:aic7x.x.x ec00-ecbe:aic7x.x.x ef00-ef3f:eth0 ffa0-ffa7:ide0 ffa8-ffaf:ide1On the ExamYou should know how to examine a running Linux system's resource a.s.signments using the /proc /proc filesystem. filesystem.
Universal Serial Bus (USB) is a type of interface used to connect various types of peripherals, ranging from keyboards and mice to hard drives, scanners, digital cameras, and printers. The USB Objective covers the general architecture of USB, USB modules, and configuring USB devices.
USB Topology USB devices are attached to a host in a tree through some number of hub devices. The lsusb lsusb command can be used to see how devices are physically attached to a Linux system. command can be used to see how devices are physically attached to a Linux system.
#lsusb-t Bus#4 '-Dev#1Vendor0x0000Product0x0000 Bus#3 '-Dev#1Vendor0x0000Product0x0000 |-Dev#2Vendor0x046dProduct0xc501 '-Dev#3Vendor0x0781Product0x0002 Bus#2 '-Dev#1Vendor0x0000Product0x0000 |-Dev#2Vendor0x0451Product0x2036 ||-Dev#5Vendor0x04b8Product0x0005 |'-Dev#6Vendor0x04b8Product0x0602 '-Dev#3Vendor0x0451Product0x2046 '-Dev#4Vendor0x056aProduct0x0011 Bus#1 '-Dev#1Vendor0x0000Product0x0000 USB Controllers There are three types of USB host controllers: Open Host Controller Interface (OHCI) Universal Host Controller Interface (UHCI) Enhanced Host Controller Interface (EHCI) OHCI and UHCI controllers are both USB 1.1 controllers, which are capable of a maximum of 12 Mbps. EHCI controllers are USB 2.0 controllers, which are capable of a theoretical maximum of 480 Mbps. To get greater than USB 1.1 speeds, you must have a USB 2.0 controller, as well as USB 2.0 devices, hubs, and cables. A USB 2.0 device attached to a USB 1.1 hub will only be able to run at USB 1.1 speeds.
USB Devices There are several cla.s.ses of USB devices, including the following: Human Interface Device (HID) Input devices (mice, keyboards, etc.) Communications device Modems Ma.s.s storage device Disk devices, flash readers, etc.
Audio Sound devices IrDA Infrared devices Printer Printers and USB-to-parallel cables USB Drivers USB support was added to the Linux kernel in the 2.3.x development kernel series, then back-ported to 2.2.x, minus support for USB ma.s.s storage devices (due to SCSI changes in 2.3.x). The back-port was included in the 2.2.18 kernel release.
NoteThere is no no kernel USB support in 2.0.x and earlier. kernel USB support in 2.0.x and earlier.
The Linux kernel USB drivers fall into three categories: Host controller drivers The USB host controller drivers include usb-ohci.o usb-ohci.o (OHCI driver), (OHCI driver), usb-uhci.o usb-uhci.o (UHCI driver), (UHCI driver), uhci.o uhci.o (old "alternate" UHCI driver), and (old "alternate" UHCI driver), and ehci-hcd.o ehci-hcd.o (EHCI driver). (EHCI driver).
Cla.s.s drivers The USB cla.s.s drivers include hid.o hid.o, usb-storage.o usb-storage.o (ma.s.s storage driver), (ma.s.s storage driver), acm.o acm.o (Automated Control Model [ACM] communications cla.s.s driver, which deals with modems that emulate the standard serial modem (Automated Control Model [ACM] communications cla.s.s driver, which deals with modems that emulate the standard serial modem AT AT command interface), command interface), printer.o printer.o, and audio.o audio.o.