AN143XSTUDHINT

March 28, 2018 | Author: ovidiu0702 | Category: Command Line Interface, Graphical User Interfaces, Superuser, V Mware, Technology
Share Embed Donate


Short Description

AN143XSTUDHINT...

Description

V8.0

cover

Front cover

AIX Jumpstart for UNIX Professionals (Course code AN14)

Student Exercises with hints ERC 3.1

Student Exercises with hints

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® is a registered trademark of International Business Machines Corporation. The following are trademarks of International Business Machines Corporation in the United States, or other countries, or both: AIX 5L™ Approach® Electronic Service Agent™ Initiate® Power Architecture® Power® POWER6® pSeries® System Storage®

AIX 6™ AS/400® Everyplace® MVS™ POWER Hypervisor™ PowerHA® POWER7+™ RS/6000® Tivoli®

AIX® DB2® HACMP™ Notes® Power Systems™ PowerVM® POWER7® System p® WebSphere®

PostScript is either a registered trademark or a trademark of Adobe Systems Incorporated in the United States, and/or other countries. Intel is a trademark or registered trademark 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. Windows is a trademark 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. Java™ and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates. VMware and the VMware "boxes" logo and design, Virtual SMP and VMotion are registered trademarks or trademarks (the "Marks") of VMware, Inc. in the United States and/or other jurisdictions. Other product and service names might be trademarks of IBM or other companies. September 2013 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 2009, 2013. 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.

V8.0 Student Exercises with hints

TOC

Contents Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii Exercises description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix Exercise 1. Introduction to AIX and IBM Power Systems . . . . . . . . . . . . . . . . . . . . Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 1: Accessing the AIX Infocenter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 2: Environment information, access, and familiarity . . . . . . . . . . . . . . . . . . . .

1-1 1-2 1-2 1-4

Exercise 2. Using system management tools in AIX . . . . . . . . . . . . . . . . . . . . . . . . Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 1: Using SMIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 2: IBM Systems Director Console for AIX (pconsole) . . . . . . . . . . . . . . . . . . .

2-1 2-2 2-2 2-6

Exercise 3. AIX software installation and maintenance . . . . . . . . . . . . . . . . . . . . . . 3-1 Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 Part 1: AIX LPP packaged software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2 Part 2: (Optional) RPM packaged software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10 Exercise 4. System configuration and devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 1: List device configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 2: List and change device attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 3: Device states (changing the status of a disk drive device) . . . . . . . . . . . . .

4-1 4-2 4-2 4-4 4-5

Exercise 5. TCP/IP implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 1: TCP/IP configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 2: (Optional) NFS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5-1 5-2 5-2 5-6

Exercise 6. System startup and shutdown . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 1: Multiuser mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 2: Using the HMC to shut down and activate an AIX partition . . . . . . . . . . . .

6-1 6-2 6-2 6-6

Exercise 7. Configuring logical partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1 Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 Exercise 8. AIX installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 1: Setting up the NIM server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 2: Activate the LPAR to SMS and initiate a network boot . . . . . . . . . . . . . . . .

8-1 8-2 8-2 8-5

Exercise 9. Working with LVM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Contents

iii

Student Exercises with hints

Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2 Part 1: Creating and manipulating volume groups . . . . . . . . . . . . . . . . . . . . . . . . . 9-2 Part 2: Creating and manipulating logical volumes . . . . . . . . . . . . . . . . . . . . . . . . 9-5 Part 3: Migrating logical volumes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8 Part 4: Mirroring rootvg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10 Part 5: Exploring and documenting your LVM environment . . . . . . . . . . . . . . . . 9-12 Part 6: (Optional) Striped logical volumes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-14 Exercise 10. File system administration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10-1 Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2 Part 1: Working with file systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2 Part 2: (Optional) File system block sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6 Exercise 11. The Object Data Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-1 Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2 Part 1: Device configuration ODM classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2 Part 2: (Optional) Modifying a device attribute default value . . . . . . . . . . . . . . . . 11-6 Exercise 12. LVM metadata issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12-1 Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3 Part 1: Using intermediate LVM commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3 Part 2: Export and import a volume group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-9 Part 3: (Optional) Analyze import messages . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-11 Part 4: (Optional) Fixing LVM ODM problems with importvg and exportvg . . . . 12-15 Part 5: (Optional) Fix an LVM ODM problem using rvgrecover . . . . . . . . . . . . . 12-18 Exercise 13. Disk management procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13-1 Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2 Part 1: rootvg disk replacement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-2 Part 2: User VG disk replacement procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-5 Part 3: (Optional) Working with quorum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-7 Exercise 14. Backup and restore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14-1 Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-2 Part 1: mksysb backup of rootvg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-2 Part 2: savevg backup and restore of lvmtestvg . . . . . . . . . . . . . . . . . . . . . . . . . 14-6 Part 3: Backup and restore by name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-9 Part 4: (Optional) Incremental backups (backup and restore by inode) . . . . . . 14-11 Part 5: Using JFS2 snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-13 Part 6: (Optional) Using JFS2 internal snapshots . . . . . . . . . . . . . . . . . . . . . . . 14-17 Part 7: (Optional) Using a snapshot volume group . . . . . . . . . . . . . . . . . . . . . . 14-20 Exercise 15. Error monitoring. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .15-1 Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-2 Part 1: Error log reports and management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-2 Part 2: Error notification with errnotify . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-4 Part 3: (Optional) Redirecting syslogd messages to AIX error log . . . . . . . . . . . 15-5

iv

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

TOC

Exercise 16. System Initialization - I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-1 Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-2 Part 1: Identifying information on your system . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-2 Part 2: Preparing NIM to support booting to maintenance mode . . . . . . . . . . . . . 16-4 Part 3: Booting to maintenance mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16-6 Part 4: Repair a corrupted boot logical volume . . . . . . . . . . . . . . . . . . . . . . . . . 16-11 Part 5: Part 5 (Optional): Working with multi-path bootlists . . . . . . . . . . . . . . . . 16-14 Exercise 17. System Initialization - II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 1: Repair a corrupted log logical volume . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 2: (Optional) Analyze and fix a phase 3 boot problem . . . . . . . . . . . . . . . . .

17-1 17-2 17-2 17-6

Exercise 18. System dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Exercise instructions with hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 1: Working with the AIX dump facility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 2: (Optional) Processing an AIX dump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Part 3: (Optional) Working with a dedicated dump logical volume . . . . . . . . . . . .

18-1 18-2 18-2 18-5 18-9

Exercise 19. Advanced install techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-1 Exercise instructions with Hints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19-2 Part 1: Creating and working with an alternate rootvg . . . . . . . . . . . . . . . . . . . . . 19-2 Part 2: Creating and working with a standby BOS using multibos . . . . . . . . . . . . 19-6 Part 3: (Optional) Applying software maintenance to a standby BOS . . . . . . . . 19-11

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Contents

v

Student Exercises with hints

vi

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

TMK

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® is a registered trademark of International Business Machines Corporation. The following are trademarks of International Business Machines Corporation in the United States, or other countries, or both: AIX 5L™ Approach® Electronic Service Agent™ Initiate® Power Architecture® Power® POWER6® pSeries® System Storage®

AIX 6™ AS/400® Everyplace® MVS™ POWER Hypervisor™ PowerHA® POWER7+™ RS/6000® Tivoli®

AIX® DB2® HACMP™ Notes® Power Systems™ PowerVM® POWER7® System p® WebSphere®

PostScript is either a registered trademark or a trademark of Adobe Systems Incorporated in the United States, and/or other countries. Intel is a trademark or registered trademark 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. Windows is a trademark 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. Java™ and all Java-based trademarks and logos are trademarks or registered trademarks of Oracle and/or its affiliates. VMware and the VMware "boxes" logo and design, Virtual SMP and VMotion are registered trademarks or trademarks (the "Marks") of VMware, Inc. in the United States and/or other jurisdictions. Other product and service names might be trademarks of IBM or other companies.

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

Trademarks

vii

Student Exercises with hints

viii

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

pref

Exercises description 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. Exercise instructions with hints — This section is an exact duplicate of the Exercise instructions section, except that in addition, specific details or hints, or both are provided to help step you through the exercise. A combination of using the Instructions section along with Instructions with hints section can make for a rewarding combination; providing you with, no hints when you don't want them, and hints when you need them. Optional exercises — This section gives you additional exercises to perform relating to the unit of discussion. It is strictly optional and should be performed when you have completed the required exercises. The required exercises pertain to the most pertinent information provided in the unit. This section can help round out the hands-on experience for a related unit. Unit 19, Topic 2: Using multibos

© Copyright IBM Corp. 2009, 2013

Exercises description

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

ix

Student Exercises with hints

x

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 1. Introduction to AIX and IBM Power Systems (with hints)

What this exercise is about This exercise is about accessing the AIX documentation and the course lab environment.

What you should be able to do At the end of the exercise, you should be able to: • Access and navigate the AIX information center • Log in and log out of the classroom environment, including both the HMC and a logical partition

Introduction The classroom environment is likely to be housed in a remote location. This exercise will familiarize you with the systems you will be working with throughout the week.

© Copyright IBM Corp. 2009, 2013

Exercise 1. Introduction to AIX and IBM Power Systems

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

1-1

Student Exercises with hints

Exercise instructions with hints Preface Two versions of these instructions are available; one with hints and one without. You can use either version to complete this exercise. Also, do not hesitate to ask the instructor if you have questions. General notes, applicable to all exercises: Your instructor will provide you with instructions for accessing the remote environment. For example, this might involve using a web browser or Virtual Private Network (VPN). Your instructor will further provide you with all the details and login IDs required. Unless otherwise stated, log in, to systems HMC/LPAR using a terminal window, for example through PuTTY or a Linux command line. » All hints are marked with a >> sign. » The system we used to capture the example output was, obviously different from the system that you will be working on. Thus, the output you see will have differences from what our example output shows. This will also make some of your answers slightly different than what our hints show.

Part 1: Accessing the AIX Infocenter __ 1. Using a web browser on your classroom machine, connect to the IBM Systems Information Center. The URL to enter is: http://publib.boulder.ibm.com/eserver __ 2. In the navigation area, on the left, click AIX Information Center. __ 3. In the content area, on the right, locate the section for AIX 7.1 and click the arrow icon. __ 4. In the content area, click AIX PDFs. Do not download these PDF files at this time, but notice that the entire AIX documentation library is available in softcopy. __ 5. At the topic of the content area, there is a link for the original AIX 7.1 information web page. Click that link to return to the IBM AIX 7.1 Information Center page. The rest of the content area has links to related resources. __ 6. Expand the AIX 7.1 information menu in the navigation area, by clicking on the twisty. The navigation area on the left is an alternate way to locate information in a hierarchical manner. __ 7. For example, you might want instructions on how to install an AIX operating system. In the navigation area, locate and expand the How-to scenarios item. __ 8. That should reveal a list of items, including Administrator how-to’s.

1-2

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Expand Administrator how-to’s, by clicking on the twisty. __ 9. This reveals a list of How-To categories. Expand the Software installation and maintenance category. __ 10. This reveals a list of How-To topics in that category. Click Installing AIX using the media to install a partition with an HMC. In the content area, on the right, you should see an article on the selected topic. __ 11. At the top of the content area, you should see a crumb list which identifies the hierarchical path that could be used to reach this topic. The first link in this list should be AIX 7.1 information. Click AIX 7.1 information to return to the Welcome page for the IBM AIX 7.1 Information Center. __ 12. The AIX Infocenter also has a keyword search capability. Locate the Search field in the upper left and type JFS2. __ 13. In the Search Results there are many links to web pages that matched your search criteria. Click the link titled: JFS and JFS2. There is a basic definition of the file systems and additional links for more detailed information. __ 14. Return to the IBM AIX 7.1 Information page. __ 15. Bookmark this web page for future use.

© Copyright IBM Corp. 2009, 2013

Exercise 1. Introduction to AIX and IBM Power Systems

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

1-3

Student Exercises with hints

Part 2: Environment information, access, and familiarity __ 16. Establish connectivity to the remote lab environment. » Your instructor will provide details on how to achieve this. __ 17. Obtain the following information from your instructor (keep this on hand for the rest of the exercises): Your assigned LPAR name: _____________________ and IP address (en0 interface):_______________________ LPAR (AIX) root password (if not ibmaix): _____________________________ HMC admin login user and password: ________________________________ HMC IP address: ________________________________________________ Managed system name: __________________________________________ NIM server IP address: ___________________________________________ __ 18. Connect and log in to your assigned HMC. In the following steps, you will have a choice between using a command line interface or using the HMC browser-based graphic interface. __ a. If using the command line interface: Open a terminal window and connect to your HMC using ssh protocol to obtain an interactive command prompt. For example, you might use PuTTY. Log in using your assigned HMC admin login user and password. __ b. If using the graphic interface: Start your browser (Firefox if using the e-lab environment) and type in the URL: https:// At the resulting Web page, click the Log on and launch the Hardware Management Console web application link.

1-4

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Accept any certificate issues and permit pop-ups as necessary to continue.

On the next window to pop up, enter your assigned HMC admin login user and password. If presented with an option to reconnect to an existing disconnected session, click the New Session button to create a new session. __ 19. Display all of the LPARs defined on the managed system. __ a. If using the command line interface: Obtain the names of the systems being managed by this HMC by entering the following command. # lssyscfg -r sys -F name © Copyright IBM Corp. 2009, 2013

Exercise 1. Introduction to AIX and IBM Power Systems

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

1-5

Student Exercises with hints

Use the lssyscfg command and format the output so just the name, state, and operating system (OS) level attributes are displayed, as follows: # lssyscfg -m -r lpar -F name state os_version __ b. If using the graphic interface: In the navigation area (on the left), expand Systems Management and then expand Servers. Click the name of your assigned system. In the content area you will see the defined LPARs listed.

__ 20. Open a virtual console to your assigned LPAR. __ a. If using the command line interface: From the HMC command line, access your assigned lab system (LPAR) by opening a virtual console session, as follows: # mkvterm -m -p __ b. If using the graphic interface:

1-6

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Select your assigned LPAR so there is a check mark in the box. When the small chevron icon appears to the right of the LPAR name, click that icon. This will display a menu. Select Console Window in the task menu and then click the submenu Open Terminal Window. A virtual terminal emulation window should be started, as a result. Note The terminal emulation window might be hidden behind existing windows.

__ 21. Log in as the user root. The password is ibmaix. __ 22. Terminate the virtual console session. __ a. If using the command line interface: Type a tilde (~) and a dot (.). Respond with yes (y) when prompted. __ b. If using the graphic interface, close the virtual terminal emulation window. __ 23. Exit the HMC session. __ a. If using the command line interface: Type exit to log out of the command line window. __ b. If using the graphic interface:

© Copyright IBM Corp. 2009, 2013

Exercise 1. Introduction to AIX and IBM Power Systems

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

1-7

Student Exercises with hints

Click Logout at the upper right area of the HMC window. __ 24. Again, using a terminal emulation window, access your assigned AIX logical partition directly (not through the HMC), using telnet protocol, and log in as the root user. __ 25. Determine who you are, including: your user and group ID, your current directory, and your home directory: UID: ______ GID: _________ Current directory: ___________ Home directory: ___________ » » » » »

# id # pwd / # echo $HOME /

__ 26. To verify that you do, in fact, have root privileges, cat out the file /etc/security/passwd. This file holds the encrypted passwords for the users on your system. Only root can look at this file. More details on this file are mentioned later in the course. Did you see the contents of the file? __________ Yes. » # cat /etc/security/passwd » (Be careful to not misspell the file name.)

End of exercise

1-8

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 2. Using system management tools in AIX (with hints)

What this exercise is about AIX provides several different tools to manage the environment and perform system administration tasks. This exercise provides an opportunity to use both the System Management Interface Tool (SMIT) and the IBM Systems Director Console.

What you should be able to do At the end of the exercise, you should be able to: • Use SMIT • Navigate through the SMIT menus • Use SMIT function keys • Display the SMIT history files: smit.log, smit.transaction, and smit.script • Use the IBM Systems Director Console for AIX

Introduction This exercise is designed to give you experience working with the system management tools supplied with AIX. In most classrooms, each student should be provided with their own AIX partition.

© Copyright IBM Corp. 2009, 2013

Exercise 2. Using system management tools in AIX

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

2-1

Student Exercises with hints

Exercise instructions with hints Preface Two versions of these instructions are available: one with hints and one without. You can use either version to complete this exercise. Also, do not hesitate to ask the instructor if you have questions. General notes, applicable to all exercises: Your instructor will provide you with instructions for accessing the remote environment. For example, this might involve using a web browser or Virtual Private Network (VPN). Your instructor will further provide you with all the details and login IDs required. Unless otherwise stated, log in to systems (HMC/LPAR) using a terminal window (for example through PuTTY or a Linux command line). On some terminal emulations, the function keys are not operative and you might need to substitute escape sequences. For example, instead of pressing F3, you might need to press for the same function. » All hints are marked with a >> sign. » The output shown in the answers is an example. Your output and answers based on the output might be different.

Part 1: Using SMIT __ 1. Log in to your assigned LPAR as the root user. __ 2. Remove any smit files from the root directory and start SMIT in ASCII mode. » # rm /smit* » # smitty __ 3. Add a user to the system, named team100. When completed exit SMIT. » In SMIT, select Security & Users > Users > Add a User * User NAME

[team100]

» Accept all other defaults. » Press Enter to run. » Exit smit. __ 4. Analyze the output in the smit.script, smit.log, and smit.transaction files. » View each file in turn: » more /smit.log » cat /smit.transaction » cat /smit.script 2-2

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 5. Using SMIT, assign a password for the new user. Set the password to be the same as the user name. When the password has been set, exit from SMIT. » Invoke SMIT: » # smitty » In SMIT, select Security & Users > Users > Change a User's Password User Name [team###] Changing password for team### teamxx's New password: team### (The password will not appear on the screen) Enter the new password again: team### » Press F10 (or Esc+0) and exit from SMIT. __ 6. Start SMIT using the options to redirect the smit.script and smit.log files to the /tmp directory. From the main SMIT menu, select Processes & Subsystems. Display all the current process running on your system. Examine the output. » # smitty -s /tmp/smit.script -l /tmp/smit.log » Select Processes & Subsystems > Processes > Show All Current Processes > Show THREAD information? The pop-up box is displayed. Select no. » Press F6 (to view the command). » Press F3 - Cancel until you are back at the System Management screen. __ a. Which command do you think was executed? _______________. » ps -ef __ b. How can you find out? ___________________________________________ » Pressing the F6 key from the output screen displays a pop-up box that shows the command that was executed. __ c. Return to the main menu. __ 7. Select each of the main SMIT menu entries, briefly examine the sub-menu, then use the F3 key (or Esc+3) to back up to the previous menu. Do not execute any commands that can cause changes to the system. Because you are logged in as root, you must be very careful. We will discuss many of these SMIT menus in later units. » Select each entry. » Press F3. » Repeat as appropriate. __ 8. Shell out (F9 or Esc+9) and execute the date command. Return to SMIT and do the following: __ a. Stop syslogd subsystem. __ b. View the command that was executed. © Copyright IBM Corp. 2009, 2013

Exercise 2. Using system management tools in AIX

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

2-3

Student Exercises with hints

__ c. List ALL subsystems to see that syslogd is inoperative. __ d. Restart syslogd. __ e. Continue to the next step. Do not press F3 or exit SMIT. » Press F9 (or Esc+9) and press Enter. » # date » Press Ctrl-d to return to SMIT. » From the Main menu, select Processes and Subsystems > Subsystems > Stop Subsystem > Stop a Single Subsystem. » Press F4 (or Esc+4) to see the list of Subsystem Process IDs. » Select syslogd. (You may need to scroll down to find it.) » Press Enter to stop the subsystem. » Press F6 (or Esc+6) to view the command. » Press F3 (or Esc+3) repeatedly, to return to the Subsystems menu. » Select List All Subsystems (syslogd should be inoperative). » Press F3 (or Esc+3) back to the Subsystems menu. » Select Start a Subsystem. » Press F4 (or Esc+4) to see the list of Subsystem Names. » Select syslogd. » Press Enter to start the subsystem. __ 9. You should have the COMMAND STATUS screen displayed. Capture an image of this screen. Exit SMIT. » Press F8=(Image) (or Esc+8) and press Enter. » Press F10 (or Esc+0, or Ctrl+C) to exit SMIT. __ 10. Look at the SMIT history files using pg or more. Look for the image you captured in the previous step. What information is in each of these files? ___________________________ _____________________________________________________________ _____________________________________________________________ _____________________________________________________________ » # more/tmp/smit.log » # more/tmp/smit.script

2-4

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» The smit.log file contains a reference to each menu screen selected, the commands executed, output from the commands, and all screen images. The smit.script files contains the high-level commands executed. » Why should these files be monitored? _____________________________________________________________ » Both files should be monitored regularly and purged periodically so disk space is not wasted.

© Copyright IBM Corp. 2009, 2013

Exercise 2. Using system management tools in AIX

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

2-5

Student Exercises with hints

Part 2: IBM Systems Director Console for AIX (pconsole) __ 11. Check to see if the IBM Systems Director Console is running on your assigned LPAR. » # lssrc -s pconsole » # netstat -a |grep 5336 » Output should be: tcp

0

0

*.5336 *.*

LISTEN

__ 12. If not, start pconsole by typing startsrc -s pconsole __ 13. Using a web browser, connect to the IBM Systems Director Console running on your assigned LPAR. If you are not sure, your instructor will advise you how to do this. » https://:5336/ibm/console/ __ 14. Login as the root user and briefly explore the pconsole applications: __ a. OS Management • SMIT, classic and tree view __ b. Monitoring __ c. Health __ 15. Using the Health function in the Navigation area, record the following information: Firmware version: __________________________ System model: _____________________________ Total allocated paging space __________________ __ 16. Log out from the IBM Systems Director Console. » Select the Logout link at the top right side of the browser. Note All of the exercises throughout the rest of the week can be performed using SMIT, pconsole or the command line. You are welcome to use the tool you feel most comfortable with.

End of exercise

2-6

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 3. AIX software installation and maintenance (with hints)

What this exercise is about In this exercise, you will install and manipulate software on the AIX system.

What you should be able to do At the of the exercise, you should be able to: • List the operating system level and query installed software • Install (apply, reject, and commit) LPP filesets • Remove installed software • View the history of installed software • (optional) Query RPM packages installed on the system • (optional) Install an RPM package

Introduction This exercise is designed to give you experience with applying, committing, updating, and rejecting software on AIX.

© Copyright IBM Corp. 2009, 2013

Exercise 3. AIX software installation and maintenance

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

3-1

Student Exercises with hints

Exercise instructions with hints Preface Two versions of these instructions are available: one with hints and one without. You can use either version to complete this exercise. Also, do not hesitate to ask the instructor if you have questions. All exercises of this unit depend on the availability of specific equipment in your classroom. » All hints are marked with a >> sign. » The output shown in the answers is an example. Your output and answers based on the output might be different. In many of the following instructions, you will have a choice between using the command line interface or the SMIT management tool. This will be seen as options in the hints. If using the SMIT panels, you might want to use the F6 (or Esc-6) option to see the underlying command or script which is executed by that panel.

Part 1: AIX LPP packaged software __ 1. Access your assigned lab system and login as the root user. __ a. What is the OS level of the system? _______________________________ Ensure that your answer includes the technology and service pack levels. » # oslevel -s __ 2. Check to see if the alex.grumpy (Grumpy Application) fileset is installed on the system. __________ » # lslpp -l alex.grumpy __ 3. Set your present working directory to /home/AN14/SW. » # cd /home/AN14/SW __ 4. Install (Apply and commit) the alex.grumpy fileset at level 1.1.0.0. Accept the defaults for all other options. The software should be located in directory: /home/AN14/SW/grumpy1100. » If you are using the command line interface: » # cd ./grumpy1100 » # installp -acd . alex.grumpy » If you are using the SMIT tool: » # smit installp Install Software * INPUT device / directory for software

3-2

AIX Jumpstart

[./grumpy1100]

+

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» Press Enter. Install Software Type or select values in entry fields. Press Enter AFTER making all desired changes. [TOP] [Entry Fields] * INPUT device / directory for software ./grumpy1100 * SOFTWARE to install [_all_latest] + PREVIEW only? (install operation will NOT occur) no + COMMIT software updates? yes + SAVE replaced files? no + AUTOMATICALLY install requisite software? yes + EXTEND file systems if space needed? yes + . . . » Position your cursor on the Software to install line. » Press F4 (or Esc-4). Move cursor to desired item and press F7. Use arrow keys to scroll. | ONE OR MORE items can be selected. | Press Enter AFTER making all selections. | | alex.grumpy ALL | + 1.1.0.0 Grumpy Application » Move your cursor to the alex.grumpy package and press F7 (or Esc-7) to select it. » Press Enter. » You should be back at the Install Software dialogue panel. » Press Enter to execute the described task. » Scroll through the command status panel to be sure the result was successful. __ 5. Install (Apply only) an update to the alex.grumpy fileset at level 1.1.0.1. It should be located in directory /home/AN14/SW/grumpy1101. Check the installation summary carefully to ensure the software update has been applied successfully. » If you are using the command line interface: »# cd ../grumpy1101 »# installp -aBd . alex.grumpy Installation Summary alex.grumpy 1.1.0.1 USR

© Copyright IBM Corp. 2009, 2013

APPLY

SUCCESS

Exercise 3. AIX software installation and maintenance

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

3-3

Student Exercises with hints

» If you are using the SMIT tool: »# smit installp Install Software * INPUT device / directory for software

[./grumpy1101]

+

» Press Enter. Install Software Type or select values in entry fields. Press Enter AFTER making all desired changes. [TOP] [Entry Fields] * INPUT device / directory for software ./grumpy1101 * SOFTWARE to install [_all_latest] + PREVIEW only? (install operation will NOT occur) no + COMMIT software updates? no + SAVE replaced files? yes + AUTOMATICALLY install requisite software? yes + EXTEND file systems if space needed? yes + » Position your cursor on the Software to install line. » Press F4 (or Esc-4). Move cursor to desired item and press F7. Use arrow keys to scroll. | ONE OR MORE items can be selected. | Press Enter AFTER making all selections. | | alex.grumpy ALL | + 1.1.0.1 Grumpy Application » Move your cursor to the alex.grumpy package and press F7 (or Esc-7) to select it. » Press Enter. » You should be back at the Install Software dialogue panel. » Position your cursor on the COMMIT software updates? line and change the value to no. » Position your cursor on the SAVE replaced files? line and change the value to yes. » Press Enter to execute the described task. » Scroll through the command status panel to ensure the result was successful.

3-4

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 6. Reject the applied update of alex.grumpy 1.1.0.1 fileset. Default all other options. Check to ensure that the fileset has reverted back to version 1.1.0.0. » If you are using the command line interface: »# installp -r alex.grumpy »# lslpp -l alex.grumpy » If you are using the SMIT tool: »# smit install Software Installation and Maintenance Move cursor to desired item and press Enter. Install and Update Software List Software and Related Information Software Maintenance and Utilities Software Service Management . . . » Select Software Maintenance and Utilities > Reject Applied Software Updates (Use Previous Version). Reject Applied Software Updates (Use Previous Version) [Entry Fields] * SOFTWARE name [alex.grumpy ] + PREVIEW only? (reject operation will NOT occur) no + REJECT dependent software? no + EXTEND file systems if space needed? yes + DETAILED output? no + . . . » Position your cursor on SOFTWARE name. » Either type in the fileset name or press F4 (or Esc-4) and locate the alex.grumpy fileset in the list of applied filesets, select it and then press Enter to return to the dialog panel.

© Copyright IBM Corp. 2009, 2013

Exercise 3. AIX software installation and maintenance

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

3-5

Student Exercises with hints

SOFTWARE name | | Move cursor to desired item and press F7. Use arrow keys to scroll. | ONE OR MORE items can be selected. | Press Enter AFTER making all selections. | | # Name Level | # ------------------------------------------------------------------| > alex.grumpy 1.1.0.1 » Press Enter to execute the specified task. » Scroll through the Command Status panel to check that there were no problems. » Press F3 (or Esc-3) repeatedly until you are at the Software Installation and Maintenance menu. » Select List Software and Related Information > List Installed Software and Related Information > List Installed Software. List Installed Software [Entry Fields] [all] no

* SOFTWARE name SHOW superseded levels?

+ +

» Either type in the fileset name, or press F4 (or Esc-4) and locate the alex.grumpy fileset in the list of applied filesets, select it and then press Enter to return to the dialog panel. » Examine the Command Status panel to see the output of the command.

__ 7. Reinstall (Apply only) the 1.1.0.1 update to alex.grumpy. » Follow hint instructions in previous Step 5. __ 8. This time, commit the applied update. Check that the software has been committed. » If you are using the command line interface: »# installp -c alex.grumpy »# lslpp -l alex.grumpy » If you are using the SMIT tool: »# smit install

3-6

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» Select Software Maintenance and Utilities > Commit Applied Software Updates (Remove Saved Files). [Entry Fields] * SOFTWARE name [alex.grumpy] PREVIEW only? (commit operation will NOT occur) no COMMIT requisites? yes EXTEND file systems if space needed? yes DETAILED output? no

+ + + + +

» Either type in the fileset name or press F4 (or Esc-4) and locate the alex.grumpy fileset in the list of applied filesets, select it, and then press Enter to return to the dialog panel. » Examine the Command Status panel to see the output of the command. » Press F3 (or Esc-3) repeated until you are at the Software Installation and Maintenance menu. » Select List Software and Related Information > List Installed Software and Related Information > List Installed Software. List Installed Software [Entry Fields] [all] no

* SOFTWARE name SHOW superseded levels?

+ +

» Either type in the fileset name or press F4 (or Esc-4) and locate the alex.grumpy fileset in the list of applied filesets, select it and then press Enter to return to the dialog panel. » Examine the Command Status panel to see the output of the command. __ 9. Remove fileset alex.grumpy from the system. » If you are using the command line interface: »# installp -u alex.grumpy » If you are using the SMIT tool: »# smit install

© Copyright IBM Corp. 2009, 2013

Exercise 3. AIX software installation and maintenance

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

3-7

Student Exercises with hints

» Select Software Maintenance and Utilities > Remove Installed Software. * SOFTWARE name [alex.grumpy] PREVIEW only? (remove operation will NOT occur) no REMOVE dependent software? no EXTEND file systems if space needed? no DETAILED output? no

+ + + + +

» Either type in the fileset name or press F4 (or Esc-4) and locate the alex.grumpy fileset in the list of applied filesets, select it and then press Enter to return to the dialog panel. » Examine the Command Status panel to see the output of the command. __ 10. Discover which LPP fileset the binary /usr/bin/whois is part of. • List the fileset____________________ » If you are using the command line interface: »# lslpp -w /usr/bin/whois » If you are using the SMIT tool: » # smit install » Select List Software and Related Information > List Installed Software and Related Information > List Fileset Containing File. [Entry Fields] [/usr/bin/whois]

File Name to Search For

__ 11. View the install history of the bos.net.tcp.server filesets using the lslpp command. » If you are using the command line interface: »# lslpp -h bos.net.tcp.server » If you are using the SMIT tool: » # smit install » Select List Software and Related Information > List Installed Software and Related Information > Show Software Installation History. [Entry Fields] [bos.net.tcp.server]

* SOFTWARE name

__ 12. Discover which files are contained in the bos.net.tcp.server fileset. » If you are using the command line interface: »# lslpp -f bos.net.tcp.server |more » If you are using the SMIT tool: 3-8

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» # smit install » Select List Software and Related Information > List Installed Software and Related Information > List Files Included in a Fileset. [Entry Fields] [bos.net.tcp.server]

