Linux Student Exercises.pdf

82
7/27/2019 Linux Student Exercises.pdf http://slidepdf.com/reader/full/linux-student-exercisespdf 1/82 Linux Jumpstart for UNIX System Administrators   (Course code LX15) Student Exercises ERC 7.1  5.4.0.3 over Front cover

Transcript of Linux Student Exercises.pdf

Page 1: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 1/82

Linux Jumpstart for UNIX System Administrators  (Course code LX15)

Student ExercisesERC 7.1

 

5.4.0.3

over

Front cover

Page 2: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 2/82

Student Exercises 

August 2011 edition

The information contained in this document has not been submitted to any formal IBM test and is distributed on an “as is” basis without

any warranty either express or implied. The use of this information or the implementation of any of these techniques is a customer

responsibility and depends on the customer’s ability to evaluate and integrate them into the customer’s operational environment. While

each item may have been reviewed by IBM for accuracy in a specific situation, there is no guarantee that the same or similar results will

result elsewhere. Customers attempting to adapt these techniques to their own environments do so at their own risk.

 

 © Copyright International Business Machines Corporation 2002, 2011.

This document may not be reproduced in whole or in part without the prior written permission of IBM.

Note to U.S. Government Users — Documentation related to restricted rights — Use, duplication or disclosure is subject to restrictions

set forth in GSA ADP Schedule Contract with IBM Corp.

Trademarks

IBM® and the IBM logo are registered trademarks of International Business Machines

Corporation.

The following are trademarks of International Business Machines Corporation, registered in

many jurisdictions worldwide:

PostScript is either a registered trademark or a trademark of Adobe Systems Incorporated

in the United States, and/or other countries.

Intel and Pentium are trademarks or registered trademarks of Intel Corporation or its

subsidiaries in the United States and other countries.

Linux is a registered trademark of Linus Torvalds in the United States, other countries, or

both.Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other

countries, or both.

UNIX is a registered trademark of The Open Group in the United States and other

countries.

Other product and service names might be trademarks of IBM or other companies.

AIX® Current® GPFS™Notes® Power® PowerPC®  

PowerPC® 

Page 3: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 3/82

Student Exercises 

5.4.0.3

OC

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 ©Copyright IBM Corp. 2002, 2011 Contents iii

Contents

Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii

Exercises description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix

Exercise 1. Advanced Linux Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2Part 1: Select your correct machine type and access your machine . . . . . . . . . . . . . . . 1-3Part 2: Select and load the boot media . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-4Part 3: Select the proper distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5

Exercise 2. Linux documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2Section 1: Manual pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2Section 2: Info command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2

Section 3: Other documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3