* SOFTWARE name

© Copyright IBM Corp. 2009, 2013

Exercise 3. AIX software installation and maintenance

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

3-9

Student Exercises with hints

Part 2: (Optional) RPM packaged software __ 13. List all of the RPM packages installed on the system. » # rpm -qa __ 14. Install the Bourne-again (BASH) shell RPM package. It should be located in directory /home/AN14/SW/bash. » # cd /home/AN14/SW/bash » # rpm -i bash321.rpm __ 15. Invoke a BASH shell and test that it works successfully. » # bash » (Type some commands; you should now be able to scroll up and down command history using up/down arrow keys). __ 16. (Optional) Uninstall the bash shell from the system, unless you wish to use the bash shell during the class. » Quit the bash shell session: # exit » # rpm -e bash-3.2-1 __ 17. Exit from the system. » # lsvg -l rootvg » You should find that the problem is fixed. The type field is now corrected.

End of exercise

3-10 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 4. System configuration and devices (with hints)

What this exercise is about This exercise allows students to understand how to list, change, and configure devices on an AIX system.

What you should be able to do At the end of the exercise, you should be able to: • List the device configuration on a system • List and change device parameters • Change device states and configure a device to make it available for use

Introduction This exercise is designed for you to become familiar with the methods you can use to discover what devices are on your system and how they are configured. It deals exclusively with adapters and disk devices.

© Copyright IBM Corp. 2009, 2013

Exercise 4. System configuration and devices

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

4-1

Student Exercises with hints

Exercise instructions with hints Preface Two versions of these instructions are available: one with hints and one without. You can use either version to complete this exercise. Also, do not hesitate to ask the instructor if you have questions. All exercises of this chapter depend on the availability of specific equipment in your classroom. If your lab environment uses remote System p/AIX platforms, the instructor will provide you with the addressing (IP address or hostname) and instructions for accessing the remote machine. For example, you might be using telnet, an X-windows server, or a VNC client. Whatever tool you are using, at various points in the exercises you might need to re-launch your remote access tool to obtain a new login prompt. » All hints are marked with a >> sign. » The output shown in the answers is an example. Your output and answers based on the output might be different.

Part 1: List device configuration __ 1. Access your assigned lab system and log in as the root user. __ 2. Invoke the prtconf command. Analyze the output. » # prtconf | more __ 3. Using the output from the prtconf command, answer the following questions: Processor type: __________________________________ Number of processors: ____________________________ Platform firmware level: ____________________________ The physical location code of: ent0 __________________________________________ hdisk0 ________________________________________ __ 4. Translate the meaning of the physical location code of the Ethernet adapter. What part of the code represents: __ a. The port on the adapter card? _____________________________________ __ b. The enclosure where the adapter card resides? _______________________ __ c. The unique device attached to the adapter? __________________________ __ d. The parent bus where the adapter card resides? ______________________ __ e. Is the device (and its parent adapter and bus) real or virtual? _____________ » See device code explanation in the course unit. 4-2

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» » » » » » »

An example location code (yours will likely differ) is: U8203.E4A.06FDDF1-V2-C2-T1 In the example: The port is T1 The enclosure is U8203.E4A.06FDDF1 There is no unique device attached to the port. The parent bus is: V2 (the virtual bus on LPARID 2) which is what tells us this Ethernet adapter is a virtual adapter.

__ 5. List all the configured devices on the system. ____________________________________________________________ »# lsdev -C -H | more __ 6. Using the lsdev command, list all of the adapters on the system. »# lsdev -Cc adapter __ 7. What is the parent device of the Ethernet adapter ent0? _______________ What command did you use? ____________________________________ »# lsdev -Cl ent0 -F parent OR »# lsparent -Cl ent0 » These two commands may give equivalent answers, but not always. The lsdev command lists the actual parent. The lsparent command lists the possible parents. __ 8. List the disks on your system. Record how many you have: _______________ » # lsdev -Cc disk __ 9. Using the lscfg command, record the network address of the Ethernet adapter ent0: _________________ »# lscfg -v -l ent0

© Copyright IBM Corp. 2009, 2013

Exercise 4. System configuration and devices

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

4-3

Student Exercises with hints

Part 2: List and change device attributes __ 10. Using the lsattr command, discover the total amount of physical memory assigned to your partition. » # lsattr -El mem0 __ 11. List the attributes of the Ethernet interface en0: ____________________ Are there any attributes that cannot be changed? ____________________ No » # lsattr -El en0 Change the value of en0’s remmtu to 1500. Record your command here: _______________________________________ » # chdev -l en0 -a remmtu=1500 __ 12. Re-check the value of remmtu to make sure it has been changed. » # lsattr -El en0

4-4

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 3: Device states (changing the status of a disk drive device) __ 13. List the status and device location of the disk device, hdisk3. _____________________________________ _____________________________________ »# lsdev -Cl hdisk3 »# lscfg -l hdisk3 » The disk should be in Available state. __ 14. Change the state of hdisk3 to a Defined state. » # rmdev -l hdisk3 » # lsdev -Cl hdisk3 » (hdisk1 should be Defined) __ 15. Change the state of hdisk3 back to the Available state. » # mkdev -l hdisk3 » # lsdev -Cl hdisk3 __ 16. Remove the disk device from the system. »# rmdev -l hdisk3 -d »# lsdev -Cl hdisk3 » You should not see hdisk3 listed. __ 17. Rediscover and configure that same disk for use. Does the device re-appear with the same location code? ________________________________________ ____________________________________________________________ » # cfgmgr »# lsdev -Cl hdisk3 » # lscfg | grep hdisk » (hdisk3 should be Available) » In our scenario, the disk will reappear with the same logical device name and location code. If yet another disk had been added prior to rerunning cfgmgr, it might have taken this logical device name and the original disk might have been assigned a new logical device name.

End of exercise

© Copyright IBM Corp. 2009, 2013

Exercise 4. System configuration and devices

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

4-5

Student Exercises with hints

4-6

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 5. TCP/IP implementation (with hints)

What this exercise is about This exercise provides an opportunity to implement and configure TCP/IP on AIX.

What you should be able to do At the end of the exercise, you should be able to: • Configure TCP/IP • Configure NFS (optional)

Introduction TCP/IP has been configured on your systems prior to class start in order to provide remote access to the lab systems, needed for earlier exercises. In this exercise, you will eliminate that network configuration and then recreate it. An optional activity is to configure NFS.

© Copyright IBM Corp. 2009, 2013

Exercise 5. TCP/IP implementation

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

5-1

Student Exercises with hints

Exercise instructions with hints Preface Two versions of these instructions are available: one with hints and one without. You can use either version to complete this exercise. Also, do not hesitate to ask the instructor if you have questions. General notes, applicable to all exercises: Your instructor will provide you with instructions for accessing the remote environment. For example, this might involve using a web browser or Virtual Private Network (VPN). Your instructor will further provide you will all the details and login IDs required. Unless otherwise stated, log in to systems (HMC/LPAR) using a terminal window (for example through PuTTY or a Linux command line). On some terminal emulations, the function keys are not operative and you might need to substitute escape sequences. For example, instead of pressing F3, you might need to press Esc+3 for the same function. » All hints are marked with a >> sign. » The output shown in the answers is an example. Your output and answers based on the output might be different.

Part 1: TCP/IP configuration __ 1. Access your assigned lab system and log in as the root user. __ 2. Collect the current network configuration information on your system. IP address (for en0): _____________________________________________ Network mask (for en0): __________________________________________ Hostname _____________________________________________________ Default gateway: ________________________________________________ » To collect the information run the following commands: » # ifconfig en0 (the mask is in hex, you will need to convert to dotted decimal) OR » # lsattr -El en0 (the mask is already in dotted decimal)

» # hostname » # netstat -r | grep default __ 3. How many Ethernet adapters are defined on your system? _______________ » # lsdev -Cc adapter |grep Ether 5-2

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Since we are going to unconfigure the TCP/IP configuration, you will need to access your system through a path which does not depend upon the LPAR’s TCP/IP configuration, such as the system console. __ 4. Connect to your assigned HMC and log in using your assigned administrative user name (or use an existing connection, if one exists already). » If using the command line interface: - Establish an interactive ssh session to the HMC (if you do not already have one) and log in with your assigned administrative user name. » If using the graphic interface: - Start your browser (Firefox if using the e-lab environment) and type in the URL https:// - At the resulting web page, click the Log on and launch the Hardware Management Console web application link. - On the next window to pop-up, enter your assigned HMC admin login user and password. If presented with an option to reconnect to an existing disconnected session, click the New Session button to create a new session. __ 5. Open a virtual terminal for your assigned LPAR (if you do not already have one). » If using the command line interface: - From the HMC, use the vtmenu command to open a virtual terminal for your assigned LPAR. - If presented with the Managed Systems list, enter the number for your server. - When presented with the Partitions list, enter the number for your assigned LPAR. Note Only one console terminal at a time can be open to a given LPAR. If you get an error that a terminal session is already open, first check to be sure you did not try to access another student’s LPAR. If there is a terminal session is still active to your LPAR, for which you do not have a window on your workstation, type: » ~> rmvterm -m -p and then repeat your attempt to open a new session. x

» If using the graphic interface: - In the navigation area (on the left), expand the Systems Management item and then expand the Servers item. Click the name of your assigned system. In the Content area, you will see the defined LPARs listed. © Copyright IBM Corp. 2009, 2013

Exercise 5. TCP/IP implementation

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

5-3

Student Exercises with hints

- Select your assigned LPAR so there is a check mark in the box. When the small chevron icon appears to the right of the LPAR name, click that icon. This will display a menu. We will call this the task menu. - Select the Console Window item from the task menu and then click the Open Terminal Window sub-menu item. A virtual terminal emulation window should be started, as a result. » Note: The terminal emulation window might be hidden behind existing windows. Note Only one console terminal at a time can be open to a given LPAR. If you get an error that a terminal session is already open, first check to be sure you did not try to access another student’s LPAR. If there is a terminal session is still active to your LPAR, for which you do not have a window on your workstation: In the Task menu for your LPAR, click the Select the Console Window menu item. Then click the Close Terminal Window sub-menu item. Then repeat your attempt to open a new session. x

__ 6. Log on through the virtual terminal connection to the LPAR as the root user. __ 7. To allow you to configure networking, you will first need to remove the current network configuration not only from the kernel but also from the ODM database. You need to do this without effecting the et0 configuration which is needed later on to support VNC connections to your LPAR. (This will disrupt any existing TCP/IP connections you might have with the LPAR.) We have provided a script that will handle this for you. __ a. List the inet0 and en0 device attributes. __ b. Execute the clearnet script located in the /home/AN14 directory. __ c. List the inet0 and en0 attributes again to verify that the configuration has been cleared from the ODM. » Following are suggested commands: # # # # #

lsattr -El inet0 lsattr -El en0 /home/AN14/clearnet lsattr -El inet0 lsattr -El en0

__ 8. Display the kernel interface configuration to verify that the default route, hostname, IP address and mask for en0 and the hostname are gone. 5-4

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» Following are suggested commands: # netstat -rn | grep default # hostname # ifconfig en0 __ 9. Use SMIT to do a minimum configuration on your en0 interface. (tcpip is an easy to remember fastpath which covers the SMIT menus for network configuration.) Enter the TCP/IP configuration information which you recorded earlier in Step 1 and execute the dialogue panel. » smitty tcpip » Select Minimum Configuration & Startup. » Select en0 from the Available Network Interface pop-up menu. *HOSTNAME [your hostname] *Internet Address [your IP address] *Network MASK (dotted decimal) [your netmask] . . . Default Gateway Address (dotted decimal or symbolic name) [your gateway IP] » Press Enter to reconfigure TCP/IP. » Press F10 to exit SMIT. __ 10. Verify that you now have a network configuration, both in the kernel and in the ODM. » Following are suggested commands: # # # # #

netstat -rn | grep default hostname ifconfig en0 lsattr -El inet0 lsattr -El en0

__ 11. Connect from your student workstation to your assigned LPAR using either the telnet or ssh protocols, and log in as the root user.

© Copyright IBM Corp. 2009, 2013

Exercise 5. TCP/IP implementation

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

5-5

Student Exercises with hints

Part 2: (Optional) NFS __ 12. For this optional part, you will need to be working together in teams of two. Decide which system will be the NFS server and which system will be the NFS client: NFS Server: _______________________ NFS Client: _______________________ __ 13. On the NFS server: __ a. Create two directories: • /server/rw • /server/root_rw » Following are suggested commands: # mkdir -p /server/rw # mkdir -p /server/root_rw __ b. Change group ownership of /server/rw to staff and change permissions to 775. » Following are suggested commands: # chgrp staff /server/rw # chmod 775 /server/rw __ c. Change group ownership of /server/root_rw to staff and change permissions to 775. » Following are suggested commands: # chgrp staff /server/root_rw # chmod 775 /server/root_rw __ d. Export the following directories (you can either edit the configuration file, use a high-level command, or use SMIT): • /usr/man

Permissions: read-only

• /server/rw

Permissions: read-write

• /server/root_rw

Permissions: read-write including the NFS client root user.

» If editing the configuration file: # vi /etc/exports /usr/man -ro /server/rw /server/root_rw -root= # exportfs -va

5-6

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» If using a high-level command: # mknfsexp -d /usr/man -t ro # mknfsexp -d /server/rw # mknfsexp -d /server/root_rw -r » If using SMIT: # smit nfs Select Network File System (NFS) > Add a Directory to Exports List. (In panel below, only selected fields are shown) Pathname of directory to export * Export directory now, system restart or both * Security method 1 * Mode to export directory Hostname list. If exported read-mostly Hosts & netgroups allowed client access Hosts allowed root access

[/server/root_rw] / both + [sys] + read-write + [] [] [LPAR99]

» Repeat for other directories. __ e. Verify that the directories are exported. » # exportfs __ f.

Start the NFS subsystems, to start now, and at system restart.

» If using the command line interface: # mknfs -B » If using SMIT: # smit nfs » Select Network File System (NFS) > Configure NFS on This System > Start NFS. * START NFS now, on system restart or both

both

__ g. List the NFS subsystems and check that the nfsd, biod, rpc.mountd, rpc.statd, and rpc.lockd are running. » # lssrc -g nfs __ 14. On the NFS client, check to see which directories the NFS server is exporting. » # showmount -e __ 15. Create three mount point directories: /clp1_man, /clp2_rw, and /clp3_root_rw. » # mkdir /clp1_man /clp2_rw /clp3_root_rw

© Copyright IBM Corp. 2009, 2013

Exercise 5. TCP/IP implementation

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

5-7

Student Exercises with hints

__ 16. Mount the NFS server directories: • /usr/man > /clp1_man • /server/rw > /clp2_rw • /server/root_rw > /clp3_root_rw » Following are suggested commands: # mount :/usr/man /clp1_man # mount :/server/rw /clp2_rw # mount :/server/root_rw /clp3_root_rw __ 17. List the NFS mounts, using the df command. » # df __ 18. As root, attempt to create a file in each of the local NFS client directories. Which write was successful? ________________________________________________________________ » Following are suggested commands: # cd /clp1_man; touch file # cd /clp2_rw; touch file # cd /clp3_root_rw; touch file » The write to the /clp3_root_rw directory should be successful. This is because the directory was exported with this root on this client being authorized to act as root on the server. » The write to /clp1_man fails because it is exported read-only. » The write to /clp2_rw fails because root is mapped to user nobody and, by default, the nobody user gains the rest of the world permission's (which in this case, do not include write). __ 19. Switch to user, user01, and attempt to create a file in the /clp2_rw directory. Was the write successful?_________________________________________________ » Following are suggested commands: # su - user01 $ cd /clp2_rw; touch file » Yes, the write to /clp2_rw should be successful. This is because the client user (user01) has a matching user definition (matched on User ID) that is a member of the staff group. And the exported directory provides write authority to members of the group staff. __ 20. Exit back to root. » # exit __ 21. Change your current directory to / (root directory) and unmount all NFS mounts.

5-8

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» The suggested commands are: # # # #

cd / umount /cpl1_man umount /cpl2_rw umount /cpl3_root_rw

End of exercise

© Copyright IBM Corp. 2009, 2013

Exercise 5. TCP/IP implementation

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

5-9

Student Exercises with hints

5-10 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 6. System startup and shutdown (with hints)

What this exercise is about This exercise familiarizes you with the system startup and shutdown process, and using the System Resource Controller (SRC).

What you should be able to do At the end of the exercise, you should be able to: • List subsystems and subsystem processes • Create startup and shutdown control scripts • Use the alog command to view the boot messages • Shutdown an AIX partition into single user mode and switch back to multi-user mode • Use the HMC to shutdown and activate a partition

Introduction All instructions involve using the system unit for starting and stopping the system in various modes.

© Copyright IBM Corp. 2009, 2013

Exercise 6. System startup and shutdown

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

6-1

Student Exercises with hints

Exercise instructions with hints Preface Two versions of these instructions are available: one with hints and one without. You can use either version to complete this exercise. Also, do not hesitate to ask the instructor if you have questions. General notes, applicable to all exercises: Your instructor will provide you with instructions for accessing the remote environment. For example, this might involve using a web browser or Virtual Private Network (VPN). Your instructor will further provide you with all the details and login IDs required. Unless otherwise stated, log in to systems (HMC/LPAR) using a terminal window (for example through PuTTY or a Linux command line). On some terminal emulations, the function keys are not operative and you might need to substitute escape sequences. For example, instead of pressing F3, you might need to press Esc+3 for the same function. » All hints are marked with a >> sign. » The output shown in the answers is an example. Your output and answers based on the output might be different.

Part 1: Multiuser mode __ 1. Log in to your assigned LPAR as the root user. __ 2. View the /etc/inittab file. Take a moment to become familiar with its contents. What is the run level of init? _______ 2 What does it mean? ___________________________________ This sets the default run level. Run level 2 represents AIX multi-user mode. » # more /etc/inittab __ 3. Using the PID of the SRC master process, produce a process tree listing of all the subsystems and subservers running on the system. » Following are suggested commands: # ps -ef |grep srcmstr # ps -T __ 4. List all subsystems running on the system. »# lssrc -a | more __ 5. List all subsystems that are part of the TCP/IP group. »# lssrc -g tcpip

6-2

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 6. Determine if the tftpd process is currently active. Edit the /etc/inetd.conf file. If the tftp service is commented out, uncomment it and if the tftp service is not commented out, then comment it out. Refresh the inetd subsystem. Confirm the state of the tftpd process is affected by the change. » Following are suggested commands: # ps -T |grep tftp # vi /etc/inetd.conf /tftp » Either add or remove the comment symbol in column 1. #tftp

dgram

udp6

SRC

nobody /usr/sbin/tftpd tftpd -n

» Save and exit the file. » Refresh inetd and examine resulting process tree: # refresh -s inetd # ps -T |grep tftp » The tftp service is normally defined as a subserver to the inetd subsystem. Any ftpd daemons should have inetd as their parent process. You should see an ftpd daemon as a inetd child process only if the inetd.conf configuration file has it as an effective definition. Note Preparation for single user mode Shutting a system down to single user mode removes the TCP/IP network configuration. Because of this, you need to log in to the system using a virtual console session, while performing the rest of the lab steps. To start a virtual console session, you must first log in directly to the HMC and then open a console session to your assigned LPAR (as completed in Exercise 1). In the following steps, you can choose between using the HMC command line interface or the HMC browser based graphical interface. Hints are provided for both options.

__ 7. Using a separate command line window, log in to the HMC as an admin user. Your instructor will provide you with the following information: Managed system name: _________________________ HMC name/IP address: __________________________ HMC admin user: ______________________________ HMC admin password: __________________________ __ 8. Connect to your assigned HMC and log in using your assigned administrative user name. © Copyright IBM Corp. 2009, 2013

Exercise 6. System startup and shutdown

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

6-3

Student Exercises with hints

» If using the command line interface: - Establish an interactive ssh session to the HMC (if you do not already have one) and log in with your assigned administrative user name. » If using the graphic interface: - Start your browser (Firefox if using the e-lab environment) and type in the URL: https:// - At the resulting web page, click the Log on and launch the Hardware Management Console web application link. - On the next window to pop-up, enter your assigned HMC admin login user and password. If presented with an option to reconnect to an existing disconnected session, click the New Session button to create a new session. __ 9. Open a virtual terminal for your assigned LPAR. » If using the command line interface: - From the HMC, use the vtmenu command to open a virtual terminal for your assigned LPAR. - When presented with the Managed Systems list, enter the number for your server. When presented with the Partitions list, enter the number for your assigned LPAR. Note Only one console terminal at a time can be open to a given LPAR. If you get an error that a terminal session is already open, first check to be sure you did not try to access another student’s LPAR. If there is a terminal session is still active to your LPAR, for which you do not have a window on your workstation, type: ~> rmvterm -m -p and then repeat your attempt to open a new session. x

» If using the graphic interface: - In the Navigation area (on the left), expand the Systems Management item and then expand the Servers item. Click the name of your assigned system. In the Content area, you will see the defined LPARs listed. - Select your assigned LPAR so there is a check mark in the box. When the small chevron icon appears to the right of the LPAR name, click that icon. This will display a menu. We will call this the task menu.

6-4

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

- Select the Console Window item from the task menu and then click the Open Terminal Window sub-menu item. A virtual terminal emulation window should be started, as a result.

EXempty

» Note: The terminal emulation window might be hidden behind existing windows). Note Only one console terminal at a time can be open to a given LPAR. If you get an error that a terminal session is already open, first check to be sure you did not try to access another student’s LPAR. If there is a terminal session is still active to your LPAR, for which you do not have a window on your workstation: In the task menu for your LPAR, click the Select the Console Window menu item. Then click the Close Terminal Window sub-menu item. Then repeat your attempt to open a new session. x

__ 10. Log in to the LPAR as the root user and shutdown the system into single user mode. »# shutdown -Fm » You will see several messages appear. Enter the root password when you see the following: INIT: Single-User Mode PASSWORD: __ 11. Verify that the SRC subsystems have been stopped. »# lssrc -a __ 12. Verify that there are few processes running on the system. »# ps -ef __ 13. Reset the run level back to multi-user mode, log back in as root, and run /etc/rc.net to configure and start the network interfaces. »# telinit 2 »# /etc/rc.net __ 14. Use the bootlist command to display the boot device used during a normal boot operation. »# bootlist -m normal -o __ 15. Keep the present console terminal window open.

© Copyright IBM Corp. 2009, 2013

Exercise 6. System startup and shutdown

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

6-5

Student Exercises with hints

Part 2: Using the HMC to shut down and activate an AIX partition __ 16. If using the command line interface for the HMC, your existing ssh session is busy being used for the virtual terminal emulation (through the vtmenu command). You will need another ssh session to enter some more HMC commands. Open (another) separate terminal emulation window, establish an ssh protocol connection (for example, by using a tool such as PuTTY), and log in to the HMC. If using the graphic interface, there is nothing you need to do in this step. __ 17. From the HMC, perform an operating system immediate shutdown of your assigned LPAR. » If using the command line interface: - From the HMC command line, enter: ~> chsysstate -m -r lpar -o osshutdown \ --immed -n (note the double dash flag for the immediate option) » If using the graphic interface: - Use the small chevron icon next to your selected LPAR to bring up the task menu. Select the Operations menu item and then click the Shutdown sub-menu item. - This will display a Shutdown Partitions window. In that window, select the Operating System Immediate option and then click OK.

(continue on next page)

6-6

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 18. Return to your virtual console session. Patiently wait for and observe the shutdown messages. __ 19. Once the console displays Halt Completed, check on the HMC display that your assigned LPAR is no longer active. » If you are using the command line interface, enter the command: ~> lssyscfg -m -r lpar -F name state \ --filter "lpar_names=" » If you are using the graphic interface: - Return to your graphic LPAR listing and observe the Status column. __ 20. When the LPAR is in a state of Not Activated, activate the LPAR using the default profile (which should execute a normal boot). » If you are using the command line interface: © Copyright IBM Corp. 2009, 2013

Exercise 6. System startup and shutdown

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

6-7

Student Exercises with hints

~> chsysstate -m -r lpar -o on -n \ -f normal

» If you are using the graphic interface: - Bring up the Task menu for your LPAR. Select the Operations menu item, select the Activate sub-menu item, and then click the Profile item. - This will display an Activate Logical Partition window. In that window, accept the defaults and click OK. __ 21. Return to your virtual console session and observe the boot messages. __ 22. Once the operating system has finished booting, you should see a login prompt in the virtual console session. Terminate your virtual console session. » If you are using the command line interface: - To exit from the LPAR console session, from the LPAR prompt type: ~. (tilde dot). Enter y to terminate the console session. - Then press q, twice, to quit the vtmenu session.’ - Leave the HMC ssh session active. » If you are using the graphic interface: - Close the window for the virtual terminal.

End of exercise

6-8

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 7. Configuring logical partitions with hints)

What this exercise is about This exercise covers the configuration of partitions and partition profiles, and the activation of partitions.

What you should be able to do At the end of the exercise, you should be able to: • Create an AIX logical partition • Create a logical partition profile • Configure resources for partition profiles

Introduction In this exercise, you become familiar with the HMC applications and menus that enables you to create and configure partitions.

Requirements • This workbook • A student workstation connected to a network with a browser to access the HMC GUI • A POWER5 or later processor-based managed system connected to the same network as the student workstations

© Copyright IBM Corp. 2009, 2013

Exercise 7. Configuring logical partitions

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

7-1

Student Exercises with hints

Exercise instructions with hints Preface All exercises in this chapter depend on the availability of specific equipment in your classroom. You will need a computer system and a managed system accessible to each other on a network. Note Some lab environment can have two NIM servers, where one is the NIM server used to provision the class lab environment and the other is a NIM server created for the students to use (usually another LPAR on your assigned server). Do not use the provisioning NIM server. Ask your instructor, if you are not sure of which server to use.

» Hints are provided for exercises in case you need them and provide solutions for the exercise steps. All hints are marked by a » sign. In this exercise, you will define a new logical partition. In the next exercise, you will install a new AIX operating system into this new logical partition. __ 1. Before we start, you will need to record the IP network parameters for your assigned LPAR. We will later use these parameters to configure the network boot of your new LPAR. The network parameters can be obtain from the configuration sheets (provided by your instructor). Some of the network parameters can be determined by running commands in your existing assigned LPAR. ILPAR IP address: _____________________________________________ LPAR Hostname: ______________________________________________ Network mask: ________________________________________________ Default gateway: _______________________________________________ NIM server LPAR IP address: _____________________________________ HMC IP address _______________________________________________ HMC name for your server _______________________________________ VLAN ID: _____________________________________________________ Partition ID for LPAR you will define: ________________________________ » Following are example commands that could be used to discover some of the network configuration: » # ifconfig en0 » # netstat -in » # hostname 7-2

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» » » »

# netstat -rn # prtconf # smitty mktcpip # entstat -d ent0 | grep VLAN

__ 2. In many lab facilities, the HMC name for the LPAR has a naming convention where they provide a prefix comprised of the server name and a class designator. For example, in the name sys4042_lpar5, the prefix is sys4042. This prefix is important in distinguishing between LPARs for different classes using the same server. If your lpar names have this type of convention, record your LPAR prefix: ____________________________________________________________ __ 3. If you do not already have a graphical connection to your assigned HMC, use the web browser on your student workstations to establish one now. The URL will be: https:// (Note the use of the SSL secure https protocol.) When prompted about certificates, accept and trust them. You will also need to permit pop-ups. Log in to the HMC using your assigned superuser name and password. __ 4. In preparation for creating your logical partition, record the following information: Note The name should have the following format: _mylparXX where XX is your team number. For example, it might look like: sys9992_mylpar2.

Record your new partition name: ______________________________________________________________ Your virtual scsi adapter number (your team number plus 40): ________________ The partition ID for your new LPAR (your original assigned partition ID plus 40): ________________________________________________________________ __ 5. In the navigation area (on the left) of the HMC GUI, expand Systems Management and then click Servers. In the Content area, select your assigned managed system

© Copyright IBM Corp. 2009, 2013

Exercise 7. Configuring logical partitions

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

7-3

Student Exercises with hints

in the HMC GUI, and choose Configuration > Create Logical Partition > AIX or Linux. The Create Lpar Partition Wizard task window opens.

The following steps will walk you through each page in the wizard. __ 6. In the Create Lpar Wizard, set the partition ID and the partition name according to what you recorded earlier. Click the Next button on the bottom of the screen to advance to the next page.

7-4

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

See the following example of the Create Partition window for partition: mylpar2.

__ 7. On the Partition Profile panel, name the partition profile normal and click the Next button. At any time during the LPAR creation and profile definition, you can use the Back and Next buttons to navigate. You can also go directly to any parameter

© Copyright IBM Corp. 2009, 2013

Exercise 7. Configuring logical partitions

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

7-5

Student Exercises with hints

already defined by clicking the corresponding step name at the left part of the screen.

__ 8. The next panel prompts you to choose either a dedicated (entire processor) or a shared processor (partial processing unit) configuration. We want to use a fractional amount of a processor’s capacity to make more efficient use of the scarce resources. Configure your partition for shared processors, and then click Next.

7-6

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 9. Set the minimum, desired, and maximum amount of processing units in the corresponding fields. Check the box for uncapped. Accept the defaults for Virtual Processors. The values we want you to use are: - Minimum = 0.1 - Desired = 0.2 - Maximum = 0.3 - Check box for uncapped (*** this is important for performance reasons ***) - Accept the defaults for all other fields. After entering these amounts, click Next. __ 10. For memory allocation, if presented with a choice between shared or dedicated, choose dedicated. __ 11. Allocate the minimum, desired, and maximum memory with 768 MB, 1 GB, and 1 GB values. Following is an example configuration. See the following example:

__ 12. Click the Next button to advance to the next page. __ 13. The I/O screen is where you could configure Physical I/O resources, but we will not directly allocate any physical adapters in this exercise. Instead, we will use virtual adapters which will allow us to use physical resources that are served from the Virtual I/O server partition. Click the Next button to advance to the next page. © Copyright IBM Corp. 2009, 2013

Exercise 7. Configuring logical partitions

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

7-7

Student Exercises with hints

__ 14. On the Virtual Adapters screen, notice that two Server Serial adapters are defined by default as required. We will define one virtual Ethernet adapter and one virtual SCSI adapter. __ a. Change the value of Maximum virtual adapters from 10 to 70. __ b. Click Create Virtual Adapter > Ethernet Adapter in the Actions menu to create a Virtual Ethernet Adapter.

__ c. Your instructor should have provided you with the VLAN ID of the VLAN which is bridged to an external network. You need to enter this into the appropriate field on the Create Virtual Ethernet panel. Depending upon the level of HMC firmware, this field will either be labeled: VLAN ID or Port Virtual Ethernet. Accept the defaults for all other options. __ d. Click Create Virtual Adapter > SCSI Adapter in the Actions menu to create a SCSI client adapter. Set the Virtual SCSI adapter slot number (Adapter field) to the number you recorded in Step 4 on page 7-3. __ e. Then, specify your VIOS partition in the Server partition field, and specify the VSCSI server adapter slot number (the same as your client partition’s Virtual SCSI adapter number) in the Server adapter ID field. Click OK.

7-8

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Here is an example of this screen, in which we assumed we were team #2:

__ 15. Click Next. __ 16. If using a POWER6 or POWER7 server, you would be presented with a panel to Allocate an LHEA port for the LPAR network access. We will not allocate any LHEA adapters in this exercise. If presented with the LHEA option, click Next. __ 17. You might also be presented with a panel to Allocate an HCA adapter. We will not allocate any HCA adapters in this exercise. If presented with the HCA option, click Next. __ 18. On the Optional Settings page, accept the defaults, including leaving the boot mode on Normal. Click Next. While you will need SMS later to install from the NIM server, you will boot to SMS when activating the LPAR by using the advanced Boot mode option, which overrides the default boot mode. __ 19. The next page is the Profile Summary. Check all of your configuration options, and if everything is correct, click the Finish button to create the partition. __ 20. Click the name of your server to display the LPARs defined on the server. You should see your new LPAR in a not activated state. If you do not see your LPAR, you may need to scroll through the list. This may also require moving the boundary of the bottom task pad to a much lower position, to expose the scroll bar. DO NOT ACTIVATE YOUR LPAR AT THIS POINT. You will activate the LPAR in the next exercise.

© Copyright IBM Corp. 2009, 2013

Exercise 7. Configuring logical partitions

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

7-9

Student Exercises with hints

End of exercise

7-10 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 8. AIX installation (with hints)

What this exercise is about In this exercise, you have the opportunity to perform a BOS install of AIX into a partition.

What you should be able to do At the end of the exercise, you should be able to: • Install AIX into a partition

Introduction You will install an AIX operating system into hdisk0 of the LPAR you have created, by booting over the network and using a NIM server.

© Copyright IBM Corp. 2009, 2013

Exercise 8. AIX installation

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

8-1

Student Exercises with hints

Exercise instructions with hints General notes, applicable to all exercises: Your instructor will provide you with instructions for accessing the remote environment. For example, this might involve using a web browser or Virtual Private Network (VPN). Your instructor will further provide you with all the details and login IDs required. On some terminal emulations, the function keys are not operative and you might need to substitute escape sequences. For example, instead of pressing F3, you might need to press Esc+3 for the same function. » The output shown in the answers is an example. Your output and answers based on the output might be different. » All hints are marked with a >> sign. In this exercise, you will shutdown your original assigned LPAR and then network boot your recently created LPAR using a NIM server. The NIM server will be configured to install a new AIX operating system onto hdisk0 of your new LPAR. You will use the IP address of your originally assigned LPAR as the IP address your new LPAR. After validating that the installation was successful, you will shutdown the newly installed LPAR and re-activate the original LPAR for use during the remainder of the class. For this exercise, you will need the following information (provided by your instructor and much of the information was already recorded at start of Exercise 7): Managed system name: ___________________________________________ NIM server IP address:____________________________________________ HMC admin login user and password: ________________________________ HMC defined name for your assigned LPAR ___________________________ HMC defined name for the LPAR you created __________________________ Client IP address of your LPAR (IP address of originally assigned LPAR) _______________________________________________________________ Hostname of originally assigned LPAR: _______________________________ Network mask: __________________________________________________ Default gateway: _________________________________________________

Part 1: Setting up the NIM server __ 1. We have already completed the creation of the NIM resources and machine objects. Check to see if NIM is enabled to install AIX into your LPAR or if it is a waiting for a NIM operation. __ a. Open a window with a telnet connection to the class NIM server and log in as root.

8-2

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ b. List the machine objects and find the machine object for your assigned LPAR. (The machine object name should match the hostname of your originally assigned LPAR). » # lsnim | grep __ c. List the attributes for your machine object. » # lsnim -l __ d. The Cstate attribute value should be: Ready for NIM operation. We would like it to be: BOS installation has been enabled. __ 2. Execute the bos_inst operation for your new LPAR. This sets up the NIM master’s environment so that resources are made available, NIM properly responds to your LPAR’s bootp request, and NIM correctly handles the installation of this NIM client. Invoke SMIT with the smitty command using the fast path to the NIM base operating system install panel. $smitty nim_bosinst You are asked to choose a TARGET for the operation. This is asking you to select the NIM client host on which you want to load AIX. Highlight your partition’s hostname and press Enter to select it. You need to enter the following information on the next few entry screens: __ a. Pick rte for the TYPE of installation. __ b. Pick an LPP source. There should be one with a naming convention which indicates it is for AIX7.1 TL2 SP1. __ c. Pick a SPOT resource. There should be one with a naming convention which indicates it is for AIX7.1 TL2 SP1. __ 3. This should bring up a dialogue panel that looks like: Install the Base Operating System on Standalone Clients [TOP] * Installation Target * Installation Type * SPOT LPP_SOURCE

[Entry Fields] sys264_lpar2 rte sp_71tl2sp1 [lpp_71tl2sp1]

+

Fill in additional fields as follows: __ a. Answer yes to the question Accept new license agreements? __ b. Scroll down to the question: Initiate reboot and installation now? Set the value to no. To change the value, press F4 or Esc+4, highlight your choice, and press Enter.

© Copyright IBM Corp. 2009, 2013

Exercise 8. AIX installation

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

8-3

Student Exercises with hints

__ c. Press Enter to effect the setup. Press Enter once and again when you are asked Are you sure? __ d. When it is done, exit SMIT (F10 or Esc+0). __ 4. Verify that NIM is now ready to support the base operating system installation (bos_inst) operation with your client: List the attributes of your LPAR’s machine object and look for a Cstate value of BOS installation has been enabled. # lsnim -l | grep Cstate # lsnim -l sys264_lpar2: | grep Cstate Cstate = BOS installation has been enabled __ 5. You need to be sure that your originally assigned LPAR is not activated. This will avoid conflict over the IP address, in addition to avoiding conflicts over the memory and processor resources. Establish a telnet session to your original assigned LPAR and login as root. Using the AIX shutdown -F command, shutdown your assigned LPAR. » # shutdown -F (You can also shut down your LPAR using the HMC graphical interface or CLI, but be sure to use the operating system shutdown option. Using of the HMC shutdown option will take the partition down hard and can cause corruption to the file systems.)