Exercise 3. Startup and shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2Section 1: The GRUB boot loader (x86) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2Section 2: The YABOOT boot loader (ppc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2Section 3: Retrieving kernel messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2Section 4: Setting the default runlevel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3Section 5: Configuring services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3Section 6: Using single-user mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4

Exercise 4. System administration tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-14.1. Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-2Section 1: Working with various system administration tools: SLES11 . . . . . . . . . . . . . 4-2Section 2: Working with various system administration tools: RHEL . . . . . . . . . . . . . . . 4-34.2. Optional exercise: Installing Webmin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5Section 1: Downloading and installing Webmin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5Exercise review and wrap-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-6

Exercise 5. Package management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2Section 1: Retrieving information about installed packages . . . . . . . . . . . . . . . . . . . . . . 5-2Section 2: Installing packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2Section 3: Using a package management frontend . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2Section 4: Creating RPMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3

Exercise 6. X Window System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-1Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2Section 1: Configuring Xorg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2Section 2: Running X applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2

Page 4: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 4/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

iv Linux Jumpstart for UNIX ©Copyright IBM Corp. 2002, 2011

Section 3: Running applications over a network (optional) . . . . . . . . . . . . . . . . . . . . . . 6-3Section 4: Running X-sessions over a network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4Exercise review and wrap-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-5

Exercise 7. User administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7-1Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2Section 1: User environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2

Section 2: User administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2Section 3: Communicating with the users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-3

Exercise 8. Block devices, RAID, and LVM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8-1Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2Section 1: Working with RAM disks (optional) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2Section 2: Working with partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2Section 3: Preparing for RAID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3Section 4: Working with RAID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3Section 5: Working with LVM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4

Exercise 9. File systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9-1Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2Section 1: Creating Linux file systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2Section 2: Automatically mounting file systems at system startup . . . . . . . . . . . . . . . . . 9-2Section 3: Changing file system size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2Section 4: Working with files with multiple names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3Section 5: Configuring user quota . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3

Exercise 10. Kernel configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-1Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2

Section 1: Viewing the current kernel configuration . . . . . . . . . . . . . . . . . . . . . . . . 10-2 Section 2: Changing the running kernel configuration . . . . . . . . . . . . . . . . . . . . . . . . . 10-2

Exercise 11. Memory management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-1Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2Section 1: Reduce the amount of configured RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2Section 2: Using top . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2Section 3: Checking swap space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3Section 4: Using the cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3Section 5: Using the swap space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3Section 6: Creating a swap file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-4

Exercise review and wrap-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-6

Exercise 12. Virtualization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-1Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2Section 1: Create file system to store Xen disk images (RHE6, SLES11) . . . . . . . . . . 12-2Section 2: Installing Xen (SUSE Linux Enterprise Server 11) . . . . . . . . . . . . . . . . . . . 12-3Section 3: Installing a guest domain (SLES11) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3Section 4: Installing Xen (RHEL6) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-4Section 5: Installing a guest domain (RHEL6) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-5

Page 5: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 5/82

Student Exercises 

5.4.0.3

OC

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 ©Copyright IBM Corp. 2002, 2011 Contents v

Section 6: Changing memory allocation of a guest machine (RHEL6/SLES11) . . . . . 12-6

Exercise 13. Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-1Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2Section 1: Install problem creation scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2Section 2: Problem #1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2Section 3: Problem #2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2

Section 4: Problem #3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2Section 5: Problem #4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-3Section 6: Problem #5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-3Exercise review/wrapup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-4

Page 6: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 6/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

vi Linux Jumpstart for UNIX ©Copyright IBM Corp. 2002, 2011

Page 7: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 7/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Trademarks vii

5.4.0.3

MK Trademarks

The reader should recognize that the following terms, which appear in the content of this

training document, are official trademarks of IBM or other companies:

IBM® and the IBM logo are registered trademarks of International Business Machines

Corporation.

The following are trademarks of International Business Machines Corporation, registered in

many jurisdictions worldwide:

PostScript is either a registered trademark or a trademark of Adobe Systems Incorporated

in the United States, and/or other countries.

Intel and Pentium are trademarks or registered trademarks of Intel Corporation or itssubsidiaries in the United States and other countries.

Linux is a registered trademark of Linus Torvalds in the United States, other countries, or

both.

Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other

countries, or both.

UNIX is a registered trademark of The Open Group in the United States and other

countries.

Other product and service names might be trademarks of IBM or other companies.

AIX® Current® GPFS™

Notes® Power® PowerPC®  

PowerPC® 

Page 8: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 8/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

viii Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Page 9: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 9/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercises description ix

5.4.0.3

ef Exercises description

This course includes the following exercises:

• Installing Linux

• Linux documentation

• Startup and shutdown

• System administration tools

• Package management

• X Window System

• User administration

• Block devices, Raid, and LVM

• File systems

• Kernel configuration

• Memory management

• Virtualization

• Troubleshooting

These exercises will teach you how to install, configure, and use

Linux. The exercises are largely independent of each other, except for

“Installing Linux” and “Block devices, RAID, and LVM.” These two

exercises must be done as they provide information and needed

structures for succeeding exercises.

Each exercise in this course is divided into sections as described

below. Select the section that best fits your method of performing

exercises. You may elect to use a combination of these sections as

appropriate.

Exercise instructions: This section contains what it is you are to

accomplish. There are no definitive details on how to perform the

tasks. You are given the opportunity to work through the exercise

given what you learned in the unit presentation, utilizing the unit

Student Notebook, your past experience, and maybe a little intuition.

This course includes two versions of the course exercises, “with hints”

and “without hints”.

The standard “Exercise instructions” section provides high-level

instructions for the tasks you should perform. You need to apply the

knowledge you gained in the unit presentation to perform the exercise.

Page 10: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 10/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

x Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

The “Exercise instructions with hints” provide more detailed

instructions and hints to help you perform the exercise steps.

The exercises support multiple distributions of Linux. The exercises

are marked accordingly, please be sure to follow the directions that

correspond to the distribution being used.

Page 11: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 11/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 1. Advanced Linux Installation 1-1

5.4

Xempty Exercise 1. Advanced Linux Installation

What this exercise is about

This exercise demonstrates the various Linux installation methods.

What you should be able to do

At the end of the exercise, you should be able to:

• Install Linux using various methods

Introduction

You will install Linux on your classroom workstation or on a remote

server in this exercise. This installation will then be used for allfollowing exercises, therefore please follow the instructions as given

(to assure the proper setup).

Verify with your instructor which Linux distribution should be loaded.

Requirements

• Boot media to invoke a network install, or a network server setup to

provide a PXEboot network installation image

• The host name or IP address of the install server as well as the

NFS port path (your instructor will provide you with this)

Page 12: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 12/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

1-2 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Exercise instructions

Preface

Section 1: Installing Linux manually

Important

This Linux class can be delivered in a number of formats: Regular classroom,

Instructor-Led-Online, blended, self-study, and so forth. It also allows the use of several

distributions (RHEL, SLES), several technical environments (physical and virtualized) and

multiple methods of installing your distribution in that environment (DVD or network).

Because of this, the installation exercise has to cater for a large number of different

scenarios.

Your instructor will tell you which of the following situations is applicable to you. Based on

that information you can select which exercise steps you will have to perform.

Question 1. Are you using a physical PC on which to install Linux, or are you using a

virtualized PC (through the use of VMWare Workstation or VMWare Player)?

• If you are using a physical PC, you will need to perform steps 1 through 3.

• If you are using a virtualized environment located in the IBM Training Datacenter

in Montpellier, France, you will need to perform steps 4 through 11.

• If you are using a virtualized environment on your local machine, you will need to

perform steps 10 to 11.

Question 2. What sort of boot media are you using? This can either be a CD/DVD or a

network boot (PXE). And you can either boot from a full installation DVD, or from a

CD/DVD or network image that initialized a network installation.

• If you are booting from a physical CD or DVD, perform steps 12 through 15.

• If you are booting from virtual CD or DVD, perform steps 16 through 20.

• If you are network booting from a PXE server (a network server serving the base

software to start the installation), perform steps 21 through 23.

Question 3. What distribution are you installing and what media are you using? This

course is written for Red Hat Enterprise Linux (RHEL) version 6 and SUSE Linux

Enterprise Server (SLES) version 11.

• If you are installing from IBM-provided boot media, perform steps 24 through 25.

• If you are installing RHEL6 from Red Hat media, perform steps 35 through 54.

Page 13: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 13/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 1. Advanced Linux Installation 1-3

5.4

Xempty • If you are installing SLES11 from SUSE media, perform steps 55 through 75.

Part 1: Select your correct machine type and access your machine 

If you are installing on a physical machine:

 __ 1. Walk over to the PC that is assigned to you. Locate the Power-On button and pressit.

 __ 2. As soon as the BIOS menu appears, press the appropriate key (typically F2, F12, or

Esc) to get the boot list menu.

 __ 3. Continue with Part 2, below.

If you are installing on a virtual machine located at the IBM Training Datacenter in

Montpellier, France:

 __ 4. Your instructor will provide you with the following information:

• The Citrix user ID and password

• The Remote Desktop user ID and password (normally: student / passw0rd)

 __ 5. Open your Web browser and go to the following URL:

https://elabgateway.moppssc.com

 __ 6. Depending on whether the Citrix client has been installed before on your PC, Citrix

will now install or upgrade the Citrix plug-in. If this is the case, work through the

menus so that the plug-in is installed.

 __ 7. Log in with the Citrix user ID and password that you received from the instructor.

 __ 8. You will now see a menu with an icon Remote Desktop Connection. Click thisicon. Log in with the Remote Desktop user name/password that your instructor

provided. You will now see the desktop of a virtual PC, on which VMWare Player or

VMWare Workstation is installed.

Note

If you want to minimize or close this virtual desktop and return to your local PC’s desktop,

use the _ or X icons that are located in the yellow bar at the top of the screen.

 __ 9. Continue with step 10, below.

If you are installing on a virtual machine that is located on your local PC:

 __ 10. Start VMWare Player or VMWare Workstation. Select the Linux Virtual Machine.

Locate the Power-On menu option and start the virtual machine. As soon as the

VMWare BIOS menu appears, press Esc to get the boot list menu.

Page 14: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 14/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

1-4 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Note

VMWare Player/Workstation will "grab" your mouse and keyboard, even when the virtual

PC is not using a graphical screen. In order to "release" your mouse and keyboard, so that

you can use them outside the VMWare application, press Ctrl+Alt.

If this is the first time that this Virtual Machine is started on this machine, you might see apop-up window This virtual machine might have been moved or copied. In this pop-up

menu select I copied it and click OK.

 __ 11. Continue with Part 2, below.

Part 2: Select and load the boot media 

If you are booting from a physical CD or DVD:

 __ 12. Insert the CD1 or DVD1 in the CD/DVD drive.

 __ 13. If you are using a virtualized machine (VMWare Player or VMWare Workstation),

click on the CD/DVD icon and select Connect.

 __ 14. In the BIOS boot list, select the boot from CD/DVD.

 __ 15. Wait until you get the boot: prompt or a boot menu. Continue with Part 3, below.

If you are booting from a virtual CD or DVD:

 __ 16. In VMWare Player or VMWare Workstation, click the CD/DVD icon and select

Settings.

 __ 17. A pop-up menu appears. In this menu, select Use ISO Image file and select the

proper ISO image.

 __ 18. After you have selected the proper ISO image, make sure it is connected by

ensuring the checkbox Connected is checked. Then click OK.

 __ 19. In the BIOS boot list, select the boot from CD/DVD.

 __ 20. Wait until you get the boot: prompt or a boot menu. Continue with Part 3, below

If you are booting through the network from a PXE server:

 __ 21. In the BIOS boot menu, select the Network Boot method.

 __ 22. It might take several seconds for the PXE boot to work, depending on the local

network settings.

 __ 23. Wait until you get the boot: prompt. Continue with Part 3, below.

Page 15: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 15/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 1. Advanced Linux Installation 1-5

5.4

Xempty Part 3: Select the proper distribution 

If you are installing from IBM provided media:

In order to provide for the different distributions that are supported in this and other classes,

IBM has created special boot media that is essentially a merge of the Red Hat and SUSE

boot media. You will notice that you are using IBM’s boot media because the word "IBM"

will be prominently displayed somewhere in the initial screen.At the initial screen, you will also see a list of distributions that are available, and the

keyword to type to start a specific installation. This keyword is typically "RHEL6" for a Red

Hat Enterprise 6 install, "SLES11" for a SUSE Linux Enterprise Server 11 install, and so

forth.

 __ 24. Type the proper keyword for the distribution you will want to install.

 __ 25. For an RHEL6 install, continue with step 27, below. For a SLES11 install, continue

with step 56, below.

If you are installing RHEL6 through the network from Red Hat network boot media:

 __ 26. At the boot: prompt or menu, press Enter.

 __ 27. Choose the language for the installation process and choose OK.

 __ 28. Choose your keyboard model, and choose OK.

 __ 29. Choose NFS directory as your Installation method and choose OK.

 __ 30. In the Configure TCP/IP select DHCP for IPv4, unless your instructor indicated

otherwise. Leave the IPv6 configuration alone; We will not be using IPv6 in this

course.

 __ 31. In the NFS Setup screen, enter the IP address and RHEL export directory that yourinstructor provided. Choose OK.

 __ 32. The installation process now contacts the NFS server and starts the X-based

installer (Anaconda). This takes a minute or so.

 __ 33. At the Welcome screen, click Next.

 __ 34. Continue with step 40, below

If you are installing RHEL6 from a full-install Red Hat DVD:

 __ 35. At the boot menu press Enter to accept the default choice (Start Installation orUpgrade).

 __ 36. Skip the media test.

 __ 37. Anaconda (the Red Hat graphical installer) will now start and present you with a

welcome screen. Click Next.

 __ 38. Select the language to use during the installation, then click Next.

Page 16: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 16/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

1-6 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

 __ 39. Select the appropriate keyboard layout, then click Next.

 __ 40. Select Basic Storage Devices, then click Next.

 __ 41. RHEL6 will now detect your hard disks and their current partition configuration. If an

invalid partition table is found, you are prompted to initialize the drive. Select

Re-initialize All in this case. If a previous installation of Linux was found, you might

be prompted to upgrade. Override this option by selecting the Install option. Click

Next to continue.

 __ 42. Depending on the installation method, RHEL6 might ask for an installation number.

Select Skip entering Installation Number, then OK, then Skip on the next dialog

box.

 __ 43. If no host name was supplied by the DHCP server, you will be prompted to enter a

host name. The host name is not important right now, so either leave the default

localhost.localdomain or enter your own name as host name.

 __ 44. Now select your Time Zone, and uncheck the UTC box, then click Next.

 __ 45. For convenience in the class, set the root password to ibmlnx. Click Next.

 __ 46. Choose Create custom layout, then Next.

 __ 47. You are now looking at your partition table. If any partitions are present, delete them.

 __ 48. You can now create your Linux partitions by clicking Create to begin adding these

partitions:

• A / (root) partition of 1500 MB

• A /usr partition of 6000 MB

• A /boot partition of 100 MB• A /home partition of 1250 MB

• A /tmp partition of 1250 MB

• A /var partition of 1500 MB

• An /opt partition of 1000 MB

• A swap partition of 512 MB

All partitions, except the swap partition, should be formatted as ext4.

Do not make partitions larger than the size indicated since you need free,

unpartitioned space in other exercises.

Click Next. If you get a pop-up window that some values are less than what your

distribution suggests, ignore the problem and click Next.

The installer will now modify your partition table and format the partitions. This will

take a minute or so.

 __ 49. The next screen allows you to set up your boot loader. Accept all defaults and click

Next.

Page 17: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 17/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 1. Advanced Linux Installation 1-7

5.4

Xempty  __ 50. The installer will now retrieve installation information. This will take a minute or so.

 __ 51. On the Software screen, select the Basic Server profile, select the Customize

Now radio button, then click Next. On the next screen, add the following selections:

Servers:

Print Server

System Administration Tools

Desktops:

General Purpose Desktop

KDE Desktop

X Window System

Development:

Development Tools

 __ 52. The installation process now installs your selections. This might take anywhere fromone to 15 minutes, depending on the number of packages to install, the network

bandwidth available and the speed of the computer.

While installing, you can see what is going on in detail by switching to the third

virtual terminal with Ctrl+Alt+F3. Switch back with Alt+F7. Also, take a look at other

virtual screens (1 through 6).

 __ 53. After the installation finishes, the system will reboot. On first boot, a Welcome

screen will appear, with additional configuration tasks. Answer the questions in the

following manner:

Accept the license agreement.

Do not register your system with RHN.

Create a user account (use your name).

Set the correct date and time.

Do not enable kdump.

 __ 54. Your Red Hat Enterprise Linux installation is now finished. Continue with Section 2

to execute a Kickstart installation.

If you are installing SLES11 from SUSE network boot media: __ 55. At the boot: prompt, press Enter.

 __ 56. Since the boot media that you used does not contain the SLES11 repository of

installation packages, you will get a warning Activating manual setup program.

Click OK.

 __ 57. Choose the language for the installation process and click Next.

 __ 58. Choose the correct keyboard map and click OK.

Page 18: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 18/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

1-8 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

 __ 59. Select Start Installation and click OK.

 __ 60. Select Start Installation or Update and click OK.

 __ 61. Choose the source medium Network and click OK.

 __ 62. Choose the network protocol NFS and click OK.

 __ 63. Answer Yes to the question Automatic configuration via DHCP? unless your

instructor tells you otherwise.

 __ 64. Enter the IP address of the NFS server, followed by the exported directory

containing the installation packages.

 __ 65. SLES will now start the graphical installation program (YaST). Continue with step

67, below.

If you are installing SLES11 from a SUSE full-install DVD:

 __ 66. At the boot menu, select Installation. SLES will now start the graphical installation

program (YaST).

 __ 67. At the Welcome screen, choose the proper language and keyboard layout. Confirm

that you agree to the License Terms. Click Next.

 __ 68. If you are installing from a full-install DVD, you will now be asked whether you want

to perform a media check. Skip this check, so click Next.

 __ 69. YaST2 will now perform a System Analysis. This will take a minute.

 __ 70. At the Installation Mode screen, select New Installation and click Next.

 __ 71. Select the proper Time Zone and Hardware Clock setting, and click Next.

 __ 72. Select Physical machine as your base scenario, then click Next.

 __ 73. At the Installation Settings screen, click Partitioning. Create a Custom Partitioning

scheme, as follows:

• A / (root) partition of 1500 MB

• A /boot partition of 100 MB (this should be a Primary Partition)

• A /usr partition of 6000 MB

• A /var partition of 1500 MB

• A /home partition of 1250 MB

• A /tmp partition of 1250 MB

• A swap partition of 512 MB

• A /opt partition of 1000 MB

All partitions should be formatted as ext3 except for the swap partition.

Do not make partitions larger than indicated since we will need free, unpartitioned

space in the rest of this course.

Page 19: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 19/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 1. Advanced Linux Installation 1-9

5.4

Xempty When finished, click Accept.

 __ 74. Still at the Installation Settings screen, click Software. In addition to the currently

selected software, also select:

• KDE Desktop Environment

• File Server

• Web and LAMP Server

• C/C++ Compiler and Tools

Click OK.

 __ 75. At the Installation Settings screen, review your settings, then click Install.

 __ 76. At the Confirm Installation pop-up screen, select Install to proceed.

Note

The installation will proceed at this point. Monitor your screen for any messages thatrequire your assistance. You should see on the right side of your screen a list of tasks to be

completed. The task currently operating is noted with an arrow.

 __ 77. SLES automatically reboots during the installation. This is normal and the

installation process will continue automatically. If any pop-up windows appear,

choose Continue.

 __ 78. Enter the password for the root user. For convenience in class, use the password

ibmlnx. Click Next. __ 79. Select a suitable host name, then click Next.

 __ 80. Unless your instructor indicates otherwise, accept all defaults in the Network

configuration. Click Next.

 __ 81. Perform the Internet connection test. Click Next.

 __ 82. In the Novell Customer Center Configuration screen, select Configure Later. Click

Next.

 __ 83. In the Installation Overview screen, accept all defaults. Click Next.

 __ 84. Select Local as the User Authentication Method, then click Next.

 __ 85. Add a user account for yourself, then click Next.

 __ 86. When the Release Notes are displayed, click Next.

 __ 87. The system will now detect all your hardware and configure it. This might take

several minutes, during which your screen might flicker and/or go blank for an

extended period of time. Be patient. Once done, accept the defaults.

 __ 88. Click Finish to complete the installation.

Page 20: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 20/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

1-10 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

 __ 89. Your SLES11 installation is now finished. Continue with Section 2 for an AutoYaST

installation.

Section 2: Installing Linux automatically using Kickstart orAutoYaST

Note

Only do this section if time permits.

If you happen to destroy your current installation but your Kickstart or AutoYaST file does

not work, contact the instructor, who has a known working Kickstart or AutoYaST file

available.

Red Hat Kickstart

 __ 90. Log in as root and take a look at the anaconda-ks.cfg file in your home directory.

Do you recognize the choices you made during the installation process?

 __ 91. Modify the anaconda-ks.cfg file as follows:

- All partitions will be deleted and recreated according to the scheme

previously set up. (Hint: The partition directives need to be uncommented,

and you need a "clearpart --all".)

- The following lines are added to the %post section to create users tux1 and

tux2:

adduser -c “Tux the Penguin 1” tux1

adduser -c “Tux the Penguin 2” tux2

echo penguin | passwd --stdin tux1

echo penguin | passwd --stdin tux2

 __ 92. Once you have updated the anaconda-ks.cfg file, upload the file under your own

name to the instructor server, in the directory /export/files. This directory is

NFS-exported so that you can access it during the subsequent install.

 __ 93. Reboot your system, get into the BIOS boot menu and select your boot medium justlike you did before. At the boot: prompt, start a Red Hat kickstart installation. Notify

the instructor once your installation has started without any errors.

SLES AutoYaST

 __ 94. Log in as root and take a look at the autoinst.xml file in your home directory. Note

that this is a rather large file (1200 lines or so). It is not intended to be modified by

hand.

Page 21: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 21/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 1. Advanced Linux Installation 1-11

5.4

Xempty  __ 95. Start the AutoYaST configuration tool and import this file.

 __ 96. Take a look at the AutoYaST configuration. Do you see the settings you made during

the installation?

 __ 97. Exit AutoYaST.

 __ 98. Upload the AutoYaST file under your own name to the instructor server, in the

directory /export/files. This directory is NFS-exported so that you can access itduring the subsequent install.

 __ 99. Reboot your system, get into the BIOS boot menu and select your boot medium just

like you did before. At the boot: prompt, start an AutoYaST installation. Notify the

instructor once your installation has started successfully.

End of exercise 

Page 22: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 22/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

1-12 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Page 23: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 23/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 2. Linux documentation 2-1

5.4

Xempty Exercise 2. Linux documentation

What this exercise is about

The purpose of this exercise is to give you the opportunity to explore

and experiment with the man and info commands. You will also readthe FAQ and HOWTO documentation.

What you should be able to do

At the end of the exercise, you should be able to:

• Use the man command

• Use the info command

• Locate and use other Linux documentation

Page 24: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 24/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

2-2 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Exercise instructions

Preface

• All exercises in this chapter depend on the availability of specific equipment in

your classroom.

Section 1: Manual pages 

 __ 1. If you are not already logged on, log in as tux1.

 __ 2. Display the manual page for the man command.

Read the information presented to obtain a better understanding of the functionality

of the man command.

 __ 3. Search for the string PAGER .

 __ 4. Use the <Q> key to end the man command.

 __ 5. Display the man page of the ls command. Move through the manual pages.

 __ a. Go to the last page.

 __ b. Go to the previous page.

 __ c. Go to the first page.

 __ 6. Close the man command.

 __ 7. Find out which manual pages deal with passwd . Then view each page, giving the

correct section number.

Note

Note: If the man -k or apropos commands do not work, then you need to run the

makewhatis command as user root. Normally, the makewhatis command is automatically

executed nightly, but because your system is freshly installed, this might not yet have

occurred.

Section 2: Info command 

 __ 8. View the info documentation for the finger command.

Are you actually reading info documentation now?

 __ 9. Move through this page by using the <space> and <backspace> keys.

 __ 10. Read the help for the info command.

 __ 11. End the info command.

 __ 12. Read the info documentation of the info command.

Page 25: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 25/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 2. Linux documentation 2-3

5.4

Xempty  __ 13. info has a nice built-in tutorial. If you have spare time during this course, look at the

tutorial to see some of the advanced features of info.

Section 3: Other documentation 

 __ 14. Make a listing of all directories in the /usr/share/doc directory.

Browse some of these directories to see what sort of information is available. __ 15. If the classroom systems have an internet connection, look at the http://www.tldp.org

website. This is the main documentation website for Linux.

Note that in some classrooms, some additional configuration of your web browser

might be needed because the classroom could be behind a socks or proxy-based

firewall. In this case, your instructor gives you additional instructions.

Find the HOWTO for IPv6 .

 __ 16. Visit http://www.google.com/linux. Search for IPv6 . Does Google find the same

HOWTO?

End of exercise 

Page 26: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 26/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

2-4 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Page 27: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 27/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 3. Startup and shutdown 3-1

5.4

Xempty Exercise 3. Startup and shutdown

What this exercise is about

This exercise illustrates the startup and shutdown process of a Linux

system.

What you should be able to do

At the end of the exercise, you should be able to:

• Choose between a graphical and a text-based login screen by

changing the run levels of a system

• Boot a Linux system in single-user mode

• Use run level editors

Introduction

In this exercise, you will modify the run level configuration of the

system.

Requirements

• This workbook

• A workstation with Fedora, RHEL, or SLES installed

Page 28: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 28/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

3-2 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Exercise instructions

Preface

• All exercises of this chapter depend on the availability of specific equipment in

your classroom.

• The hints provided for locating documentation on particular web pages werecorrect when this course was written. By nature, web pages tend to change over

time, so ask your instructor if you have trouble navigating the websites.

• A computer system with a connection to the World Wide Web and a web browser

is recommended but not required.

Section 1: The GRUB boot loader (x86) 

 __ 1. Log in as root.

 __ 2. Change the /boot/grub/menu.lst configuration file so that a password is

required when you try to alter the various boot options. Make sure the password isencrypted. For convenience in class, use the password ibmlnx.

Note: When starting grub, it starts probing devices to guess BIOS drives. This might

take a long time, up to several minutes, depending on your hardware. Wait until this

is done before typing the md5crypt command within grub.

 __ 3. Reboot your machine. Use the shutdown command to perform the reboot. Then try

to alter the GRUB boot sequence without and with supplying the password.

Section 2: The YABOOT boot loader (ppc) 

 __ 4. Log in as root.

 __ 5. Change the /etc/yaboot.conf configuration file so that a password is required when

you try to alter the various boot options. Make sure the password is encrypted. For

convenience in class, use the password ibmlnx.

 __ 6. Reboot your machine. Use the shutdown command to perform the reboot. Then try

to proceed through the boot sequence without and with supplying the password.

Section 3: Retrieving kernel messages 

The messages which are displayed by the kernel can be a helpful tool in problem

determination. That is why you might want to retrieve them, even after your system has

booted.

 __ 7. Log in as root.

 __ 8. View the kernel messages and the log file /var/log/ messages.

Page 29: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 29/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 3. Startup and shutdown 3-3

5.4

Xempty Section 4: Setting the default runlevel 

The default runlevel can be altered to configure your system for your situation. In this

exercise, you set the default to 3 so that you do not get a graphical login prompt. Note,

however, that depending on your hardware, kickstart or autoyast might not have configured

X correctly. Thus, you need to test and, if needed, configure X first.

 __ 9. Verify the current run level of the system. The current run level is __________. __ 10. If your current runlevel is 5, change it to 3.

 __ 11. Edit the file /etc/inittab so that the default runlevel will be 5. (Your default might

already be 5. That's okay.)

 __ 12. Depending on your hardware, kickstart (RHEL/Fedora) or autoyast (SLES) might not

have configured X correctly. Start X with the X command. (This only starts the

XFree86 server.) If X comes up correctly (black or grey background with an

X-shaped mouse cursor (nothing more, nothing less), stop the X server with

Ctrl-Alt-Backspace and continue with the next step. If X does not come up

correctly, run system-config-display (RHEL/Fedora) or sax2 (SLES) to configure X.You should be in runlevel 3 to do this.

 __ 13. Reboot your system, this time using Ctrl-Alt-Delete.

 __ 14. When GRUB appears, do nothing. After a few seconds, GRUB should automatically

boot your default operating system.

 __ 15. When the graphical login prompt appears, switch to the first virtual terminal. Then

switch back to VT 7.

 __ 16. Log in as root, then start a terminal screen (from menus).

 __ 17. Verify the current run level of the system. The current run level is __________.

Section 5: Configuring services 

 __ 18. Make a long list of files in the directories /etc/rc.d/rc3.d, /etc/rc.d/rc4.d,

/etc/rc.d/rc5.d, and /etc/rc.d/init.d (RHEL/Fedora) or /etc/init.d 

(SLES).

 __ 19. Create a list of services with chkconfig, and check its output with the output from

the previous commands.

 __ 20. Verify that the portmap service is enabled in your current runlevel. Disable this

service, and then check the symbolic links in /etc/rc.d/rc5.d again.

 __ 21. Check whether the portmap daemon is currently running. Then reboot the system.

 __ 22. Log in and check whether the portmap daemon is running now.

 __ 23. Enable the portmap service again, and start the service manually.

Page 30: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 30/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

3-4 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Section 6: Using single-user mode 

Single-user mode is very convenient for system maintenance.

 __ 24. Log out, reboot the system with Ctrl-Alt-Delete, and boot in single-user mode.

 __ 25. Look at the list of running processes.

 __ 26. Reboot the system.

End of exercise 

Page 31: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 31/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 4. System administration tools 4-1

5.4

Xempty Exercise 4. System administration tools

What this exercise is about

This exercise gives you some practical experience in using the system

administration tool on your distribution.

What you should be able to do

At the end of the exercise, you should be able to:

• Use and configure the system administration tool on the

distribution used.

Introduction

In this exercise, you will utilize various system administration tools

found on the distribution installed on your system.

Requirements

• This workbook

• A workstation with RHEL or SLES installed

Page 32: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 32/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

4-2 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

4.1. Exercise instructions

Preface

• All exercises in this chapter depend on the availability of specific equipment in

your classroom.

• The hints provided for locating documentation on particular web pages werecorrect when this course was written. By nature, web pages tend to change over

time, so ask your instructor if you have trouble navigating the websites.

• A computer system with a connection to the World Wide Web and a web browser

is recommended but not required.

Section 1: Working with various system administration tools: SLES11

 __ 1. Login as root with the password of ibmlnx.

 __ 2. From a terminal window, issue the yast command to bring up the ncurses menu.

# yast

 __ 3. Navigate to the Software configuration module and select the Installation Source

sub-menu. List the first two installation sources available to your system:

Name:________________ URL:_________________ 

Name:________________ URL:__________________ 

 __ 4. Exit the yast interface.

 __ 5. List the available fast paths that can be used with yast/yast2, by issuing the following

command:

# yast -l

 __ 6. Using the fast path of host with the yast command, create an /etc/hosts entry

with the following values:

# yast2 host

IP Address: XX.XX.XX.XX

Host name: service.example.com

Alias: service

 __ 7. Exit the yast interface.

 __ 8. Verify the entry was created:

# grep service /etc/hosts

 __ 9. From a terminal window, issue the yast2 command to bring up GUI menu.

# yast2

Page 33: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 33/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 4. System administration tools 4-3

5.4

Xempty  __ 10. Navigate to the System configuration module and select the System Services

(Runlevel) sub-menu. Click the Expert Mode radio button in the top portion of the

GUI menu. In what run-level is the acpid service enabled? __________ 

 __ 11. Enable the apache2 service to be enabled in run-level 5 only:

# chkconfig apache2 off

# chkconfig apache2 --level 5 on

 __ 12. In a separate window, verify the apache2 service was enabled by using the

chkconfig command:

# chkconfig --list apache2

 __ 13. Search the yast2 interface and find the configuration module that has the sub-menu

View System Log. Which configuration module is it? __________ 

 __ 14. Exit the yast2 interface.

Section 2: Working with various system administration tools: RHEL

 __ 15. Login as root with the password of ibmlnx.

 __ 16. From a terminal window, issue the system-config-packages command to bring up

the GUI menu.

# system-config-packages

 __ 17. Select Edit -> Repositories from the menu. Click the ADD button. Enter the

following information into the dialog box:

Name: RHEL6 Server

Description: Red Hat Enterprise Linux 6 Server

Location: http://10.0.0.100/rhel60s/Server

Click OK when finished.

Exit the application and restart it. (Re-run the command

system-config-packages.)

 __ 18. Locate the Application -> Editors package group and answer the following

questions:

 __ a. What are the total amount of packages available to be installed? __________ 

 __ b. How many of the packages are currently installed on the system? __________ 

 __ c. List the package names that are a part of the Editors package group:

-  ___________ 

-  ___________ 

-  ___________ 

-  ___________ 

-  ___________ 

Page 34: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 34/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

4-4 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

 __ 19. Exit the system-config-pages interface.

 __ 20. Using the system-config-network interface, click the Hosts tab. Create an /etc/hosts

entry with the following values:

IP Address: XX.XX.XX.XX

Hostname: service.example.com

Alias: service

 __ 21. Exit the system-config-network interface.

 __ 22. Verify the entry was created:

# grep service /etc/hosts

 __ 23. According to the system-config-services interface, in what run-level is the acpid 

service enabled? __________ 

 __ 24. Enable the httpd service to be enabled in runlevel 5 only:

# chkconfig httpd off

# chkconfig httpd --level 5 on

 __ 25. In a separate window, verify the httpd service was enabled by using the chkconfig 

command:

# chkconfig --list httpd 

 __ 26. Exit the system-config-services interface.

 __ 27. Determine which system-config interface should be used to modify group

assignments for users. Which system-config interface is it? __________ 

End of exercise 

Page 35: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 35/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 4. System administration tools 4-5

5.4

Xempty 4.2. Optional exercise: Installing Webmin

Preface

• This optional exercise deals with the installation of Webmin from an installation

source.

Section 1: Downloading and installing Webmin 

 __ 1. If your classroom can access the Internet, start a web browser and enter the URL:

http://www.webmin.com. From the main page, download the RPM package,

saving it either in your home directory or on your desktop.

If your classroom cannot access the Internet, your instructor will tell you how to

obtain the Webmin package.

 __ 2. Locate and install the Webmin RPM file.

»# cd r pm_l oc at i on 

»# rpm -ivh webmin-version.rpm 

 __ 3. Access Webmin using your Web browser. Type http://127.0.0.1:10000 in the

location bar of the browser.

 __ 4. Log in to Webmin as root. Browse through the various menus and options.

End of exercise 

Page 36: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 36/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

4-6 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Exercise review and wrap-up

This exercise covered utilization of various system administration tools found on the

distribution installed on your system.

Page 37: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 37/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 5. Package management 5-1

5.4

Xempty Exercise 5. Package management

What this exercise is about

This exercise gives you some practical experience in using the

packaging tool on your distribution.

What you should be able to do

At the end of the exercise, you should be able to:

• Install, upgrade, and deinstall packages

• Query packages

• Verify the authenticity of packages

• Create simple packages

Introduction

In this exercise, you will be performing various package management

activities.

Requirements

• This workbook• A workstation with Fedora, RHEL, or SLES installed

Page 38: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 38/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

5-2 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Exercise instructions

Preface

• All exercises in this chapter depend on the availability of specific equipment in

your classroom.

• The hints provided for locating documentation on particular web pages werecorrect when this course was written. By nature, web pages tend to change over

time, so ask your instructor if you have trouble navigating the websites.

• A computer system with a connection to the World Wide Web and a web browser

is recommended but not required.

Section 1: Retrieving information about installed packages 

 __ 1. Make a list of all packages that are installed on the system.

 __ 2. Find out which package installed the /etc/inittab file.

 __ 3. List the information of that package.

 __ 4. List all files in that package.

 __ 5. Verify whether all files in that package are still the same. Which file has changed and

in what respect? Why?

Section 2: Installing packages 

 __ 6. Create a directory /mnt/server. Mount the installation directory from the

installation server on /mnt/server. List all the package files that are available on the

install server.

 __ 7. Add the public key from the distribution to your keyring. Your public key is located in

your installation directory /mnt/server.

 __ 8. Locate the mtools package. Verify that the package mtools is not installed. Verify

the package on the installation server, and install mtools and any package

dependencies. Then verify that it installed, and list the files in the package. You can

also execute mtools to ensure that it works.

 __ 9. Uninstall the mtools package.

Section 3: Using a package management frontend  __ 10. If necessary, start X; then start the RPM frontend tool for your distribution

(system-config-packages for Fedora/RHEL, yast2 for SLES). Use the tool's search

function to find the package mtools and install it.

Page 39: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 39/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 5. Package management 5-3

5.4

Xempty Section 4: Creating RPMs 

 __ 11. Check with your instructor if the file hello-1.2 files are available somewhere on

the network and download it into /root. If they are available, create a directory

/root/hello-1.2 and copy the files into it. If not, you need to create the directory

/root/hello-1.2 and create the following files in it:

hello.c:#include <stdio.h>

main()

{

printf("Hello, World!\n");

}

 Makefile:

all: hello

hello: hello.c

gcc -o hello hello.c

install: helloinstall -d $(DESTDIR)/usr/bin

install -s -m 0755 -o root -g root hello $(DESTDIR)/usr/bin

clean:

rm -f hello

Note: The lines containing commands are indented with a TAB, not with spaces!

README:

(c) Copyright IBM 2005

This program is licensed under the GPL.

This program prints the text "Hello, World!" on your screen. This isan excellent way to start your day - some people even consider it

better than getting a random fortune cookie every morning!

To build, simply type make.

To install, simply type make install.

Then, go back to your /root directory, make a tar file of all these files, and gzip it.

 __ 12. Copy the hello-1.2.tar.gz to /usr/src/redhat/SOURCES (RHEL/Fedora)

or /usr/src/packages/SOURCES (SLES).

 __ 13. Copy the hello.spec file, as shown in the visual, into the correct directory.

Page 40: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 40/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

5-4 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

The file should look like this:

#

# SPEC file for hello world program

#

Summary: Hello, World program

Name: hello

Version: 1.2

Release: 1License: GPL

Group: Applications/Useless

Source: hello-1.2.tar.gz

Distribution: Useless Linux 1.2

Vendor: IBM IT Education Services

Packager: Wanda C. Results <[email protected]>

BuildRoot: /var/tmp/hello-1.2

%description

This program prints the text "Hello, World!" on your screen. This is an excellent

way to start your day - some people even consider it better than getting a random

fortune cookie every morning!

%prep

%setup

%build

make

%install

make install DESTDIR=${RPM_BUILD_ROOT}

%files

%doc README

/usr/bin/hello

Page 41: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 41/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 5. Package management 5-5

5.4

Xempty  __ 14. Start the RPM prep stage and watch the results.

Note: The directory /var/tmp/hello-1.2 has not been created yet.

 __ 15. Start the RPM build stage and watch the results.

Note: The directory /var/tmp/hello-1.2 has not been created yet.

 __ 16. Start the RPM install stage and watch the results.

 __ 17. Create the binary RPM and watch the results.

 __ 18. Create the source RPM and watch the results.

 __ 19. Test first to see if there is a hello program installed. Since there is not, install your

brand new hello RPM file using the rpm command. Test it, uninstall it, and then test

it again.

End of exercise 

Page 42: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 42/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

5-6 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Page 43: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 43/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 6. X Window System 6-1

5.4

Xempty Exercise 6. X Window System

What this exercise is about

This exercise lets you use the X Window system.

What you should be able to do

At the end of the exercise, you should be able to:

• Configure X

• Start and stop X

• Work with window managers

• Run X applications over a network

IntroductionIn this exercise, you will be performing various activities using the X

Window system.

Requirements

• This workbook

• A workstation with RHEL or SLES installed

Page 44: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 44/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

6-2 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Exercise instructions

Preface

• All exercises in this chapter depend on the availability of specific equipment in

your classroom.

• The hints provided for locating documentation on particular web pages werecorrect when this course was written. By nature, web pages tend to change over

time, so ask your instructor if you have trouble navigating the websites.

• A computer system with a connection to the World Wide Web and a web browser

is recommended but not required.

Section 1: Configuring Xorg 

Do this section if your distribution uses Xorg.

 __ 1. If you are in a runlevel that automatically starts X, switch to a runlevel that does not

start X. If you started X manually, stop it. __ 2. Make a backup copy of the xorg.conf file.

 __ 3. Try to configure your xorg.conf file using system-config-display. If

system-config-display yields a sufficiently good xorg.conf file (test this with startx),

make a backup of this file called xorg.conf.system-config-display.

 __ 4. Try to configure your xorg.conf file using Xorg -configure. If Xorg -configure

yields a sufficiently good xorg.conf file (test this with startx), then make a backup of

this file called /etc/X11/xorg.conf.xorg .

 __ 5. Select the xorg.conf file that worked the best for you and rename it to

/etc/X11/xorg.conf. Then start X or switch to the runlevel that starts X for you.

Section 2: Running X applications 

In this section, you will see that the X environment is made up of more than one layer. We

will begin in runlevel 3 and then build an X Windows environment one layer at a time.

 __ 6. First, you want to be on VT-1 in runlevel 3 with no X server running. Kill any X server

that is running with CTRL-ALT-Backspace, and then change to run-level 3.

 __ 7. Start the X Server and switch to VT-7. You will see a blank screen with a cursor in

the shape of an X , and that is all you will see. This indicates the X Server is running. __ 8. The X Server is not very helpful at this point. If you attempt to run an xterm , it will fail

because there is no place to display the application. Log in on VT-2 as root, set the

DISPLAY variable, and try again, this time running xterm in the background.

 __ 9. Now you have a term, or window, where you can type commands. However, if you

want to open a new application, it covers up the old and you cannot move the

display.

Page 45: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 45/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 6. X Window System 6-3

5.4

Xempty Note: Some of these x-applications might not exist on your distribution.

 __ 10. In order to gain control of the situation, you need a program to manage your X

application windows, so let's start an X window manager. Go to VT-2 and start the

TWM X Window Manager. Change to VT-7, and now you can move and resize your

application windows.

 __ 11. This is helpful but does not look like our normal X Windows environment. You can

now start the startkde or gnome-session program of your choice and watch how

the X Window environment changes.

 __ 12. Now you have a full Windows environment. When you are done, you can shut down

each application that you started, but you should do that in reverse order (otherwise

known as backing out gracefully) or you can kill the X Server which will kill all

applications that are dependent upon it. Let's press Ctrl-Alt-Backspace. This

should take you back to VT-1 automatically. When you get there, check your

runlevel.

 __ 13. Finally, let's get back to runlevel 5. This will force the session manager to ask you to

log back in.

Section 3: Running applications over a network (optional) 

Since applications use a TCP/IP connection to communicate to the X server, you can also

run applications from another server.

 __ 14. Using the gdmsetup tool, modify the configuration to allow remote logins.

Under the Security tab, check the box for Enable XDMCP, and uncheck the box for

Deny TCP connections. When finished, exit the tool, and restart the login manager.

 __ 15. Ask a fellow student to open a terminal window for you.

 __ 16. Set the display variable to point to your own screen. The command for that will look

like this: export DISPLAY=1. 2. 3. 4 :0.0, where 1.2.3.4 is your own IP address.

 __ 17. Now try to start an xterm . You should get an error message: Could not open

display. This is a safety feature of X. It does not automatically accept incoming

connections.

 __ 18. Go back to your own system and enter the command xhost +.This will enable

incoming connections.

 __ 19. Go back to the system of your fellow student and retry the xterm command. Thistime it should succeed.

 __ 20. In your graphical screen, you should see a new xterm. Try the hostname command

in this screen to verify that the xterm application is actually running on the other

system.

 __ 21. Close the xterm and do an xhost.

Page 46: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 46/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

6-4 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

 __ 22. Now try to open another xterm from your partner's system, but this time use xauth 

authentication.

Note: This only works if your system's host name has been set properly and can be

resolved through DNS.

Section 4: Running X-sessions over a network 

You cannot only run a single application over a network, but you can run your whole

X-session over a network as well. In this case, it's not only the application that is running on

a remote system, but the window manager as well. In fact, the only program that needs to

be running locally is your X server.

 __ 23. Using the gdmsetup tool, modify the configuration to allow remote logins.

Under the Security tab, check the box for Enable XDMCP, and uncheck the box

Deny TCP connections. When finished, restart your login manager.

 __ 24. Start a second X-server, this time telling X to get its login manager from your partner

system. Make sure there is a space  before the :1. __ 25. Stop the second session and start it again, but do an indirect broadcast for a login

manager. You should get a chooser which allows you to login to any system running

a display manager on the network. Make sure there is a space  before the :1.

 __ 26. If time permits, perform steps 22 and 23 again, but this time use Xnest to start an X

server within your current X environment. Make sure there is a space  before the :1.

Note: You might need to install Xnest first.

End of exercise 

Page 47: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 47/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 6. X Window System 6-5

5.4

Xempty Exercise review and wrap-up

This exercise covered various basic operations dealing with the X Window System.

Page 48: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 48/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

6-6 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Page 49: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 49/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 7. User administration 7-1

5.4

Xempty Exercise 7. User administration

What this exercise is about

This exercise teaches you how to add users and groups and where to

find information about users and groups in your system.

What you should be able to do

At the end of the exercise, you should be able to:

• Add and delete users and groups

• Specify the files involved in user administration

Introduction

In this exercise, you will create and modify Linux users and groups.

During this lab exercise, you will use the Linux distribution that you

have loaded onto your lab system. Please disregard any exercise

steps that reference a different Linux distribution.

Requirements

• This workbook

• A workstation with Fedora, RHEL, or SLES installed

Page 50: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 50/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

7-2 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Exercise instructions

Preface

• All exercises in this chapter depend on the availability of specific equipment in

your classroom.

• The hints provided for locating documentation on particular web pages werecorrect when this course was written. By nature, web pages tend to change over

time, so ask your instructor if you have trouble navigating the websites.

• A computer system with a connection to the World Wide Web and a web browser

is recommended but not required.

Section 1: User environment 

 __ 1. Log out every user.

 __ 2. Log in as tux1 at VT 1 and as root at VT 5.

 __ 3. Look at the following files:

• /etc/profile

• /etc/bashrc (RHEL/Fedora) or /etc/bash.bashrc (SLES)

• $HOME/.bash_profile (RHEL/Fedora) or $HOME/.profile (SLES)

• $HOME/.bashrc

• $HOME/.bash_logout (RHEL/Fedora only)

What do these files do in your system? What information can be found in there?

Section 2: User administration 

 __ 4. List all users defined in your system at this moment.

 __ 5. Does every user have a password?

 __ 6. As root, using the command line, add a user with the user name tux3 and full name

Tux the Penguin (3).

 __ 7. Look at the contents of /etc/shadow. What is the password of the new user?

 __ 8. Give tux3 the password penguin. Then take a look at the /etc/shadow file again.

 __ 9. List the contents of the /etc/passwd file. What is stored in this file?

 __ 10. What is the login group of the user you added?

 __ 11. Add the group penguins to the system.

 __ 12. Place the user tux3 in the group penguins.

 __ 13. Locate this change in /etc/group.

 __ 14. What is the syntax of the group file?

Page 51: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 51/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 7. User administration 7-3

5.4

Xempty  __ 15. Which users are specified in the last field of the /etc/group file?

Section 3: Communicating with the users 

 __ 16. As root, modify the /etc/issue file. Write in this file that the system is for

authorized users only. Remove all distribution and kernel information.

 __ 17. As root, create the /etc/motd file. Write in this file your system name and thename of the distribution you are using.

 __ 18. As tux1, log out and log in again. Look at the information shown on your screen.

 __ 19. As tux1, create the file .hushlogin in your home directory.

 __ 20. Log out and then log in. Again look at the information showing up on your screen. Do

you notice any difference with the output from step 16?

End of exercise 

Page 52: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 52/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

7-4 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Page 53: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 53/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 8. Block devices, RAID, and LVM 8-1

5.4

Xempty Exercise 8. Block devices, RAID, and LVM

What this exercise is about

This exercise lets you work with block devices, RAID, and LVM.

What you should be able to do

At the end of the exercise, you should be able to:

• Work with RAM disks

• Worth with software RAID

• Work with logical volume management

Introduction

In this exercise, you will create and modify Linux storage devices, both

physical and logical. During this lab exercise, you will use the Linux

distribution that you have loaded onto your lab system. Please

disregard any exercise steps that reference a different Linux

distribution.

Requirements

• This workbook

• A workstation with Fedora, RHEL, or SLES installed

Page 54: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 54/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

8-2 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Exercise instructions

Preface

• All exercises in this chapter depend on the availability of specific equipment in

your classroom.

• The hints provided for locating documentation on particular web pages werecorrect when this course was written. By nature, web pages tend to change over

time, so ask your instructor if you have trouble navigating the websites.

• A computer system with a connection to the World Wide Web and a web browser

is recommended but not required.

Note

In this exercise you are going to create and use various block devices. Block devices as

such are not really useful, though, until you create a file system in there. For this, you are

going to use the mke2fs command to create a file system, and the mount command tomount the file systems. These commands are covered in-depth in the next unit.

Section 1: Working with RAM disks (optional) 

 __ 1. Verify the size of the RAM disks that the kernel uses.

 __ 2. Format the ramdisk with mke2fs.

 __ 3. Create a directory /mnt/ramdisk, and mount the RAM disk on that mountpoint.

 __ 4. Run the df command to see how much space is available on this RAM disk. __ 5. Copy some files onto this ramdisk, and verify that they are indeed there.

 __ 6. Unmount the ramdisk and mount it again. Is the file still there?

 __ 7. Reboot your system and then try to mount the RAM disk again. Does this work?

Section 2: Working with partitions 

If you installed your system correctly, then you should have at least 450MB in unpartitioned

space left. We are going to create four partitions in here, 150MB each, which are going to

be used in the subsequent exercises. __ 8. Start the fdisk program and create four additional partitions. The partition size

should be 150MB each. Save the partition table to disk. Write down the partition

numbers you created, because you'll be using these in the rest of this exercise.

 __ 9. Ensure the changes to the partition table have been modified in the running kernel

by executing the partprobe command.

Page 55: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 55/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 8. Block devices, RAID, and LVM 8-3

5.4

Xempty  __ 10. Format the first of the four partitions with the mke2fs command. Create a

mountpoint /mnt/partition and mount this partition on this mountpoint.

 __ 11. Run the df command to see how much space is available on these partitions.

 __ 12. Copy some files onto these partitions and verify that they are indeed there.

 __ 13. Reboot your system and then try to mount the partition again. Does this work?

 __ 14. Unmount the partition you just mounted.

Section 3: Preparing for RAID 

 __ 15. With fdisk, change the partition types of the four partitions to 0xfd (Linux RAID

autodetect).Use partprobe to re-read the partition table and, if necessary, reboot

your system afterwards.

Section 4: Working with RAID 

 __ 16. Create a RAID array using three partitions in a linear array. Use the mdadm 

command to initialize the array, and then create a file system on it. Mount the array

on a mountpoint called /mnt/raid. Run the df command to find out how much

space this partition has, and view the status of the RAID array. Then, unmount the

partition and stop the RAID array.

Note: In order to watch what happens during the steps below, such as the --create or

--manage options, open another terminal and type:

watch -n1 -d cat /proc/mdstat

Now adjust your other terminal window so you can type in it and see the results of the

watch commands. __ 17. Create a new RAID array using four partitions in a RAID-0 array. Use the mdadm

command to initialize the array, and then create a file system on it. Mount the array

on a mountpoint called /mnt/raid. Run the df command to find out how much

space this partition has, and view the status of the RAID array. Then, unmount the

partition and stop the RAID array.

 __ 18. Create a new RAID array using three partitions in a RAID-1 array and one more

used as a spare. Use the mdadm command to initialize the array, and then create a

file system on it. Mount the array on a mountpoint called /mnt/raid. Run the df 

command to find out how much space this partition has, and view the status of the

RAID array. Set one or two disks in the array to faulty and watch the array recover

itself using the spare disk. Then, unmount the partition and stop the RAID array.

 __ 19. Create a new RAID array using three partitions in a RAID-5 array and one more

used as a spare. Use the mdadm command to initialize the array, and then create a

file system on it. Mount the array on a mountpoint called /mnt/raid. Run the df 

command to find out how much space this partition has, and view the status of the

Page 56: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 56/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

8-4 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

RAID array. Set one or two disks in the array to faulty and watch the array recover

itself using the spare disk. Then, unmount the partition and stop the RAID array.

Section 5: Working with LVM 

 __ 20. With fdisk, change the partition types of the four partitions to 0x8e (Linux LVM). Try

using partprobe and, if necessary, reboot your system afterwards.

 __ 21. Initialize each of the four partitions that you used earlier as physical volumes. If you

get the error message /etc/lvmtab does not exist, run the vgscan 

command to create it.

 __ 22. Create a volume group vg00 consisting of only the first two LVM partitions. Use a PE

size of 4MB.

 __ 23. Create a logical volume lv00 of 50MB in the volume group vg00.

 __ 24. Format the logical volume with the mke2fs command. Create a mount point

/mnt/lv00 and mount the logical volume. Then run the df command to see how

much space is available. __ 25. Use the various LVM commands to retrieve information about the physical volumes,

the volume group, and the logical volumes.

 __ 26. Take a look at the files that were created in /etc/lvm. Can you read these files?

 __ 27. Add the third and fourth LVM partitions to the volume group vg00, and migrate all

data onto these physical volumes. Then, reduce the volume group so that the

volume group only contains the third and fourth partition. Do you need to unmount

the /dev/vg00/lv00 logical volume first?

 __ 28. Add the first two LVM partitions back to your volume group, and create three more

logical volumes in this volume group, called lv01 through lv03. Each logical volume

needs to be 50MB as well. We will need these in the next exercise.

 __ 29. Take a look at the output of the pvscan command. Does this seem helpful?

End of exercise 

Page 57: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 57/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 9. File systems 9-1

5.4

Xempty Exercise 9. File systems

What this exercise is about

This exercise lets you work with file systems.

What you should be able to do

At the end of the exercise, you should be able to:

• Create, mount, and unmount Linux file systems

• Mount and unmount non-Linux file systems

• Automatically mount file systems at system startup

• Configure user quota

IntroductionIn this exercise, you will create and modify Linux file systems. During

this lab exercise, you will use the Linux distribution that you have

loaded onto your lab system. Please disregard any exercise steps that

reference a different Linux distribution.

Requirements

• This workbook

• A workstation with Fedora, RHEL, or SLES installed

Page 58: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 58/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

9-2 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Exercise instructions

Preface

• All exercises in this chapter depend on the availability of specific equipment in

your classroom.

• The hints provided for locating documentation on particular web pages werecorrect when this course was written. By nature, web pages tend to change over

time, so ask your instructor if you have trouble navigating the websites.

• A computer system with a connection to the World Wide Web and a web browser

is recommended but not required.

Section 1: Creating Linux file systems 

You will now create various file systems in the logical volumes we made earlier. Note that

/dev/vg00/lv00 already contains an ext2 file system.

 __ 1. Create an ext3 file system in /dev/vg00/lv01. __ 2. Create a mount point, /mnt/lv01, for this file system.

 __ 3. Mount the file system on this mount point.

 __ 4. Issue the mount and df commands to see the mounted file systems. Can you see

how much space the journals are taking? Also, list the root directory of the mounted

file systems. Are the journals visible?

 __ 5. Create some files and directories on these mounted file systems.

Section 2: Automatically mounting file systems at system startup 

File systems that you want to mount automatically at system startup should be listed in

/etc/fstab.

 __ 6. Edit the /etc/fstab file to include all the previously created file systems.

 __ 7. Issue the sync command to ensure that all data is written to disk. Wait five seconds,

and then turn off your computer with the power off button. (Do not do a proper

shutdown!) Turn on your computer and watch the boot messages. Which file system

was checked the fastest?

Section 3: Changing file system size  __ 8. Using lvextend and resize2fs, increase the size of each file system in vg00 to

100MB. When complete, verify the new file system size using df.

Note: The ext2 file system does not support online resizing, so it will have to be

unmounted. The ext3 file system can be resized online (while mounted).

Page 59: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 59/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 9. File systems 9-3

5.4

Xempty Section 4: Working with files with multiple names 

As seen in the lecture, a file can have multiple names, as long as each name refers to the

same inode. An example of this situation is /bin/gzip, /bin/gunzip, and /bin/zcat.

 __ 9. Verify that /bin/gzip, /bin/gunzip, and /bin/zcat indeed have the same

inode number.

 __ 10. Go to /root and create a file named one, using Vi. Put some text in the file so thatyou can identify that file for yourself.

 __ 11. Verify the file name and the contents.

 __ 12. Now create a second link to the file (a second file name) named two. Verify the file

name and the contents.

 __ 13. Delete the file one.

 __ 14. Verify the file name and contents of two. Note that the link count has dropped.

 __ 15. Create a third link, called three, in the / directory. It should again point to the original

file. Verify the file name and contents of this file.

 __ 16. Now try to create a fourth link, named four, on one of the file systems you just

created.

 __ 17. Create a symbolic link from /root/two to /mnt/lv00/four. Read the manual

page for ln if necessary. Verify the name and contents of the file.

 __ 18. Now delete /root/two, and verify the contents of both /tmp/three and

/mnt/lv00/four.

Section 5: Configuring user quota 

 __ 19. Remount the /home file system so that quota are enabled, and ensure that quotas

are enabled when the system reboots.

 __ 20. Perform a recalculation of current quotas and turn quota checking on.

 __ 21. Set the soft limit of users tux1 and tux2 to 4MB and the hard limit to 5MB.

 __ 22. On another virtual terminal, log in as tux1, and create five files of 1MB each. Watch

what happens.

 __ 23. Still logged in as tux1, check the quota.

 __ 24. Switch back to your root session and check the quota of all users.

End of exercise 

Page 60: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 60/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

9-4 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Page 61: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 61/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 10. Kernel configuration 10-1

5.4

Xempty Exercise 10. Kernel configuration

What this exercise is about

This lab provides you with hands on experience configuring a Linux

kernel.

What you should be able to do

At the end of the exercise, you should be able to:

• Configure the running kernel

• Make temporary and persistent changes to the kernel configuration

Introduction

In this exercise you will be performing various kernel configuration

activities.

Requirements

• This workbook

• A workstation with RHEL or SLES installed

Page 62: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 62/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

10-2 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Exercise instructions

Preface

• All exercises in this chapter depend on the availability of specific equipment in

your classroom.

• The hints provided for locating documentation on particular web pages werecorrect when this course was written. By nature, web pages tend to change over

time, so ask your instructor if you have trouble navigating the websites.

• A computer system with a connection to the World Wide Web and a web browser

is recommended but not required.

Section 1: Viewing the current kernel configuration 

 __ 1. Use the lsmod command to list the modules currently loaded in the running kernel.

How many are there? (Hint: Use tail and wc to construct a command to tell you)

 __ 2. SLES only: You can see the contents of the config file used to compile the kernel bylooking at the contents of the /proc/config.gz file. Use zcat and less to view it.

 __ 3. Module configuration is done in the /etc/modprobe.conf file. View the contents

of the file. How many modules are being configured? Which module corresponds to

the eth0 device alias?

 __ 4. Locate the module file for the eth0 device in the file system. Using modinfo, view

the author, license, description, and parameters of the module.

Section 2: Changing the running kernel configuration 

 __ 5. Using the sysctl command, view all the tunable kernel parameters.

 __ 6. Using the same command, view just the parameter vm.swappiness.

 __ 7. Change the value of vm.swappiness to 10.

 __ 8. Using the cat command, view the contents of the file in the /proc virtual file system

that holds the currently set value.

 __ 9. The change is made in the kernel and has taken effect instantly, but it will not persist

after a reboot. Change the /etc/sysctl.conf file, and add a line to the bottom to

set this kernel parameter.

 __ 10. Reboot the machine. Log in as root and see if the parameter is set to the new value.

End of exercise 

Page 63: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 63/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 11. Memory management 11-1

5.4

Xempty Exercise 11. Memory management

What this exercise is about

This exercise demonstrates memory management in Linux and how to

create additional paging space volumes.

What you should be able to do

At the end of the exercise, you should be able to:

• Use the most important tools in memory management

• Create and activate paging partitions and paging files

Introduction

In this exercise, you will be performing various memory management

activities.

Requirements

• This workbook

• A workstation with a supported distribution of Linux installed

Page 64: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 64/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

11-2 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Exercise instructions

Preface

• All exercises in this chapter depend on the availability of specific equipment in

your classroom.

• The hints provided for locating documentation on particular web pages werecorrect when this course was written. By nature, web pages tend to change over

time, so ask your instructor if you have trouble navigating the websites.

• A computer system with a connection to the World Wide Web and a web browser

is recommended but not required.

Section 1: Reduce the amount of configured RAM 

In this exercise, you are going to look at memory management in Linux. As part of this

exercise, we are going to exhaust the available memory. To make the exercise a bit easier

to perform, the Linux kernel needs to be modified to only detect 256MB of RAM. This can

be done by passing a parameter to the kernel at boot time.Since 256MB of memory is not enough to run a full graphical environment, we will also boot

the system in runlevel 3, which disables the graphical login. The exercise will be done at

the command line.

 __ 1. Reboot your machine, and stop at the GRUB bootloader screen.

 __ 2. Modify the kernel to only configure 256MB of memory.

Section 2: Using top 

 __ 3. Log in as root. Verify the virtual console number that you have just logged into.This means that you have logged in on virtual console 1, accessible by

<CTRL><ALT><F1>.

 __ 4. Start top and identify the following pieces of information:

• The time, the up time, the number of users, and the load information on the first

line

• The number of processes on the second line

• The CPU breakdown on the third line

• The real memory breakdown on the fourth line

• The swap space breakdown on the fifth line• The processes (sorted by CPU-time) on the next lines

Verify that Linux detected only 256MB.

 __ 5. top automatically refreshes itself after 10 seconds. To increase this to one second,

enter the command s1.

Page 65: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 65/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 11. Memory management 11-3

5.4

Xempty  __ 6. top by default does not show the amount of swap space used by each processes.

To show this amount too, call up the Field Order screen with the f command, and

enable the swap space display.

 __ 7. To sort processes in a different order use the M , P, or T command.

 __ 8. Leave top running in this virtual console, switch to the next available one, likely

number 2, and log in as root.

Section 3: Checking swap space 

 __ 9. There should be one active swap space (check the fifth line of top). Deactivate this

swap space. (If you do not know which partition is used as swapspace, check

/proc/swaps.)

 __ 10. Go back to your top window and check what happened.

 __ 11. Switch back to virtual console 2 and re-activate the swap space.

Section 4: Using the cache  __ 12. Caching is done automatically. If you have performed the exercises so far, your

cache usage should be about 20MB. Let's see what happens if we really start

accessing the disk. Start a very disk-intensive program.

 __ 13. Watch what happens to the amount of cached data in top. This number should

increase until your cache occupies almost all of your real memory. Only about 4MB

will be left over for application use; however, also note that virtually no processes will

be swapped out to disk.

Section 5: Using the swap space The swap space is only used if there is a real shortage in memory. First, the amount of

cached data decreases to about zero before processes are swapped to disk. Therefore,

you need to have a program which uses a lot of real memory. The easiest solution is to

write that ourselves.

 __ 14. Create the directory /root/bin and cd into it.

Page 66: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 66/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

11-4 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

 __ 15. Create a program called usemem , with contents:

#!/usr/bin/perl

 print "Allocating $ARGV[0] megabytes of memory...\n";

$big = "";

for( $i=0; $i<$ARGV[0]; $i++ )

{

$big .= "1234567890"x104858;}

 print "Press ENTER to release memory...\n";

 <STDIN>;

When you start this program, it will gradually allocate the amount of memory you

specify on the command line and then wait for you to press Enter. When you press

Enter, the program exits and thus will deallocate its memory.

Note: Your instructor might have this program available already.

 __ 16. Do a chmod 755 of this program and start it with parameter 1. This will ensure that

the program allocates about 1MB of memory.

 __ 17. Now, go back to your top screen and select the sort by memory usage mode by

issuing the M command. Note how much memory is used by the usemem program.

 __ 18. Stop usemem and start it with about half the amount of memory which is in your

system. Thus, if you have 256MB of real memory or decreased the amount to

256MB, use 99 as parameter. Watch what happens in top. First you should see the

amount of cached data decrease and maybe see some processes already being

swapped out.

 __ 19. Now start usemem with about 80% of your memory and watch what happens.

 __ 20. Stop usemem and watch what happens. Note that processes swapped out are notautomatically swapped in as soon as memory comes available. They will be

swapped in when needed.

 __ 21. Disable your swap space with swapoff and watch what happens.

 __ 22. Enable swap space again, and run usemem with about 90% of the total amount of

memory (real + swap). If you exhaust your real memory, and exhaust the swap

space, you will see that usemem is automatically killed when it tries to allocate even

more memory.

Section 6: Creating a swap file 

If you suddenly need more swap space on a running system but you have no more empty

partitions to spare, you can use swap files. Using swap files, however, is less efficient than

swap partitions, therefore use this only in an emergency. It is even possible to put your

swapfile on an NFS-mounted directory, but there are easier ways of bringing down a

network.

Page 67: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 67/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 11. Memory management 11-5

5.4

Xempty  __ 23. First, find a file system where you have room for a large swapfile (at least 64MB

free). Locate a suitable directory on this file system.

 __ 24. Create the large file to be used as swapfile.

 __ 25. Convert this file into a swapfile.

 __ 26. Activate it.

 __ 27. Go to your top window and check whether the swap space has increased. Also,view the /proc/swaps file. What do you think is the meaning of the Priority field,

and why is this different from the swap partition? Now try the usemem command

that failed last time.

 __ 28. Add the swap file to your /etc/fstab file so that it is activated next time you

reboot.

 __ 29. Reboot your system to make sure that you are working with the correct amount of

memory again.

End of exercise 

Page 68: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 68/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

11-6 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Exercise review and wrap-up

This exercise covered various memory management activities.

Page 69: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 69/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 12. Virtualization 12-1

5.4

Xempty Exercise 12. Virtualization

What this exercise is about

This exercise demonstrates how to install and configure Xen on Linux.

What you should be able to do

At the end of the exercise, you should be able to:

• Use the various graphical and command line utilities that manage

the Xen environment

Introduction

In this exercise you will be performing various Xen configuration andmanagement activities.

Requirements

• This workbook

• A workstation with RHEL6 or SLES11 installed.

Page 70: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 70/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

12-2 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Exercise instructions

Preface

• All exercises in this chapter depend on the availability of specific equipment in

your classroom.

• The hints provided for locating documentation on particular web pages werecorrect when this course was written. By nature, web pages tend to change over

time, so ask your instructor if you have trouble navigating the websites.

• A computer system with a connection to the World Wide Web and a web browser

is recommended but not required.

Section 1: Create file system to store Xen disk images (RHE6, SLES11) 

A file system needs to be created to hold the file based disk images for the Xen guests. The

following steps will create a 5Gb partition which will be formatted as ext3 and mounted on

/var/lib/xen/images . This is the default location for all guest disk images. The steps

assume the partition created is /dev/sda13.# fdisk /dev/sda

Command: n

First Cylinder: <Enter> Last Cylinder: +5000M Command: w

# partprobe

# mke2fs -j /dev/sda13

# mount /dev/sda13 /var/lib/xen/images

# vi /etc/fstab

Add the following line to the end of the file:

/dev/sda13 /var/lib/xen/images ext3 defaults 1 2

Overview of tasks

This exercises consists of three parts. First, you will be installing the Xen packages and

configuring domain 0. Second, you will be installing a Xen guest domain using YaST.

Finally, you will be modifying the memory allocation of your Xen guest.

The instructions for installing the packages and creating the Xen guest domain are different

for SLES11 and RHEL6. Make sure you follow the exercises that correspond to your

distribution. The memory allocation exercise is the same on all three distributions.

Page 71: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 71/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 12. Virtualization 12-3

5.4

Xempty Section 2: Installing Xen (SUSE Linux Enterprise Server 11) 

Note

These instructions are for installing the Xen packages in SLES11. If you are using RHEL6,

skip to the section entitled Installing Xen (RHEL6).

 __ 1. Log in to your machine as the root user.

 __ 2. Start the YaST Control Center, and select the Software Management module.

 __ 3. Change the filter to Patterns.

 __ 4. Click Xen Virtual Machine Host Server to add a checkbox and select all the

packages in that category.

 __ 5. Go back to Filter, select Search, and type xen in the search field. You will see a

number of xen packages already selected in the previous step. Select thekernel-xen package from the list and click Accept when done.

You might see a window detailing additional packages that will be installed to satisfy

dependencies. Select Accept to continue.

The Xen packages will now be installed on your system, using the pre-configured

repository.

 __ 6. Reboot the machine, and select the Xen kernel from the GRUB boot menu.

 __ 7. Log in as the root user.

 __ 8. Open a terminal window and use the xm list command to view the currentlyrunning domains. There should be only one domain running, Domain-0.

Section 3: Installing a guest domain (SLES11) 

 __ 9. Open the YaST Control Center.

 __ 10. Select Virtualization -> Virtual Machine Manager

 __ 11. Select the Xen service running on localhost, then click the New button at the bottom

of the screen.

 __ 12. Select I need to install an operating system and click Forward to continue. __ 13. Make sure SUSE Linux Enterprise Server 11 is highlighted, and click Forward to

continue.

 __ 14. On the Summary screen, click Operating System Installation.

 __ 15. For the Network URL, type http://xx.xx.xx.xx/sles11 . Leave all other boxes

blank, and click Apply to continue.

Page 72: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 72/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

12-4 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

 __ 16. On the Summary Screen, click OK to continue. You should see a dialog box pop-up

stating that the virtual machine has been created and installation has started. When

it disappears, you will return to the Virtualization Manager window. You should now

see a new virtual machine called sles11 running.

 __ 17. Right-click the sles11 virtual machine, and select Open.

 __ 18. Follow the normal installation prompts. Leave everything at their defaults, and start

the installation. The installation of the guest should take approximately 10-15

minutes. As with a normal installation, after the packages are installed, the virtual

machine will reboot. The virtual console window needs to be reopened when this

occurs.

Continue following the configuration steps of the installation program. Use the

options in the Installing Linux exercise as a guideline.

 __ 19. Skip to the section entitled Changing memory allocation of a guest machine.

Section 4: Installing Xen (RHEL6) 

Note

The following instructions are for installing the Xen packages in RHEL6. If you are using

SLES11, skip to the section entitled Installing Xen (SLES11).

 __ 20. Log in as the root user.

 __ 21. From the Applications menu on the top panel, select Add/Remove Software.

 __ 22. Select the Edit menu option, then select Repositories from the menu.

 __ 23. Click Add.

 __ 24. Fill in the following values in the dialog box:

RHEL5:

Name: rhel5-xen

Description: RHEL6 Virtualization Repository

Location: http://server.example.com/rhel60s/VT

Advanced -> GPG Key:

file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

 __ 25. Exit the application, and restart it (Applications -> Add/Remove Software).

 __ 26. Select the packages that need to be installed.

RHEL6: Select Virtualization on the left side, then select the checkbox for

Virtualization. Click the Optional Packages button. Make sure all packages are

selected, then click Close.

Page 73: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 73/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 12. Virtualization 12-5

5.4

Xempty  __ 27. Click Apply, then Continue. If you see the Dependencies Added dialog box, select

Continue to install all dependent software. You might also see an Import Key dialog

box. If so, select Import Key.

 __ 28. When the installation is complete, exit the application.

 __ 29. Reboot the machine. Upon reboot, press a key to pause the GRUB bootloader, and

select the newly installed kernel. It is the one with the word xen in the version

information.

During boot, you will notice more informational messages displayed; they are all

prefixed with (XEN) and are configuring the paravirtualized kernel.

 __ 30. At the login prompt, log in as root.

 __ 31. Open a terminal window, and type xm list. You should see an entry for the Xen

Domain-0, which is the Xen hypervisor. Under the State column, you should see an

r; this indicates that the domain is in the running state.

Section 5: Installing a guest domain (RHEL6)  __ 32. Select Applications -> System Tools -> Virtual Machine Manager from the top

panel menus. In the application window, you will see one entry for localhost with a

status of Disconnected.

 __ 33. Right-click the localhost entry, and select Connect from the menu.

The localhost entry should now be highlighted and show with a status of Active, and

a new line with the name Domain-0 should have appeared, with a status of Running.

 __ 34. Click the New button at the bottom of the application window. Read the dialog box,

and click Forward to continue.

 __ 35. In the Naming your virtual system dialog box, use rhel6-guest for RHEL6. Click

Forward to continue.

 __ 36. In the Choose a virtualization method dialog box, select Paravirtualized. Click

Forward to continue.

 __ 37. In the Locating installation media dialog box, enter the following into the Install

Media URL:

RHEL6: http://server.example.com/rhel60s

 __ 38. Click Forward to continue. __ 39. In the Assigning storage space dialog box, select Simple File. Verify the values.

RHEL6:

File Location: /var/lib/xen/images/rhel6-guest.img

File Size: 4000MB

Deselect the checkbox for Allocate entire virtual disk now and click Forward to

continue.

Page 74: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 74/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

12-6 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

 __ 40. In the Connect to host network dialog box, leave all settings as their defaults, and

click Forward to continue.

 __ 41. In the Allocate memory and CPU dialog box, verify the following settings:

VM Max Memory (MB): 512

VM Startup Memory (MB): 512

VCPUs: 1

 __ 42. Click Forward to continue.

 __ 43. At the Ready to begin installation screen, take a moment to verify your settings.

When ready, click Finish to continue.

The virtual machine will now be created, and a Virtual machine Console will start up.

In the console, you will see the Linux kernel messages, as well as the installation

program start.

 __ 44. In the Virtual Machine console, select the correct install language and keyboard.

 __ 45. Leave all other installation options (Partitioning, TCP/IP, Package Selection) at theirdefault values. For the root password, use ibmlnx.

The installation of the guest machine will take 10-15 minutes. When the installation

is complete, select Next to reboot the guest. It will shut down, and the console will

give you a message Guest Not Running. Click the Run button on the menu bar to

restart the guest.

Section 6: Changing memory allocation of a guest machine (RHEL6/SLES11) 

In this section, you will experiment with dynamically changing the memory allocated to yourvirtual machine, and you will see the effects within the guest operating system.

 __ 46. Log in to the Xen guest domain you just installed as the root user.

 __ 47. Start up a terminal emulator, and within it, run the top application.

 __ 48. Press <CTRL><ALT> to release the mouse from the virtual machine console.

Select the Virtual Machine Manager window.

 __ 49. Right-click the entry for your guest machine, and select Details from the drop-down

menu.

 __ 50. Select the Hardware tab.

 __ 51. Select the Memory option in the left window pane.

 __ 52. Change the memory allocated to the client to 256Mb and click Apply.

 __ 53. Switch back to the Virtual Console of the guest and look at the top output. What did

you notice?

 __ 54. Switch back to the guest Machine Details window, increase the memory to its

previous value, and click Apply to finish.

Page 75: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 75/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 12. Virtualization 12-7

5.4

Xempty  __ 55. Switch back to the Virtual Console and look at the output of the top command. Did

the allocated memory increase?

End of exercise 

Page 76: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 76/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

12-8 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Page 77: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 77/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 13. Troubleshooting 13-1

5.4

Xempty Exercise 13. Troubleshooting

What this exercise is about

This exercise lets you troubleshoot some Linux problems and use

some techniques to solve these problems.

What you should be able to do

At the end of the exercise, you should be able to:

• Use rescue mode

Introduction

In this exercise, you will be performing various activities related totroubleshooting.

Requirements

• This workbook

• A workstation with RHEL or SLES installed

Page 78: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 78/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

13-2 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Exercise instructions

Preface

• All exercises in this chapter depend on the availability of specific equipment in

your classroom.

• The hints provided for locating documentation on particular web pages werecorrect when this course was written. By nature, web pages tend to change over

time, so ask your instructor if you have trouble navigating the websites.

• A computer system with a connection to the World Wide Web and a web browser

is recommended but not required.

Section 1: Install problem creation scripts 

 __ 1. Log in to the system as root.

 __ 2. Create a mount point for the NFS server named /mnt/problem.

 __ 3. Mount the NFS server directory /export/files/problem to the /mnt/problem mount point. NFS server name/address: _____________________________ 

 __ 4. Install the problem creation script rpm problem-1.0-0.i386.rpm.

Section 2: Problem #1

 __ 5. Log in to the system as root.

 __ 6. Create the problem by issuing the following command: /root/prob/p1create. Note

the problem:

 __ 7. Return the system to normal operation. How was the problem resolved? __ 8. Have the instructor validate that the problem has been resolved.

Section 3: Problem #2 

 __ 9. Log in to the system as root.

 __ 10. Create the problem by issuing the following command: /root/prob/p2create. Note

the problem:

 __ 11. Return the system to normal operation. How was the problem resolved?

 __ 12. Have the instructor validate that the problem has been resolved.

Section 4: Problem #3 

 __ 13. Log in to the system as root.

 __ 14. Create the problem by issuing the following command: /root/prob/p3create. Note

the problem:

 __ 15. Return the system to normal operation. How was the problem resolved?

Page 79: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 79/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

 © Copyright IBM Corp. 2002, 2011 Exercise 13. Troubleshooting 13-3

5.4

Xempty  __ 16. Have the instructor validate that the problem has been resolved.

Section 5: Problem #4 

 __ 17. Log in to the system as root.

 __ 18. Create the problem by issuing the following command: /root/prob/p4create. Note

the problem: __ 19. Return the system to normal operation. How was the problem resolved?

 __ 20. 20. Have the instructor validate that the problem has been resolved.

Section 6: Problem #5 

 __ 21. Log in to the system as root.

 __ 22. Create the problem by issuing the following command: /root/prob/p5create. Note

the problem:

 __ 23. Return the system to normal operation. How was the problem resolved? __ 24. Have the instructor validate that the problem has been resolved.

End of exercise 

Page 80: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 80/82

Student Exercises 

Course materials may not be reproduced in whole or in part

without the prior written permission of IBM.

13-4 Linux Jumpstart for UNIX © Copyright IBM Corp. 2002, 2011

Exercise review/wrapup

This exercise introduced a number of problems onto the students’ system that required the

students to troubleshoot and resolve the issues.

Page 81: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 81/82

5.4.0.3

ackpgBack page

Page 82: Linux Student Exercises.pdf

7/27/2019 Linux Student Exercises.pdf

http://slidepdf.com/reader/full/linux-student-exercisespdf 82/82