8-4

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 2: Activate the LPAR to SMS and initiate a network boot In this part, you will activate your new LPAR to SMS and boot from your network adapter. By configuring the network boot parameters, a bootp request will be sent to your NIM server which has been setup to support a BOS installation. Remember that your new LPAR has a name ending in mylparXX (where XX is your team #). There are two options for executing this procedure. You can either use the HMC graphical web interface or you can use the HMC command line interface (CLI). If you choose the graphical interface, start out executing Step 6. If you choose the command line interface, then start out executing at Step 7. In either case, once you have a virtual terminal window and the logical partition is booting, the remaining steps, beginning at Step 10, are the same. __ 6. This step will activate the partition and start a virtual terminal using the HMC graphical Web interface. If you do not already have a graphical connection to your assigned HMC, use the web browser on your student workstations to establish one now. __ a. The URL will be: https:// (Note the use of the SSL secure https protocol.) __ b. When prompted about certificates, accept and trust them. You will also need to permit pop-ups. __ c. Log in using your assigned HMC user ID and password. __ d. Click your assigned managed system in the HMC GUI to obtain a list of the partitions. __ e. Select your recently created LPAR and choose Operations > Activate > Profile.

© Copyright IBM Corp. 2009, 2013

Exercise 8. AIX installation

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

8-5

Student Exercises with hints

__ f.

Click the Open a terminal window or console session check box on the Activate Logical Partition window.

__ g. Click the Advanced button to boot a partition into SMS mode. In the Advanced window, override the boot mode and set it to SMS. Then click OK, and OK again, to activate the partition. Respond positively to any pop-ups concerning certificates.

8-6

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

__ h. If this is the first time you have established the virtual terminal connection, you will need to respond to series of security pop-ups. Respond to allow the connection to continue. Be careful and read each prompt; sometimes you will see a final prompt that requires an answer of No in order to continue.

EXempty

__ i.

A virtual console window opens (you might need to bring it to the foreground). You might be asked to press 0 to select it as your console. Eventually, the SMS menu will be shown.

__ 7. Skip this, and the next two steps, if you used the HMC graphical user interface. This step will activate your new partition and start a virtual terminal using the HMC command line interface. __ a. If you do not currently have an interactive ssh session to the HMC, establish one at this point and log in with your assigned administrative user name. __ b. If you do not already have a window with a virtual terminal to your new LPAR, start one now. From the HMC command line, access your new LPAR by opening a virtual console session, as follows: ~> mkvterm -m -p -OR~> vtmenu When presented with the Managed Systems list, enter the number for your server. When presented with the Partitions list, enter the number for your new LPAR. Since the new LPAR is not yet active, we do not expect to see anything in this virtual terminal at this point. Note Only one console terminal can be open at a time. If there is a session is still active, for which you do not have a window on your workstation, type: ~> rmvterm -m -p and then repeat your attempt to open a new session. x

__ 8. Open a second terminal emulation window and connect to your HMC using ssh protocol. Log in with your assigned HMC user ID. __ 9. In your new window, activate your newly defined LPAR into SMS mode, as follows: ~> chsysstate -m -r lpar -o on -n \ -f normal -b sms Make sure that you are booting the LPAR that you created and not your originally assigned LPAR. If you continue with the network boot using the originally provided © Copyright IBM Corp. 2009, 2013

Exercise 8. AIX installation

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

8-7

Student Exercises with hints

LPAR, the resulting installation will overwrite (and thus lose) files which are needed for later exercises. Return to the window running your virtual terminal session with your LPAR. The following instructions are the same regardless of whether you started a virtual terminal and activated the partition using a graphical or using the command line interface. In either case, you will use the SMS menu in the window that has the virtual terminal. __ 10. In your virtual console session, you should see the system boot up into system firmware with an SMS Main Menu being displayed. Interact with the SMS menu to configure and test the network boot IP parameters.

__ a. Type 2 (and press Enter) to select 2 Setup Remote IPL. __ b. Select the Interpartition Logical LAN adapter (or it might be labeled as a Virtual Ethernet Adapter). __ c. If prompted to Select Internet Protocol Version, select option 1: IPv4. __ d. If prompted to Select Network Service then select option 1: BOOTP. __ e. On the Network parameters screen, select 1 IP Parameters. __ f.

In the next screen are four options. Type the number of each option you want to alter. For example, type 1, then press Enter to alter the Client IP address. Type in the appropriate values and press Enter again to submit the update. This information should have been recorded in Step 1 of this exercise. • Enter your partition’s IP address for the Client IP address. • Enter the Main NIM server’s IP address for the Server IP Address.

8-8

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

• Enter the network gateway address for the Gateway IP Address.

EXempty

• Enter the subnet mask. __ g. Press Esc to exit to the Network Parameters menu. __ h. Type 2 to select 2 Adapter Configuration. Disable the Spanning tree. Press 2, then 2 again to disable. Press Esc repeatedly to go back to the Network Parameters menu. (Note that the name of the option is Spanning Tree Enable, this name is not any indication of whether it is enabled or disabled). __ i.

On the Network parameters screen, select 3 to select 3 Ping Test. Type 1 and press Enter to execute the ping test. After a moment or two, it should say Ping Success if the ping test succeeded. Press any key to return to the Ping Test screen. If the ping test fails, check your IP parameters.

__ j.

Press Esc (repeatedly) to escape out of the Ping Test screen and go back to the Main Menu.

__ 11. Configure SMS to boot using the Virtual Ethernet Adapter. __ a. Select 5 Select Boot Options. __ b. Select 1 Select Install/Boot Device. __ c. Select 6 Network, 1 BOOTP. __ d. Select the Interpartition Logical LAN (or it might be labeled Virtual Ethernet Adapter). __ e. Select 2 Normal Mode Boot. __ f.

Select 1 Yes when asked Are you sure you want to exit System Management Services to exit SMS.

__ g. You should see indications of a network boot, including a tftp transfer byte count. Do not worry if the tftp has to restart a few times; this is not uncommon. Once the network boot image has been transferred, you should see the LPAR booting using that image. Be patient. The progress codes shown on the HMC will go through a sequence such as: C46, C40, C42, C31.

© Copyright IBM Corp. 2009, 2013

Exercise 8. AIX installation

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

8-9

Student Exercises with hints

__ 12. On reboot, you should see the following, (example only): IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

STARTING SOFTWARE PLEASE WAIT... IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

TFTP BOOT --------------------------------------------------Server IP.....................10.6.51.118 Client IP.....................10.6.51.119 Gateway IP....................10.6.51.1 Subnet Mask...................255.255.255.0 ( 1 ) Filename................./tftpboot/sys264_lpar2 TFTP Retries..................5 Block Size....................512 FINAL PACKET COUNT = 30181 FINAL FILE SIZE = 15452160 BYTES Elapsed time since release of system processors: 1383 mins 25 secs

------------------------------------------------------------------------------Welcome to AIX. boot image timestamp: 16:47 01/14 The current time and date: 19:28:37 04/19/2013 processor count: 1; memory size: 640MB; kernel size: 23461769 boot device: /vdevice/[email protected]:speed=auto,duplex=auto,10.6.51.118,,10.6.52 -------------------------------------------------------------------------------

8-10 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 13. At the Please define the System Console window, select 1 and press Enter to use this terminal as the system console. At the next prompt, select 1 again and press Enter to use English during the install. __ 14. You will now be at the Welcome to Base Operating System Installation and Maintenance main menu. Select option 2 to review the Change/Show Installation Settings and Install options. » Select option 2 and press Enter. __ 15. It is important that we do an overwrite install on hdisk0. (It should be the only disk available, in this exercise.) Check that the system settings are set to: Method of Installation.............New and Complete Overwrite Disk Where You Want to Install.....hdisk0 If they are not set as specified, you will have an opportunity to correct them in the next step. __ 16. In a more realistic environment, you would have a list of disks to choose from, and you cannot be sure that the installation utility will name the disks in the same order as the AIX operating system does. We should verify that hdisk0 is the disk we think it is. __ a. Type 1 and press Enter to examine the System Settings. __ b. If an operating system is detected on the selected disk, you will be prompted for the method of installation. If presented with a Change Method of Installation panel, select New and Complete Overwrite option and then press Enter. __ c. On the Change Disk(s) Where You Want to Install panel, you will note that there is no AIX location code. That is because the disks are being provided by the Virtual I/O Server. Note If you see multiple disks to choose from, stop and ask for assistance from your instructor. In this exercise, you should see only one disk. If you see multiple disks, it is likely that you started the wrong logical partition.

__ d. Type 77 and press Enter to view the Alternate Disk Attributes. __ e. The first alternate disk attribute is the PVID. We cannot use this because hdisk0 does not have a PVID at this point; or even if it does, we likely do not know how to associate it with a particular disk in this situation. __ f.

Type 77 and press Enter to view more Alternate Disk Attributes.

© Copyright IBM Corp. 2009, 2013

Exercise 8. AIX installation

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

8-11

Student Exercises with hints

__ g. Now you can see the physical location codes. This is a good unique identifier of the disk we are about to use. __ h. Type 99 and press Enter to return to the Installation and Settings menu. __ 17. On the Installation and Settings menu, select 4 to proceed to the More options (Software install options) panel. On the next panel, entering the number of the software install option toggles between a yes and a no response. Answer no to both the Graphics Software (AIX Windows) and the Enable System Backups to install on any system options. This will vastly speed up the installation. Install Options 1. 2. 3. 4.

Graphics Software.................................... System Management Client Software.................... Create JFS2 File Systems............................. Enable System Backups to install any system.......... (Installs all devices)

no yes yes no

Then type 99 and press Enter to return to the Installation and Settings menu. __ 18. On the Installation and Settings menu, select 0 to proceed to install using these settings. This will display the Overwrite Installation Summary. Finally, select 1 to confirm and install the system. The system should install in approximately 20-30 minutes depending on the network speed and traffic on the network. Your instructor will likely suggest either a break or that you start on the next unit while waiting. » From the Installation and Settings menu, select 0 and press Enter. » From the Overwrite Installation Summary, select 1 and press Enter. __ 19. When the system has completed installing, log in as the root user. Run the lspv command to see that your disk is in the rootvg volume group. » # lspv Congratulations, you have successfully completed an AIX BOS install into a partition. __ 20. At this point, we want to return to using your originally assigned LPAR. Execute a fast shutdown of the LPAR which you just installed (do not reboot). » # shutdown -F __ 21. When AIX has halted, exit the AIX console session. » If you are using the HMC command line interface: # ~.

8-12 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» If you are using the HMC graphic interface: Close the virtual terminal emulation window. __ 22. When the LPAR is in a Not Activated state, activate your originally assigned LPAR to a normal multi-user mode. » One way to do this is to follow the HMC command line interface procedure you used at the end of Exercise 6 (System startup and shutdown). » Alternatively, you could use the HMC web interface to select your LPAR and then specify the Operation task of Activate. __ 23. Exit the HMC. » If using the command line interface: # exit » If using the HMC graphic interface: Click Logoff in the upper right portion of the web page.

End of exercise

© Copyright IBM Corp. 2009, 2013

Exercise 8. AIX installation

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

8-13

Student Exercises with hints

8-14 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 9. Working with LVM (with hints)

What this exercise is about The purpose of this exercise is to give students the opportunity to work with the facility that manages physical and logical data storage, the Logical Volume Manager (LVM).

What you should be able to do At the end of the exercise, you should be able to: • Create and manipulate volume groups • Create and manipulate logical volumes • Mirror rootvg • Explore and document the LVM environment

Introduction In this exercise, you work extensively with the Logical Volume Manager. First, you will create and manipulate volume groups followed by logical volumes. When you are comfortable with working with the Logical Volume Manager you will mirror the root volume group. Finally, you will work with LVM commands to query and document the environment you have just created. Feel free to use the command line, SMIT or the IBM director console to perform the following steps.

© Copyright IBM Corp. 2009, 2013

Exercise 9. Working with LVM

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

9-1

Student Exercises with hints

Exercise instructions with hints Preface Two versions of these instructions are available: one with hints and one without. You can use either version to complete this exercise. Also, do not hesitate to ask the instructor if you have questions. General notes, applicable to all exercises: Your instructor will provide you with instructions for accessing the remote environment. For example, this might involve using a web browser or Virtual Private Network (VPN). Your instructor will further provide you with all the details and login IDs required. Unless otherwise stated, log in to systems (HMC/LPAR) using a terminal window (for example through PuTTY or a Linux command line). You have the option of using the command line interface or SMIT to accomplish the tasks in this exercise. On some terminal emulations, the function keys are not operative and you might need to substitute escape sequences. For example, instead of pressing F3, you might need to press Esc+3 for the same function. » All hints are marked with a >> sign. » The output shown in the answers is an example. Your output and answers based on the output might be different.

Part 1: Creating and manipulating volume groups __ 1. Access your assigned lab system and log in as the root user. __ 2. Create a new original volume group on hdisk1 called myVG. Make the physical partition size equal to 64 MB (given the size of the disk, it should default to 128 MB). This is to allow better granularity of space allocation and thus save disk space. » The suggested commands are: » # mkvg -f -s 64 -y myVG hdisk1 OR » # smitty lvm

9-2

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» Select Volume Groups > Add a Volume Group > Add an Original Volume Group. Add an Original Volume Group VOLUME GROUP name Physical partition SIZE in megabytes * PHYSICAL VOLUME names FORCE the creation of volume group? Activate volume group AUTOMATICALLY at system restart? Volume group MAJOR NUMBER Create VG Concurrent Capable? Infinite Retry Option?

[myVG] 64 + [hdisk1] + yes + yes + [] +# no + no +

__ 3. Add the free disk, hdisk2 into myVG. As the disks might have previously contained a volume group, use the force (-f) option. » The suggested commands are: » # extendvg -f myVG hdisk2 OR » # smitty lvm » Select Volume Groups > Set Characteristics of a Volume Group > Add a Physical Volume to a Volume Group. » (Use F4 or to pick values off of a list.)

Force the creation of a volume group? * VOLUME GROUP name * PHYSICAL VOLUME names

no [myVG] [hdisk2]

+ + +

__ 4. Check that hdisk0 is associated with rootvg, while hdisk1 and hdisk2 are associated with myVG. » # lspv __ 5. List the volume group attributes of myVG. What is the maximum number of PPs per PV? _______________________ » What is the maximum number of PVs in the volume group? ______________ »# lsvg myVG » You should see that PPs per PV is 1016 and that the max PVs per VG is 32. __ 6. Remove disk hdisk2 from myVG. Make sure you remove the correct disk. » # reducevg myVG hdisk2

© Copyright IBM Corp. 2009, 2013

Exercise 9. Working with LVM

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

9-3

Student Exercises with hints

OR » # smitty lvm » Select Volume Groups > Set Characteristics of a Volume Group > Remove a Physical Volume from a Volume Group. » (Use F4 or to pick values off of a list.) * VOLUME GROUP name * VOLUME GROUP name * PHYSICAL VOLUME names FORCE deallocation of all partitions on this physical volume?

[myVG] myVG [hdisk2] no

+

+ +

__ 7. Verify that the disk is no longer associated with myVG. » # lspv __ 8. Convert myVG to a Scalable VG: Note The volume group must first be deactivated (varyoffvg).

» The suggested commands are: # varyoffvg myVG # chvg -G myVG » (Answer yes to convert.) __ 9. Bring the myVG volume group on-line and list the myVG attributes. How can you tell the volume group is now of type scalable? _______________________________________________ » # varyonvg myVG » # lsvg myVG » You should see that the MAX PVs to be set to 1024. For VGs of type Original, the MAX PV value is set to 32.

9-4

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 2: Creating and manipulating logical volumes __ 10. Extend myVG to include disks, hdisk2, and hdisk3. » # extendvg -f myVG hdisk2 hdisk3 __ 11. Add a logical volume to myVG: • Name: datalv1 • No of copies: 1 • Type: jfs2 • Size: 5 LPs • For all other values, accept the default » The suggested commands are: » # mklv -y datalv1 -t jfs2 -c 1 myVG 5 OR » # smit lvm

» Select Logical Volumes > Add a Logical Volume. » (Use F4 or to pick values off of a list.) * VOLUME GROUP name

[myVG]

+

» The resulting dialogue panel is: Logical volume NAME * VOLUME GROUP name * Number of LOGICAL PARTITIONS PHYSICAL VOLUME names + Logical volume TYPE POSITION on physical volume RANGE of physical volumes MAXIMUM NUMBER of PHYSICAL VOLUMES to use for allocation Number of COPIES of each logical partition

[datalv1] myVG [5] [] [jfs2] middle minimum [] 1

#

+ + + # +

Which disk was the logical volume created on? _______________________

© Copyright IBM Corp. 2009, 2013

Exercise 9. Working with LVM

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

9-5

Student Exercises with hints

» The suggested commands are: # lslv -l datalv1 OR # lspv -l hdisk1; lspv -l hdisk2; lspv -l hdisk3 » Note that the space could have been allocated on any disk in the VG. If concerned about disk placement, this could be specified on the mklv command (or SMIT equivalent). __ 12. Display the number of logical partitions (LP) in the datalv1 logical volume. » # lslv datalv1 | grep LP __ 13. Increase the size of datalv1 by 5 LPs. » # extendlv datalv1 5 __ 14. Display the number of logical partitions (LP) in the datalv1 logical volume. » # lslv datalv1 | grep LP __ 15. Create a mirror copy of datalv1 on hdisk3. Ensure that the LP copies will be synchronized. Note that you need to specify the final number of copies rather than the number to be added. » The suggested commands are: » # mklvcopy -k datalv1 2 hdisk3 OR » # smit lvm » Select Logical Volumes > Set Characteristic of a Logical Volume > Add a Copy to a Logical Volume.

9-6

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» (Use F4 or to pick values off of a list.) * LOGICAL VOLUME name + * LOGICAL VOLUME name * NEW TOTAL number of logical partition copies PHYSICAL VOLUME names POSITION on physical volume RANGE of physical volumes MAXIMUM NUMBER of PHYSICAL VOLUMES to use for allocation Allocate each logical partition copy on a SEPARATE physical volume? File containing ALLOCATION MAP SYNCHRONIZE the data in the new logical partition copies? . . .

[datalv1] datalv1 2

+

[hdisk3] outer_middle minimum [1024]

+ + + #

yes

+

yes

+

[]

__ 16. Verify a copy of the data was successfully mirrored to hdisk3. » The suggested commands are: # lslv -l datalv1 # lslv datalv1 » The COPIES fields will identify if mirroring is configured. » The ratio of LPs to PPs will also identify any mirroring.

© Copyright IBM Corp. 2009, 2013

Exercise 9. Working with LVM

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

9-7

Student Exercises with hints

Part 3: Migrating logical volumes __ 17. Add another logical volume to myVG: • • • • • •

Name: datalv2 Disk: hdisk1 Type: jfs2 Size: 5 LPs POSITION on physical volume: outer edge For all other values accept the default

» The suggested commands are: » # mklv -y datalv2 -a e -t jfs2 myVG 5 hdisk1 OR » # smit lvm » Select Logical Volumes > Add a Logical Volume. » (Use F4 or to pick values off of a list.) * VOLUME GROUP name

[myVG]

+

[datalv2] myVG [5] [hdisk1] [jfs2] outer_edge minimum []

# + + + + #

» The resulting dialogue panel is: Logical volume NAME * VOLUME GROUP name * Number of LOGICAL PARTITIONS PHYSICAL VOLUME names Logical volume TYPE POSITION on physical volume RANGE of physical volumes MAXIMUM NUMBER of PHYSICAL VOLUMES to use for allocation Number of COPIES of each logical partition . . .

1

+

__ 18. Verify the position of datalv2 on hdisk1. » The suggested commands are: » # lspv -l hdisk1 __ 19. Migrate the logical volume datalv2 to hdisk2. Verify the LV has migrated successfully. » The suggested commands are:

9-8

AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» # migratepv -l datalv2 hdisk1 hdisk2 » # lslv -l datalv2 __ 20. We want to free up hdisk1 but not lose its data. Fortunately its only LV, datalv1, is already mirrored on hdisk3. Remove the mirror copies of datalv1 from hdisk1. (If you did not request synchronization when allocating the mirror copies, you will get an error. To correct the situation run: # syncvg -l datalv1.) » The suggested commands are: » # rmlvcopy datalv1 1 hdisk1 OR » # smit lvm » Select Logical Volumes > Set Characteristic of a Logical Volume > Remove a Copy from a Logical Volume. » (Use F4 or to pick values off of a list) * LOGICAL VOLUME name

[datalv1]

+

» The resulting dialogue panel is: * LOGICAL VOLUME name * NEW maximum number of logical partition copies PHYSICAL VOLUME names

datalv1 1 [hdisk1]

+ +

__ 21. Verify that datalv1 now only resides on hdisk3 and that hdisk1 has no LV allocations. » The suggested commands are: » # lslv -l datalv1 » # lspv -l hdisk1

© Copyright IBM Corp. 2009, 2013

Exercise 9. Working with LVM

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

9-9

Student Exercises with hints

Part 4: Mirroring rootvg __ 22. Remove hdisk1 from the myVG volume group. » The suggested commands are: » # reducevg myVG hdisk1 __ 23. Add the free disk, hdisk1, into rootvg. Since the disk might have previously contained a volume group, use the force (-f) option. » The suggested commands are: » # extendvg -f rootvg hdisk1 __ 24. Accepting all the default options, mirror rootvg to hdisk1. Note This command will take a few minutes to complete.

» The suggested commands are (there are two very different approaches listed): » Approach #1: # mirrorvg rootvg hdisk1 OR # smit lvm » Select Volume Groups > Mirror a Volume Group. » (Use F4 or to pick values off of a list.)

* VOLUME GROUP name

[rootvg]

+

» The resulting dialogue panel is: * VOLUME GROUP name Mirror sync mode PHYSICAL VOLUME names Number of COPIES of each logical partition Keep Quorum Checking On? Create Exact LV Mapping?

rootvg [Foreground] [hdisk1] 2 no no

+ + + + +

» Approach #2: # mirrorvg -s rootvg hdisk1 # syncvg -v rootvg & # lsvg -l rootvg (run repeatedly and observe the STATUS of the LVs. This allows you to monitor progress of the synchronization; when there are no more STALE LVs, the syncrhonization is complete.) 9-10 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 25. Create a boot image on hdisk1. » # bosboot -a -d /dev/hdisk1 __ 26. Update the normal bootlist to include hdisk1. » # bootlist -m normal hdisk0 hdisk1

© Copyright IBM Corp. 2009, 2013

Exercise 9. Working with LVM

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

9-11

Student Exercises with hints

Part 5: Exploring and documenting your LVM environment __ 27. List the volume group attributes of rootvg. Is quorum checking enabled? If not, why not? ____________________________________________________________ ____________________________________________________________ ___________________________________________________________ » # lsvg rootvg » Quorum checking is disabled. It was disabled by the mirror VG procedure. It is important that quorum checking is disabled in a 2-disk mirrored volume group so the VG does not go off-line if one disk fails. __ 28. Using a single command, list all the logical volumes in each active (online) volume group. Notice the ratio of PPs to LPs for the rootvg logical volumes. » # lsvg -o | lsvg -il __ 29. Query the physical volumes in both volume groups: rootvg and myVG. » The suggested commands are: » # lsvg -p rootvg » # lsvg -p myVG __ 30. List all logical volumes on hdisk1. » # lspv -l hdisk1 __ 31. List the physical volume partition map for disk, hdisk1. Which logical volumes are positioned in the center of the disk? ___________________________________________________________ » # lspv -p hdisk1 __ 32. List the logical volume attributes of datalv1. » # lslv datalv1 __ 33. Reduce the number of rootvg mirror copies to 1, retaining the rootvg logical volumes on hdisk0. Remove hdisk1 from the boot list and clear the boot record on hdisk1. » The following commands will reduce the mirroring, update the bootlist and clear the boot record: » » » »

# # # #

unmirrorvg -c 1 rootvg hdisk1 chpv -c hdisk1 bosboot -a -d /dev/hdisk0 bootlist -m normal hdisk0

__ 34. Remove hdisk1 from the rootvg. » The suggested command is:

9-12 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» # reducevg rootvg hdisk1

© Copyright IBM Corp. 2009, 2013

Exercise 9. Working with LVM

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

9-13

Student Exercises with hints

Part 6: (Optional) Striped logical volumes __ 35. Add hdisk1 to the myVG volume group. » The suggested commands are: » # extendvg myVG hdisk1 __ 36. On myVG, create a striped (RAID 0) logical volume named stripelv. Stripe the logical volume across all three disks in the volume group: • Type: jfs2 • Size: 24 LPs • Stripe size: 64K • For all other values accept the default » The suggested commands are: » # mklv -y stripelv -t jfs2 -S 64K myVG 24 hdisk1 hdisk2 hdisk3 OR » # smit lvm » Select Logical Volumes > Add a Logical Volume. » (Use F4 or to pick values off of a list.) * VOLUME GROUP name

[myVG]

+

» An example dialogue panel is: Logical volume NAME * VOLUME GROUP name * Number of LOGICAL PARTITIONS PHYSICAL VOLUME names Logical volume TYPE POSITION on physical volume RANGE of physical volumes MAXIMUM NUMBER of PHYSICAL VOLUMES to use for allocation Number of COPIES of each logical partition . . . Stripe Size? . . .

[stripelv] myVG [24] # [hdisk1 hdisk2 hdisk3] + [jfs2] + outer_middle + minimum + [] # 1

[64K]

+

+

__ 37. Check to see how many PPs have been created on each disk. _____________ » # lslv -l stripelv 9-14 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» There are eight PPs on each disk. __ 38. Check that the LPs have been striped across each of the three disks in the volume group. » The suggested commands are: » # lslv -m stripelv (shows that the LPs are distributed) » # lslv stripelv (shows the stripe size and stripe width) __ 39. Delete logical volume, stripelv. » # rmlv stripelv » Answer yes when prompted. __ 40. Remove hdisk1 from the myVG volume group. » The suggested command is: » # reducevg myVG hdisk1

End of exercise

© Copyright IBM Corp. 2009, 2013

Exercise 9. Working with LVM

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

9-15

Student Exercises with hints

9-16 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 10. File system administration (with hints)

What this exercise is about In this exercise, students are given the opportunity to perform file system administration in AIX.

What you should be able to do At the end of the exercise, you should be able to: • Add, remove, extend, and shrink AIX file systems • Mount and unmount file systems • (Optional) Describe the effects of file system block sizes

Introduction In this exercise, you will work extensively with file systems. There are two parts: • Part 1: You will add, remove, extend, and shrink file systems. • (Optional) Part 2: You will be given the chance to understand the effects of file system block sizes.

© Copyright IBM Corp. 2009, 2013

Exercise 10. File system administration

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

10-1

Student Exercises with hints

Exercise instructions with hints Preface Two versions of these instructions are available: one with hints and one without. You can use either version to complete this exercise. Also, do not hesitate to ask the instructor if you have questions. General notes, applicable to all exercises: Your instructor will provide you with instructions for accessing the remote environment. For example, this might involve using a web browser or Virtual Private Network (VPN). Your instructor will further provide you with all the details and login IDs required. Unless otherwise stated, log in to systems (HMC/LPAR) using a terminal window (for example through PuTTY or a Linux command line). On some terminal emulations, the function keys are not operative and you might need to substitute escape sequences. For example, instead of pressing F3, you might need to press Esc+3 for the same function. » All hints are marked with a >> sign. » The output shown in the answers is an example. Your output and answers based on the output might be different. » This exercise assumes that rootvg is on hdisk0 and that the myVG volume group is defined with datalv1 defined with allocations in myVG.

Part 1: Working with file systems __ 1. Access your assigned lab system and log in as the root user. __ 2. Create an enhanced (JFS2) file system: • Volume Group: myVG • Size: 100 MB • Mount point /myfs • For all other values, accept the default » The suggested commands are: »# crfs -v jfs2 -g myVG -a size=100M –m /myfs OR »# smitty jfs2

10-2 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» Select Add an Enhanced Journaled File System. Add an Enhanced Journaled File System Volume group name SIZE of file system Unit Size * Number of units * MOUNT POINT

myVG Megabytes + [100] # [/myfs]

__ 3. List all of the logical volumes in myVG. What is the LV device file name and the state of the newly created file system? ____________________________________________________________ There was also one additional LV created. __ a. What was it called? ___________________________ __ b. What type is it? _______________________________ __ c. How big is it? _________________________________ » # lsvg -l myVG » The new file system is in a logical volume called fslv00. » The state of the logical volume is closed (not mounted). » Regarding the additional LV that was created: - What was it called? loglv01 What type is it? jfs2log - How big is it? 2 LP (for an LP size of 64 MB) __ 4. View the stanza in the /etc/filesystems file regarding the new created file system. » # tail /etc/filesystems __ 5. Mount the /myfs file system, list the mounted filesystems, and recheck the state of the logical volume. » The suggested commands are: » # mount /myfs » # mount » # lsvg -l myVG » The state of the logical volume should now be open/syncd. __ 6. Create an enhanced journaled file system (JFS2) on a previously created logical volume. This allows you more control over the initial location of the file system and other logical volume characteristics. - Use datalv1 as the logical volume (which was created in the last exercise). © Copyright IBM Corp. 2009, 2013

Exercise 10. File system administration

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

10-3

Student Exercises with hints

- Set the file system mount point to /datafs1 - Specify that the filesystem should be mounted at each system restart. » The suggested commands are: » # crfs -v jfs2 -A yes -d datalv1 -m /datafs1 OR »# smitty jfs2 » Select Add an Enhanced Journaled File System on a Previously Defined Logical Volume. * LOGICAL VOLUME name datalv1 + * MOUNT POINT Mount AUTOMATICALLY at system restart? PERMISSIONS

[/datafs1] yes read/write

+

__ 7. List the filesystem characteristics of the /myfs file system. What is the value of the Auto attribute? _______________________________________________ » # lsfs /myfs » The Auto attribute should have a value of no. __ 8. Change the file system characteristics of /myfs so that it is set to mount automatically during the system start-up process. Check the value of the Auto attribute. » The suggested commands are: » # chfs -A yes /myfs » # lsfs /myfs » You should see that the Auto attribute is now yes.

__ 9. Record the size (in MB) of the file system /myfs: ________________________ » # df -m /myfs » You should see the same size as you recorded after you created the logical volume. __ 10. Increase the size of /myfs by 500 MB. Check that the file system size was increased. » The suggested commands are: » # chfs -a size=+500M /myfs » # df -m /myfs __ 11. Decrease the size of /myfs by 300 MB. Check that the file system size was decreased.

10-4 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» The suggested commands are: » # chfs -a size=-300M /myfs » # df -m /myfs __ 12. Remove file system /myfs from the system. What step needs to be performed before the file system can be deleted? ____________________________________________________________ » The suggested commands are: » # unmount /myfs » # rmfs /myfs » Before the file system can be deleted, it must first be unmounted. » Note: Deleting the file system also removes the associated logical volume and the stanza from the /etc/file systems file. __ 13. Remove file system /datafs1 from the system. » The suggested command is: » # rmfs /datafs1 __ 14. If you are not immediately going to do the optional part 2 of this exercise, remove the myVG volume group. Request deletion of any logical volumes. Verify that myVG was removed. » The suggested command is: » # reducevg -d myVG hdisk2 hdisk3 » # lsvg

© Copyright IBM Corp. 2009, 2013

Exercise 10. File system administration

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

10-5

Student Exercises with hints

Part 2: (Optional) File system block sizes __ 15. If doing this optional part at a later point in time, you might not have the myVG volumes group defined. In that case, create a myVG volume group using an available physical volume. » The suggested command is: » # mkvg -f -s 64 -y myVG hdisk2 (assumes hdisk2 is the available disk) __ 16. Create and mount two JFS2 file systems in volume group myVG: __ a. /test512: • Block Size of 512 bytes • Size: 64 MB (or the VG ppsize, whichever is larger) __ b. /test4096: • Block Size of 4096 bytes • Size: 64 MB (or the VG ppsize, whichever is larger) » Our exercise hints will assume that 16 MB is the larger size. » The suggested commands are: » # crfs -v jfs2 -g myVG -a agblksize=512 \ -a size=64M -m /test512 » # crfs -v jfs2 -g myVG -a agblksize=4096 \ -a size=64M -m /test4096 » # mount /test512; mount /test4096 __ 17. Let us see how many 512 byte files we can create in each file system (created in the previous step). A script, called create_files under the directory /home/AN14, has been written for you to do this automatically. The script will accept one argument. An argument value of c512 will create files in /test512 and an argument value of c4096 will create files in /test4096. (Be patient; this task may take a significant amount of time to complete.) __ a. Run the create_files script with each of these argument values: # cd /home/AN14 __ b. Invoke: # ./create_files c512 How many files were created? ____________________________ # ./create_files c4096 How many files were created? ____________________________ What are your conclusions? __________________________________________________________________ __________________________________________________________________

10-6 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__________________________________________________________________ __________________________________________________________________ » File systems with smaller block sizes are more efficient at storing lots of small files. » 14297 512 byte files should have been created in the /test4096 file system. » 61352 512 byte files should have been created in the /test512 file system. » Note: There is some space overhead for the structure of the JFS2 file system. Remember also to take into account the size and space required for the inodes, which by default are 512 bytes each in size. __ 18. Remove the /test512 and /test4096 file systems. What needs to be done before they can be removed? ______________________________________________________. » The suggested commands are: » # unmount /test512 » # rmfs /test512 » The suggested commands are: » # umount /test4096 » # rmfs /test4096 __ 19. Remove the myVG volume group. Request deletion of any logical volumes. Verify that no physical volumes assigned to myVG. » The example command is: » # reducevg -d myVG hdisk2 » # lspv

End of exercise

© Copyright IBM Corp. 2009, 2013

Exercise 10. File system administration

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

10-7

Student Exercises with hints

10-8 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 11.The Object Data Manager (with hints)

What this exercise is about This exercise will review some of the most important Object Data Manager (ODM) files and how they are used in device configuration. You will use the ODM command line interface.

What you should be able to do At the end of the exercise, you should be able to: • Describe some of the most important ODM files • Use the ODM command line interface • Explain how ODM classes are used by device configuration commands

Introduction This exercise has two parts: • Part 1: Review of device configuration ODM classes (PdDv, PdAt, CuDv, CuAt, CuDep, and CuDvDr). • (Optional) Part 2: Modify a device attribute default value. All instructions in this exercise require root authority.

© Copyright IBM Corp. 2009, 2013

Exercise 11. The Object Data Manager

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

11-1

Student Exercises with hints

Exercise instructions with hints Preface Two versions of these instructions are available: one with hints and one without. You can use either version to complete this exercise. Also, please do not hesitate to ask the instructor if you have questions. All exercises of this unit depend on the availability of specific equipment in your classroom. » All hints are marked with a >> sign. » The output shown in the answers is an example. Your output and answers based on the output might be different.

Part 1: Device configuration ODM classes __ 1. Execute the lsdev command and identify all devices that are supported on your system. Tell the lsdev command to provide column headers in the output. What is the command you used? __________________________________________________________ » # lsdev -P -H | pg Which ODM object class is used by the lsdev command to generate this output? (You might need to refer to your Student Guide materials). __________________________________________________________ » PdDv __ 2. Execute the lsdev command and identify all disk devices that are currently attached to your system. Tell the lsdev command to provide column headers in the output. What is the command you used? __________________________________________________________ » # lsdev -C -c disk -H Which ODM class is used by the lsdev command to generate this output? __________________________________________________________ » CuDv __ 3. Request the same listing as above, except customize the reported fields needed to complete the following list for disk hdisk0: Name: ___________________________________ Status: ___________________________________ Location: _________________________________

11-2 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Physical location: ___________________________ Description: _______________________________ » This information can be obtained from the output of the command: » lsdev -C -c disk -F “name status location physloc”, but answers (particularly the location information) might vary. __ 4. Use the ODM command line interface and list the ODM object that describes the hdisk0 disk device. Also, use the ODM command line interface to list the ODM object that contains the parent adapter’s physical location code as part of its Vital Product Data information. What commands did you used? __________________________________________________________ » # odmget -q name=hdisk0 CuDv » # odmget -q name= CuVPD From the output, complete the following list for disk hdisk0: Status: ___________________________________ Chgstatus: ________________________________ Parent: ___________________________________ Location: _________________________________ Connwhere: _______________________________ PdDvLn: __________________________________ Physical Location: __________________________ » This information can be obtained from the output of the command odmget -qname=hdisk0 CuDv, but answers (particularly the parent and location information) might vary. For some devices, such as virtual devices, there might not be any AIX location code; in that case the physical location code provides the location information. __ 5. Execute the lscfg command and filter for hdisk0. Compare the physical location code with the ODM information you just displayed. How do they compare? _____________________________________________________________ ______________________________________________________________ » Suggested command is: » # lscfg | grep hdisk0 » The disk physical location code was constructed form the physical location code of the parent adapter appended with the connwhere of the disk device. The connwhere (used to locate a device once we know the parent adapter port) is often part of either the AIX location code or the physical location code. © Copyright IBM Corp. 2009, 2013

Exercise 11. The Object Data Manager

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

11-3

Student Exercises with hints

__ 6. From this output and your Student Guide notes (Customized devices object class), please answer the following question: What is the meaning of the displayed value of the descriptor: chgstatus? __________________________________________________________ » A value of 2 (the expected result) indicates that the status of the disk device has not changed since the last reboot. __ 7. List the effective attributes (lsattr) for your hdisk0 device and identify the physical volume identifier for that disk. What is the command you used? __________________________________________________________ » # lsattr -El hdisk0 Write down the physical volume ID of the disk: pvid: ______________________________________________________ » This value can be obtained from the output of the command lsattr -El hdisk0, but answers will vary. On two systems previously used to test this exercise, the pvid values obtained were 0009330f2d01c69f0000000000000000 and 00cee60e58b2d39a0000000000000000. Note that while these are 32-digit values, the last 16 digits are zeros. __ 8. Use the ODM command line interface, and list the ODM object that stores the physical volume identifier (pvid) device attribute: What is the command you used? __________________________________________________________ »Suggested commands are: » # odmget -q"name=hdisk0 and attribute=pvid" CuAt OR » # odmget CuAt | grep -p hdisk0 | grep -p pvid __ 9. The /dev directory contains the special files to access the devices. Write down the major and minor number of the special file for hdisk0. Major number: _____________________ Minor number: _____________________ » # ls -l /dev/hdisk0 Which ODM class is used to identify the major number and minor number for the device driver? __________________________________________________________ » CuDvDr 11-4 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» Enter the following command to see the relevant entry in the CuDvDr object class: » # odmget -q value3=hdisk0 CuDvDr __ 10. List all your logical volumes that are part of the rootvg. What is the command you used? __________________________________________________________ » # lsvg -l rootvg __ a. Query the ODM class CuDep and identify all logical volumes that belong to rootvg. What is the command you used? __________________________________________________________ »Suggested commands are: » # odmget -qname=rootvg CuDep OR » # odmget -q parent=rootvg CuDv

© Copyright IBM Corp. 2009, 2013

Exercise 11. The Object Data Manager

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

11-5

Student Exercises with hints

Part 2: (Optional) Modifying a device attribute default value In this part of the exercise, you will backup and then modify the ODM using the ODM commands. Our example will use an Ethernet interface attribute which will not have much real effect (so it is safe to play with). The remote MTU (remmtu) attribute is intended to set the Maximum Transmission Unit (MTU) size when transmitting to a partner on a remote network, but it is superseded by other mechanisms. __ 11. Using a high-level command, retrieve the en1 effective attributes. What is the value of the remmtu attribute? _____________________________________________ » # lsattr -E -l en1 » You should find that the value is set to 576. __ 12. This value is very small. We want to set it to the largest possible value. Run a high level command to identify the allowable range of values for this attribute. What is the largest value that we can use? _________________________________________ ________________________________________________________________ » # lsattr -R -l en1 -a remmtu » You should see that the largest allowable value is 1500. __ 13. We could use a high-level command to set the effective value of the attribute for our interface; but, we would have to do this repeatedly each time a new instance of the device was added. What command would you use to set a new effective value (but do not run it)? ____________________________________________________ _______________________________________________________________ » The command you would use (but do not do this here) to override a default value for a particular device would be chdev -l -a = __ 14. Let us verify that the current attribute value is not already an override to the default value. Use a high-level command to retrieve the default attributes for the en1 interface. Is the default the same as the effective attribute value in this instance? _______________________________________________________________ » # lsattr -D -l en1 -a remmtu » You should find that the default attribute value is the same as the effective attribute value. __ 15. If we change the default value for the attribute, each new instance of the device will automatically have the preferred value. There is no high-level command to modify the default values. What object class holds the default attribute values? _______________________________________________________________ » The predefined attributes (PdAt) object class is where device default values are stored.

11-6 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 16. Before you use ODM commands to make this change, first back up the ODM object class that you will be changing. » The suggested commands are: » # odmget PdAt > /tmp/PdAt-back OR » # mkdir /tmp/objrepos » # cp /etc/objrepos/* /tmp/objrepos __ 17. To locate the correct object, you will need to know the class, subclass, and type values associated with the Ethernet interface device. Retrieve the ODM customized device object for en1 and record the pre-defined device link descriptor value (PdDvLn): _______________________________________________________________ » # odmget -q name=en1 CuDv __ 18. The corresponding descriptor value in the predefined ODM database is the uniquetype descriptor. Using both the attribute descriptor value of remmtu and the uniquetype descriptor value to qualify the operation, display the predefined attribute object for the remote MTU attribute. Be sure that you see one and only one object in the display. What is the attribute value displayed? __________________ » # odmget -q “uniquetype=if/EN/en AND attribute=remmtu” PdAt __ 19. Repeat this display, only redirect the output to the file: /tmp/remmtu-object. » # odmget -q “uniquetype=if/EN/en AND attribute=remmtu” PdAt > /tmp/remmtu-object __ 20. Edit the file you created to change the default value to the maximum value allowed. » # vi /tmp/remmtu-object » Change the deflt descriptor value to 1500. » Write and quit the edit session. __ 21. Using the same qualification as on the retrieval, replace the ODM object with the one in your edited file. » # A suggested command is: # odmchange -o PdAt -q “uniquetype=if/EN/en AND \ attribute=remmtu” /tmp/remmtu-object __ 22. Use a high-level command to verify that the remmtu attribute default value has changed. You can use either the en1 logical device name or the uniquetype value to identify the object. » # lsattr -D -l en1 -a remmtu © Copyright IBM Corp. 2009, 2013

Exercise 11. The Object Data Manager

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

11-7

Student Exercises with hints

__ 23. Display the effective remmtu attribute value for en1. Did it change? ______________________________________________________________ » # lsattr -E -l en1 -a remmtu » You should see that the effective attribute value has changed. The default value is effective unless there is an override created with the chdev command. Of course, any new interfaces that are configured, automatically, will be effectively using the new value.

End of exercise

11-8 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 12.LVM metadata issues (with hints)

What this exercise is about In this exercise, you will analyze and fix LVM-related ODM problems. There will be optional exercises for students who want and have time for additional exercise experiences.

What you should be able to do At the end of the exercise, you should be able to: • Fix LVM-related ODM problems

Introduction This exercise has five parts: • Part 1: You are asked to fix another ODM failure. It is a failure which requires you to use intermediate level ODM commands to fix the problem. • Part 2: You export a volume group and then import the volume group. • (Optional) Part 3: You deal with errors during the import of a volume group. • (Optional) Part 4: You will fix an LVM ODM problem using the importvg and exportvg technique. • (Optional) Part 5: You will be asked to analyze and fix an LVM ODM failure by using the rvgrecover procedure. You will need root authority to complete this exercise.

Requirements • /home/AN14/corrupt_pvid • /home/AN14/corrupt_odm • /home/AN14/rvgrecover • /home/AN14/build_vg © Copyright IBM Corp. 2009, 2013

Exercise 12. LVM metadata issues

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

12-1

Student Exercises with hints

• /home/AN14/corrupt_odm2 • /home/AN14/corrupt_odm3

12-2 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise instructions with hints Preface Two versions of these instructions are available: one with hints and one without. You can use either version to complete this exercise. Also, please do not hesitate to ask the instructor if you have questions. All exercises of this unit depend on the availability of specific equipment in your classroom. » All hints are marked with a >> sign. » The output shown in the answers is an example. Your output and answers based on the output might be different. » This lab exercise assumes that rootvg on hdisk0 and that all other disks are free.

Part 1: Using intermediate LVM commands __ 1. Ensure that the lvmtestvg volume group does not exist. If it does, delete it. » Suggested commands are: # lsvg » If needed: # lsvg -p lvmtestvg # umount /lvmtestfs # reducevg -d lvmtestvg hdisk2 __ 2. List the physical volumes on your system to verify that hdisk2 is available. If it belongs to a volume group, free the disk from that volume group. » Suggested commands are: # lspv » If needed: » -- for VG with another disk --# migratepv hdisk2 hdisk# # reducevg hdisk2 » OR » -- for VG with only hdisk2 -#reducevg -d hdisk2 __ 3. The problem we want to create is significant, so we will not use the rootvg for this. Instead, you have been provided with a script which will create a volume group (using hdisk2) and a file system with a special naming convention to match the problem setup script. The script is: /home/AN14/build_vg. Execute this script. » # /home/AN14/build_vg

© Copyright IBM Corp. 2009, 2013

Exercise 12. LVM metadata issues

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

12-3

Student Exercises with hints

__ 4. Display the online VGs and then list the logical volumes and physical volumes in the lvmtestvg volume group. Record the names of any physical volumes that belong to the lvmtestvg volume group: ________________________________________________________________ » Suggested commands are: # lsvg -o lvmtestvg rootvg # lsvg -l lvmtestvg lvmtestvg: LV NAME TYPE POINT lvmtestlv jfs2 /lvmtestfs loglv00 jfs2log

LPs

PPs

1

1

1

open/syncd

1

1

1

open/syncd

# lsvg -p lvmtestvg lvmtestvg: PV_NAME PV STATE DISTRIBUTION hdisk2 active 219..216..218..218..219

PVs LV STATE

TOTAL PPs

FREE PPs

1092

1090

MOUNT

N/A

FREE

__ 5. Verify that the new /lvmtestfs file system is mounted. » # mount __ 6. Create a data file in the /lvmtestfs directory. » # echo “hello world” > /lvmtestfs/testfile __ 7. In the /home/AN14 directory you will find a script called corrupt_odm3. Execute this script. » # /home/AN14/corrupt_odm3 0518-307 0518-307 0518-307 0518-307 0518-307

odmdelete: odmdelete: odmdelete: odmdelete: odmdelete:

8 2 1 2 2

objects objects objects objects objects

deleted. deleted. deleted. deleted. deleted.

__ 8. Display the online VGs and then list the logical volumes in the lvmtestvg volume group. What problems did you see? » The suggested commands are:

12-4 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» # lsvg -o 0516-304 : Unable to find device id 00c07f7f00004c0000000121ad0e4aee in the Device Configuration Database. vgid=00c07f7f00004c0000000121ad0e4aee rootvg

» # lsvg -l lvmtestvg 0516-306 : Unable to find volume group lvmtestvg in the Device Configuration Database.

» # lsvg -p lvmtestvg 0516-306 : Unable to find volume group lvmtestvg in the Device Configuration Database.

__ 9. Try to increase the size of the /lvmtestfs file system by one block. Could it be done? _____________________________________________________________ » # chfs -a size=+1 /lvmtestfs 0516-306 /usr/sbin/getlvodm: Unable to find lvmtestlv in the Device Configuration Database. chfs: Cannot get lv id from odm.

__ 10. Display the contents of the testfile that you created earlier. Were you able to access your data? _________________________________ » The suggested commands are: # cat /lvmtestfs/testfile hello world » It is interesting that while the corruption prevents us from executing important LVM commands, it does not impact our ability to access the user data. __ 11. We could try to solve the problem with the exportvg and importvg technique. Attempt to export lvmtestvg (you first need to close the logical volumes and vary the VG offline). How far can you get before you experience a problem? ________________________________________________________________ ________________________________________________________________ ________________________________________________________________ » Suggested commands are: # umount /lvmtestfs # varyoffvg lvmtestvg 0516-306 getlvodm: Unable to find volume group lvmtestvg in the Device Configuration Database. 0516-942 varyoffvg: Unable to vary off volume group lvmtestvg.

© Copyright IBM Corp. 2009, 2013

Exercise 12. LVM metadata issues

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

12-5

Student Exercises with hints

» The procedure fails before we can even try to execute the exportvg command, which requires that the volume group be inactive. __ 12. Mount the /lvmtestfs file system. » The suggested command is: » # mount /lvmtestfs __ 13. Try using an intermediate level command that will synchronize the LVM information with the ODM. What happened? _____________________________________________________________ » The suggested command is: # synclvodm lvmtestvg 0516-306 : Unable to find volume group lvmtestvg in the Device Configuration Database. 0516-502 synclvodm: Unable to access volume group lvmtestvg. » The command requires that certain volume group information be in the ODM. The corruption deleted this ODM information, preventing us from using the synclvodm command. __ 14. Use an intermediate-level LVM command to redefine the lvmtestvg volume group in the ODM. Specify the disk which you recorded in step 4. » The suggested command is: # redefinevg -d hdisk2 lvmtestvg __ 15. Display the online VGs and then list the logical volumes in the lvmtestvg volume group. What problems do you see? » The suggested commands are: » # lsvg -o lvmtestvg rootvg

» # lsvg -l lvmtestvg lvmtestvg: LV NAME lvmtestlv loglv00

TYPE ??? jfs2log

LPs 2 1

PPs 2 1

PVs LV STATE 1 open/syncd 1 open/syncd

MOUNT POINT /lvmtestfs N/A

# lsvg -p lvmtestvg lvmtestvg: PV_NAME hdisk2

12-6 AIX Jumpstart

PV STATE active

TOTAL PPs 1092

FREE PPs 1089

FREE DISTRIBUTION 219..215..218..218..219

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» The volume group and its physical volume and logical volume membership is recovered, but the data for the logical volumes does not appear to be complete, given the type value of ???. __ 16. Try to increase the size of the /lvmtestfs file system by one block. Could it be done? _____________________________________________________________ » # chfs -a size=+1 /lvmtestfs 0516-306 /usr/sbin/getlvodm: Unable to find lvmtestlv in the Device Configuration Database. chfs: Cannot get lv id from odm.

» Even though the logical volumes are known to be in the volume group, the logical volume information needed by the chfs command is still missing. Specifically, it is missing the logical volume ID. __ 17. Once again, try using an intermediate-level command that will synchronize the LVM information with the ODM. This failed prior to the execution of the redefinevg command. What happens when you try it now? _____________________________________________________________ » The suggested command is: # synclvodm lvmtestvg » It succeeds this time. » It should be noted that, if we had attempted an importvg command as our first fix attempt after creating the problem, it would have failed (gives error messages); but, the importvg command would have completed enough repairs to the ODM to allow the synclvodm command to run successfully. Under the covers, the importvg shell script executes the redefinevg command! As they say in New Orleans, there is more than one way to skin a catfish. __ 18. Display the online VGs and then list the logical volumes and physical volumes in the lvmtestvg. How did the situation change? ____________________________ ______________________________________________________________ » The suggested commands are: » # lsvg -o lvmtestvg rootvg

» # lsvg -l lvmtestvg lvmtestvg: LV NAME lvmtestlv loglv00

TYPE jfs2 jfs2log

© Copyright IBM Corp. 2009, 2013

LPs 2 1

PPs 2 1

PVs LV STATE 1 open/syncd 1 open/syncd

MOUNT POINT /lvmtestfs N/A

Exercise 12. LVM metadata issues

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

12-7

Student Exercises with hints

» # lsvg -p lvmtestvg lvmtestvg: PV_NAME hdisk2

PV STATE active

TOTAL PPs 1092

FREE PPs 1089

FREE DISTRIBUTION 219..215..218..218..219

» We no longer see any problems with the displays of LVM information. __ 19. Try to increase the size of the /lvmtestfs file system by one block. Could it be done? _____________________________________________________________ » # chfs -a size=+1 /lvmtestfs Filesystem size changed to 262144

» Looks like the ODM problem is fixed.

12-8 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 2: Export and import a volume group __ 20. Verify what the logical volumes are in lvmtestvg with the lsvg command. Fill in the following table with the logical volume information in lvmtestvg: » Suggested command and example output are: »# lsvg -l lvmtestvg lvmtestvg: LV NAME POINT lvmtestlv loglv00

TYPE jfs2 jfs2log

LV NAME

TYPE

LPs 5

PPs 5

1

PVs LV STATE 1

1

MOUNT

open/syncd /lvmtestfs 1 open/syncd N/A

MOUNT POINT

An example of the table filled in based on the results above are: LV NAME

TYPE

MOUNT POINT

loglv00

jfslog

N/A

lvmtestlv

jfs

/lvmtestfs

__ 21. Create some new files in the /lvmtestfs file system. » Suggested commands are: # cd /lvmtestfs # touch m1 m2 m3 __ 22. Export the lvmtestvg volume group from your system. Write down all the steps you executed to export the volume group. ____________________________________________________________ ____________________________________________________________ ____________________________________________________________ » Suggested commands are: # # # #

cd umount /lvmtestfs varyoffvg lvmtestvg exportvg lvmtestvg

© Copyright IBM Corp. 2009, 2013

Exercise 12. LVM metadata issues

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

12-9

Student Exercises with hints

__ 23. Analyze your system to see if it contains any reference to the exported volume group. For example, check whether the file system which you created exists. Check /etc/filesystems. » Suggested commands are: # lsvg # lsfs » /lvmtestfs does not exist on the system. # more /etc/filesystems » /etc/filesystems contains no reference to a file system that is in the volume group that has been exported. __ 24. Import the volume group into your system. Explicitly specify the volume group name lvmtestvg; otherwise, the system will generate a new volume group name. Write down the command you executed: ______________________________________________________________ »# importvg -y lvmtestvg hdisk2 __ 25. Check whether the imported volume group, lvmtestvg, is varied on. » # lsvg -o (lvmtestvg should be varied on.) __ 26. Check to see if the file system information is back. » Suggested commands are: # lsfs # cat /etc/filesystems # mount » References to the filesystem are there but the file system is not mounted. __ 27. Mount the /lvmtestfs file system. Check that no files have been lost. »# mount /lvmtestfs »# ls /lvmtestfs

12-10 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 3: (Optional) Analyze import messages In Part 2: Export and import a volume group, the export and import worked without problems, as the logical volumes and file systems did not exist during the import of the volume group. This part will show what will happen when a volume group that is being imported has the same logical volume names as those that already exist on the system. __ 28. Use the fastpath smit mklv to create a logical volume in lvmtestvg with the following characteristics: • Logical volume name: lv_raw • Number of logical partitions: 1 » The suggested commands are: »# smit mklv * VOLUME GROUP name Logical volume NAME * VOLUME GROUP name * Number of LOGICAL PARTITIONS

[lvmtestvg]

+

[lv_raw] lvmtestvg [1]

__ 29. Export the lvmtestvg volume group again. Repeat the steps from the last export. » The suggested commands are: # # # #

cd umount /lvmtestfs varyoffvg lvmtestvg exportvg lvmtestvg

__ 30. Use the fastpath smit mklv to create a logical volume in rootvg with the following characteristics: • Logical volume name: lv_raw • Number of logical partitions: 1 » The suggested commands are: »# smit mklv * VOLUME GROUP name

[rootvg]

Logical volume NAME * VOLUME GROUP name * Number of LOGICAL PARTITIONS

[lv_raw] rootvg [1]

© Copyright IBM Corp. 2009, 2013

Exercise 12. LVM metadata issues

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

+

12-11

Student Exercises with hints

__ 31. Use the fastpath smit jfs2 to create one JFS2 file system in rootvg with the following characteristics (these are the same as in Part 1). • Size of file systems: 16 MB (65536 512-byte blocks) • Mount points: - File system: /lvmtestfs » The suggested commands are: »# smit jfs2 Add an Enhanced Journaled File System Volume group name SIZE of file system Unit Size * Number of units * MOUNT POINT

rootvg Megabytes [16] [/lvmtestfs]

+ #

What is the corresponding logical volume name that has been created for the file system? »# lsfs Logical volume for /lvmtestfs:

______/dev/fslv00 (for example)_________

__ 32. Mount the /lvmtestfs file system, and add a few files to it. »# mount /lvmtestfs »# cd /lvmtestfs »# touch m20 m21 m22 __ 33. At this stage, the following problems will come up when you import the lvmtestvg volume group: • The lv_raw logical volume already exists in rootvg. • The /lvmtestfs file system already exists in rootvg. Let us see how importvg will react to this situation. Import the lvmtestvg volume group into the system. »# importvg -y lvmtestvg hdisk2 0516-530 synclvodm: Logical volume name lv_raw changed to fslv01. imfs: Warning: mount point /lvmtestfs already exists in /etc/filesystems. lvmtestvg __ 34. Write down the new logical volume names that are created for lvmtestvg during the import. _______________________________________________________________ _______________________________________________________________

12-12 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

_______________________________________________________________ » lv_raw has been changed to fslv01 (Example names). __ 35. Another error message, that you should seen, was that the /lvmtestfs file systems already exists in rootvg. To fix this problem, first unmount the /lvmtestfs file system. »# cd »# umount /lvmtestfs __ 36. Mount your JFS2 file system from lvmtestvg over the /lvmtestfs mount point. Use the new logical volume name that you just created. You have to specify the log device that is part of lvmtestvg. Write down the commands you executed. _______________________________________________________________ _______________________________________________________________ » Example commands are (be sure to substitute the logical volume names that you list in the mount command): »# lsvg -l lvmtestvg (to obtain lv names) lvmtestvg: LV NAME POINT lvmtestlv loglv00 fslv01

TYPE jfs2 jfs2log jfs

LPs

PPs

5 1 1

5 1 1

PVs LV STATE 1 1 1

MOUNT

closed/syncd N/A closed/syncd N/A closed/syncd N/A

»# mount -o log=/dev/loglv00 -V jfs2 /dev/lvmtestlv /lvmtestfs __ 37. Check the files you have created in /lvmtestfs. They should exist in this directory. »# ls /lvmtestfs __ 38. At the end of this exercise, both file systems should be mounted at the same time. Start with unmounting /lvmtestfs. »# umount /lvmtestfs __ 39. Create a new directory, /newtestfs. This will be the new mount point for the file system from lvmtestvg. »# mkdir -p /newtestfs __ 40. Create a new stanza in /etc/filesystems that describes the file system from lvmtestvg. You must use the new logical volume name that was created during the import of lvmtestvg. »# vi /etc/filesystems © Copyright IBM Corp. 2009, 2013

Exercise 12. LVM metadata issues

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

12-13

Student Exercises with hints

» (add to the bottom of the file:) »/newtestfs: dev = /dev/lvmtestlv vfs = jfs2 log = /dev/loglv00 mount = false options = rw account = false __ 41. Mount the /newtestfs file systems. »# mount /newtestfs »# mount /lvmtestfs __ 42. Verify you can access all the files. »# ls /newtestfs »# ls /lvmtestfs __ 43. Unmount the /newtestfs and /lvmtestfs file systems. »# umount /lvmtestfs »# umount /newtestfs __ 44. Remove the lvmtestvg volume group. Request that any logical volumes be deleted. Respond yes when prompted. »# reducevg -d lvmtestvg hdisk2 __ 45. Remove the /lvmtestfs file system from the rootvg volume group. »# rmfs /lvmtestfs __ 46. Remove the lv_raw logical volume from the rootvg volume group. »# rmlv lv_raw

12-14 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 4: (Optional) Fixing LVM ODM problems with importvg and exportvg The export and import technique can only be used with non-rootvg volume groups. __ 47. This exercise requires the use of hdisk2. Display the physical volumes on your system to determine if hdisk2 is available (not assigned to a volume group). List the name of the volume group which is using hdisk2, if it is not available: _________________________________________________________ List the names of all the disks which are used by the above listed volume group: _________________________________________________________ » # lspv __ 48. If hdisk2 is not available, eliminate the using volume group in order to free it up. Remember to first unmount any file systems in that volume group before reducing it. Any logical volumes or file systems which are allocated in that volume group can be deleted. » Suggested commands are: # lsvg -l (vg_name> » For each mounted filesystem: # umount » Once the unmounts are completed: # reducevg -d __ 49. You have been provided with a script which will create a volume group (using hdisk2) and a file system with a special naming convention to match the problem setup script. The script is: /home/AN14/build_vg. Execute this script. » # /home/AN14/build_vg __ 50. Display the online VGs and then list the logical volumes and physical volumes in the lvmtestvg volume group. » Suggested commands are: » # lsvg -o lvmtestvg rootvg

» # lsvg -l lvmtestvg lvmtestvg: LV NAME lvmtestlv loglv00

TYPE jfs2 jfs2log

© Copyright IBM Corp. 2009, 2013

LPs 1 1

PPs 1 1

PVs LV STATE 1 open/syncd 1 open/syncd

MOUNT POINT /lvmtestfs N/A

Exercise 12. LVM metadata issues

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

12-15

Student Exercises with hints

» # lsvg -p lvmtestvg lvmtestvg: PV_NAME hdisk2

PV STATE active

TOTAL PPs 1092

FREE PPs 1090

FREE DISTRIBUTION 219..216..218..218..219

__ 51. In the /home/AN14 directory, you will find a script called corrupt_odm2. Execute this script. » # /home/AN14/corrupt_odm2 __ 52. Display the online VGs and then list the logical volumes and physical volumes in the lvmtestvg. What problems do you see? _________________________________________________________________ _________________________________________________________________ » The suggested commands are: » # lsvg -o lvmtestvg rootvg

» # lsvg -l lvmtestvg lvmtestvg: LV NAME lvmtestlv loglv00

TYPE ??? jfs2log

LPs 4 1

PPs 4 1

PVs LV STATE 1 open/syncd 1 open/syncd

MOUNT POINT /lvmtestfs N/A

» # lsvg -p lvmtestvg lvmtestvg: PV_NAME hdisk2

PV STATE active

TOTAL PPs 1092

FREE PPs 1090

FREE DISTRIBUTION 219..216..218..218..219

» The command is unable to locate the type attribute for the lvmtestlv logical volume. __ 53. Try to increase the size of the /lvmtestfs file system. What happened? _________________________________________________________________ _________________________________________________________________ » The suggested commands are: # chfs -a size=+1 /lvmtestfs 0516-306 /usr/sbin/getlvodm: Unable to find lvmtestlv in the Device Configuration Database. chfs: Cannot get lv id from odm.

» The command fails because it is unable to find the logical volume in the ODM. __ 54. Try to solve the problem using the exportvg and importvg technique. Remember that the volume group must off-line. In order to take the VG offline, all logical volumes in the volume group must be closed. 12-16 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» Suggested commands are: # # # #

umount /lvmtestfs varyoffvg lvmtestvg exportvg lvmtestvg importvg -y lvmtestvg hdisk2

__ 55. Display the online VGs and then list the logical volumes and physical volumes in the lvmtestvg. Did the problem go away? _________________________________________________________________ _________________________________________________________________ » The suggested commands are: » # lsvg -o lvmtestvg rootvg

» # lsvg -l lvmtestvg lvmtestvg: LV NAME lvmtestlv loglv00

TYPE jfs2 jfs2log

LPs 1 1

PPs 1 1

PVs LV STATE 1 open/syncd 1 open/syncd

MOUNT POINT /lvmtestfs N/A

» # lsvg -p lvmtestvg lvmtestvg: PV_NAME hdisk2

PV STATE active

TOTAL PPs 1092

FREE PPs 1090

FREE DISTRIBUTION 219..216..218..218..219

__ 56. Try to increase the size of the /lvmtestfs file system. What happened? _________________________________________________________________ _________________________________________________________________ » The suggested command is: # chfs -a size=+1 /lvmtestfs » The attempt is now successful. The problem is fixed. __ 57. Unmount the /lvmtestfs file system and remove the lvmtestvg volume group, deleting any logical volumes that are allocated in the volume group. » Suggested commands are: # umount /lvmtestfs # reducevg -d lvmtestvg hdisk2

© Copyright IBM Corp. 2009, 2013

Exercise 12. LVM metadata issues

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

12-17

Student Exercises with hints

Part 5: (Optional) Fix an LVM ODM problem using rvgrecover If the volume group is the rootvg, then we can not vary off and export the volume group. Instead we must use a procedure which is the functional equivalent of the exportvg and importvg method. __ 58. Execute the program /home/AN14/corrupt_odm. » # /home/AN14/corrupt_odm __ 59. Verify the following information: __ a. Check whether your volume groups are OK. Use lsvg. » # lsvg __ b. Check whether your physical volumes are OK. Use lspv. Make note of which disk is associated with the rootvg. _________________________________ » # lspv __ c. Check whether your logical volumes are OK. List all logical volumes that are part of your rootvg. Use lsvg -l rootvg. » # lsvg -l rootvg What happens? ________________________________________________________ ________________________________________________________ ________________________________________________________ » Typically for this problem, the TYPE information for some logical volumes is not shown. (The string ??? is shown instead.) The logical volume type is stored in CuAt; so, this result indicates that there might be a problem with logical volume objects in the CuAt object class in the ODM. __ 60. Display information for logical volume hd2. Use lslv hd2. » # lslv hd2 What happens? __________________________________________________________ __________________________________________________________ __________________________________________________________ » The following error message is displayed: 0516-306 lslv: Unable to find hd2 in the Device Configuration Database.

12-18 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 61. Analyze the ODM problem by comparing the CuDv and CuAt objects for your hd2 logical volume with a logical volume in your user volume group. What is the ODM situation with other rootvg logical volumes? What causes the ODM problems? __________________________________________________________ __________________________________________________________ __________________________________________________________ » Use the following commands: # odmget -q “name=hd2” CuDv # odmget -q “name=lvmtestlv” CuDv » The results indicate that the logical volumes are missing in CuDv. # odmget -q “name=hd2” CuAt # odmget -q “name=lvmtestlv” CuAt | more » The results indicate that the LVIDs are missing in CuAt. # odmget -q “name=hd4” CuDv # odmget -q “name=hd4” CuAt » The results indicate that other logical volumes in the rootvg have a similar problem. __ 62. Examine the /home/AN14/rvgrecover script and modify it if necessary to match your situation (the specified disk must be one in your rootvg). » # view /home/AN14/rvgrecover » After making any required changes to the script, fix the ODM problem by executing /home/AN14/rvgrecover. Ignore the error messages. This can take up to one minute, depending upon the speed of your lab system. » # /home/AN14/rvgrecover Check that your ODM problems have been fixed. Repeat lsvg -l rootvg and lslv hd2. They should work now without problems. » # lsvg -l rootvg » # lslv hd2 __ 63. Look into /home/AN14/rvgrecover. Remember that this is not an AIX provided command, but rather a procedure for fixing rootvg ODM problems. What two main steps fix your ODM problem? » The two main steps are: • Deleting all rootvg related ODM objects • Importing new ODM objects by reading the information from the VGDA and LVCB on the boot disk.

© Copyright IBM Corp. 2009, 2013

Exercise 12. LVM metadata issues

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

12-19

Student Exercises with hints

__ 64. Another approach to solving the same problem is to use intermediate LVM commands. Recreate the problem which you just fixed and verify that the problem is installed by listing the logical volumes in the rootvg (type information should be: ???). » # /home/AN14/corrupt_odm » # lsvg -l rootvg __ 65. Use an intermediate-level command to request a synchronization of the LVM information in the ODM for the rootvg volume group. » # synclvodm rootvg __ 66. List the logical volumes in the ODM. Is the problem fixed? __________________ » # lsvg -l rootvg » You should find that the problem is fixed. The type field is now corrected.

End of exercise

12-20 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 13.Disk management procedures (with hints)

What this exercise is about This exercise provides practice in handling disk replacement procedures and in managing issues related to importing a volume group.

What you should be able to do At the end of the exercise, you should be able to: • Implement the disk replacement procedure for a disk that has not yet failed • (Optional): Deal with quorum issues when working with a mirrored volume group

Introduction This exercise has three parts: • Part 1: Disk replacement procedure for rootvg • Part 2: Disk replacement procedure for user VGs • (Optional) Part 3: Working with LVM mirroring quorum This exercise requires one disk to be completely empty. This disk will be used to create a new volume group. This volume group will be exported and imported. All instructions in this exercise require root authority.

© Copyright IBM Corp. 2009, 2013

Exercise 13. Disk management procedures

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

13-1

Student Exercises with hints

Exercise instructions with hints Preface Two versions of these instructions are available: one with hints and one without. You can use either version to complete this exercise. Also, please do not hesitate to ask the instructor if you have questions. All exercises of this unit depend on the availability of specific equipment in your classroom. » All hints are marked with a >> sign. » The output shown in the answers is an example. Your output and answers based on the output might be different. » This exercise assumes that the rootvg is on hdisk0 and that all of the other disks are free.

Part 1: rootvg disk replacement Hypothetical scenario: While you have your application data on SAN disks, your rootvg is on a disk in a disk bay which is integrated into your server. Recently, you have noticed frequent temporary but recoverable disk error events (DISK_ERR4) in the AIX error log. You have decided to replace the disk, but you do not want to take down the system. There is already a spare disk in the disk bay. You will migrate the rootvg content from the failing disk to this spare disk and then replace the failing disk. (This has scared you enough that you plan to mirror the rootvg when the bad disk is replaced). __ 1. Check to see if hdisk1 is assigned to a volume group, If it is, remove it from that volume group. » Example commands for doing this: » # lspv » If needed: - -- for VG with another disk --# migratepv hdisk1 hdisk# # reducevg hdisk1 OR - -- for VG with only hdisk1 -#reducevg -d hdisk1 __ 2. Extend the rootvg volume group to include the hdisk1 physical volume. You might have to use the force flag if there is an old VGDA on the disk.

13-2 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» # extendvg rootvg hdisk1 __ 3. Migrate only the rootvg boot logical volume from hdisk0 to hdisk1. » # migratepv -l hd5 hdisk0 hdisk1 __ 4. Regenerate the contents of the boot logical volume. » # bosboot -ad /dev/hdisk1 __ 5. Clear the old boot record of hdisk0. » # chpv -c hdisk0 __ 6. Update the bootlist to only try to boot off of hdisk1. » # bootlist -m normal hdisk1 __ 7. Migrate all rootvg logical volumes, remaining on hdisk0, to hdisk1. The migration will take a few minutes; be patient. » # migratepv hdisk0 hdisk1 __ 8. Verify that all of the logical volumes have been moved from hdisk0 to hdisk1. Then, remove the hdisk0 physical volume from the rootvg volume group. » Example commands are: # # # #

lspv -l hdisk0 lspv -l hdisk1 reducevg rootvg hdisk0 lsvg -p rootvg

__ 9. Delete hdisk0 from the ODM. » Example commands are: # rmdev -d -l hdisk0 # lsdev -c disk __ 10. We will assume that the failing disk has been replaced through a hot swap procedure. Rediscover and configure the replacement disk. » Example commands are: # cfgmgr # lsdev -c disk __ 11. Later exercises assume that the rootvg resides on hdisk0. Migrate the rootvg back to hdisk0. The migration will take a few minutes; be patient

© Copyright IBM Corp. 2009, 2013

Exercise 13. Disk management procedures

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

13-3

Student Exercises with hints

» Example commands for doing this: # # # # # #

extendvg rootvg hdisk0 migratepv -l hd5 hdisk1 hdisk0 bosboot -ad /dev/hdisk0 chpv -c hdisk1 bootlist -m normal hdisk0 migratepv hdisk1 hdisk0

__ 12. Remove hdisk1 from the rootvg. » Example command for doing this: » # reducevg rootvg hdisk1

13-4 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 2: User VG disk replacement procedure __ 13. The lvmtestvg volume group should not exist. If it does exist, remove it. » An example command is: # reducevg -d lvmtestvg hdisk2 __ 14. Use the /home/AN14/build_vg script to create the volume group. » # /home/AN14/build_vg __ 15. List the logical volumes in lvmtestvg. The /lvmtestfs filesystem should be open (mounted). If /lvmtestfs is defined, but not mounted, then mount it at this point. » An example command is: » # lsvg -l lvmtestvg » If /lvmtestfs is not mounted (not open): » # mount /lvmtestfs __ 16. Create some files in the /lvmtestfs file system by copying configuration files from the /etc directory. » An example command is: » # cp /etc/*.conf /lvmtestfs We will pretend that you have the following situation: You have your user data in the SAN. The disk arrays were purchased mainly on a criteria of lowest price. The disk arrays have had performance and functional problems, resulting in the purchase of a more reliable replacement disk array. You have been assigned to (non-disruptively) move the user volume group off of the old disk and onto the disk that is backed by a LUN in the new disk array. __ 17. Check to see that another disk is available (such as hdisk3). » An example command is: » # lspv __ 18. Extend the volume group to include the extra disk. » An example command is: » # extendvg lvmtestvg hdisk3 __ 19. Migrate the data which is on the failing disk to the new disk. » An example command is: » # migratepv hdisk2 hdisk3 __ 20. Verify that there are no logical volumes left on the failing disk.

© Copyright IBM Corp. 2009, 2013

Exercise 13. Disk management procedures

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

13-5

Student Exercises with hints

» An example command is: » # lspv -l hdisk2 __ 21. Verify that the data you created is still there. » An example commands is: » # ls -R /lvmtestfs __ 22. Remove the old disk from the VG and verify that your volume group now has only the new disk. » Example commands are: » # reducevg lvmtestvg hdisk2 » # lsvg -p lvmtestvg __ 23. Remove the old disk from the ODM customized device database and verify that it has been deleted from the ODM. » Example commands are: »# rmdev -dl hdisk2 » # lsdev -Cc disk __ 24. At this point, we will assume that the SAN administrators have created and zoned a new LUN for our system. Discover and configure the disk. Verify that we now have an hdisk2 disk. » Example commands are: » # cfgmgr » # lsdev -Cc disk __ 25. Finally, let us cleanup what we have created in this part of the exercises. Remove the lvmtestvg volume group. You will either need to first remove any logical volumes or request that the removal of the logical volumes be handled as part of removing the volume group. » Example commands are: » # umount /lvmtestfs » # reducevg -d lvmtestvg hdisk3 Note Let your instructor know when you have finished parts 1 and 2.

13-6 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 3: (Optional) Working with quorum __ 26. Create a volume group named newvg using one unused disk. » Check to see which disks are free: » # lspv hdisk0 hdisk1 hdisk2 hdisk3

00c07f7f59ac0ea9 00c07f7fbcdf4791 00c07fbf59f134be none

rootvg None None None

active

» Create the volume group with one disk: (We will assume that this disk is hdisk2 in the rest of the exercise examples.) »# mkvg -y newvg hdisk2 __ 27. Use the lsvg command to find the volume group information for the newvg volume group. a. Quorum: ________ b. Number of VGDAs (VG Descriptors): ____________ c. Active physical volumes: ___________ » Command and sample output: »# lsvg newvg VOLUME GROUP: newvg 00c07f7f00004c00000001218da898f3 VG STATE: active VG PERMISSION: read/write MAX LVs: 256 LVs: 0 OPEN LVs: 0 TOTAL PVs: 1 STALE PVs: 0 ACTIVE PVs: 1 MAX PPs per VG: 32512 MAX PPs per PV: 1016 LTG size (Dynamic): 256 kilobyte(s) HOT SPARE: no

VG IDENTIFIER: PP SIZE: TOTAL PPs: FREE PPs: USED PPs: QUORUM: VG DESCRIPTORS: STALE PPs: AUTO ON:

128 megabyte(s) 546 (69888 megabytes) 546 (69888 megabytes) 0 (0 megabytes) 2 (Enabled) 2 0 yes

MAX PVs: AUTO SYNC: BB POLICY:

32 no relocatable

» Quorum: 2 » 2 VGDAs » 1 active physical volume __ 28. Add a second unused disk to the newvg volume group. » We will assume that this disk is hdisk3 in the rest of this exercise. » # extendvg -f newvg hdisk3 © Copyright IBM Corp. 2009, 2013

Exercise 13. Disk management procedures

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

13-7

Student Exercises with hints

__ 29. Use the lsvg command to find the volume group information for the newvg volume group. a. Quorum: ____________________ b. Number of VGDAs: ____________ c. Active physical volumes: ___________ » Command and sample output: » # lsvg newvg VOLUME GROUP: newvg 00c07f7f00004c00000001218da898f3 VG STATE: active VG PERMISSION: read/write MAX LVs: 256 LVs: 0 OPEN LVs: 0 TOTAL PVs: 2 STALE PVs: 0 ACTIVE PVs: 2 MAX PPs per VG: 32512 MAX PPs per PV: 1016 LTG size (Dynamic): 256 kilobyte(s) HOT SPARE: no

VG IDENTIFIER: PP SIZE: TOTAL PPs: FREE PPs: USED PPs: QUORUM: VG DESCRIPTORS: STALE PPs: AUTO ON:

128 megabyte(s) 625 (80000 megabytes) 625 (80000 megabytes) 0 (0 megabytes) 2 (Enabled) 3 0 yes

MAX PVs: AUTO SYNC: BB POLICY:

32 no relocatable

» Quorum: 2 » 3 VGDAs » 2 active physical volumes » The number of PVs and the number of VGDAs both increased. __ 30. Use the lspv command to identify how many VGDAs there are on each disk in the VG. • Number of VGDAs on original PV for newvg (hdisk2): ____________ • Number of VGDAs on additional PV for newvg (hdisk3): ____________ » Commands and sample output: »# lspv hdisk2 | grep -i descriptor TOTAL PPs:

546 (69888 megabytes)

VG DESCRIPTORS:

2

VG DESCRIPTORS:

1

»# lspv hdisk3 | grep -i descriptor TOTAL PPs:

79 (10112 megabytes)

» 2 VGDAs on hdisk2 » 1 VGDA on hdisk3 13-8 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 31. Make the second disk (with only one VGDA) unavailable using the following steps. __ a. Varyoff the newvg volume group. »# varyoffvg newvg __ b. Make the second disk unavailable using rmdev. Do not delete it from CuDv, just change the device state from available to defined. » Use rmdev -l . Do not use the rmdev -d flag. »# rmdev -l hdisk3 hdisk3 Defined __ 32. Try to vary on the newvg volume group. Did it vary on? _____________________ What is the status of the disk you unconfigured? __________________________ » Command and sample output: »# varyonvg newvg PV Status:

hdisk2 00c07fbf59f134be hdisk3 00c07f7f8db00776 varyonvg: Volume group newvg is varied on.

PVACTIVE PVMISSING

» The volume group did vary on, but the second disk was missing. __ 33. Look in the error log file to see if any errors were logged. » You should only have to look at the first two errors. There were two errors logged:

© Copyright IBM Corp. 2009, 2013

Exercise 13. Disk management procedures

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

13-9

Student Exercises with hints

» # errpt -A | pg --------------------------------------------------------------------------LABEL: LVM_QUORUMNOQUORUM Date/Time: Fri May 29 15:09:19 2009 Type: INFO Resource Name: LIBLVM Description Activation of a no quorum volume group without 100% of the disks. Detail Data MAJOR/MINOR DEVICE NUMBER 0021 0000 SENSE DATA 00C0 7F7F 0000 4C00 0000 0121 8DA8 98F3 0000 0000 0000 0000 0000 0000 0000 0000 --------------------------------------------------------------------------LABEL: LVM_MISSPVADDED Date/Time: Fri May 29 15:09:19 2009 Type: UNKN Resource Name: LIBLVM Description PHYSICAL VOLUME DEFINED AS MISSING Detail Data MAJOR/MINOR DEVICE NUMBER 0011 0003 SENSE DATA 0000 0000 0000 0000 0000 0000 0000 0000 ---------------------------------------------------------------------------

__ 34. Bring the second disk in the newvg volume group back to an available state and verify the state by listing the device. » Use cfgmgr to bring hdisk3 on-line. »# cfgmgr OR »# mkdev -l hdisk3 » Use lsdev to list the state. »# lsdev -l hdisk3 hdisk3 Available Virtual SCSI Disk Drive __ 35. Display the physical volumes in the newvg volume group. What is the PV STATE of the second disk? _______________________________________________________________ » Commands and sample output: »# lsvg -p newvg newvg: PV_NAME hdisk2 hdisk3

13-10 AIX Jumpstart

PV STATE active missing

TOTAL PPs 546 79

FREE PPs 546 79

FREE DISTRIBUTION 110..109..109..109..109 16..16..15..16..16

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» The second disk (hdisk3) is still in a missing state. __ 36. What do you think will bring hdisk3 into an active state in the newvg volume group? Try your strategy. (Look at the Hints if you do not know.) Verify that it worked by running the lsvg -p newvg command. » Running the varyonvg command works. » Note: You do not have to vary it off first. you can run varyonvg on a volume group that's already active. This will refresh the state of the disks in the volume group. » # varyonvg newvg » # lsvg -p newvg newvg: PV_NAME hdisk2 hdisk3

PV STATE active active

TOTAL PPs 546 79

FREE PPs 546 79

FREE DISTRIBUTION 110..109..109..109..109 16..16..15..16..16

» The second disk, hdisk3, is now back in an active PV state. In the previous steps, you removed the second disk (which only had one VGDA). In the following steps, you will remove the first disk (which has two VGDAs). __ 37. Make the first disk unavailable using the following steps. Varyoff the newvg volume group. »# varyoffvg newvg __ 38. Make the first disk unavailable using rmdev. Do not delete it from CuDv. » Use rmdev -l hdisk2. Do not use the rmdev -d flag. »# rmdev -l hdisk2 hdisk1 Defined __ 39. Clear the AIX error log of previous errors. » # errclear 0 __ 40. Try to vary on the newvg volume group. Did it vary on? If not, why not? » Command and sample output: »# varyonvg newvg 0516-052 varyonvg: Volume group cannot be varied on without a quorum. More physical volumes in the group must be active. Run diagnostics on inactive PVs.

» The volume group did not vary on. » In a previous step, you removed hdisk3, the second disk added to the volume group, and then did a varyonvg of newvg. The varyonvg was successful because hdisk3 only had one active VGDA and hdisk2 had two. © Copyright IBM Corp. 2009, 2013

Exercise 13. Disk management procedures

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

13-11

Student Exercises with hints

» Why did if fail this time? This time you removed hdisk2 that had two active VGDAs leaving only one active VGDA, which is less than 51% of the total VGDAs. __ 41. Look in the AIX error log to see if any new errors were logged. » # errpt -A | pg » Note: No new errors were logged. __ 42. Vary on the newvg volume group using the force (-f) flag. What is the state of the disk which you just unconfigured? _____________________________________________________________ » The force (-f) option to varyonvg must be used. » # varyonvg -f newvg PV Status:

hdisk2 00c07fbf59f134be hdisk3 00c07f7f8db00776

PVREMOVED PVACTIVE

» varyonvg: Volume group newvg is varied on. The disk is in a removed state. __ 43. Look in the error log file to see if any errors were logged. » There were two errors logged: »# errpt -A | pg --------------------------------------------------------------------------LABEL: LVM_FORCEVARYON Date/Time: Fri May 29 15:36:06 2009 Type: INFO Resource Name: LIBLVM Description Forced activation of a volume group. Detail Data MAJOR/MINOR DEVICE NUMBER 0021 0000 SENSE DATA 00C0 7F7F 0000 4C00 0000 0121 8DA8 98F3 0000 0000 0000 0000 0000 0000 0000 0000 --------------------------------------------------------------------------LABEL: LVM_MISSPVADDED Date/Time: Fri May 29 15:36:06 2009 Type: UNKN Resource Name: LIBLVM Description PHYSICAL VOLUME DEFINED AS MISSING Detail Data MAJOR/MINOR DEVICE NUMBER 0011 0000 SENSE DATA 0000 0000 0000 0000 0000 0000 0000 0000 ---------------------------------------------------------------------------

13-12 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 44. Bring the first disk in the newvg volume group back to an available state and verify that the device state result by listing the device. » Use cfgmgr to bring hdisk2 on-line. »# cfgmgr OR »# mkdev -l hdisk2

» Use the lsdev command to list the hdisk2 device state. »# lsdev -l hdisk2 hdisk2 Available Virtual SCSI Disk Drive __ 45. In the previous scenario, we placed the second disk into a defined state and then varied the volume group on-line to cause that physical volume to be in a missing state. Then, after we brought the second disk back to an available state, the varyonvg command rebuilt the VGDA information and brought the volume group back to the original state with both physical volumes active. In the current scenario, try the varyonvg command, followed by the lsvg -p newvg command. Did it fix the situation? _______________________________________________________________ » Commands and sample output: » # varyonvg newvg » # lsvg -p newvg newvg: PV_NAME hdisk2 hdisk3

PV STATE removed active

TOTAL PPs 546 79

FREE PPs 546 79

FREE DISTRIBUTION 110..109..109..109..109 16..16..15..16..16

» The PV states are the same as they were before. The first physical volume is in a removed state. It did not fix the problem. __ 46. Explicitly change the state of the first physical volume to an active state. » # chpv -v a hdisk2 __ 47. Display the physical volumes in the newvg volume group. Has anything changed? » Example command and output: » # lsvg -p newvg newvg: PV_NAME hdisk2 hdisk3

PV STATE active active

© Copyright IBM Corp. 2009, 2013

TOTAL PPs 546 79

FREE PPs 546 79

FREE DISTRIBUTION 110..109..109..109..109 16..16..15..16..16

Exercise 13. Disk management procedures

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

13-13

Student Exercises with hints

» The first physical volume has changed from a state of removed to a state of active. __ 48. Prove that the first physical volume is truly active in the volume group by creating a logical volume with one physical partition allocated on that physical volume. » Example command and output: » # mklv newvg 1 hdisk2 lv01

» # lspv -l hdisk2 hdisk2: LV NAME lv01

LPs 1

PPs 1

DISTRIBUTION 00..01..00..00..00

MOUNT POINT N/A

» The chpv command has logic to make the specified Active state truly effective without having to vary on the volume group. __ 49. Remove the newvg volume group. Delete any allocated logical volume as needed to succeed in the VG removal.

End of exercise

13-14 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 14.Backup and restore (with hints)

What this exercise is about The purpose of this exercise is to familiarize the students with backup and restore facilities in AIX.

What you should be able to do At the end of the exercise, you should be able to: • Create a mksysb • Backup and restore a non-rootvg volume group • Use the AIX backup and restore commands • Create a JFS2 snapshot and then use it either as its own restore source or as a basis for generating a backup of the file system

Introduction In this exercise, you will create a mksysb backup of rootvg and perform a backup and restore of a non-rootvg volume group. You will explore AIX backup and restore commands. In addition, you will learn how to create and use a consistent snapshot of a file system.

© Copyright IBM Corp. 2009, 2013

Exercise 14. Backup and restore

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

14-1

Student Exercises with hints

Exercise instructions with hints Preface Two versions of these instructions are available: one with hints and one without. You can use either version to complete this exercise. Also, do not hesitate to ask the instructor if you have questions. General notes, applicable to all exercises: Your instructor will provide you with instructions for accessing the remote environment. For example, this might involve using a web browser or Virtual Private Network (VPN). Your instructor will further provide you with all the details and login IDs required. Unless otherwise stated, log in to systems (HMC/LPAR) using a terminal window (for example through PuTTY or a Linux command line). On some terminal emulations, the function keys are not operative and you might need to substitute escape sequences. For example, instead of pressing F3, you might need to press Esc+3 for the same function. » All hints are marked with a >> sign. » The output shown in the answers is an example. Your output and answers based on the output might be different. » This exercise assumes that rootvg is on hdisk0 and that all other disks are free.

Part 1: mksysb backup of rootvg __ 1. Access your assigned lab system and log in as the root user. __ 2. Create a new volume group on hdisk1 called backupVG. » The suggested commands are: »# mkvg -f -y backupVG hdisk1 OR »# smitty lvm

14-2 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» Select Volume Groups > Add a Volume Group > Add an Original Volume Group. Add an Original Volume Group VOLUME GROUP name Physical partition SIZE in megabytes * PHYSICAL VOLUME names FORCE the creation of volume group? Activate volume group AUTOMATICALLY at system restart? Volume group MAJOR NUMBER Create VG Concurrent Capable?

[backupVG] [hdisk1] yes yes

+ + + +

[] no

+# +

__ 3. Create an enhanced journaled file system (JFS2): • Volume Group: backupVG • Size: 2000 MB • Mount point /backup • For all other values accept the default » The suggested commands are: » # crfs -v jfs2 -g backupVG -a size=2000M -m /backup OR »# smitty jfs2 » Select Add an Enhanced Journaled File System. Add an Enhanced Journaled File System Volume group name SIZE of file system Unit Size * Number of units * MOUNT POINT

backupVG Megabytes + [2000] # [/backup]

__ 4. Mount the new /backup file system. » # mount /backup __ 5. Create a mksysb of your system to a file named, my_mksysb in the /backup directory. Be sure to create a new /image.data file. (This should only take a few minutes.) Read the output carefully to be sure the backup was successful. » The suggested commands are: »# mksysb -i /backup/my_mksysb © Copyright IBM Corp. 2009, 2013

Exercise 14. Backup and restore

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

14-3

Student Exercises with hints

OR »# smitty » Select System Storage Management (Physical & Logical Storage) > System Backup Manager > Back Up the System > Back Up This System to Tape/File. * Backup DEVICE or FILE Create MAP files? EXCLUDE files? List files as they are backed up? Verify readability if tape device? Generate new /image.data file? EXPAND /tmp if needed?

[/backup/my_mksysb] no no no no yes yes

+/ + + + + + +

__ 6. Simulate a user error by first listing and then deleting the files in the home directory of user01. Record the file names here: _________________________________ _______________________________________________________________ » Here are suggested commands: » # cd /home/user01 » # ls » # rm .* __ 7. Selectively display what files are in your mksysb backup which are from the home directory of user01. (To avoid a prompt to mount the backup media, ask for a quiet execution.) Note the path recorded in the mksysb. What does that tell you about doing a restore? _______________________________________________________ ______________________________________________________________ » Here is the suggested command: » # restore -qTvf /backup/my_mksysb | grep /home/user01 OR » # lsmksysb -f /backup/my_mksysb | grep /home/user01 » You will note that the filename in the backup is the relative path from the root directory /. This means you must be in the root directory during restore if you want the file to be placed back where it was originally. __ 8. Using your mksysb backup file, restore the deleted contents of user01’s home directory. (Be aware that the restore utility does not use wild-card matching. Since the mksysb is in file-name format, specifying a directory file will only restore that directory file and not the files under that directory.) » The example commands to restore the files are:

14-4 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

»# cd / »# restore -qxvf /backup/my_mksysb ./home/user01/.profile \ ./home/user01/.sh_history OR »# cd / »# restorevgfiles -f /backup/my_mksysb ./home/user01/.profile \ ./home/user01/.sh_history OR »# smitty » Select System Storage Management (Physical & Logical Storage) > System Backup Manager > Restore Files in a System Image. * Restore DEVICE or FILE [/backup/my_mksysb] +/ FILES to restore [./home/user01/.profile ./home/user01/.sh_history] (Leave blank to restore entire archive) Number of BLOCKS to read in a single input [] # (Leave blank to use a system default) Verify BLOCK size if tape device? no + Restore extended attributes? yes + __ 9. Validate that the files are restored. »# ls /home/user01 __ 10. Remove the mksysb file. » # rm /backup/my_mksysb

© Copyright IBM Corp. 2009, 2013

Exercise 14. Backup and restore

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

14-5

Student Exercises with hints

Part 2: savevg backup and restore of lvmtestvg __ 11. List the pht define on hdisk2, then free up the hdisk2 physical volume and then execute the /home/AN14/build_vg script. __ 12. An example commandysical volumes on your system and list the logical volumes on hdisk2. The lvmtestvg volume group may be already on-line, on hdisk2. » If lvmtestvg is no is: » # lspv » If hdisk2 is part of lvmtestfs, free the disk (if necessary) and then execute the script: » # (if necessary) reducevg -d hdisk2 » # /home/AN14/build_vg __ 13. List the logical volumes in lvmtestvg. The /lvmtestfs filesystem should be open (mounted). If /lvmtestfs is defined, but not mounted, then mount it at this point. » An example command is: » # lsvg -l lvmtestvg » If /lvmtestfs is not mounted (not open): » # mount /lvmtestfs __ 14. Create some files in the /lvmtestfs file system by copying configuration files from the /etc directory. » An example command is: » # cp /etc/*.conf /lvmtestfs __ 15. Perform a savevg backup of lvmtestvg to a file named testvg.bk in /backup directory. Be sure to create a new lvmtestvg.data file. » The suggested commands are: »# savevg -f /backup/testvg.bk -i lvmtestvg OR »# smitty lvm

14-6 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» Select Volume Groups > Back Up a Volume Group > Back Up a Volume Group to Tape/File. * Backup DEVICE or FILE * VOLUME GROUP to back up List files as they are backed up? Generate new vg.data file? Create MAP files? EXCLUDE files? EXPAND /tmp if needed?

[/backup/testvg.bk] [lvmtestvg] no yes no no yes

+/ + + + + + +

__ 16. Umount all of the file systems in lvmtestvg. » There are a couple of ways to do this: » First, you can list the LVs, note the mounted file systems, and manually unmount each: » # lsvg -l lvmtestvg » # umount (repeat for each filesystem) OR » You can use a script to do it all in one step. »# lsvg -l lvmtestvg | grep -v N/A | grep open | awk '{print $7}' | \ »while read lvname »do »umount $lvname »done __ 17. Vary off and export the lvmtestvg volume group from the system. » # varyoffvg lvmtestvg » # exportvg lvmtestvg __ 18. Confirm lvmtestvg has been removed from the system. » # lspv __ 19. Using the savevg backup file, restore the volume group, lvmtestvg. » The suggested commands are: »# restvg -q -f /backup/testvg.bk OR »# smitty lvm

© Copyright IBM Corp. 2009, 2013

Exercise 14. Backup and restore

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

14-7

Student Exercises with hints

» Select Volume Groups > Remake a Volume Group. * Restore DEVICE or FILE [/backup/testvg.bk] +/ SHRINK the filesystems? no Recreate logical volumes and filesystems only? no PHYSICAL VOLUME names [] + (Leave blank to use the PHYSICAL VOLUMES listed in the vgname.data file in the backup image) Use existing MAP files? yes Physical partition SIZE in megabytes [] +# (Leave blank to have the SIZE determined based on disk size) Number of BLOCKS to read in a single input [] # (Leave blank to use a system default) Alternate vg.data file [] (Leave blank to use vg.data stored in backup image)

+ +

+

/

__ 20. Confirm lvmtestvg was successfully restored and the file systems were mounted. » # lspv » # df __ 21. Remove the lvmtestvg volume group. Remember that you first need to unmount related filesystems and that the related logical volumes need to be deleted. » The suggested commands are: »# umount /lvmtestfs » # reducevg -d lvmtestvg hdisk2

14-8 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 3: Backup and restore by name __ 22. Using the backup command, perform an absolute path backup of the /home directory. Store the backup in /backup/absolute_home.bk. » The suggested commands are: »# find /home | backup -iqvf /backup/absolute_home.bk OR »# smitty » Select System Storage Management (Physical & Logical Storage) > Files & Directories > Backup a File or Directory. This option will perform a backup by name. * Backup DEVICE [/backup/absolute_home.bk> +/ * FILE or DIRECTORY to backup [/home] Current working DIRECTORY [] / Backup LOCAL files only? yes + VERBOSE output? no + PACK files? no + Backup extended attributes? yes + Backup EFS attributes? yes + __ 23. Using the backup command, perform a relative path backup of the /home directory. Store this backup in the /backup/relative_home.bk. » The suggested commands are: » # cd /home »# find . | backup -iqvf /backup/relative_home.bk OR »# smitty » Select System Storage Management (Physical & Logical Storage) > Files & Directories > Backup a File or Directory. This option will perform a backup by name. * Backup DEVICE [/backup/relative_home.bk> +/ * FILE or DIRECTORY to backup [.] Current working DIRECTORY [/home] / Backup LOCAL files only? yes + VERBOSE output? no + PACK files? no + Backup extended attributes? yes + Backup EFS attributes? yes +

© Copyright IBM Corp. 2009, 2013

Exercise 14. Backup and restore

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

14-9

Student Exercises with hints

__ 24. List the names of the files in the two backup files just created. » The suggested commands are: »# restore -Tvf /backup/absolute_home.bk »# restore -Tvf /backup/relative_home.bk OR (The example below only gives the relative path backup listing; repeat using the absolute path backup file name.) »# smitty » Select System Storage Management (Physical & Logical Storage) > Files & Directories > List Contents of a Backup. * Backup DEVICE VERBOSE output?

[backup/relative_home.bk] +/ no +

__ 25. Remove the contents of the /home directory. » # rm -r /home/* __ 26. Using the absolute backup file, restore the contents of the /home directory. Verify the contents have been restored. » The suggested commands are: »# restore -xvf /backup/absolute_home.bk »# ls -l /home OR »# smitty » Select System Storage Management (Physical & Logical Storage) > Files & Directories > Restore a File or Directory. * Restore DEVICE [/backup/absolute_home.bk] * Target DIRECTORY [.] FILE or DIRECTORY to restore [] (Leave blank to restore entire archive.) VERBOSE output? no Number of BLOCKS to read in a single input [] operation Restore extended attributes? yes

+/ /

+ # +

» Because the backup is absolute path, the Target DIRECTORY and the FILE or DIRECTORY to restore fields are not relevant.

14-10 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 4: (Optional) Incremental backups (backup and restore by inode) __ 27. Create and mount JFS2 filesystem on rootvg: • Mount point: /data • Size: 100 MB » Suggested commands are: # crfs -v jfs2 -g rootvg -a size=100M -m /data # mount /data __ 28. In the /data directory, create a directory called level0. In this directory, copy the file /unix. » Suggested commands are: » # mkdir /data/level0 # cp /unix /data/level0 __ 29. Unmount the /data file system. » # unmount /data __ 30. Using the backup command, perform a level 0 backup of the /data directory. Store the backup in the /backup directory, named level0_data.bk. » # backup -u -0 -f /backup/level0_data.bk /data __ 31. Re-mount the /data directory. In /data, create another directory called level1. In /data/level1, copy the file /unix. » Suggested commands are: # mount /data # mkdir /data/level1 # cp /unix /data/level1 __ 32. Unmount the /data file system. » # unmount /data __ 33. Perform a level 1backup of the /data directory. Store the backup in the /backup directory, named level1_data.bk. » # backup -u -1 -f /backup/level1_data.bk /data __ 34. Review the contents of the /etc/dumpdates file. » # cat /etc/dumpdates __ 35. Re-mount the /data directory and delete the contents. » # mount /data; rm -r /data/* __ 36. Change directory to /data and perform a restore of the /data directory using the backup by inode files. After each restore, check the contents of the /data directory. © Copyright IBM Corp. 2009, 2013

Exercise 14. Backup and restore

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

14-11

Student Exercises with hints

» The suggested commands are: # # # # # #

cd /data restore -rqvf /backup/level0_data.bk ls -lR /data restore -rqvf /backup/level1_data.bk ls -lR /data rm restoresymtable

__ 37. Unmount the /backup filesystem and delete the backupVG volume group (respond yes to prompts on deleting any logical volumes). » The suggested commands are: # umount /backup # reducevg -d backupVG hdisk1

14-12 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 5: Using JFS2 snapshots __ 38. Create an enhanced file system (JFS2), with the following characteristics: • Volume Group: rootvg • Size: 128 MB • Mount point /myfs • Internal snapshots: yes • For all other values accept the default » The suggested commands are: » # crfs -v jfs2 -a isnapshot=yes -g rootvg \ -a size=128M -m /myfs OR » # smitty jfs2 » Select Add an Enhanced Journaled File System. » (When prompted for Volume Group name, select: rootvg.) Volume group name SIZE of file system Unit Size * Number of units * MOUNT POINT . . . Allow internal snapshots?

rootvg Megabytes [128] [/myfs] yes

+ #

+

__ 39. Mount the file system that you just created. » # mount /myfs __ 40. The /home/AN14 directory has a script called filegen which will generate 10 files of 10 MB each in a specified directory. Use the script to place files in the file system you just created and then list the files. The filegen script accepts a single argument with the path to the directory in which to place the files.

Here is the code in the script: for f in 0 1 2 3 4 5 6 7 8 9 do dd if=/dev/zero bs=10k count=1024 of=${1}/sfile$f done » The suggested commands are:

© Copyright IBM Corp. 2009, 2013

Exercise 14. Backup and restore

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

14-13

Student Exercises with hints

» # /home/AN14/filegen /myfs » # ls -l /myfs __ 41. Create an external snapshot for the /myfs file system, size 100 MB. Record the name of the created snapshot logical volume _____________________________ » The suggested commands are: » # snapshot -o snapfrom=/myfs -o size=100M OR » # smitty jfs2 » Select Create Snapshot for an Enhanced Journaled File System > Create Snapshot for an Enhanced Journaled File System in New Logical Volume. File System Name SIZE of snapshot Unit Size * Number of units

/myfs Megabytes [100]

+ #

__ 42. Display the snapshots for /myfs. Record the name of the logical volume that was created. Record the free space for the listed external snapshot. ____________________________________________________________ ____________________________________________________________ » The suggested commands are: » # snapshot -q /myfs OR » # smitty jfs2 » Select List Snapshots for an Enhanced Journaled File System. * File System Name

[/myfs]

+

__ 43. Delete all of the files in the /myfs directory. » # rm /myfs/* __ 44. Verify that the files have been deleted. » # ls /myfs __ 45. Display the space utilization of the listed external snapshot. Record the amount of free space. ___________________________________________________ Did the snapshot space fill up significantly? What would be the impact of running out of space in a snapshot? ___________________________________________________________ 14-14 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

___________________________________________________________ » The suggested commands are: » # snapshot -q /myfs OR » # smitty jfs2 » Select List Snapshots for an Enhanced Journaled File System. * File System Name

[/myfs]

+

» The snapshot filled up significantly, with the original data blocks of the deleted files. If the external snapshot logical volume ran out of space, the entire snapshot would have been invalidated and would be unusable. __ 46. Access the snapshot by mounting the external snapshot LV (you recorded this name earlier) and show that the files are still shown there. » The suggested command are: # # # #

mkdir /mntsnap mount -v jfs2 -o snapshot /dev/ /mntsnap cd /mntsnap ls

__ 47. Restore a single file back to the snappedFS and verify that it is recovered. » Suggested commands are: # cp sfile0 /myfs # ls /myfs __ 48. Restore all of the /myfs file system contents to what they were when the snapshot was taken, using the snapshot rollback facility. Accept the default of removing the snapshot logical volume when the snapshot is deleted. Remember that you have to first unmount the snapshot and then unmount the file system, before executing the rollback. You can safely ignore any fsck errors, since the snapshot is being deleted. » The suggested commands are: # cd # unmount /mntsnap # unmount /myfs # rollback -s /myfs /dev/ OR # cd # unmount /mntsnap # unmount /myfs # smitty jfs2

© Copyright IBM Corp. 2009, 2013

Exercise 14. Backup and restore

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

14-15

Student Exercises with hints

» Select Rollback an Enhanced Journaled File System to a Snapshot > Rollback an Enhanced Journaled File System to an External Snapshot. * File System Name [/myfs] + * Snapshot Location [/dev/] + Remove Deleted Snapshot Logical Volumes? yes + __ 49. Remount the file system /myfs and check that the files have been restored to the same state as when the snapshot was taken. » The suggested commands are: # mount /myfs # ls -l /myfs __ 50. If executing the optional steps on the internal snapshot, delay this until the end of the exercise. Unmount and delete the /myfs file system. » The suggested commands are: # umount /myfs # rmfs /myfs

14-16 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 6: (Optional) Using JFS2 internal snapshots __ 51. Display the space utilization of the /myfs file system, in megabytes. Record the amount of free space. ___________________________________________ » # df -m /myfs __ 52. Create an internal snapshot of the /myfs file system, named mysnap. » The suggested commands are: » # snapshot -o snapfrom=/myfs -n mysnap OR » # smitty jfs2 » Select Create Snapshot for an Enhanced Journaled File System > Create Snapshot for an Enhanced Journaled File System in File System. » (When prompted for the filesystem, select: /myfs.) File System Name * Snapshot Name

/myfs [mysnap]

__ 53. Verify the snapshot was created. » The suggested commands are: » # snapshot -q /myfs OR » # smitty jfs2 » Select List Snapshots for an Enhanced Journaled File System. * File System Name

[/myfs]

+

__ 54. Delete all of the files in the /myfs directory. (Ignore messages about lost+found.) » # rm /myfs/* __ 55. Verify that the files have been deleted. » # ls /myfs __ 56. Display the space utilization of the /myfs file system, in megabytes. Record the amount of free space. __________________________________________ Did the file system size decrease as a result of deleting all the files? Why? ___________________________________________________________ ___________________________________________________________ » # df -m /myfs

© Copyright IBM Corp. 2009, 2013

Exercise 14. Backup and restore

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

14-17

Student Exercises with hints

» The file system size did not significantly decrease. That is because the deleted files were first copied to the snapshot which is also part of the file system space allocation. __ 57. Access the snapshot and show that the files are still shown there. » The suggested commands are: # cd /myfs/.snapshot/mysnap # ls __ 58. Restore a single file back to the snappedFS and verify that it is recovered. » The suggested commands are: # cp sfile0 /myfs # ls /myfs __ 59. Restore all of the /myfs file system contents to what they were when the snapshot was taken, using the snapshot rollback facility. » The suggested commands are: # cd / # unmount /myfs # rollback -n mysnap /myfs OR # cd / # unmount /myfs # smitty jfs2 Select Rollback an Enhanced Journaled File System to a Snapshot > Rollback an Enhanced Journaled File System to an Internal Snapshot. * File System Name * Snapshot Name

/myfs [mysnap]

+

__ 60. Remount the file system and verify that all of the files have been restored. » The suggested commands are: # mount /myfs # cd /myfs # ls __ 61. List the snapshots for the /myfs file system. Is your snapshot still there? ____________________________________________________________.

14-18 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» The suggested commands are: # snapshot -q /myfs OR # smitty jfs2 Select List Snapshots for an Enhanced Journaled File System. * File System Name

[/myfs]

+

» You will note that the snap shot is gone. A rollback of a snapshot will result in the deletion of the snapshot used for the rollback and any other snapshot which were created after that point in time. __ 62. Unmount and delete the /myfs file system. » The suggested commands are: # umount /myfs # rmfs /myfs

© Copyright IBM Corp. 2009, 2013

Exercise 14. Backup and restore

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

14-19

Student Exercises with hints

Part 7: (Optional) Using a snapshot volume group __ 63. If the disks hdisk2 or hdisk3 are assigned to a volume group, remove them from their respective volume groups (removing the volume groups if necessary). » Following is an example commands: # lspv (if necessary: # reducevg __ 64. In the /home/AN14 directory you should find a script named: build_mirror_vg. The script creates a mirrored volume group, named testvg, with two included file systems (one JFS and one JFS2). It also populates these file systems with data files. Change directory to /home/AN14 and execute the build_mirror_vg script. » Following is an example command: # cd /home/AN14 # ./build_mirror_vg __ 65. Display the information for the logical volumes within the created testvg volume group. Are the file systems mirrored? _______________________________________________________________ » Following is a suggested command and sample output: # lsvg -l testvg testvg: LV NAME TYPE testlv2 jfs2 testlv jfs loglv00 jfs2log loglv01 jfslog

LPs 8 8 1 1

PPs 16 16 2 2

PVs 2 2 2 2

LV STATE open/syncd open/syncd open/syncd open/syncd

MOUNT POINT /testfs2 /testfs N/A N/A

» In the example output, the ratio of PPs to LPs is 2:1, indicating mirroring. __ 66. Display the mapping of logical partitions to physical partitions for both of the created logical volumes, testlv and testlv2. Record which disk holds the second copy. _____________________________________________________________

14-20 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» Following are suggested commands and sample output: # lslv -m testlv testlv:/testfs LP PP1 PV1 0001 0212 hdisk2 0002 0213 hdisk2 0003 0214 hdisk2 0004 0215 hdisk2 0005 0216 hdisk2 0006 0217 hdisk2 0007 0218 hdisk2 0008 0219 hdisk2

PP2 0212 0213 0214 0215 0216 0217 0218 0219

PV2 hdisk3 hdisk3 hdisk3 hdisk3 hdisk3 hdisk3 hdisk3 hdisk3

PP3 PV3

# lslv -m testlv2 testlv2:/testfs2 LP PP1 PV1 0001 0204 hdisk2 0002 0205 hdisk2 0003 0206 hdisk2 0004 0207 hdisk2 0005 0208 hdisk2 0006 0209 hdisk2 0007 0210 hdisk2 0008 0211 hdisk2

PP2 0204 0205 0206 0207 0208 0209 0210 0211

PV2 hdisk3 hdisk3 hdisk3 hdisk3 hdisk3 hdisk3 hdisk3 hdisk3

PP3 PV3

» In the sample output, both logical volumes have their second copies on hdisk3. __ 67. When ready to backup the file system data, you would briefly quiesce the application and then split the VG. In this class, our method of quiescing is to simply not run any commands that affect the data while splitting the mirrored VG. Split the volume group, using the disk which holds the second copy as the snapshot volume group. Name the new volume group: myvg-snap. Time how long it took to create the snapshot Volume Group. Once the split is completed, you would un-quiesce and resume application processing. We will represent application processing, later, with a script to update some files. How long did it take to split the mirrored VG? __________________________ » Following is an example command: # timex splitvg -y testvg-snap real 8.04 user 0.89 sys 0.41

© Copyright IBM Corp. 2009, 2013

-c 2

testvg

Exercise 14. Backup and restore

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

14-21

Student Exercises with hints

» In the example output, the splitvg command took only 8 seconds. While larger numbers of physical partitions will require some more time, it is not much more. An 8 GB drive fully populated with data, involving over one thousand physical partitions required 17 seconds to complete the split. What took longer was not the amount of data but the number of logical partitions. This is significant, since in very large databases, the volume groups typically use a much larger PP size, thus requiring fewer logical partitions to contain the same amount of data. __ 68. Display the testvg characteristics. Does it identify the status of having created a snapshot VG? Does it have any stale PVs? ______________________________________________________________ ______________________________________________________________ » Following is a suggested command and sample output: # lsvg testvg VOLUME GROUP: testvg VG IDENTIFIER:00f6060300004c000000012f21d4122f VG STATE: active PP SIZE: 8 megabyte(s) VG PERMISSION: read/write TOTAL PPs: 2030 (16240 megabytes) MAX LVs: 256 FREE PPs: 1994 (15952 megabytes) LVs: 4 USED PPs: 36 (288 megabytes) OPEN LVs: 4 QUORUM: 1 (Disabled) TOTAL PVs: 2 VG DESCRIPTORS: 2 STALE PVs: 1 STALE PPs: 1 ACTIVE PVs: 1 AUTO ON: yes MAX PPs per VG: 32768 MAX PVs: 1024 LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: no HOT SPARE: no BB POLICY: relocatable SNAPSHOT VG: testvg-snap PV RESTRICTION: none » In the example output, you can identify that this volume group has a snapshot because the SNAPSHOT VG field lists the name of the snapshot VG. You can also see that one of the PPs is marked as stale. __ 69. Display the testvg-snap volume group characteristics. What information does it provide about the snapshot situation? _______________________________________________________________ _______________________________________________________________

14-22 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» Following is an example command and sample output: # lsvg testvg-snap VOLUME GROUP: testvg-snap 00f6060300004c000000012f21e78f8b VG STATE: active VG PERMISSION: read/write MAX LVs: 256 LVs: 4 OPEN LVs: 0 TOTAL PVs: 1 STALE PVs: 0 ACTIVE PVs: 1 MAX PPs per VG: 32768 LTG size (Dynamic): 256 kilobyte(s) HOT SPARE: no SNAPSHOT VG: yes PV RESTRICTION: none

VG IDENTIFIER: PP SIZE: 8 megabyte(s) TOTAL PPs: 1015 (8120 megabytes) FREE PPs: 997 (7976 megabytes) USED PPs: 18 (144 megabytes) QUORUM: 1 (Disabled) VG DESCRIPTORS: 2 STALE PPs: 0 AUTO ON: yes MAX PVs: 1024 AUTO SYNC: no BB POLICY: relocatable PRIMARY VG: testvg

» In the example output, the SNAPSHOT VG field set to yes indicates that this volume group is a snapshot VG. The PRIMARY VG field identities which volume group is the related primary. __ 70. Display the information for the logical volumes within the testvg-snap volume groups. What names were generated for the new logical volumes and the contained file systems? Are the new file systems mounted? Is there any indication of mirroring? ______________________________________________________________ ______________________________________________________________ _______________________________________________________________ » Following is a suggested command and sample output: # lsvg -l testvg-snap testvg-snap: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT fstestlv2 jfs2 8 8 1 closed/syncd /fs/testfs2 fstestlv jfs 8 8 1 closed/syncd /fs/testfs fsloglv00 jfs2log 1 1 1 closed/syncd N/A fsloglv01 jfslog 1 1 1 closed/syncd N/A » The new logical volume names are the LV names in the primary VG, prefixed with fs. The file system default mount points (/etc/filesystems stanza labels) are the primary VG mount points but relative to the /fs directory path. The logical volumes in a snapshot VG are not aware that there is any mirroring being tracked; that information is maintained in the primary VG which still knows about both disks.

© Copyright IBM Corp. 2009, 2013

Exercise 14. Backup and restore

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

14-23

Student Exercises with hints

__ 71. Mount the new file systems in the snapshot VG. » Following are suggested commands and sample output: # mount /fs/testfs Replaying log for /dev/fstestlv. # mount /fs/testfs2 Replaying log for /dev/fstestlv2. __ 72. Display file systems and their space utilization, requesting a unit size of one megabyte. What is the utilization of the test file systems? How many megabytes are used by each file system? ________________________________________________________________ ________________________________________________________________ » Following is a suggested command and sample output: # df -m | egrep “MB|test” Filesystem MB blocks /dev/testlv2 64.00 /dev/testlv 64.00 /dev/fstestlv 64.00 /dev/fstestlv2 64.00

Free %Used 0.00 100% 0.00 100% 0.00 100% 0.00 100%

Iused %Iused Mounted on 19 60% /testfs2 26 1% /testfs 26 1% /fs/testfs 19 60% /fs/testfs2

» The example output shows all of the test file systems as being 100% utilized. They each use 64 MB of disk space. __ 73. Next we want to update the data in one of the logical partitions for each filesystem. A script has been provided that will do this: update_files. It updates one file in each of the file systems, making each file one megabyte smaller. Execute the script, update_files. » Following is a suggested command and sample output: # ./update_files **** creating source files for filesystem population **** **** updating file data7 in JFS2 filesystem **** ****updating file data7 in JFS filesystem **** __ 74. Display file systems, requesting a unit size of one megabyte. Were the file systems in the snapshot VG affected by the update you just executed? _________________________________________________________________ _________________________________________________________________

14-24 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» Following is a suggested command and sample output: # df -m | egrep “MB|test” Filesystem MB blocks /dev/testlv2 64.00 /dev/testlv 64.00 /dev/fstestlv 64.00 /dev/fstestlv2 64.00

Free %Used 3.02 96% 7.02 90% 0.00 100% 0.00 100%

Iused %Iused Mounted on 19 3% /testfs2 26 1% /testfs 26 1% /fs/testfs 19 60% /fs/testfs2

» The example output shows that while the utilization of the file systems in the primary VG is smaller in size (due to the updates you just made), the snapshot VG file systems are un-affected; they are the same utilization as they were when the snapshot was taken. __ 75. Display the logical volume characteristics for each of the test file systems in the testvg volume group. Were some of the physical partitions counted as stale? _______________________________________________________________ ________________________________________________________________ » Following are suggested commands and sample output: # lslv testlv | grep PPs LPs: 8 STALE PPs: 3

PPs: BB POLICY:

16 relocatable

# lslv testlv2 | grep PPs LPs: 8 STALE PPs: 2

PPs: BB POLICY:

16 relocatable

» The example output shows that 3 out of 16 PPS are stale in the JFS file system and that 2 out of 16 PPs are stale in the JFS2 filesystem. Since the rejoining of the VGs only requires the synchronization of stale PPs, this means that the rejoin will be much faster than if we had to synchronize all physical partitions. __ 76. The backup of the snapshot contents would either be to a remote server or to removable storage (tape or DVD). In this class, you will backup to your assigned server LPAR, but you first need to create and access a filesystem on that server which is large enough to hold the backups. __ a. What is the size of the /fs/testfs2 file system? (See your answer in the earlier Step 72 on page 14-24.) _____________________________________________________________ __ b. Start a terminal emulation with a new connection to your assigned server LPAR (if you do not already have one) and log in as root. __ c. On the server LPAR, create and mount a JFS2 filesystem which is larger than the size of the /fs/testfs2 file system. Use SMIT (fast path jfs2) or the crfs command.

© Copyright IBM Corp. 2009, 2013

Exercise 14. Backup and restore

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

14-25

Student Exercises with hints

Name the file system: back-, to avoid conflict with the other team sharing the server. NFS export the new file system (with read-write authority) to your client LPAR with root access. Be careful to specify the correct IP address for your assigned client LPAR. You can use SMIT (fastpath nfs) or the mknfsexp command: mknfsexp -d -B -S sys -t rw -r » The example commands are: # crfs -v jfs2 -g rootvg -a size=65M -m /back-sys304_118 # mount /back-sys304_118 # mknfsexp -d /back-sys304_118 -B -S sys -t rw -r 10.6.52.118 __ d. Return to your client LPAR session and execute an NFS mount (read-write) of the file system you just created with a mount point of /mnt. » # mount -o rw 10.6.52.117:/back-sys304_118

/mnt

__ 77. Backup (relative path) the /fs/testfs2 file system to a backup file in the /mnt directory. Then verify the names of the files in the backup archive. In the real world, the amount of data would be much greater and would require an extensive amount of time to complete. » Following are suggested commands and sample output: # cd /fs/testfs2 # find . | backup -q -i -v -f /mnt/vgsnap-fs2.bak Backing up to /mnt/vgsnap-fs2.bak Cluster 51200 bytes (100 blocks). Volume 1 on /mnt/vgsnap-fs2.bak a 0 . a 8044544 ./data1 a 4194304 ./data10 . . . a 4194304 ./data14 a 4186112 ./data15 a 4194304 ./data2 . . . a 4194304 ./data9 a 0 ./lost+found total size: 66756608 Done at Mon Apr 4 21:59:45 2011; 130400 blocks on 1 volume(s) # restore -Tvf /mnt/vgsnap-fs2.bak

14-26 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 78. Unmount the file systems which are in the snapshot VG, and then rejoin the snapshot VG with the primary VG. The time it takes to join the snapshot VG to the primary VG depends mainly upon how many PPs were marked as stale during the existence of the snapshot. » Following are suggested commands: # # # #

cd / umount /fs/testfs umount /fs/testfs2 joinvg testvg

__ 79. List the volume groups to verify that the snapshot VG no longer exists. » Following is a suggested command and sample output: # lsvg rootvg testvg __ 80. List the logical volumes in the testvg volume group to verify that it is back to its normal mirroring with no stale PPs. » Following is a suggested command and sample output: # lsvg -l testvg testvg: LV NAME TYPE testlv2 jfs2 testlv jfs loglv00 jfs2log loglv01 jfslog

LPs 8 8 1 1

PPs 16 16 2 2

PVs LV STATE 2 open/syncd 2 open/syncd 2 open/syncd 2 open/syncd

MOUNT POINT /testfs2 /testfs N/A N/A

__ 81. Before continuing to other parts of this exercise, remove the testvg volume group by executing the provided script: clean_mirror_vg. » Following is a suggested command and sample output: » # cd /home/AN14 # ./clean_mirror_vg rmlv: Logical volume testlv2 is removed. rmlv: Logical volume testlv is removed. rmlv: Logical volume loglv00 is removed. rmlv: Logical volume loglv01 is removed. ldeletepv: Volume Group deleted since it contains no physical volumes.

End of exercise

© Copyright IBM Corp. 2009, 2013

Exercise 14. Backup and restore

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

14-27

Student Exercises with hints

14-28 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 15.Error monitoring

.

(with hints)

What this exercise is about This exercise has two parts. In the first part, you will work with the AIX error logging facility, including sending syslogd messages to the AIX error log, and using the ODM error notification class errnotify to automate responses to threshold conditions.

What you should be able to do At the end of the exercise, you should be able to: • Determine what errors are logged on your machine • Generate different error reports • Automate error logging with errnotify • (optional) Redirect syslogd messages to the error log

Introduction This exercise has three parts: • Part 1: Error log reports and management • Part 2: You will work with the ODM error notification class errnotify. • (Optional) Part 3: You will work with redirecting syslog message to the AIX error log. You will need root authority to complete this exercise.

© Copyright IBM Corp. 2009, 2013

Exercise 15. Error monitoring.

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

15-1

Student Exercises with hints

Exercise instructions with hints Preface Two versions of these instructions are available: one with hints and one without. You can use either version to complete this exercise. Also, please do not hesitate to ask the instructor if you have questions. All exercises of this chapter depend on the availability of specific equipment in your classroom. » All hints are marked with a >> sign. » The output shown in the answers is an example. Your output and answers based on the output might be different.

Working with the error log Part 1: Error log reports and management __ 1. Generate a summary report of your system’s error log. Write down the command that you (or SMIT) used: ____________________________________________________________ » # errpt __ 2. Generate a detailed report of your system’s error log. Write down the command that you (or SMIT) used: ____________________________________________________________ » # errpt -a __ 3. Use the date command to obtain the current date and time in the format of: mmddhhmmyy (month, day, hour, minute, year). Record the result here: _____________________________________________ Modify this time stamp to reflect a time 1 day earlier. Record that result here: ____________________________________________ » An example of how this could be done is: » # date +%m%d%H%M%y __ 4. Using SMIT, generate the following reports. When prompted, select Filename and do not request CONCURRENT error reporting. • A summary report of all errors that occurred during the past 24 hours (place the date recorded in previous step in the STARTING time interval field). Write down the command that SMIT executes:

15-2 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

____________________________________________________________ » # smit errpt After generating the report, press F6 or to see the command used. The command SMIT executes is errpt -s ’mmddhhmmyy’ (where mmddhhmmyy were the month, day, hour, minute, and year 24 hours ago). • A detailed report of all records with an Error Class of hardware. Write down the command that SMIT executes: ____________________________________________________________ » # smit errpt » After generating the report, press F6 or to see the command used. » The command SMIT executes is errpt -a -d H. __ 5. Write down the characteristics of your error log: LOGFILE: ___________________________________________________ Maximum LOGSIZE: __________________________________________ Memory BUFFER SIZE: _______________________________________ What command have you used to show these characteristics? ____________________________________________________________ » # smit errdemon OR » # /usr/lib/errdemon -l Notice that the labels for these characteristics used by SMIT are somewhat different from the labels used when you execute errdemon directly. __ 6. List the entries that have an error class of operator. » # errpt -d O __ 7. Clean up all error entries that have an error class of operator. Write down the command which you (or SMIT) used: ____________________________________________________________ » # errclear -d O 0 __ 8. Verify that the operator entries are now gone. » # errpt -d O

© Copyright IBM Corp. 2009, 2013

Exercise 15. Error monitoring.

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

15-3

Student Exercises with hints

Part 2: Error notification with errnotify This part of the exercise demonstrates how to automate working with the error log. __ 9. Create an errnotify object that mails a message to root, whenever an operator message is posted to the errlog. Write down the stanza that you added: ____________________________________________________________ ____________________________________________________________ ____________________________________________________________ ____________________________________________________________ ____________________________________________________________ ____________________________________________________________ ____________________________________________________________ » The suggested commands are: » # vi notify.add errnotify: en_name="sample" en_persistenceflg=0 en_class="O" en_method="errpt -a -l $1 | mail -s ERRLOG root" » Be careful to use an uppercase letter O for Operator. » # odmadd notify.add » # odmget -q “en_name=sample” errnotify __ 10. Execute the errlogger command and create an entry in the errlog. Write down the command that you used: ____________________________________________________________ » # errlogger test entry in the log __ 11. After a short time, check the mail for the root user. The mail processing is batched and it could take more than a minute before the mail is delivered. ____________________________________________________________

15-4 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 3: (Optional) Redirecting syslogd messages to AIX error log __ 12. Edit the /etc/syslog.conf file. All debug level messages should be directed to the AIX error log. Write down what you have added: ____________________________________________________________ » *.debug

errlog

__ 13. Refresh the syslogd subsystem. Write down the command that you used: ____________________________________________________________ » # refresh -s syslogd __ 14. Generate a syslogd message, for example, use an invalid password during a login. Check that the message is posted to the error log. ____________________________________________________________ ____________________________________________________________ » # login

(Use an invalid password.)

» After three bad attempts, you will lose your telnet session. Either go to a spare session, if you have one or establish a new telnet session. Log in as root and check the error log. » # errpt | more » # errpt -a | pg

End of exercise

© Copyright IBM Corp. 2009, 2013

Exercise 15. Error monitoring.

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

15-5

Student Exercises with hints

15-6 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 16.System Initialization - I (with hints)

What this exercise is about This exercise will review the hardware boot process of an AIX system and provide practice in dealing with problems locating and loading a boot image.

What you should be able to do At the end of the exercise, you should be able to: • Boot a machine in maintenance mode • Repair a corrupted boot logical volume

Introduction This exercise has four parts: • Part 1: Identify information for your system • Part 2: Prepare NIM server to support maintenance boot • Part 3: Validate successful maintenance boot • Part 4: Repair a corrupted boot logical volume All instructions in this exercise require root authority.

Requirements • The program /home/AN14/bootprob1 • A NIM server that you can customize to support your LPAR

© Copyright IBM Corp. 2009, 2013

Exercise 16. System Initialization - I

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

16-1

Student Exercises with hints

Exercise instructions with hints Preface Two versions of these instructions are available; one with hints and one without. You can use either version to complete this exercise. Also, please do not hesitate to ask the instructor if you have questions. All exercises of this chapter depend on the availability of specific equipment in your classroom. » The output shown in the answers is an example. Your output and answers based on the output might be different. » All hints are marked with a >> sign.

Part 1: Identifying information on your system __ 1. What is the boot sequence of your system for a normal boot? Boot device:___________________________ What is the command you used, to determine the bootlist? ________________ » # bootlist -m normal -o __ 2. Identify which disks are contained within the rootvg: ____________________________________________________________ What command did you use? ___________________________________ » # lsvg -p rootvg

Which disk is the bootable disk? (That means the disk that contains the boot logical volume hd5): ______________________ What command did you use? ___________________________________ » lspv -l hdisk0 (for example) or lslv -m hd5

What is the logical volume type of hd5? _________________________ What command did you use? ___________________________________ » # lsvg -l rootvg » TYPE: boot __ 3. If the bootlist had more than one device, set the normal bootlist so it contains only the bootable hard disk. » (If needed) # bootlist -m normal hdisk0

16-2 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 4. The Logical Volume Manager uses names and IDs when storing information. Complete the following table that maps names to IDs: rootvg VGID First disk PVID Second disk PVID Be careful, the window might need to be enlarged to see the entire output. The VGID is 32 characters long - be sure to record all of it. What command did you use to determine the rootvg VGID? _______________ »# lsvg rootvg

What command did you use to determine the physical volume IDs? __________ »# lspv __ 5. Using odmget, identify the attribute pvid of one of your disks from ODM class CuAt. What command did you use?_____________________________________ »odmget -q "name=hdisk0 and attribute=pvid" CuAt

What difference do you see with the ID value? » The ODM stores physical volume IDs in a 32-number field, and adds 16 zeros to the ID of the disk. lspv just shows 16 bytes. __ 6. Display your configured interfaces. What is your Ethernet interface name? ____________________________________________________________ » Suggested commands are: » # ifconfig -a » -or» # netstat -in __ 7. Display and record the physical location code of the Ethernet adapter which your interface is using (the numeric suffix of the interface will match the numeric suffix of the adapter). _____________________________________________________________ » Suggested commands are: » # lscfg | grep ent

© Copyright IBM Corp. 2009, 2013

Exercise 16. System Initialization - I

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

16-3

Student Exercises with hints

Part 2: Preparing NIM to support booting to maintenance mode To fix various problems in the following lab exercises, you will need to boot to maintenance mode. Since we are unable to provide every LPAR with an optical or tape drive (mounted with bootable media), instead we will boot over the network using NIM. To support this, we must first configure NIM to provide maintenance boot services. __ 8. Using your telnet session to your class NIM server LPAR (start one if you do not already have one), log in as root. __ 9. List the NIM standalone machine objects and locate your client LPAR in the list, by executing: # lsnim | grep standalone You machine object name should match your LPAR’s hostname. » Following are the example commands and output: » # lsnim | grep standalone sys264_lpar1 sys264_lpar2

machines machines

standalone standalone

__ 10. List the attributes of your machine object, by executing: # lsnim -l » Following are the example commands and output: » # lsnim -l sys264_lpar2 sys264_lpar2: class type connect platform netboot_kernel if1 cable_type1 Cstate prev_state Mstate cpuid Cstate_result

= = = = = = = = = = = =

machines standalone shell chrp mp net_en0 sys264_lpar2 0 N/A ready for a NIM operation currently running not running 00C35B904C00 success

__ 11. If the Cstate value is not ready for a NIM operation, force reset the state of your client machine object, by executing: # nim -o reset -F » Following are the example commands and output:

16-4 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» # nim -o reset -F sys264_lpar2 » # lsnim -l sys264_lpar2 | grep Cstate Cstate = ready for a NIM operation Cstate_result = reset __ 12. The maintenance boot operation requires that a SPOT is allocated to the machine. Check that there is a SPOT allocated, by executing: # lsnim -l | grep -i spot If there is not a SPOT allocated, then allocate one that matches the version and release of your client LPAR’s operating system, by executing: # lsnim | grep -i spot # nim -o allocate -a spot=sp_71tl0sp1 (note that the naming convention uses tl for technology level; the l is a lower case L.) » Following are the example commands: » # lsnim -l sys264_lpar2 | grep spot » (If needed) # nim -o allocate -a spot=sp_71tl0sp1 sys264_lpar2 __ 13. Invoke the maint_boot operation for your client LPAR, by executing: # nim -o maint_boot » Following is an example command: » # nim -o maint_boot sys264_lpar2 __ 14. Verify that your client LPAR machine object now has a Cstate of maintenance boot has been enabled, by executing: # lsnim -l | grep Cstate » Following are the example commands and output: » # lsnim -l sys264_lpar2 | grep Cstate Cstate

= maintenance boot has been enabled

__ 15. ONLY if there are problems with the setup and installation, you will need to restore your NIM client machine object to its original state. To do this you need to both deallocate any resources and reset the state of your client, by executing: # nim -o deallocate -a subclass=all # nim -F -o reset Once your client is back in an initial state, repeat the previous steps starting at Step 12 on page 16-5.

© Copyright IBM Corp. 2009, 2013

Exercise 16. System Initialization - I

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

16-5

Student Exercises with hints

Part 3: Booting to maintenance mode __ 16. Before creating any boot problems, verify that you can boot into maintenance mode and then reboot back to multiuser mode. This will be crucial to fixing the problem. The procedure for LPARs is described, at a high level, as follows (details provided in the following exercise steps): • Shut down your AIX operating system in your client LPAR. • Access the HMC and locate the icon for your client LPAR. • Activate your client LPAR into SMS mode. • Network boot your client LPAR into maintenance mode using SMS. • Shut down your client LPAR from the current maintenance mode. • Start your client LPAR back up into multi-user mode. Except for the shutdown of a running AIX operating system, details of this will depend on the level of HMC with which you are working. This course is written to expect HMCv7 or later. Execute the above procedure, using the following steps. Check off each step as you complete it. __ 17. This steps is just for reference to support the previously enumerated procedure and to provide a reference for using these procedures in later steps. Do not re-execute these procedures at this point, if you completed them during the previous step. These instructions assume that you are working with the graphic web interface for HMC version 7. __ a. At your AIX client LPAR (be sure it is not your server LPAR), shut down your AIX operating system: - If you have access to a root level prompt on the client LPAR, execute shutdown -F from the AIX root level command prompt in your LPAR. - If you do not have a root level prompt at your client LPAR, then: • Access the HMC and locate your LPAR as described in substep b. • From the task menu, select Operations > Shutdown. • On the resulting Shutdown Partitions pop-up, select the Operating System Immediate button and click OK. • If the Operating System Immediate button is grayed out, then select the Immediate option and click OK. • Respond yes to continue and respond no to the questions about the cache battery.

16-6 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ b. Access the HMC and locate your LPAR: 1) Start a Web browser on your lab workstation (note that the workstation can be a portal machine at a remote location). 2) Enter a URL of: https://. This will take you to an HMC status window which has three status indicators and a link with the text: Log on and Launch the Hardware Management Console web application 3) Click the Logon link to launch the HMC logon panel. 4) Enter your assigned HMC user ID and password and click the Logon button. This should launch the HMC web interface. 5) In the left navigation area click Systems Management. The Systems Management item should expand to show Servers and Custom Groups. 6) Click the Servers item. The Servers item should expand to show the managed systems. 7) Click the managed system which is assigned to your team. In the Content Area on the right, you should see a list of logical partitions defined for your assigned system. 8) Select your assigned logical partition by clicking the box under Select for your LPAR. After a short delay, you should see a small menu icon appear to the right of your LPAR name, and the Tasks Area on the bottom half of the panel should update to reflect operations which are appropriate for the selected target. 9) If you left-click the new menu icon (to right of the LPAR name), you should see a menu which is similar to what you see in the Tasks Area. __ c. Activate your LPAR into SMS mode: 1) When the partition state is Not Activated, proceed to activate the partition. 2) Select the partition (if not already selected). 3) When the small menu icon appears, click it to show the menu and move your mouse over the Operations task. 4) When the subtasks appear, click the Activate subtask. 5) Choose profile in the next menu. 6) In the pop-up window labeled Activate Logical Partition: , click (select) the small box to the left of Open a terminal window or console session and then click the Advanced button on the right. This should result in a new pop-up window labeled Activate Logical Partition - Advanced.

© Copyright IBM Corp. 2009, 2013

Exercise 16. System Initialization - I

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

16-7

Student Exercises with hints

7) In the new pop-up window, click the menu icon to the right of Boot Mode and select SMS. Click OK to exit this pop-up. 8) On the panel that is labeled Activate Logical Partition: , click OK. Respond yes to any security pop-up windows. A virtual terminal window should appear and you should see the system console displays for a boot system, ending in an SMS menu. (If you do not see the virtual terminal window, it is likely behind some other window and you will need to bring it to the foreground). __ d. Network boot your LPAR into maintenance mode using SMS: 1) From the SMS main menu, select option: 2. Setup Remote IPL (Initial Program Load) 2) From the list of Network Interface Card (NIC) Adapters, choose the first one (the one that matches the location code recorded earlier). 3) On newer systems, you will be prompted on what protocols to use. Select IPv4 and bootp. 4) This should bring up the Network Parameters panel. Select option: 1. IP Parameters 5) On the IP Parameters panel, if the network parameters are already set, validate that they are correct (The server IP address, if already set, is likely to be wrong for this exercise; it should be the server that you configured in Part2 of the this exercise.) If they are not correct, then modify them. The way to modify the values is to enter the number of the parameter you want to change, type in the replacement value and then press Enter. The values will be the same ones you used during the AIX Installation exercise. When you are comfortable that the IP Parameters are correct, return to the previous Network Parameters panel by pressing the key. 6) Next use the ping test to see if the parameters allow you to communicate with the designated server. Select: 3. Ping Test and 1. Execute Ping Test If you do not get a Ping Success result, then check the status of the server and your IP Parameter values. 7) Back out to the main menu, using the key.

16-8 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

8) From the SMS main menu, select options: 5. Select Boot Options 1. Select Install/Boot Device 6.

Network

When prompted for a network service, select bootp. Select the device number of your network adapter. 9) Then select: 2. Normal Mode Boot 1. Yes (to exit SMS)

You should see the tftp packet count incrementing as it downloads the boot image. Then you should see the system booting up into maintenance mode. It will prompt you to identify the system console. Type 1 and press Enter. It will next ask you to identify the language to be used while in maintenance mode. Type 1 (for English) and press Enter. It should then display the Maintenance menu. __ e. Shut down the partition from maintenance mode. 1) If you have accessed the volume group, simply run sync;sync;halt - this can be done because there is no disk activity in the current state. If you have not accessed the volume group (perhaps you are looking at the maintenance menu), you will have to use the HMC to shutdown the LPAR - as follows: 2) On the HMC Content Area, make sure your LPAR (and only your LPAR) is currently selected. 3) Click the menu icon, move your mouse over the Operations task and then click the Shutdown subtask. This should result in a pop-up window. 4) In the shutdown window, select Immediate and then click OK. When prompted, confirm that you want to shutdown the partition. Answer no if asked if you are replacing a cache battery. The shutdown immediate option is only valid because of the lack of any disk activity in the current state. From a multiuser mode, do not use the HMC shutdown immediate. The os shutdown option is preferable. 5) The partition shutdown is complete when the Status field for your LPAR changes from Running to Not Active.

© Copyright IBM Corp. 2009, 2013

Exercise 16. System Initialization - I

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

16-9

Student Exercises with hints

__ f.

Start your partition in multiuser mode (normal bootlist). When the partition state is Not Activated, proceed to activate the partition: 1) Select the partition (if not already selected). 2) When the small menu icon appears, click it to show the menu and move you mouse over the Operations menu item. 3) When the sub-menu appears, move your mouse pointer over the Activate menu item. Then click the Profile item. 4) In the pop-up window Activate Logical Partition: , click the small box next to Open a terminal window or console session (unless you already have a virtual console window open) and click OK. 5) You should eventually see a login prompt appear in the virtual console window.

16-10 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 4: Repair a corrupted boot logical volume __ 18. On your assigned client LPAR, if you have not already tested the boot to maintenance procedure, do so now: boot to maintenance mode and then reboot back to multiuser mode. This verifies that this procedure can be successfully implemented. You will need it when dealing with the exercise problems. __ 19. If you do not already have a virtual console (to your client LPAR) open, open one now and log in as root. What follows are instructions to open a virtual console (if you do not already have one open): __ a. Locate and select your LPAR, as described earlier. __ b. Left-click the menu to the right of your LPAR name. __ c. Left-click the Console Window item. __ d. Left-click the Open Terminal Window item. __ 20. In the virtual console window, execute the program /home/AN14/bootprob1. When the prompt is returned, shut down and reboot the system. » # /home/AN14/bootprob1 You have successfully broken your machine! Now, run shutdown -Fr to attempt a reboot. » # shutdown -Fr

What happens on your system during the reboot? Examine both the HMC displayed reference code for your LPAR and the virtual console for your LPAR. ______________________________________________________________ ______________________________________________________________ ______________________________________________________________ ______________________________________________________________ » On an LPAR system (using the HMC console): » Access the HMC and locate your partition as described in the previous section. » The state of the partition will depend on the level of code. On older POWER5 systems, you might see a state of open firmware. On newer systems, you might see a state of starting with a reference code of AA060011. » The boot record at the beginning of your partition has been removed. When an LPAR is unable to locate a boot image, its behavior depends on the firmware level. On older firmware levels, it automatically booted to SMS, which is a menu front end to the system

© Copyright IBM Corp. 2009, 2013

Exercise 16. System Initialization - I

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

16-11

Student Exercises with hints

firmware. At newer firmware levels, it repeatedly retries the bootlist and displays a message of: No OS image was detected by firmware At least one disk in the bootlist was not found yet Firmware is now retrying the entries in the bootlist __ 21. Terminate any looping condition that might exist. » Press Ctrl-C to stop retrying. » This signal will trigger a boot to SMS mode. __ 22. Boot to maintenance mode to do the repair. On the virtual console for your LPAR, you should see an SMS menu (resulting from termination of the retry attempts to find a boot image). Use SMS to execute a network boot of your system. 1) From the SMS main menu, select options: 5. Select Boot Options 1. Select Install/Boot Device 6.

Network

When prompted for a network service, select bootp. Select the device number of your network adapter. 2) Then select: 2. Normal Mode Boot 1. Yes (to exit SMS)

You should see the tftp packet count incrementing as it downloads the boot image. Then you should see the system booting up into maintenance mode. It will prompt you to identify the system console. Type 1 and press Enter. It will next ask you to identify the language to be used while in maintenance mode. Type 1 (for English) and press Enter. It should then display the Maintenance menu. If the corresponding NIM machine object is in the correct state, your system should boot to maintenance mode. __ 23. Repair the boot logical volume. The procedure for using the maintenance menu to repair the boot logical volume is the same for all environments: __ a. Access the rootvg with all mounted file systems.

16-12 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» Since you are booting from NIM, you will already be at the Maintenance menu. » From the Maintenance menu, select option 1, Access a Root Volume Group. » Type 0 to continue. » Next, the Access a Root Volume Group screen is displayed. This screen lists all of the volume groups (root and otherwise) on your system. » Select the option for the root volume group whose logical volume information you want to display. If there are multiple volume groups to choose from, choose the one which matches the VGID that you recorded in Part 1 of this exercise (it is likely identified as hdisk0). » After entering your selection, the Volume Group Information screen is displayed. » Select option 1, Access this volume group and start a shell. Selecting this choice imports and activates the volume group and mounts the file systems for this root volume group before providing you with a shell and a system prompt.

__ b. In the maintenance shell, check that hdisk0 is in the normal bootlist. Also check that the rootvg actually has a boot logical volume on it. Correct if needed. » The suggested commands are: » # bootlist -o -m normal » # lsvg -l rootvg __ c. In the maintenance shell, rebuild the boot image on the boot logical volume. Ensure that your changes are committed to disk. Write down the commands you used. ____________________________________________________________ ____________________________________________________________ » The suggested commands are: » # bosboot -ad /dev/hdisk0 (for example) » # sync » # sync __ 24. If the command executes successfully, reboot your system in normal mode. » # reboot » We would normally recommend a shutdown command, but since there is no disk activity in the current state, it is safe to use the reboot command. Also, use of the shutdown command would generate multiple errors related to the assumption that the shutdown is being issued from a multi-user mode (which it is not true in this situation). __ 25. When you receive a login prompt, the repair is complete.

© Copyright IBM Corp. 2009, 2013

Exercise 16. System Initialization - I

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

16-13

Student Exercises with hints

Part 5: Part 5 (Optional): Working with multi-path bootlists This section requires that your assigned LPAR have a fibre channel adapter with a LUN that has be zoned to it. The fibre channel adapter may be either a physical adapter or a virtual adapter. When a boot disk is accessed over a storage area network, there can be multiple paths to that disk. Once AIX is running, path management software can automatically fall over to an alternate path when there is a problem. On the other hand, the firmware needs be explicitly told which paths to use in accessing the disk during the boot process. This section is about managing the bootlist in that situation. __ 26. Login to your assigned client LPAR, if not logged in already. __ 27. List the devices of class disk. Do you see a disk with an AIX location code and a description which indicates it is fibre channel (FC) attached? What is the name of that disk? _______________________________________________________ »# lsdev -c disk __ 28. List the configured devices and filter for just disk devices. Look for a disk which was the world-wide name (ww_name) for the remote storage subsystem’s port as part of its physical location code. The ww_name will begin with a W, followed by the hexadecimal identifier. What is the name of the disk? ________________________________________________________________ »# lscfg | grep disk __ 29. Identify the parent device of the disk. What is the name and description of the parent device? _________________________________________________________ »# lsparent -C -l hdisk# __ 30. Identify the parent device of the device you just described. What is the name and description of this device? _________________________________________________________ »# lsparent -C -l fscsci0 __ 31. List the paths defined for the previously identified fibre channel attached disk, requesting the pathid as part of the information. How many are there? Do the paths relate to the parent device? _________________________________________________________ »# lspath -l hdisk# -t » Even though there is only one Fibre Channel adapter, there are multiple paths. That is because there are multiple alternative paths in the fabric of the SAN. __ 32. Display the normal mode bootlist. Record the current devices in the bootlist. _________________________________________________________ »# bootlist -o -m normal

16-14 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 33. Update the normal mode bootlist to include the existing device, the fibre channel attached disk, and one other non-FC attached disk (such as hdisk1). Keep the current device as the first in the bootlist order and place the other non-FC attached disk as the last device. »# bootlist -m normal hdisk0 hdisk# hdisk1 __ 34. Display the normal mode bootlist. Record the devices in the bootlist. _________________________________________________________ _________________________________________________________ _________________________________________________________ _________________________________________________________ _________________________________________________________ Do you notice anything odd? __________________________________ _________________________________________________________ »# bootlist -o -m normal » When you specify a fibre channel attached device for the bootlist without any path restrictions, an attempt is made to add an entry for each of the known paths. This can cause a problem in situation where the number of Paths fills up the bootlist capacity, preventing a later disk from being included. » In the current example, the bootlist filled up. On the development system, there were 6 possible paths to the disk and only four could fit into the bootlist. The third (non-FC attached) disk also could not be included, even though it was specified. __ 35. Update the normal mode bootlist to only have the original boot device followed by only the two of the paths to the FC attached disk, and with the other non-FC attached disk listed last. »# bootlist -m normal hdisk0 hdisk# pathid=1,3 hdisk1 __ 36. Display the normal mode bootlist. Record the devices in the bootlist. _________________________________________________________ _________________________________________________________ _________________________________________________________ _________________________________________________________ »# bootlist -o -m normal » Because you controlled which paths to include for the FC attached disks, you were able get a total bootlist that included all the of the disks that you specified. __ 37. Update the normal mode bootlist to include only the original device. »# bootlist -m normal hdisk0

© Copyright IBM Corp. 2009, 2013

Exercise 16. System Initialization - I

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

16-15

Student Exercises with hints

__ 38. Validate that your change was effective. _________________________________________________________ _________________________________________________________ _________________________________________________________ »# bootlist -o -m normal

End of exercise

16-16 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 17.System Initialization - II (with hints)

What this exercise is about This exercise will review the software boot process of an AIX system and provide practice dealing with problems during rc.boot and init execution.

What you should be able to do At the end of the exercise, you should be able to: • Repair a corrupted log logical volume • (Optional) Analyze and fix a phase 3 boot problem

Introduction This exercise has two parts: • Part 1: Repair a corrupted log logical volume • (Optional) Part 2: Analyze and fix a phase 3 boot problem All instructions in this exercise require root authority.

Required material • Script /home/AN14/bootprob2 • Script /home/AN14/bootprob3 • Bootable media that matches the version and release of your system or a NIM server setup that can be used to execute a remote boot.

© Copyright IBM Corp. 2009, 2013

Exercise 17. System Initialization - II

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

17-1

Student Exercises with hints

Exercise instructions with hints Preface Two versions of these instructions are available: one with hints and one without. You can use either version to complete this exercise. Also, please do not hesitate to ask the instructor if you have questions. All exercises of this chapter depend on the availability of specific equipment in your classroom. » All hints are marked with a >> sign. » The output shown in the answers is an example. Your output and answers based on the output might be different.

Part 1: Repair a corrupted log logical volume Before starting the exercise, read the following paragraph. Files or directories which are created or updated are stored with their i-nodes and the superblock of the file system in memory first. Most write requests are handled in memory first to improve system performance. Later the data is written to disk, either due to the syncd daemon (every 60 seconds) or due to a threshold of dirty memory pages being exceeded (for example every 16 KB of changes). Just before the data is written to disk, these changes to the journaled file systems (superblock, i-nodes, list of free data blocks, and so forth) are recorded in a log logical volume. The rootvg uses, by default, the log logical volume /dev/hd8. When the changes are written to the disk, the journaled file system transactions are removed from the log logical volume. This guarantees the integrity of a file system. Until the file system changes are written to disk, the changes are recorded and held in the log logical volume. In this part of the exercise, we corrupt the jfslog to cause a boot failure. __ 1. If you do not already have GUI interface to your HMC, establish one now. __ 2. If you do not already have a virtual terminal interface to your client LPAR, establish one now. __ 3. In your virtual terminal window, check to see if your rootvg file systems are JFS or JFS2. You will need this information later in this exercise. ____________________________________ » # lsvg -l rootvg __ 4. Execute the program /home/AN14/bootprob2. This program can take as long as 30 seconds to run. It will shut down your machine. When you see the message Halt Completed, switch over to the window for your Web browser session with the HMC. »# /home/AN14/bootprob2 17-2 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 5. Once the partition state is Not Activated, attempt to activate your LPAR to a multiuser mode from the HMC. » Follow the instructions in the step Start your partition to multiuser mode in Exercise 16, Part 3. __ 6. What happens during the reboot? Investigate any reference code that seems to persist. Examine your Student Guide to find an explanation for the boot failure. _____________________________________________________________ _____________________________________________________________ » LED, LCD or HMC Reference Code field will show 0557 and will not change from that code. A 557 progress code indicates that the mount of /dev/hd4, root file system, failed. __ 7. Boot your machine in maintenance mode. » Use your HMC to shut down your partition and then activate your partition to maintenance mode as described by the procedures described in Exercise 16, Part 3 (Booting to maintenance mode). __ 8. From the Maintenance menu, access the rootvg before mounting the file systems. You need to do this, because mounting the file systems in rootvg will fail due to the corrupted log logical volume. » Select your terminal. » Select your language. » If booting from media, you will see: Welcome to the Base Operating System Installation and Maintenance. From here, select Start Maintenance Mode for System Recovery. » From the Maintenance menu, select option 1, Access a Root Volume Group. » Type 0 to continue. » The Access a Root Volume Group screen displays. Select the volume group that is causing the problem.

© Copyright IBM Corp. 2009, 2013

Exercise 17. System Initialization - II

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

17-3

Student Exercises with hints

» Select option 2, Access this volume group and start a shell before mounting file systems. Notice the error messages while rootvg is varied on. These provide more clues to the problem: Importing Volume Group... imfs: can't find log for volume group rootvg rootvg Checking the / filesystem. fsck: Cannot find the vfs value for file system /dev/hd4 .Checking the /usr filesystem. fsck: Cannot find the vfs value for file system /dev/hd2 .Exit from this shell to continue the process of accessing the root volume group. __ 9. Reformat the journal log logical volume. Be sure to do a file system check for all file systems that use /dev/hd8. If you like, use set -o emacs or set -o vi, to enable command retrieval and edit. » If it is a JFS2 file system: » # logform -V jfs2 /dev/hd8 » logform: Destroy /dev/hd8 (y)? y »# »# »# »# »# »# »#

fsck fsck fsck fsck fsck fsck fsck

-y -y -y -y -y -y -y

-V -V -V -V -V -V -V

jfs2 jfs2 jfs2 jfs2 jfs2 jfs2 jfs2

/dev/hd1 /dev/hd2 /dev/hd3 /dev/hd4 /dev/hd9var /dev/hd10opt /dev/hd11admin

__ 10. Use the sync command to flush your changes from memory to the disk. Shut down your system and reboot your system in normal mode. Where you able to successfully reboot? _____________________________________________ » Here are example commands: »# sync »# sync »# reboot » (Use of the reboot command is appropriate for the current state of the machine, but the shutdown command should be used when the machine is in a multiuser mode.) » If you are unable to shutdown the system from the command prompt, then use the HMC to stop and start your system: • See the HMC instructions in Exercise 16.

17-4 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 11. If the reboot failed, determine if it is the same problem already identified or a new problem. If it is the same problem, go back and figure out what was missed in the fix procedure.

© Copyright IBM Corp. 2009, 2013

Exercise 17. System Initialization - II

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

17-5

Student Exercises with hints

Part 2: (Optional) Analyze and fix a phase 3 boot problem __ 12. Execute the program /home/AN14/bootprob3. As soon as you see the message Halt Completed, switch over to your web browser session with the HMC. »# /home/AN14/bootprob3 __ 13. Attempt to activate your LPAR to a multiuser mode. » Follow the instructions in the step Start your partition to multiuser mode in the Exercise 16, Part 3. __ 14. What happens during the reboot of the system? Write down the last reference code that is shown. What type of problem is this indicative of? ______________________________________________________________ ______________________________________________________________ ______________________________________________________________ » The system stops with LED/LCD or HMC Reference Code value of 0553 » This is an indication for a corrupted /etc/inittab. » Another possible symptom would be for a prompt to appear on the AIX system console which asks for a run level; when responding with a multi-user run level of “2”, the system can simply hang with no message or error code. __ 15. Reboot the system to maintenance mode. » Use your HMC to shut down your partition and then activate your partition to maintenance mode as described by the procedures described in Exercise 16, Part 3 (Booting to maintenance mode). __ 16. Access your machine with the file systems mounted. __ 17. Examine your system and find the corrupted file that leads to the boot failure. Note that facilities that provide full-screen interfaces such as SMIT or vi need a proper terminal emulation defined. When we used to work on a directly attached graphical display, we would have set the TERM variable to lft. When using the HMC virtual terminal connection, it seems that vt220 and vt420 work well. Set the TERM variable to a usable value, otherwise vi or SMIT will not work correctly in the maintenance shell. » Select your terminal. » Select your language. » If booting from media you will see: Welcome to the Base Operating System Installation and Maintenance. From here, select Start Maintenance Mode for System Recovery. » From the Maintenance menu, select option 1, Access a Root Volume Group. » Type 0 to continue.

17-6 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» The Access a Root Volume Group screen displays. Select the volume group that is causing the problem. » Select option 1, Access this volume group and start a shell. Selecting this choice imports and activates the volume group and mounts the file systems for this root volume group before providing you with a shell and a system prompt. » Set an appropriate terminal emulation. For example, when using the HMC virtual terminals to an LPAR, issue the command: # export TERM=vt420 » The corrupted file is /etc/inittab. __ 18. Repair the corrupted file. You will find an example in your Student Notebook. If you are not able to fix the boot failure, contact your instructor. » Notice that the file has a semi-colon instead of a colon as the first delimiter. Correct this by manually editing /etc/inittab. » # vi /etc/inittab :%s/;/:/g :wq! » Shut down your system and reboot your system in normal mode. Your machine should boot now without any boot failure. » # sync » # sync » # reboot » Use of the reboot command is appropriate for the current state of the machine, but the shutdown command should be used when the machine is in a multiuser mode.

End of exercise

© Copyright IBM Corp. 2009, 2013

Exercise 17. System Initialization - II

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

17-7

Student Exercises with hints

17-8 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 18.System dump (with hints)

What this exercise is about This exercise allows you to become familiar with the AIX dump facility. In addition, you will use the snap command to include the dump in the system data that you would provide to AIX Support Line personnel.

What you should be able to do At the end of the exercise, you should be able to: • Initiate a dump and locate the dump location following reboot • (Optional) Process the dump either to immediate examination or for transfer to AIX Support for analysis • (Optional) Working with a dedicated dump device

Introduction In this exercise you will create a dump and, optionally, include it in a snap of data to be provided to the AIX Support Line personnel. You will need root authority to complete this exercise.

© Copyright IBM Corp. 2009, 2013

Exercise 18. System dump

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

18-1

Student Exercises with hints

Exercise instructions with hints Preface Two versions of these instructions are available: one with hints and one without. You can use either version to complete this exercise. Also, please do not hesitate to ask the instructor if you have questions. All exercises of this chapter depend on the availability of specific equipment in your classroom. » All hints are marked with a >> sign. » The output shown in the answers is an example. Your output and answers based on the output might be different. Note All users must perform this exercise together if there is more than one user on your system.

Part 1: Working with the AIX dump facility __ 1. If you do not have a web browser session with your HMC, establish this before starting this exercise. Navigate to the panel listing your LPARs. You will need this in order to observe the reference code. __ 2. Record the following dump-related settings for your system: Primary dump device _____________________________ Secondary dump device ___________________________ Copy directory ___________________________________ Dump compression (ON or OFF) _____________________ » # sysdumpdev -l » Note that, in systems running AIX 5L V5.3 or later, the value shown for dump compression should be ON. (This is the default for AIX 5L V5.3 or later. In AIX 6.1, this cannot be changed.) __ 3. Execute the command to display the estimated size of a dump and record the estimate you obtain: _______________________________________________ » # sysdumpdev -e » On a system with approximately 1 GB of memory that was used in testing this exercise, the value obtained was approximately 157 MB.

18-2 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 4. Verify that the dump copy directory is large enough to hold the dump size reported on the previous command. » # df -m /var » You could also use the command /usr/lib/ras/dumpcheck -p to check if the size of the copy directory is large enough. If no message is sent to stdout, then the size is sufficient. If there is not enough space, you must increase the size of the corresponding file system. (If necessary, use the chfs command to increase the size of the appropriate file system, typically /var.) After increasing the size, reverify that the filesystem is large enough. » # chfs -a size=+##M /var where ## represents the number of megabytes that /var must be increased by to hold the dump. On a system with approximately 1 GB of memory that was used in testing this exercise, the value used for ## was 245. Note that chfs will now accept M (Megabytes) and G (Gigabytes) unit identifiers for file system size specifications. In our example, the command chfs -a size=+245M /var can be used to indicate that the size of /var should be increased by 245 MB. # /usr/lib/ras/dumpcheck -p __ 5. Ensure that the value of the autorestart attribute for sys0 is set to true. (If autorestart is set to true, the system will reboot after a crash.) » Suggested commands are: » # lsattr -El sys0 -a autorestart » (if necessary) # chdev -l sys0 -a autorestart=true __ 6. Use the command sysdumpstart -p to start a dump to the primary dump device. » # sysdumpstart -p What LED code appears for several minutes after this command is entered? This is referred to as an Operator Panel Value (pre-HMCv7) or as the Reference Code (HMCv7) in the HMC display across from your LPAR name. _______________________________________________ » 0c2 __ 7. After the system reboots, re-establish a telnet session with your LPAR and log in as root. Determine and write down the size, uncompressed size, and file name for your system dump: _________________________________________________________________ _________________________________________________________________ © Copyright IBM Corp. 2009, 2013

Exercise 18. System dump

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

18-3

Student Exercises with hints

» # sysdumpdev -L » Sample output is given below: Device name: /dev/hd6 Major device number: 10 Minor device number: 2 Size: 65926144 bytes Uncompressed Size: 757624951 bytes Date/Time: Mon Aug 29 20:01:53 2011 Dump status: 0 Type of dump: traditional dump completed successfully Dump copy filename: /var/adm/ras/vmcore.0.BZ (if it’s the first dump) Note that the value shown for Uncompressed Size is much larger than the value shown for Size. Also note that the .BZ extension means that the compressed dump cannot be uncompressed using the uncompress command.

18-4 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 2: (Optional) Processing an AIX dump __ 8. Uncompress the dump file (for example, /var/adm/ras/vmcore.0.BZ). When doing the dump-uncompress, keep the original compressed file. Note, based on the reported Uncompressed Size just reported, that you might need to further increase the size of /var to accommodate the size of the uncompressed dump (in addition to the already created compressed dump). Then, execute the kdb command on the uncompressed dump that was created. Write down the commands you used: _______________________________________________ _______________________________________________ » # chfs -a size=+##M /var » The additional number of megabytes should be greater than the Uncompressed Size you have recorded. » # dmpuncompress -p /var/adm/ras/vmcore.0.BZ (if it is the first dump) # kdb /var/adm/ras/vmcore.0 __ 9. Use the kdb stat and status subcommands to show the system name and time of the dump, and the processes/threads running when the dump occurred. If the subcommand output is large, the more facility may be invoked to page the report; you will need to either space through the report or use before entering the next subcommand. Quit the kdb command after examining this information.

© Copyright IBM Corp. 2009, 2013

Exercise 18. System dump

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

18-5

Student Exercises with hints

» Sample output is shown below: (0)> stat SYSTEM_CONFIGURATION: CHRP_SMP_PCI POWER_PC POWER_7 machine with 8 available CPU(s) (64-bit registers) SYSTEM STATUS: sysname... AIX nodename.. sys304_118 release... 1 version... 7 build date Aug 31 2010 build time 16:22:09 label..... 1034B_710 machine... 00F606034C00 nid....... F606034C time of crash: Mon Aug 29 20:01:53 2011 age of system: 6 min., 43 sec. xmalloc debug: enabled FRRs active... 0 FRRs started.. 0 CRASH INFORMATION: CPU -1 CSA 052AA6C8 at time of crash, error code for LEDs: 00000000 (0)> status CPU INTR TID TSLOT PID PSLOT PROC_NAME 0 1200057 288 6C0002 108 sysdumpstart 1 180031 24 E001C 14 wait 2 190033 25 F001E 15 wait 3 1B0037 27 100020 16 wait 4 1C0039 28 110022 17 wait 5 1D003B 29 120024 18 wait 6 1E003D 30 130026 19 wait 7 1F003F 31 140028 20 wait 8-1023 Disabled (0)> q __ 10. Remove the uncompressed dump, but keep the original compressed dump. (This will ensure proper processing of the system dump by the snap command, which you will use in a subsequent lab step.) 18-6 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» # rm /var/adm/ras/vmcore.0

(If it is the first dump.)

__ 11. Check to see how much free space is currently available in /tmp. If necessary, increase your /tmp file system so that there is at least 114 MB of free space. We need this space in the next exercise step. Write down the commands you used: _______________________________________________ _______________________________________________ » # df -m » If necessary, you can increase the size of /tmp using a command similar to the following: » # chfs -a size=+68M /tmp » (The unit used for size is specified, by default, in terms of 512-byte units/blocks.) __ 12. Execute the snap command to collect all information for your system. If there is not enough space in the /tmp file system, increase the size of /tmp and repeat the snap execution. Do not collect any dump information to removable media, if prompted. (Note that this command will take as long as 10 minutes to run, but might run significantly quicker on newer systems). » # snap -a Review the output of this command. This output will include a list of various directories (in /tmp/ibmsupt) to which the snap command writes its output. In these directories, you will find files with names that end in .snap, which are ASCII files. Review the content of a few of these files. » » » »

# cd /tmp/ibmsupt # ls # cd # view *.snap

__ 13. Change your directory to the testcase directory that was created and create some files in that directory. » # cd /tmp/ibmsupt/testcase » # touch here are four files __ 14. Change directory back to your home directory. » # cd __ 15. Create a compressed pax file of the snap generated directory tree, using the snap command. » # snap -c

© Copyright IBM Corp. 2009, 2013

Exercise 18. System dump

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

18-7

Student Exercises with hints

__ 16. Rename the resulting compressed pax file to the standard naming convention, given the following assumptions: • Your PMR# is 12121. • Your branch# is 989. • Use your own country code (if you do not know it, for this class, just use 000). » # cd /tmp/ibmsupt » # mv

snap.pax.Z

18-8 AIX Jumpstart

pmr12121.b989.c000.snap.pax.Z

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 3: (Optional) Working with a dedicated dump logical volume In this part of the exercise, you will create a dedicated dump logical volume, configure to use it, and process a dump in this environment. __ 17. Remove any dump files currently in /var/adm/ras if they exist. » The suggested commands are: # ls /var/adm/ras/vmcore* # rm /var/adm/ras/vmcore* __ 18. List the estimated size of a dump on your systems. Record it here: ________________________________________________________________ » A suggested command and example output is: # sysdumpdev -e Estimated dump size in bytes: 350643814 __ 19. List the physical partition size for your rootvg. ________________________________________________________________ » A suggested command and example output is: # # lsvg rootvg | grep "PP SIZE" VG STATE: active

PP SIZE: 16 megabyte(s

__ 20. Calculate how many physical partitions you must allocate to satisfy the estimated size of a dump. Record it here: ________________________________________________________________ » Using our example output, the result of dividing 16 MB per PP into 350 Megabytes is 21.8. Rounded up, this gives a minimum allocation of 22 physical partitions.

__ 21. Verify that the file system that holds the copy directory has enough free space, given the estimated dump size. Increase the filesystem size, if necessary. » # df -m /var » # chfs -a size=+16M /var __ 22. Create a logical volume, out of the rootvg, that has more than enough physical partitions to handle the estimated dump size. Name it dumplv and specify a logical volume type of sysdump. » # mklv -y dumplv -t sysdump rootvg 46 __ 23. Permanently define this new logical volume as the primary dump device. » # sysdumpdev -P -p /dev/dumplv

© Copyright IBM Corp. 2009, 2013

Exercise 18. System dump

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

18-9

Student Exercises with hints

__ 24. Verify that you new logical volume is defined as the primary dump device. » # sysdumpdev -l __ 25. Initiate a dump of your operating system to your primary dump device. On our development system, this require a little more than 7 minutes to complete. » # sysdumpstart -p __ 26. In your HMC GUI interface, examining the reference code field across from your client LPAR, monitor the dump progress. 0c2 indicates the dump is in progress. Eventually, the dump will complete and the AIX system will reboot. __ 27. After the system reboots, reestablish a telnet session with your LPAR and log in as root. List the dump status. What was the size of the dump? Was there a Dump copy filename line in the report? __________________________________________ ________________________________________________________________ » # sysdumpdev -L Sample output is given below: Device name: /dev/dumplv Major device number: 10 Minor device number: 12 Size: 68368896 bytes Uncompressed Size: 767622000 bytes Date/Time: Mon Aug 29 20:48:57 2011 Dump status: 0 Type of dump: traditional dump completed successfully __ 28. Examine the copy directory. Is there a vmcore file located in that directory? ______________________________________________________________ » # ls /var/adm/ras/vmcore* » There should not be any vmcore files in the directory. The dump may be left in the dedicated dump device and is not automatically copied to the copy directory. __ 29. Copy the dump and the current kernel to the dump copy directory. » # savecore /var/adm/ras /unix » There should now be a new vmcore file in the directory. __ 30. Again, examine the copy directory. Is there a vmcore file located in that directory? ______________________________________________________________ » # ls /var/adm/ras/vmcore*

18-10 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

End of exercise

© Copyright IBM Corp. 2009, 2013

Exercise 18. System dump

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

18-11

Student Exercises with hints

18-12 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Exercise 19.Advanced install techniques (with hints)

What this exercise is about This exercise provides an opportunity to practice using advanced techniques for updating AIX (alternate disk and multibos).

What you should be able to do At the end of the lab, you should be able to: • Create an alternate rootvg disk and update it with maintenance without changing the level of the active rootvg • Create a standby BOS inside the active rootvg and apply maintenance without changing the level of the active BOS

Introduction All instructions in this exercise require root authority. There must be another disk which is large enough to hold the updated rootvg. The rootvg must have enough free space to hold the standby BOS rootvg file systems. The disk assignments on your system can vary from what is in the exercise hints. Adjust your commands to match your situation.

© Copyright IBM Corp. 2009, 2013

Exercise 19. Advanced install techniques

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

19-1

Student Exercises with hints

Exercise instructions with Hints Preface Two versions of these instructions are available; one with hints and one without. You can use either version to complete this exercise. Also, please do not hesitate to ask the instructor if you have questions. All exercises of this unit depend on the availability of specific equipment in your classroom. » All hints are marked with a >> sign. » The output shown in the answers is an example. Your output and answers based on the output might be different.

Part 1: Creating and working with an alternate rootvg __ 1. Open a terminal emulation window using telnet protocol to connect to your assigned NIM server LPAR. Log in as root. __ 2. AIX 7.1 TL2 SP2 maintenance is stored on your NIM server LPAR in the /export/AIX_7100-02-02 directory. Verify that there are files under this directory. »# ls /export/AIX_7100-02-02 __ 3. Check to see if this maintenance directory has been NFS exported to allow read-only access (root access allowed) from your client LPARs, using standard AIX system authentications (sys). »# exportfs __ 4. If it has not been NFS exported, then setup the NFS export for this directory, with the characteristics which were described in the previous step. If it has been NFS exported, but your client LPAR does not have root access permission, then just add your LPAR to that permission list. Be sure to coordinate with the other students sharing this NIM server so you do not try to configure NFS at the same time. »If not yet NFS exported: »# smitty nfs » Select Network File System (NFS) > Add a Directory to Exports List.

19-2 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» On the dialogue panel: Pathname of directory to export [/export/AIX_7100-02-02] . . . * Security method 1 [sys] + * Mode to export directory read-only + Hostname list. If exported read-mostly [] Hosts & netgroups allowed client access [] Hosts allowed root access [] » If exported, but your LPAR does not have root access permission: » # smitty nfs » Select Network File System (NFS) > Change / Show Attributes of an Exported Directory. » When prompted, provide the name of the exported maintenance directory. » When prompted, specify version 3. » In the dialogue panel, under Security method 1, add your LPAR IP address to the list (comma or colon delimited) next to Hosts allowed root access. __ 5. Open a terminal emulation window using telnet protocol to connect to your assigned LPAR. Log in as root. __ 6. Check to see if the exported maintenance directory is already mounted to your /mnt directory mount point, with read-only access. If not, then mount it. » The suggested commands are: » # mount » If not already mounted: » # mount -o ro :/export/AIX_7100-02-02 /mnt __ 7. Identify the current level of the AIX base operating systems (BOS), including the technology level and the service pack. » The suggested commands are: » # oslevel -s 7100-02-01-1245 __ 8. Verify that hdisk1 is not part of an existing volume group. If it is, remove hdisk1 from that volume group, specifying that any allocated logical volumes be deleted. » The suggested commands are: » # lspv » (If necessary): # reducevg -d hdisk1 © Copyright IBM Corp. 2009, 2013

Exercise 19. Advanced install techniques

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

19-3

Student Exercises with hints

__ 9. Use the alt_disk_copy command to create a clone on hdisk1. Update the clone with all of the AIX 7.1 TL2 SP2 maintenance as it is being created. Notify your instructor that you have initiated the alternate disk copy operation. The cloning followed by application of maintenance could take anywhere from a few minutes up to almost an hour, depending on the type of disk storage being used. If setup properly, it should run fairly quickly (15 minutes in our development lab). While you are waiting, your instructor may direct you either to continue with the next part of the exercise, to continue with lecture and discussion, or to take a break. » The suggested commands are: » # alt_disk_copy -b update_all -l /mnt -d hdisk1 » If you receive an error message stating that the disk might not be bootable, use the -g flag to override the check. Ignore any /dev/ipldevice and bosboot errors. __ 10. When the alternate rootvg has been created, display the physical volumes and their associated volume groups. Is the target disk of the alt_disk_copy operation identified as the alternate rootvg? _________________________________________ » The suggested commands are: » # lspv hdisk0 hdisk1

00c07f6f584cd485 00c07f6f820feea0

rootvg active altinst_rootvg

» The target disk now is identified as belonging to the altinst_rootvg volume group. __ 11. Also display the normal boot list. Is the active or alternate rootvg listed as the first boot device? ____________________________________________________ » The suggested commands are: » # bootlist -o -m normal hdisk1 blv=hd5 pathid=0 » The normal bootlist has been changed to have the altinst_rootvg disk as the only device in the list. __ 12. If the bootlist does not have the alternate rootvg disk as the first boot device, change it to boot off of the alternate rootvg. » The suggested commands are: » (If needed:) # bootlist -m normal hdisk# __ 13. Reboot your system in a safe manner. » The suggested command is: » # shutdown -Fr

19-4 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 14. After the reboot is completed, log back into your LPAR as the root user, and verify that the level of the BOS is at the applied TL and SP level. » The suggested commands are: » # oslevel -s 7100-02-02-1316 __ 15. List the physical volumes. What are the associated volume groups? Did they change? » The suggested commands are: » # lspv hdisk0 hdisk1

00c07f6f584cd485 00c07f6f820feea0

old_rootvg rootvg

active

» In the hint example, the volume group name for hdisk0 has been changed from rootvg to old_rootvg, while the volume group name for hdisk1 has been changed from altinst_rootvg to rootvg. __ 16. Change the bootlist back to using the original boot logical volume and safely reboot the LPAR. » The suggested commands are: # bootlist -m normal hdisk# (where hdisk# is the original rootvg disk) # shutdown -Fr __ 17. Reconnect and log back into the logical partition as the root user. Confirm that the operating system is back to the older level. » The suggested command is: » # oslevel -s

© Copyright IBM Corp. 2009, 2013

Exercise 19. Advanced install techniques

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

19-5

Student Exercises with hints

Part 2: Creating and working with a standby BOS using multibos __ 18. The alternate BOS creation will involve cloning the rootvg file systems and other logical volumes. We need to ensure that there is enough space on the disk holding the rootvg to receive all of the system defined logical volumes that will be cloned. Extending the volume group and configuring multibos to use an additional disk is non-trivial. For the rootvg, determine the amount of space used and the amount of space free. Record the values here (both in the number of physical partitions and in units of megabytes): ________________________________________________________________ If there is not more free space than the amount of used space in the rootvg, contact your instructor.

» The suggested command is: » # lsvg rootvg __ 19. Create and then mount a user defined enhanced file system (JFS2) in the rootvg which is one logical partition in size and then mount that file system. The default mount point directory should be: /userfs. OR » The suggested commands are: » # crfs -v jfs2 -g rootvg -a size=1 –m /userfs »# mount /userfs OR »# smit jfs2 » Select Add an Enhanced Journaled File System. Then select rootvg off of the volume group list. Add an Enhanced Journaled File System [TOP] Volume group name SIZE of file system Unit Size * Number of units * MOUNT POINT

[Entry Fields] rootvg 512bytes [1] [/userfs]

+ #

(accept the defaults for the other fields) » # mount /userfs

19-6 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

__ 20. Create some files in the new file system. » The suggested commands are: # cd /userfs # touch this will create five files # cd __ 21. Create a standby BOS and extend file systems as needed. Notify your instructor that you have initiated the creation of the standby BOS. This could take between 5 and 15 minutes to complete (It could take longer if the lab has not been setup to avoid disk contention problems, or it could just a few minutes if using a fibre channel accessed cached storage subsystem). Your instructor may direct you on how to spend the time while waiting, such as taking a break. » The suggested commands are: # multibos -p -Xs # multibos -Xs __ 22. When the standby BOS creation is completed, display the logical volumes in the rootvg. What do you new file systems? Are they mounted? ______________________________________________________________ ______________________________________________________________ ______________________________________________________________ » The suggested commands are: » # lsvg -l rootvg rootvg: LV NAME hd5 hd6 hd8 hd4 hd2 hd9var hd3 hd1 hd10opt hd11admin fslv00 fslv01 bos_hd5 bos_hd4 bos_hd2 bos_hd9var bos_hd10opt

TYPE boot paging jfs2log jfs2 jfs2 jfs2 jfs2 jfs2 jfs2 jfs2 jfs2 jfs2 boot jfs2 jfs2 jfs2 jfs2

LPs 1 4 1 4 34 2 3 2 1 1 1 1 1 4 34 2 1

PPs 1 4 1 4 34 2 3 2 1 1 1 1 1 4 34 2 1

PVs 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

LV STATE closed/syncd open/syncd open/syncd open/syncd open/syncd open/syncd open/syncd open/syncd open/syncd open/syncd closed/syncd open/syncd closed/syncd closed/syncd closed/syncd closed/syncd closed/syncd

MOUNT POINT N/A N/A N/A / /usr /var /tmp /home /opt /admin /data /userfs N/A /bos_inst /bos_inst/usr /bos_inst/var /bos_inst/opt

» You should see new logical volumes with names prefixed with bos_. For the new logical volumes which are file systems, you should see that their default mount points are under the /bos_inst directory. © Copyright IBM Corp. 2009, 2013

Exercise 19. Advanced install techniques

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

19-7

Student Exercises with hints

» The closed state for the standby BOS file systems indicates that they are not mounted. __ 23. Was there a new copy of your user defined file system in the standby BOS? ______ ________________________________________________________________ » Your should see that your user defined file system is available, but it is the same logical volume rather than a unique copy related to the standby BOS. __ 24. Display the normal bootlist. How does this differ from what you displayed prior to standby BOS creation? ____________________________________________ ______________________________________________________________ » The example command and output is: »# bootlist -o -m normal hdisk0 blv=bos_hd5 hdisk0 blv=hd5 » You will notice that the standby BOS have been established as the first boot device. If this is not what is desired, the multibos command has an option to suppress making this automatic change. __ 25. Mount the standby BOS. and then display what file systems are mounted. What is the path to the mount points of the standby BOS unique file system? _____________________________________________________________ » The suggested commands are: # multibos -m # mount node mounted -------- --------------/dev/hd4 /dev/hd2 /dev/hd9var /dev/hd3 /dev/hd1 /dev/hd11admin /proc /dev/hd10opt /dev/fslv01 /dev/bos_hd4 /dev/bos_hd2 /dev/bos_hd9var /dev/bos_hd10opt

mounted over --------------/ /usr /var /tmp /home /admin /proc /opt /userfs /bos_inst /bos_inst/usr /bos_inst/var /bos_inst/opt

vfs -----jfs2 jfs2 jfs2 jfs2 jfs2 jfs2 procfs jfs2 jfs2 jfs2 jfs2 jfs2 jfs2

date options ------------ --------------Apr 14 12:05 rw,log=/dev/hd8 Apr 14 12:05 rw,log=/dev/hd8 Apr 14 12:06 rw,log=/dev/hd8 Apr 14 12:06 rw,log=/dev/hd8 Apr 14 12:06 rw,log=/dev/hd8 Apr 14 12:06 rw,log=/dev/hd8 Apr 14 12:06 rw Apr 14 12:06 rw,log=/dev/hd8 Apr 14 12:14 rw,log=/dev/hd8 Apr 14 15:29 rw,log=/dev/hd8 Apr 14 15:29 rw,log=/dev/hd8 Apr 14 15:29 rw,log=/dev/hd8 Apr 14 15:29 rw,log=/dev/hd8

» The file systems under the /bos_inst directory are now mounted. __ 26. Change your current working directory to the root of the standby BOS unique file systems, and then create a new directory called special in the standby BOS /bos_inst/usr file system. Create some files in /bos_inst/usr/special and then change your working directory back to the active BOS root directory.

19-8 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

» The suggested commands are: # # # # #

cd /bos_inst/usr mkdir special cd special touch this should create eight files in the directory cd /

__ 27. Unmount the standby BOS. » The suggested command is: » # multibos -u __ 28. Display the directories under the active BOS /usr directory. Is the new special directory there? ______________________________________________ » The suggested command is: » # ls /usr » The special directory is not shown. This illustrates how customizations of a mounted standby BOS do not affect the active BOS. __ 29. Start a standby BOS shell. In the shell, list the directories under the /usr directory. Then exit the shell. Was the directory called special shown? ________________________________________________________________ » The suggested commands are: # multibos -S MULTIBOS> ls /usr/special MULTIBOS> exit » You should notice that the special directory is not only there, but that it has a path of /usr/special, rather than a path of /bos_inst/user/special. This is because of the chroot environment created for this special multibos shell. » Reboot your LPAR. The suggested command is: » # shutdown -Fr __ 30. __ 31. Display what is mounted. What logical volumes are now mounted to the standard BOS defined file systems’ mount points? _______________________________ ______________________________________________________________ ______________________________________________________________ » The suggested commands are:

© Copyright IBM Corp. 2009, 2013

Exercise 19. Advanced install techniques

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

19-9

Student Exercises with hints

» # mount node mounted -------- --------------/dev/bos_hd4 /dev/bos_hd2 /dev/bos_hd9var /dev/hd3 /dev/hd1 /proc /dev/bos_hd10opt /dev/hd11admin

mounted over --------------/ /usr /var /tmp /home /proc /opt /admin

vfs -----jfs2 jfs2 jfs2 jfs2 jfs2 procfs jfs2 jfs2

date -----------Apr 14 15:48 Apr 14 15:48 Apr 14 15:48 Apr 14 15:48 Apr 14 15:49 Apr 14 15:49 Apr 14 15:49 Apr 14 15:49

options --------------rw,log=/dev/hd8 rw,log=/dev/hd8 rw,log=/dev/hd8 rw,log=/dev/hd8 rw,log=/dev/hd8 rw rw,log=/dev/hd8 rw,log=/dev/hd8

__ 32. Change the normal bootlist to have the original BOS first in the bootlist, and safely reboot your LPAR. (Be careful to use the correct logical device name for the disk where you created your standby BOS). » The example commands and output are: # bootlist -m normal hdisk0 blv=hd5 hdisk0 blv=bos_hd5 # bootlist -o -m normal hdisk0 blv=hd5 hdisk0 blv=bos_hd5 # shutdown -Fr __ 33. When the reboot is complete, reconnect to your LPAR and log back in as the root user.

19-10 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0 Student Exercises with hints

EXempty

Part 3: (Optional) Applying software maintenance to a standby BOS __ 34. Open a terminal emulation window using telnet protocol to connect to your assigned NIM server. Log in as root. __ 35. AIX 7.1 TL2 SP2 maintenance is stored on your NIM server in the /export/AIX_7100-02-02 directory. Verify that there are files under this directory. » # ls /export/AIX_7100-02-02 __ 36. Check to see if this maintenance directory has been NFS exported to allow read-only access (root access allowed) from your client LPARs, using standard AIX system authentications (sys). » # exportfs __ 37. If it has not been NFS exported, then setup the NFS export for this directory, with the characteristics described in the previous step. If it has been NFS exported, but your client LPAR does not have root access permission, then just add your LPAR to that permission list. Be sure to coordinate with the other students sharing this NIM server so you do not try to configure NFS at the same time. » If not yet NFS exported: » # smitty nfs » Select Network File System (NFS) > Add a Directory to Exports List. » On the dialog panel: Pathname of directory to export [/export/AIX_7100-02-02] . . . * Security method 1 [sys] + * Mode to export directory read-only + Hostname list. If exported read-mostly [] Hosts & netgroups allowed client access [] Hosts allowed root access [] » If exported, but your LPAR does not have root access permission: » # smitty nfs » Select Network File System (NFS) > Change / Show Attributes of an Exported Directory. » When prompted, provide the name of the exported maintenance directory. » When prompted, specify version 3. » In the dialogue panel, under Security method 1, add your LPAR IP address to the list (comma or colon delimited) next to Hosts allowed root access.

© Copyright IBM Corp. 2009, 2013

Exercise 19. Advanced install techniques

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

19-11

Student Exercises with hints

__ 38. If you do not already have a session with your assigned client LPAR, open a terminal emulation window using telnet protocol to connect to your assigned LPAR. Log in as root. __ 39. Mount the exported maintenance directory to your /mnt directory mount point, with read-only access. » The suggested command is: » # mount -o ro :/export/AIX_7100-02-02 /mnt __ 40. Identify the current level (including TL and SP) of the AIX base operating system (BOS). ___________________________________________________________ » The suggested commands are: » # oslevel -s 7100-02-01-1245 __ 41. Perform a customized update of the software in the standby BOS and extend file systems as needed. Apply maintenance to update the BOS to AIX 7.1 TL2 SP2. First run in preview mode; then, run it to actually create the standby BOS. Notify your instructor that you have initiated the creation of the standby BOS. This could take between 9 and 20 minutes to complete (It could take longer if the lab has not been setup to avoid disk contention problems, or it could just a few minutes if using a fibre channel accessed cached storage subsystem). » The suggested commands are: # multibos -p -Xca -l /mnt # multibos -Xca -l /mnt __ 42. Start a standby BOS shell. In the shell, display the OS level including the technology level and service pack. Was update effective? When done, exit the shell. ________________________________________________________________ » The suggested commands are: # multibos -S MULTIBOS> oslevel -s MULTIBOS> exit » You should see that the standby bos now has the newer level.

End of exercise

19-12 AIX Jumpstart

© Copyright IBM Corp. 2009, 2013 Course materials may not be reproduced in whole or in part without the prior written permission of IBM.

V8.0

backpg

Back page

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF