Vous êtes sur la page 1sur 178

HP-UX Boot Camp

Lab guide

Rev. 14.21
HP Confidential For training purposes only

Use of this material to deliver training without prior written permission from HP is prohibited.
Copyright 2014 Hewlett-Packard Development Company, L.P.
The information contained herein is subject to change without notice. The only warranties for
HP products and services are set forth in the express warranty statements accompanying
such products and services. Nothing herein should be construed as constituting an additional
warranty. HP shall not be liable for technical or editorial errors or omissions contained herein.
This is an HP copyrighted work that may not be reproduced without the written permission of
HP. You may not use these materials to deliver training to any person outside of your
organization without the written permission of HP.
Microsoft and Windows are U.S. registered trademarks of Microsoft Corporation. Oracle and
Java are registered trademarks of Oracle and/or its affiliates. UNIX is a registered trademark
of The Open Group.
Printed in the USA
HP-UX Boot Camp
Lab guide
May 2014
HP Confidential For training purposes only
Contact HP Education for customer training materials.
Contents

Lab 0Using the HP Virtual Lab


Objectives ...................................................................................................... 1
Requirements .................................................................................................. 1
Accessing the HP Virtual Lab environment ........................................................... 2
HPVL equipment layout ................................................................................... 10
Exiting the HPVL ............................................................................................. 11
Using the breakout room and sub-conference line ...............................................12

Module 1 labNavigating the file system and shell basics


Objectives ...................................................................................................... 1
Requirements .................................................................................................. 1
Navigating the HP-UX file system ....................................................................... 2

Module 2 labFile and directory manipulation, permissions, and access


Objectives ...................................................................................................... 1
Requirements .................................................................................................. 1
Exercise 1File manipulation ........................................................................... 2
Exercise 2Directory manipulation ................................................................... 8
Exercise 3Scavenger hunt (optional) .............................................................. 11
Exercise 4File permissions and access ............................................................13
Directory permissions ................................................................................13
Changing ownership and group ................................................................16
Exercise 5Adding and deleting text and moving the cursor .............................. 19
Exercise 6Modifying text ............................................................................. 24

Module 3 labExploring the system hardware


Objectives ...................................................................................................... 1
Requirements .................................................................................................. 1
Introduction ..................................................................................................... 1
Exercise 1Exploring your system configuration ................................................. 2
Exercise 2Legacy and Agile View hardware addressing .................................... 4
Exercise 3Viewing devices via the SMH .......................................................... 7
Exercise 4Configuring SMH for secure web connection ..................................... 8
Exercise 5Exploring QuickSpecs (optional) ...................................................... 9
Exercise 6Viewing and Interpreting Device Files ............................................. 10

Rev. 14.21 HP Confidential For training purposes only i


HP-UX Boot Camp

Module 4 labConfiguring and managing disks with LVM


Objectives ...................................................................................................... 1
Requirements .................................................................................................. 1
Introduction ..................................................................................................... 1
Exercise 1Creating Physical Volumes, Volume Groups, and Logical Volumes ........ 3
Exercise 2Extending, reducing, and removing LVs, PVs, and VGs ....................... 6
Exercise 3Exploring the SMH fsweb interface (optional) .................................. 10

Module 5 labConfiguring and managing LVM boot disks on Integrity


servers
Objectives ...................................................................................................... 1
Requirements .................................................................................................. 1
IntroductionMirroring an HP Integrity LVM boot disk ......................................... 2
Exercise 1Configuring the mirrors partition table ............................................. 3
Exercise 2Populating the mirrors system partition ............................................. 5
Exercise 3Populating the mirrors OS partition .................................................. 6
Exercise 4Adding the mirror to the EFI boot manager menu ............................... 8
Exercise 5Changing the primary swap volumes consistency recovery policy ....... 9
Exercise 6Booting from the new mirror .......................................................... 10

Module 6 labBooting Integrity systems and using iLO and EFI file system
Objectives ...................................................................................................... 1
Requirements .................................................................................................. 1
Introduction ..................................................................................................... 1
Exercise 1Shutting down the system ................................................................ 2
Exercise 2Interacting with the EFI Boot Manager .............................................. 4
Exercise 3Interacting with the HPUX kernel loader ...........................................17

Module 7 labRecovering LVM disks and structures


Objectives ...................................................................................................... 1
Requirements .................................................................................................. 1
Introduction ..................................................................................................... 1
Exercise 1Performing the preliminary steps ...................................................... 2
Exercise 2Rebuilding missing /etc/lvmtab or /etc/lvmtab_p files ............. 4
Exercise 3Accessing a volume group containing failed disks.............................. 6
Exercise 4Replacing a failed disk ................................................................. 10
Exercise 5Restoring logical volumes ...............................................................12
Exercise 6Cleaning up .................................................................................14
Exercise 7Resetting the root password ............................................................15

ii HP Confidential For training purposes only Rev. 14.21


Contents

Module 8 labCreating and managing DRD clones


Objectives ...................................................................................................... 1
Requirements .................................................................................................. 1
Introduction ..................................................................................................... 1
ExerciseCreating and managing DRD clones ................................................... 2

Module 9 labManaging software with SD-UX


Objectives ...................................................................................................... 1
Requirements .................................................................................................. 1
Exercise 1Preparing to use SD-UX ................................................................... 2
Exercise 2Listing installed software ................................................................. 3
Exercise 3Installing and removing software ...................................................... 5
Exercise 4Completing preliminary steps for installing patches ............................ 7
Exercise 5Installing and removing patches ....................................................... 8
Exercise 6Installing and removing patches with applications ............................. 11
Exercise 7Committing patches.......................................................................13

Module 10 labWorking with HP-UX services


Objectives ...................................................................................................... 1
Requirements .................................................................................................. 1
Exercise 1Exploring the startup/shutdown scripts .............................................. 2
Exercise 2Starting and stopping services ......................................................... 5
Exercise 3Enabling, disabling, and configuring services .................................... 7

Module 12 labConfiguring and troubleshooting network connectivity


Objectives ...................................................................................................... 1
Requirements .................................................................................................. 1
Introduction ..................................................................................................... 1
Exercise 1Performing the preliminary steps ...................................................... 2
Exercise 2Configuring a LAN interface ........................................................... 3
Exercise 3Checking the new configuration ...................................................... 11
Exercise 4Troubleshooting network connectivity ...............................................12
Performance ............................................................................................12
New system disrupts LAN ..........................................................................13
Determining interface name.......................................................................13
Multiple LAN interfaces, intermittent failures ................................................13
New system cant reach some subnets ........................................................14
Configuring address 127.0.0.1 ...................................................................14
Displaying station address .........................................................................14
Resetting LAN card ..................................................................................15
Tracing ...................................................................................................15

Rev. 14.21 HP Confidential For training purposes only Contents iii


HP-UX Boot Camp

Intermittent networking problems ................................................................16


No such interface in boot logs ................................................................16
No such interface report by ifconfig ...................................................16
Plumbing error ......................................................................................16
Cant communicate outside local supernet ...................................................17

Module 13 labInstalling the OS with Ignite-UX


Objectives ...................................................................................................... 1
Requirements .................................................................................................. 1
Exercise 1Rebooting the Integrity server .......................................................... 2
Exercise 2Selecting the boot path to boot from the Ignite-UX server .................... 4

iv HP Confidential For training purposes only Rev. 14.21


Using the HP Virtual Lab
Lab 0

Objectives
After completing this lab, you should be able to:
Access the HP Virtual Lab (HPVL) environment
Identify the components in HPVL for course exercises
Exit the HPVL environment
Enter your assigned breakout room

Requirements
To complete this lab, you will need:
Internet access to the HPVL equipment at: http://www.hp.com/go/hpvl
Login credentials provided by your instructor

Note
Installing the web browser plug-ins might require administrative credentials on
your local system.

Rev. 14.21 HP Confidential For training purposes only L0 1


HP-UX Boot Camp

Accessing the HP Virtual Lab environment


To access the HPVL:
1. Start a supported web browser and access the main HPVL page by typing
http://www.hp.com/go/hpvl in the address field. Then, click the Access
Virtual Lab Environment link on that page.

L0 2 HP Confidential For training purposes only Rev. 14.21


Using the HP Virtual Lab

2. In the HPVL Access Portals field, type the HPVL username received from your
instructor and click Logon to access the appropriate virtual lab for your class.

Note
You might have to click Continue to accept a security alert.

3. The HPVL Access screen displays, with your HPVL username. Add the password
supplied by your instructor and click the Logon button.

Rev. 14.21 HP Confidential For training purposes only L0 3


HP-UX Boot Camp

4. Connecting to the HPVL requires you to install one or two plug-ins (depending
on your browser and if you have previously accessed the HPVL).
When prompted, click Install.

Note
Depending on your browser, the plug-ins might require that you close and restart
your web browser.

5. The HP Virtual Lab Welcome page displays. Click the Terminal Servers icon on
the left.

L0 4 HP Confidential For training purposes only Rev. 14.21


Using the HP Virtual Lab

6. In the upper right side of the screen, click Options.

7. From the drop-down list, select your preferred screen resolution, color depth, or
optional Disable local drive access.

Rev. 14.21 HP Confidential For training purposes only L0 5


HP-UX Boot Camp

8. Click the Home link (the name might vary) to return to the welcome screen.

9. From the HP Virtual Lab Welcome page, in the Terminal Servers section, click the
HPVL Access Windows RDP web client (Full Functionality) link (the name might
vary).

L0 6 HP Confidential For training purposes only Rev. 14.21


Using the HP Virtual Lab

10. From the Choose a Lab Group page, click the link for your instructor-assigned
lab group in the list.

Your assigned HPVL lab group page displays.

Top section of the lab group page

Rev. 14.21 HP Confidential For training purposes only L0 7


HP-UX Boot Camp

11. Read the information provided on the lab group page and note the username
and password for each access method.

Important
! Two levels of access permissions will be required through the training. Root
access permissions are displayed on the HPVL page. User level access requires
the username assigned to you by your instructor (such as user1 or user2). The
password for the user level access is blank at the password prompt, press Enter
to log in.

12. To log into the System Console of your landing server through the Management
Processor, use the Connect to MP button on the HPVL Lab Group page.

13. At the terminal window, enter credentials found on the HPVL Lab Group page.
To finish MP session, type exit at UNIX prompt and use MP menu to exit the
session.

14. To connect to the landing server using the SSH protocol, use the Connect to Host
button. At the terminal window, use login credentials required by the Lab Guide.
Type exit to close the session.
L0 8 HP Confidential For training purposes only Rev. 14.21
Using the HP Virtual Lab

15. To connect to the iLO or SMH web-based management pages, use the Connect
to iLO or Connect to SMH buttons.
16. Internet Explorer window will open. To proceed, select Continue to this website
(not recommended).

17. At the next screen, enter the credentials provided at the HPVL Lab Group page
and click Sign In to log into the iLO interface. To finish the iLO session, close the
browser window.

Rev. 14.21 HP Confidential For training purposes only L0 9


HP-UX Boot Camp

HPVL equipment layout

Each lab group has one rx2660 Integrity server. Management connectivity is
provided by the management network. Student LAN provides with IP connectivity and
System Management Homepage. The build network will be used during the HP-UX
installation lab.

L0 10 HP Confidential For training purposes only Rev. 14.21


Using the HP Virtual Lab

Exiting the HPVL


To exit the HPVL environment:
1. At the end of each day or when your lab work is complete, close all open
terminal sessions.
2. To log out of the HPVL lab group, click the Exit Lab button at the bottom of the
lab group information page.

Rev. 14.21 HP Confidential For training purposes only L0 11


HP-UX Boot Camp

Using the breakout room and sub-conference line


Your instructor will assign you a lab group number and you will share that lab group
with your partner for all lab exercises.
After assigning your lab group number, your instructor will move you and your
partner to your assigned breakout room (usually the same number as your lab
group). A new HP Virtual Room window will open where you can have private
communication with your partner as you work on the lab activities. In the breakout
room, you can share:
Your primary desktop
A region of the desktop
Applications
To use the breakout room:
1. To enter the breakout room, right click your assigned breakout room, and click
Go To Room.
2. From your assigned HP Virtual Room, click Share and select what you want to
share with your partner.

L0 12 HP Confidential For training purposes only Rev. 14.21


Using the HP Virtual Lab

3. If you want to give control of the screen to your lab partner, from the Sharing in
Progress tool bar, click Transfer, select the name of your partner, and click
Assign.

4. Your partner then receives an invitation to Accept Remote Control. He or she


accepts this invitation by clicking Yes.

You should also use your assigned sub-conference phone line, which usually has the
same number as your lab group number, to speak with your partner. In your lab
group sub-conference, you have private communication with your lab partner.

Note
Your instructor might ask you to return to the main conference room for an
important discussion. The instructor can also join your breakout room and
sub-conference line for support or review purposes.

Rev. 14.21 HP Confidential For training purposes only L0 13


HP-UX Boot Camp

5. Use your active phone communication to enter the sub-conference line. Press *9
and then press the number of your assigned sub-conference line followed by the
# key.
Example
To use the sub-conference line for breakout room 5, you would press *95# on
your phone.
6. To return to the main conference line, also called breakout room 0, press *9.

L0 14 HP Confidential For training purposes only Rev. 14.21


Navigating the file system and shell basics
Module 1 lab

Objectives
After completing this lab, you should be able to navigate through the HP-UX file
system, create, remove, and list the content of directories.

Requirements
To complete this lab, you will need:
Credentials to access HPVL
Credentials for user level SSH access to one Integrity server (assigned by your
instructor).

Rev. 14.21 HP Confidential For training purposes only L1 1


HP-UX Boot Camp

Navigating the HP-UX file system


In the following Lab, you will questions with answers. Use answers provided as a
guide, since results on your server might be different.
1. Login to the HPVL.
2. Click Connect To Host button on your HPVL Labgroup page.
3. At the login prompt, type user1 or user2 (depending on what your instructor
assigned you) and press Enter.
4. Press Enter at the password prompt.
5. What is the name of your HOME directory?
Answer
Log in and then issue the pwd command. It should display something similar to
/home/YOUR_USER_NAME.
6. From your HOME directory, find out the entire tree structure rooted at the
subdirectory called tree using the ls command. Draw a picture of it, marking
directories by circling them. Use a separate sheet of paper if you need more
space
Answer
The exercise consists of a lot of ls (lsf) commands. Or, as an alternative, you
could have used the -R (recursive) option (ls lR | more). The directory map
should look similar to:
tree/
|
-----------------------------------------------------------------
| | | | | | |
cherry car.models/ collie probe dog.breeds/ poodle taurus
| |
-------------- -------------------
| | | | |
chrysler/ gm/ ford/ retriever/ shepherd/
| |
---------- -----------------------------
| | | | |
sedan/ sports/ golden labrador mixed
|
mustang

7. What is the full path name of the file labrador in the tree drawing from the
previous exercise? What is its relative path name from your HOME directory?
Answer
Full path name:
/home/YOUR_USER_NAME/tree/dog.breeds/retriever/labrador
Relative path name: tree/dog.breeds/retriever/Labrador

L1 2 HP Confidential For training purposes only Rev. 14.21


Navigating the file system and shell basics

8. From your HOME directory, change into the retriever directory. Using a
relative path name, change into the shepherd directory. Again, using a
relative path name, change into the car.models directory. Finally, return to
your HOME directory. What commands did you use? How did you know if you
arrived at each of your destinations?
Answer
$ cd
$ cd tree/dog.breeds/retriever
$ cd ../shepherd
$ cd ../../car.models
$ cd

To verify each destination:


$ pwd

9. Create a directory in your HOME directory called junk. Make that directory
your current working directory. What commands did you use? What is the full
path name of this new directory?
Answer
$ cd
$ mkdir junk
$ cd junk
$ pwd
/home/YOUR_USER_NAME /junk

10. From your HOME directory, make these directories with a single command line:
junk/dirA/dir1
junk/dirA
junk/dirA/dir2
junk/dirA/dir1/dirc
Did you have any problems? If you encounter any problems, before trying
again, remove any directories created as a result of your effort. What single
command did you use?
Answer
$ mkdir junk/dirA junk/dirA/dir1 junk/dirA/dir2
junk/dirA/dir1/dirc

or
$ mkdir -p junk/dirA/dir1/dirc junk/dirA/dir2

If you entered the directory names in the order in which they are presented in
the exercise, it will fail, because the command executes the arguments from left
to right.

Rev. 14.21 HP Confidential For training purposes only L1 3


HP-UX Boot Camp

11. From your HOME directory, obtain a directory listing of the directory dirA under
the junk directory. Use both relative and absolute path names. What
commands did you use?
Answer
$ ls junk/dirA
$ ls /home/YOUR_USER_NAME/junk/dirA

12. From your HOME directory, using only the rmdir command, remove all
subdirectories under the directory junk. How is this accomplished using a
single rmdir command?
Answer
$ rmdir junk/dirA/dir1/dirc
$ rmdir junk/dirA/dir1
$ rmdir junk/dirA/dir2
$ rmdir junk/dirA
$ rmdir junk/dirA/dir1/dirc junk/dirA/dir1 junk/dirA/dir2
junk/dirA
$ rmdir R junk (if you want to use single command)

13. Return to your HOME directory. With one command, display a long listing of the
files cp and vi (from the /usr/bin directory). Try to use both absolute and
relative path names.
Answer
$ cd
$ pwd
/home/YOUR_USER_NAME

$ ls -l /usr/bin/cp /usr/bin/vi Absolute path names


$ ls -l ../../usr/bin/cp ../../usr/bin/vi Relative path names

L1 4 HP Confidential For training purposes only Rev. 14.21


File and directory manipulation, permissions,
and access
Module 2 lab

Objectives
After completing this lab, you should be able to:
Display content of the file, copy, rename and delete files, and directories
Change permissions, group and owner of files and directories
Add and delete text and navigate through open files using the vi editor
Modify text using the vi editor

Note
There are sections of exercises to complete. You will find all necessary files in
HOME folder of the user assigned to you for this lab. Run the commands
necessary to solve the exercises and answer the associated questions. Time may
not allow you to complete all exercises.

Requirements
To complete this lab, you will need:
Credentials to access HPVL
One properly configured HP Integrity server (assigned by your instructor)
Username and password for HP-UX access for regular user access to the system
for each student (assigned by your instructor)
File named tst found in your HOME directory to start using the vi editor

Rev. 14.21 HP Confidential For training purposes only L2 1


HP-UX Boot Camp

Exercise 1File manipulation


Perform these steps:
1. In your HOME directory, use the cat command to display the contents of the file
funfile. What do you notice? What alternate command provides scrolling
control when displaying the contents of a file?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ cat funfile

The file is too long for one screen. The more command provides screen scrolling
control. For example:
$ more funfile

2. Use the more command to display the contents of the directory called tree.
What do you notice? What command do you use to see the contents of a
directory?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ more tree
****** tree is a directory ******

more knows that tree is a special directory file, not a normal text file, so its
contents cannot be displayed to the screen in a readable format. You use the ls
command to display the contents of a directory.
Example:
$ ls tree

L2 2 HP Confidential For training purposes only Rev. 14.21


File and directory manipulation, permissions, and access

3. Use the more command to display the file /usr/bin/ls. What do you notice?
Display the contents of /usr/bin/ls with the cat command. What happens?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
In an HP-UX environment:
$ more /usr/bin/ls
****** /usr/bin/ls: Not a text file ******

more recognizes that /usr/bin/ls is a binary file, not an ASCII text file, so
its contents cannot be displayed to the screen in a readable format.
$ cat /usr/bin/ls

Viewing a binary file with the cat command may change your terminal settings.
If using a putty terminal emulator:
Press Return to restore the terminal session.
If using an HP terminal or terminal window:
Hit the Break key.
Simultaneously press Shift + Ctrl + Reset.
Press Return to get the shell prompt.
At the prompt, type the commands:
$ tset -e k -e: sets erase to ^H, -k: sets kill to ^X
$ tabs

4. Go to your HOME directory. Copy the file called names to a file called names.cp.
List the contents of both files to verify that their contents are the same.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ ll names*
$ cp names names.cp
$ cat names names.cp

Rev. 14.21 HP Confidential For training purposes only L2 3


HP-UX Boot Camp

5. If the file names is modified, will it affect the file names.cp? Modify the file
names by copying the file funfile to the file names. What happened to the
file names and the file names.cp?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
The files names and names.cp are individual entities. The content of names
was overwritten with the content of the file funfile. The file names.cp is not
affected.
$ cp funfile names
$ more names names.cp
names now contains the same contents as funfile, while names.cp still
contains the content that was in names.

6. How do you restore the file names? Issue the command to restore names.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
To restore the contents of the file names, copy or move from the file names.cp.
$ cp names.cp names
or
$ mv names.cp names

7. Make another copy of the file names called names.new. Change the name of
names.new to names.orig.

.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ cp names names.new
$ mv names.new names.orig

L2 4 HP Confidential For training purposes only Rev. 14.21


File and directory manipulation, permissions, and access

8. How do you create two files (called names.2nd and names.3rd) that reference
the contents of the file names?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ ln names names.2nd
$ ln names names.3rd or $ln names.2nd names.3rd

Note the inode numbers are the same for the linked files.

rx26-413[/home/user1]#ll -i names*
87 -rw-rw---- 3 user1 class 61 Nov 12 1993 names
87 -rw-rw---- 3 user1 class 61 Nov 12 1993 names.2nd
87 -rw-rw---- 3 user1 class 61 Nov 12 1993 names.3rd
1977 -rw-r----- 1 user1 sshd 61 Apr 1 12:32 names.cp
1978 -rw-r----- 1 user1 sshd 61 Apr 1 12:40 names.orig

9. If you modify the contents of names, will the contents of names.2nd and
names.3rd be affected? Copy the file funfile to the file names, and do a
long listing of all your names files. Is names.orig affected? names.2nd?
names.3rd?

.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................

Answer:
The files names, names.2nd, and names.3rd are all referencing the same
data on the disk. If one is modified, all three will be modified. From the long
listing, you see that their link count has gone up to three, since there are now
three names referencing the same data. names.orig is still an individual entity,
as seen by its link count still being one.
$ cp funfile names
$ ls -l names.orig names names.2nd names.3rd
-rw-r--r-- 1 user3 class 37 Jul 24 11:06 names.orig
-rw-r--r-- 3 user3 class 125 Jul 24 11:08 names
-rw-r--r-- 3 user3 class 125 Jul 24 11:10 names.2nd
-rw-r--r-- 3 user3 class 125 Jul 24 11:12 names.3rd
Rev. 14.21 HP Confidential For training purposes only L2 5
HP-UX Boot Camp

If you do an ls -i of the names files, their inode numbers will be


displayed. The inode stores each file's characteristics, such as permissions,
number of links, and ownership. Files that are linked together share the same
inode.
$ ls -i names.orig names names.2nd names.3rd
102 names.orig
322 names
322 names.2nd
322 names.3rd

10. Remove the file names. What happens to names.2nd and names.3rd?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ rm names

The files names.2nd and names.3rd are unaffected except that their link
count will be reduced by one, which can be seen with the ls -l command:
$ ls -l names.orig names names.2nd names.3rd
names not found
-rw-r--r-- 1 user3 class 37 Jul 24 11:06 names.orig
-rw-r--r-- 2 user3 class 125 Jul 24 11:10 names.2nd
-rw-r--r-- 2 user3 class 125 Jul 24 11:12 names.3rd

11. Use the interactive option for rm to remove names.2nd and names.3rd.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ rm -i names.2nd names.3rd
names.2nd? y
names.3rd? y
$

L2 6 HP Confidential For training purposes only Rev. 14.21


File and directory manipulation, permissions, and access

12. Copy the file names.orig back to names.


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ cp names.orig names

Rev. 14.21 HP Confidential For training purposes only L2 7


HP-UX Boot Camp

Exercise 2Directory manipulation


Perform these steps:
1. Make a directory called fruit under your HOME directory. With one command,
move the following files, which are also under your HOME directory, to the fruit
directory:
lime
grape
orange
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ cd
$ mkdir fruit
$ mv lime grape orange fruit

2. Move the following files, also found under your HOME directory, to the fruit
directory. Their destination names will be as specified below:

Source Destination
apple APPLE
peach Peach

.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ cd
$ mv apple fruit/APPLE
$ mv peach fruit/Peach
$

L2 8 HP Confidential For training purposes only Rev. 14.21


File and directory manipulation, permissions, and access

3. Look at the tree directory structure in your HOME directory. It requires a little
organization.
a. Move the files collie and poodle, so that they are under the dog.breeds
directory.
b. Move the file probe under the sports directory.
c. Move the file taurus under the directory sedan.
d. Create a new directory under tree, called horses.
e. Copy the mustang file to the horses directory you just created.
f. Move the file cherry to the fruit directory you created in the previous
exercise.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ cd
$ cd tree
$ pwd
/home/YOUR_USER_NAME/tree
$ mv collie poodle dog.breeds
$ mv probe car.models/ford/sports
$ mv taurus car.models/ford/sedan
$ mkdir horses
$ cp car.models/ford/sports/mustang horses
$ mv cherry ../fruit

Hint:
You can make these changes from any directory, but what directory do you think
you should be in?

Rev. 14.21 HP Confidential For training purposes only L2 9


HP-UX Boot Camp

4. Move the fruit directory from your HOME directory to the tree directory.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ cd
$ mv fruit tree

A directory called fruit is created under tree.

5. Make the fruit directory your current working directory. Move the files banana
and lemon to the fruit directory.

Hint:
Remember dot dot (..) represents the parent directory and dot (.) represents
your current directory.

Answer
$ cd
$ cd tree/fruit
$ mv ../../banana ../../lemon .

L2 10 HP Confidential For training purposes only Rev. 14.21


File and directory manipulation, permissions, and access

Exercise 3Scavenger hunt (optional)


Under your HOME directory, you will find the first clue for the scavenger hunt in the file
scaveng.README. The hunt will involve files and directories found in the scavenger
directory underneath the HOME directory. Underneath the scavenger directory are
north, south, east, and west subdirectories. Under these are 1_mile, 2_mile,
3_mile subdirectories. Clues are available under each of these directories to the
secret code word.
For example, if the clue is "go east 3 miles," you go to the east/3-mile
subdirectory where you will find a file called README. This file will give you the next
clue. You continue through the clues until you obtain the secret code word.
Good luck!
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................

Rev. 14.21 HP Confidential For training purposes only L2 11


HP-UX Boot Camp

Answer:
$ cd
$ more scaveng.README
north, 1 mile
$ cd scavenger
$ cd north/1_mile
$ more README
east, 2 miles
$ cd ../../east/2_mile
$ more README
You are on the right track!
south, 3 miles
$ cd ../../south/3_mile
$ more README
You have to keep going south, 2 miles
$ cd ../2_mile
$ more README
You are almost there west 1 mile
$ cd ../../west/1_mile
$ more README
CONGRATS You have found the end of the trail.
The code word is ________

L2 12 HP Confidential For training purposes only Rev. 14.21


File and directory manipulation, permissions, and access

Exercise 4File permissions and access


Directory permissions
Perform these steps:
1. Under your HOME directory, create a directory called mod5.dir. Copy the file
mod5.1 to mod5.dir. List the contents of the new directory. What are the
permissions on the mod5.dir?

Hint:
ls -ld mod5.dir

.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ cd
$ mkdir mod5.dir
$ cp mod5.1 mod5.dir
$ ls mod5.dir
mod5.1
$ ls -ld mod5.dir
drwxrwxrwx 3 YOUR_LOGNAME class 1024 Jul 24 13:13 mod5.dir
$

2. Modify the permissions on mod5.dir to be rw-------. Can you change


directory to mod5.dir? Can you display the contents of mod5.dir? Can you
access the contents of the file mod5.1 under the mod5.dir?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................

Rev. 14.21 HP Confidential For training purposes only L2 13


HP-UX Boot Camp

Answer:
$ chmod a-rwx,u+rw mod5.dir
$ cd mod5.dir
sh: mod5.dir: Permission denied
$ ls mod5.dir
mod5.1
$ ls -l mod5.dir/
mod5.dir/mod5.1 not found
total 0
$ cat mod5.dir/mod5.1
cat: cannot open mod5.dir/mod5.1: Permission denied
$

3. Modify the permissions on mod5.dir to be -wx------. Can you display the


contents of mod5.dir? Can you display the contents of the file mod5.1 under
the mod5.dir? Can you change directory to mod5.dir?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ chmod u+wx mod5.dir
$ ls mod5.dir
$ cat mod5.dir/mod5.1
This is the contents of mod5.1
$ cd mod5.dir cd is successful
$ pwd
/home/user3/mod5.dir
$ ls

L2 14 HP Confidential For training purposes only Rev. 14.21


File and directory manipulation, permissions, and access

4. Can other users copy files into your HOME directory? How do you display the
permissions for your HOME directory?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ cd
$ ls ld .
drwxr-xr-x 3 YOUR_USER_NAME class 1024 Jul 24 13:13 .

Other users can display the contents of your HOME directory, and change to your
HOME directory, but they cannot modify the contents of your HOME directory.
Therefore, other users cannot copy files to your HOME directory.

5. From your HOME directory, copy the file mod5.1 to the directory /usr/bin.
Did you have any problems? What are the permissions of /usr/bin?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ ls -ld /usr/bin
dr-xr-xr-x 3 bin other 1024 Jul 24 13:13 /usr/bin

Write access for others is not set on /usr/bin, so your copy should fail.

Rev. 14.21 HP Confidential For training purposes only L2 15


HP-UX Boot Camp

6. Can you copy the file /usr/bin/date to your HOME directory?


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ cd
$ ls -l /usr/bin/date
-r-xr-xr-x 1 bin bin 16384 Nov 15 13:13 /usr/bin/date
$ cp /usr/bin/date .

Since /usr/bin/date has read permission for others, you are able to make a
copy of the file.

Changing ownership and group


Perform these steps:
1. Look under your HOME directory. You should find a file that has the same name
as your login name. What access do you have to this file? What group does
your partner belong to? What access does your partner have to this file?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ ls -l YOUR_LOGNAME
-rw------- 1 YOUR_LOGNAME class 3967 Jan 24 13:13
YOUR_LOGNAME

You have read and write access. Your partner is also in the group class but has
no access to this file.

L2 16 HP Confidential For training purposes only Rev. 14.21


File and directory manipulation, permissions, and access

2. Still working with the file YOUR_LOGNAME, change the ownership of this file to
your partner. Can you access the file now? Try to make a copy of the file. Can
you get ownership back?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ ls -l YOUR_LOGNAME
-rw------- 1 YOUR_LOGNAME class 3967 Jan 24 13:13
YOUR_LOGNAME
You initially have read and write access.
$ chown partner_login_name YOUR_LOGNAME
$ ls -l YOUR_LOGNAME
-rw------- 1 partner class 3967 Jan 24 13:13 YOUR_LOGNAME

You no longer have access to this file.


You need a minimum of read access to copy a file, so you cannot make a
copy with the current permissions.
You are a member of the group class, but the group permissions are
disabled.
The only way you can get ownership back, is to have your partner chown the
file back to you. (Have you been nice to your partner?) You could also su to
your partner's account (if he or she will share his or her password) and chown
the file yourself.

3. Make a copy of mod5.1 and call it mod5.3. Remove all permissions from the
file mod5.3. Can you change the ownership of this file to your partner?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................

Rev. 14.21 HP Confidential For training purposes only L2 17


HP-UX Boot Camp

Answer:
$ cp mod5.1 mod5.3
$ chmod a-rwx mod5.3
$ chown partner mod5.3

You can change the ownership because the permissions are associated with
your access to the contents of the file, not the ownership and group identifiers
assigned to the file.

L2 18 HP Confidential For training purposes only Rev. 14.21


File and directory manipulation, permissions, and access

Exercise 5Adding and deleting text and moving


the cursor
Perform these steps:
1. Use vi to start an editing session on the file tst found in your HOME directory.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
$ vi tst

2. Insert the word only between the words will be.


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
Move cursor to the second line, type j or Return or 2G.
Move cursor to the last l in will, type ee or 2e or several ls.
Append text after the l, type a; type only or
Move cursor to the first b in be, type ww or 2w or several ls.
Insert text before the b, type i; type only.

3. Add the words many, many on the end of the line It will be used for.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
Go back to command mode, type Esc.
Move the cursor to the end of the line, type $.
Add (append) the text, a; enter text many, many.

Rev. 14.21 HP Confidential For training purposes only L2 19


HP-UX Boot Camp

4. Add a new blank line at the end of the file, and enter your name. DON'T PRESS
THE Esc!
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
Go back to command mode, type Esc.
Move cursor to the last line: G.
Open a new line below, o.
Type your name.

5. Using the Backspace, remove your name, and enter your partner's name.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
Backspace over the first name.
Type in your partner's name.

6. Open a new line at the top of your file. (Hint: O)


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
Go back to command mode, type Esc.
1GO

L2 20 HP Confidential For training purposes only Rev. 14.21


File and directory manipulation, permissions, and access

7. Enter 12345.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
12345

8. Backspace two times. Do any of the numbers disappear from your display?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
Backspace Backspace
The cursor will be under the 4. No characters disappear.

9. Enter 1234. What happens to the numbers that you backspaced over?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
The 4 and 5 will be typed over.

10. Backspace 3 times.


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
Backspace Backspace Backspace
The cursor is now under the second 2.

Rev. 14.21 HP Confidential For training purposes only L2 21


HP-UX Boot Camp

11. Press Esc. What happens to the characters you backspaced over? Where does
the cursor end up?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
The second 234 will disappear, and the cursor will back up so it is under the 1.

12. Type in 4 a's. How many a's appear? Why?


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
Three a's appear because the first a is taken to be the vi append command.

13. Backspace five times. What happens? Why?


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
You can only Backspace three times, because you have only entered 3 letters in
this input session.

14. Press Esc. What happens?


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
All a's you just entered disappear. You are back in command mode.

L2 22 HP Confidential For training purposes only Rev. 14.21


File and directory manipulation, permissions, and access

15. Quit your vi session saving the changes you made to the file tst.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
Enter :wq or ZZ

Rev. 14.21 HP Confidential For training purposes only L2 23


HP-UX Boot Camp

Exercise 6Modifying text


Perform these steps:
1. Start a vi session on the file vi.tst and make the modifications as directed in
that file. Following is a copy of the contents of vi.tst.
Enter your name here ->

Change the following to your favorite color -> lavender


Change the following to your favorite flower -> rose
Change the following to your favorite book -> A Tale of Two
Cities

Correct the typos in the next two lines:


Corect teh typooos im thiss line.
Ther awe mroe mistakkes in thsi linne.

The above two lines should read:


Correct the typos in this line.
There are more mistakes in this line.

Delete every occurrence of the word "jog" in the next line:


walk jog run walk jog run walk jog run walk jog run

Change every occurrence of the word "walk" to "WALK" in the


above line.

line1
line2
line3
line4
line5
line6
line7
line8

L2 24 HP Confidential For training purposes only Rev. 14.21


File and directory manipulation, permissions, and access

2. Complete the following exercises on line1 through line8 above:


a. Move the lines containing line1 through line5 and paste them after the line
containing line8.
b. Copy the lines containing line2 through line4 and paste them before the
line containing line6, and also after the line containing line3.
c. Quit your edit session on "vi.tst" saving the changes that you have made.
3. Start a new session by editing the file called funfile in your HOME directory
and change all occurrences of bug to FEATURE.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
:1,$s/bug/FEATURE/g

4. Write the first forty lines of the funfile out to another file called new.40.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
:1,40w new.40

5. Go to the last line in funfile.


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
G

Rev. 14.21 HP Confidential For training purposes only L2 25


HP-UX Boot Camp

6. Find and execute the command to place your cursor midway down the window.
Insert the following line:
This file is silly.

.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
This file is silly.
Esc

7. Without quitting vi, write your new version of the file out to a file called
funfile.123.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
:w funfile.123

8. Without leaving vi, load the file new.40 into the buffer, overwriting the
previous contents.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
:e new.40

L2 26 HP Confidential For training purposes only Rev. 14.21


File and directory manipulation, permissions, and access

9. Turn on line numbering with the ex number option.


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
:set number

10. Search for an occurrence of FEATURE in the file.


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
/FEATURE

11. Change this occurrence of FEATURE to BUG. Then quit out of vi without saving.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
cwBUG
Esc q! Return

Rev. 14.21 HP Confidential For training purposes only L2 27


HP-UX Boot Camp

12. Copy funfile to funfile.new. In funfile.new, search for all occurrences of the
string System or system and use /, cw, n, and . to change all but one of them to
XXXXX.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
1G
/[Ss]ystem
cwXXXXX Esc
n
.
n
n
.
n
.
n
.

13. Write your current edit session and quit the editor.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
:wq
or
ZZ

L2 28 HP Confidential For training purposes only Rev. 14.21


Exploring the system hardware
Module 3 lab

Objectives
After completing this lab, you should be able to:
Use the ioscan command to explore your system's hardware configuration
Explore the peripheral devices via the SMH interface
View and explore system device files.

Note
This lab was designed to be performed in teams using the shared MP system
console session.

Requirements
To complete this lab, you will need:
Credentials to access HPVL
One properly configured HP Integrity server (assigned by your instructor)
Credentials for MP access to one Integrity server (available at the HPVL login
page)
Root credentials to access the system through the shared MP console session
(available at the HPVL login page)

Introduction
All of the labs that follow the Lab 3 will be performed through the Management
Processor (MP) interface. To reach the Integrity Server system console perform
following tree steps.
1. At the HPVL landing page for your Lab Group, click Connect to MP button.
Terminal window will open.
2. At the terminal window, login as Admin / Admin.
3. Navigate to the console by typing co and pressing Enter.
At this time, you are connected to the MP shared console. At the time both students
will be able to see the console, but only one connection will have write permissions.
In order to gain controll, you will need to press the following key sequence: Ctrl+e
and then c and f in rapid succession.

Rev. 14.21 HP Confidential For training purposes only L3 1


HP-UX Boot Camp

Exercise 1Exploring your system configuration


The goal in this exercise is to explore your assigned lab systems configuration.
Perform these steps:
1. Log in as root on your assigned server.
2. Execute the model command to determine your systems model string. Consult
the table of HP server types earlier to determine whether your system is an entry
class, blade, mid-range, or high-end server.

Answer:
# model

3. Execute machinfo to determine your systems processor type and speed. Some
older PA-RISC systems do not support machinfo. If your system generates an
error message, skip this step.

Answer:
# machinfo

4. Execute machinfo to determine the amount of physical memory on your system.


Some older PA-RISC systems do not support machinfo. If your system generates
an error message, you can determine the amount of physical memory by
executing dmesg |grep i physical.

Answer:
# machinfo

5. Execute ioscan C cell to determine how many (if any) cell boards you
have on your system.

Answer:
# ioscan C cell

L3 2 HP Confidential For training purposes only Rev. 14.21


Exploring the system hardware

6. Execute ioscan C processor to determine how many processor cores you


have on your system.

Answer:
# ioscan C processor

7. Execute ioscan C lan to determine how many LAN interfaces you have on
your system.

Answer:
# ioscan C lan

8. Execute ioscan C disk to determine how many disk class devices you have
on your system.

Answer:
# ioscan C disk

9. DVDs and CDROMs are disk class devices, too. Execute ioscan C disk
and look in the Description column for the string DVD or DV to determine if you
have a DVD drive.

Answer:
# ioscan C disk

10. Are there any parallel SCSI buses on your system? Execute ioscan C
ext_bus to view external bus type components. Look in the Description column
for the string SCSI.

Answer:
# ioscan C ext_bus

Rev. 14.21 HP Confidential For training purposes only L3 3


HP-UX Boot Camp

Exercise 2Legacy and Agile View hardware


addressing
Perform these steps:
1. Execute the ioscan command to view your system configuration. Try the
command with each of the options listed below. View the results and explain the
significance of each option. Check the man page if you need to.
# ioscan
# ioscan f
# ioscan N
# ioscan k
# ioscan kfN
Answer:
When executed without any options, ioscan scans the buses and reports each
hardware components legacy hardware path, class, and description.
The -f option adds several additional columns to the output, including the driver
name, instance number, SW State, and HW Type.
The -N option displays Agile View hardware addresses rather than legacy
hardware addresses.
The -k option displays cached information. On a large system, ioscan
executes significantly faster with the -k than it does without the -k option.
The last example combines the last three options to display a full listing of Agile
View hardware paths using kernel cached information. This is one of the most
popular permutations of the ioscan command.

2. Does your system have any SCSI ext_buses? If so, can you determine their
hardware paths?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ioscan kfNC ext_bus

Answers will vary.

L3 4 HP Confidential For training purposes only Rev. 14.21


Exploring the system hardware

3. Skip this step if your system does not have SCSI buses. If your system does have
one or more SCSI buses, how many devices are on the first bus? Execute the
command below to find out. Replace the hardware path below with the first
SCSI bus hardware path you discovered in the previous step.
# ioscan -kfNH n/n/n/n
Answer:
Answers will vary.

4. Skip this step if your system does not have any SCSI buses. If you add a new
device to the SCSI bus you explored in the previous step, which SCSI target
addresses have already been claimed by existing devices on the bus?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
Look at the second to last component in each SCSI device address to determine
which target addresses are already taken. There must not be duplicate SCSI
target addresses on a SCSI bus.

5. 11i v3s new mass storage stack introduced some helpful new tools for
managing disks and LUNs, particularly on systems with multi-pathed devices.
Execute ioscan m lun to determine which disks (if any) on your system are
multi-pathed. If so, how many paths lead to each disk/LUN?
# ioscan m lun
Answer:
If ioscan lists multiple lunpaths below an Agile View LUN hardware path, the
LUN is multi-pathed.

Rev. 14.21 HP Confidential For training purposes only L3 5


HP-UX Boot Camp

6. Choose a disk or LUN from the ioscan m lun output above and record its
LUN hardware path and one of its lunpath hardware addresses below. If your
system has multi-pathed LUNs, use one of the multi-pathed LUNs.
LUN hardware path: ....................................................................................
lunpath hardware path: ...............................................................................
Conceptually, what is the difference between a LUN hardware address and a
lunpath hardware address?
Answer:
A LUN hardware path represents a disk or LUN. A lunpath hardware address
represents a single path to a disk or LUN. Each LUN has one LUN hardware
path, but may have multiple lunpath hardware addresses.

7. Recall that ioscan m lun also reports each LUNs health status. Are any of
your LUNs currently disabled?
# ioscan m lun
Answer:
All LUNs should be online.

8. When troubleshooting SAN problems, your storage administrators may ask you
to determine a LUNs WWID. Execute the command below to determine the
WWID of the disk or LUN you selected in the previous question.
# scsimgr get_attr -a wwid -H 64000/0xfa00/0x___

Answer:
Answers may vary.

9. You may also be asked to determine a LUNs LUN ID. Use the lunpath hardware
address that you selected previously to determine the LUNs LUN ID.
# scsimgr get_attr -a lunid H

Answer:
Answers may vary.

L3 6 HP Confidential For training purposes only Rev. 14.21


Exploring the system hardware

Exercise 3Viewing devices via the SMH


If time permits, explore the Devices functional area in the SMH.
In the HP Virtual Lab, use the SMH button that is available from the Lab Group
window to open an SMH browser.
1. From the Home Page, under the System Configuration area, click Disks and File
Systems, then click the disk tab. Notice the same disks listed from ioscan are
listed here.
2. From the Home Page, under the IO section, click IO Tree. Notice all the PCI
adapters and devices listed here are the same as in ioscan.
3. Click the Health Test tab to view the result of the last Diagnostic test or runa a
new one.

Rev. 14.21 HP Confidential For training purposes only L3 7


HP-UX Boot Camp

Exercise 4Configuring SMH for secure web


connection
By default on HPUX, System Management Homepage is installed with autostart feature enabled.
A daemon listens on port 2301and only starts HP SMH on port 2381 when requested, then
stops it again after a timeout period. This configuration is known as autostart URL mode.
To enable port 2381 and port 2301 running at all times, you have to change the configuration
mode to automatic startup on boot.
To configure HP SMH to permanently listen on port 2381, perform the following
procedure.
1. Login to the system console.
2. To see what configuration you are currently running, use command:
# smhstartconfig
3. To configure SMH in automatic startup on boot mode, issue command:
# smhstartconfig b on
4. To check if configuration changed:
# smhstartconfig

L3 8 HP Confidential For training purposes only Rev. 14.21


Exploring the system hardware

Exercise 5Exploring QuickSpecs (optional)


External web sites are not available from within the HP Virtual Lab. To explore
QuickSpecs, use the web browser on your local computer.

If time permits, visit the http://www.hp.com/go/servers website.


Go to the Integrity servers page on the website. See if you can find the
QuickSpecs page for one or two server models. If you need help finding the
QuickSpecs, ask your instructor.
Also have a look at some of the hardware documentation available at
http://docs.hp.com/en/hw.html.

Rev. 14.21 HP Confidential For training purposes only L3 9


HP-UX Boot Camp

Exercise 6 Viewing and Interpreting Device Files


For serveral questions you will need to know the DSF name of your system boot disk.
Execute the lvlnboot v command to determine your boot disk device file.
# lvlnboot v
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/disk/diska_p2 -- Boot Disk
Boot: lvol1 on: /dev/disk/diska_p2
Root: lvol3 on: /dev/disk/diska_p2
Swap: lvol2 on: /dev/disk/diska_p2
Dump: lvol2 on: /dev/disk/diska_p2, 0

In the lab solutions for the questions that follow, this disk will be identified as diska.
Record it here:

Boot Disk Persistent DSF: /dev/disk/disk_____

1. Some commands require block DSFs; some commands require character DSFs.
Is the boot disk DSF above a block or character DSF?
Answer:
# ll /dev/disk/diska

The b at the beginning of the ll output, as well as the fact that the DSF is in the
/dev/disk/ directory rather than /dev/rdisk/, indicate that this is a block
DSF.

2. Which kernel driver is associated with the DSF?


Answer:
# lssf /dev/disk/diska
esdisk section 2 at address 64000/0xfa00/0x1 /dev/disk/diska_p2

The driver name will be the first field in the output, and can also be seen as a
result of the lsdev(1m) command.

3. How can you view a list of the other DSFs associated with the disk? On Integrity
systems, which DSF represents the EFI boot disk partition containing the
operating system?
Answer:
# ioscan -kfnN /dev/disk/diska or
# ioscan m lun /dev/disk/diska

L3 10 HP Confidential For training purposes only Rev. 14.21


Exploring the system hardware

Integrity boot disks should have eight DSFs: a block and raw DSF for the entire
disk, plus block and raw DSFs for each of the EFI partitions. The
/dev/[r]disk/diska_p2 DSFs represent the OS partition in 11i v3. In 11i v1
and v2, the OS partition DSF ends in s2.

4. What is the agile view LUN hardware path associated with this DSF?
Answer:
# ioscan -kfnN /dev/disk/diska or
# ioscan m lun /dev/disk/diska or
# lssf /dev/disk/diska

5. When troubleshooting SAN problems, its oftentimes helpful to know a LUNs


WWID. What is the boot disks WWID?
Answer:
# scsimgr get_attr a wwid -D /dev/rdisk/diska

Look for the WWID line in the output.

6. Servers often access arrays via multiple redundant paths to enhance


performance and availability. How many paths are available to the disk?
Answer:
# ioscan m lun /dev/rdisk/diska

Count the number of lunpaths.

7. How can you correlate the boot disks persistent DSF with its legacy DSFs?
Answer:
# ioscan m dsf /dev/disk/diska

8. Are there any other disks available on the system? View a list of all of the disk
class devices and their persistent DSFs. Record the persistent block DSF for one
of the other disks on the system below:
Non Boot Disk Persistent DSF: /dev/disk/disk___
In the lab solutions for the questions that follow, this disk will be identified as
diskb.

Answer:
# ioscan kfnNC disk or
# ioscan m lun

There should be at least one disk on the system besides the boot disk.
Rev. 14.21 HP Confidential For training purposes only L3 11
HP-UX Boot Camp

L3 12 HP Confidential For training purposes only Rev. 14.21


Configuring and managing disks with LVM
Module 4 lab

Objectives
After completing this lab, you should be able to configure and manage disks using
LVM, including creation and extension of:
Physical volumes
Volume groups
Logical volumes
Optionally, you will learn how to access HP SMH to explore disk configuration
through the web interface.

Note
This lab was designed to be performed in teams.

Requirements
To complete this lab, you will need:
Credentials to access HPVL
One properly configured HP Integrity server (assigned by your instructor)
Credentials for MP access to one Integrity server (available on the HPVL login
page)
Root credentials to access the system through the shared MP console session
(available on the HPVL login page)
Four disks available for this exercise

Introduction
For the rest of the labs, you will need to know the DSF name of your system boot
disk, in order to NOT destroy it. Execute lvlnboot v command to determine your
boot disk device file:
# lvlnboot v

For the lab exercises that follow, this disk will be identified as diska. Record it here:
Boot Disk Persistent DSF: /dev/disk/disk____
You will neeed four disks to complete these folowing exerices: Execute ioscan
command to list all disks contained in your server:
# ioscan kfnNC disk

Rev. 14.21 HP Confidential For training purposes only L4 1


HP-UX Boot Camp

Select four available disk drives from the output of the ioscan command, by
eliminating the boot disk and the DVD drive first. For the lab exercises identify these
disks as diskw, diskx, disky, and diskz. Record your disk names below.
diskw = ....................................................................................................
diskx = ......................................................................................................
disky = ......................................................................................................
diskz = ......................................................................................................

L4 2 HP Confidential For training purposes only Rev. 14.21


Configuring and managing disks with LVM

Exercise 1 Creating Physical Volumes, Volume


Groups, and Logical Volumes
Perform these steps using the root credentials:
1. Verify that the preceding disks (diskw, diskx, disky, and diskz) are not already in
use.

Answer:
Combine information gathered from execution of these two commands:
# for d in /dev/rdisk/disk*
do
diskowner $d
done
# strings /etc/lvmtab

2. Configure two of the free disks as LVM physical volumes.

Answer:
# pvcreate /dev/rdisk/diskw
# pvcreate /dev/rdisk/diskx
# pvdisplay /dev/rdisk/diskw
# pvdisplay /dev/rdisk/diskx

3. Create a new LVMv2.2 vg02 volume group using your newly created physical
volumes. Use an 8MB extent size and a 1TB maximum volume group size.

Answer:
# vgcreate V 2.2 S 1t s 8 vg02 /dev/disk/diskw
/dev/disk/diskx

4. Use vgdisplay and pvdisplay to check the status of your new volume
group. How many physical volumes are in the volume group at this point? How
many logical volumes are in the volume group at this point? What is the extent
size? How many physical volumes could potentially be added to the volume
group? How many logical volumes could potentially be added to the volume
group?

Rev. 14.21 HP Confidential For training purposes only L4 3


HP-UX Boot Camp

Answer:
# vgdisplay -v vg02 | more
# pvdisplay /dev/disk/diskw /dev/disk/diskx

Currently there should be just two PVs in the volume group, and no LVs. The PE
size should be 8 MB. Max LVs should be 2047. Max PVs should be 2048.

5. Create a 32MB datavol logical volume in your new volume group. Verify that
your volume was created successfully. Which disk did LVM use for the new
logical volume?

Answer:
# lvcreate -n datavol L 32 vg02
# lvdisplay -v /dev/vg02/datavol

The logical volume was placed on the first disk in the volume group in
accordance with the LVM default allocation policy.

6. Create a second logical volume in vg02. Attempt to make this logical volume
33MB, and allow LVM to choose a logical volume name for you. What name
did LVM choose for the new logical volume? Why? How large is the logical
volume? Why? Which disk is the new logical volume on? Why?

Answer:
# lvcreate L 33 vg02
# lvdisplay v /dev/vg02/lvol2

LVM assigns default logical volume names based on the logical volumes minor
number. Since this is the second logical volume in the volume group, its minor
number ended in 02, and the logical volume name was set to lvol2.
Even though we requested a 33MB logical volume, LVM rounded up to the next
highest extent boundary, yielding a 40MB logical volume.
The logical volume was placed on the first disk in the volume group in
accordance with the LVM default allocation policy.

7. The first physical volume is gradually filling up. Lets create a third logical
volume, but this time, to provide some load balancing, do whatever is necessary
to ensure that the logical volume is stored on the second disk. The logical
volume should be named appvol, and should be 32MB in size. Before
extending the logical volume, check the size of the disk using the diskinfo
command.

L4 4 HP Confidential For training purposes only Rev. 14.21


Configuring and managing disks with LVM

Answer:
# diskinfo b /dev/rdisk/diskx
# lvcreate n appvol vg02
# lvextend L 32 /dev/vg02/appvol /dev/disk/diskx

8. To avoid LVM fragmentation performance problems, some administrators enforce


a logical volume policy that requires LVM to use contiguous extents when a
logical volume is extended. Do whatever is necessary to ensure that
/dev/vg02/datavol and /dev/vg02/appvol will always be contiguous.

Answer:
# lvchange C y /dev/vg02/datavol
# lvchange C y /dev/vg02/appvol

9. Create a VxFS file system in the /dev/vg02/appvol logical volume and


mount it on /app. Do not add the file system to /etc/fstab.

Answer:
# newfs /dev/vg02/rappvol
# mkdir /app
# mount /dev/vg02/appvol /app

Rev. 14.21 HP Confidential For training purposes only L4 5


HP-UX Boot Camp

Exercise 2Extending, reducing, and removing LVs,


PVs, and VGs
As users generate data on your system, it will likely be necessary to re-allocate space
in your volume groups at some point. This part of the lab gives you an opportunity to
extend, reduce, and remove volume groups and logical volumes.
Perform these steps:
1. Determine how much unallocated space is available. How much unallocated
space is available in vg02?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# vgdisplay v vg02

Answers will vary.

2. At this point, we should have plenty of free space in the volume group. Just to be
sure, though, add one more disk to vg02. Use vgdisplay to verify that this
worked.

Answer:
# pvcreate /dev/rdisk/disky
# vgextend vg02 /dev/disk/disky
# vgdisplay v vg02

L4 6 HP Confidential For training purposes only Rev. 14.21


Configuring and managing disks with LVM

3. Can you double the size of the /dev/vg02/datavol and


/dev/vg02/appvol logical volumes? Try it, and explain the results.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# lvextend L 64 /dev/vg02/datavol
# lvextend L 64 /dev/vg02/appvol

datavol cannot be extended due to the contiguous policy. appvol can be


extended since it has contiguous extents available.

4. Did extending the logical volume also extend the file system in the logical
volume? If not, did extending the appvol logical volume also extend the /app
file system in the logical volume? If not, do whatever is necessary to extend the
/app file system now.

Answer:
No. The file system must be separately extended.
# bdf
# fsadm F vxfs b 64m /app
# bdf

5. It turns out that you do not need that extra space after all. Do whatever is
necessary to reduce appvol back down to 32MB.

Answer:
/app contains a file system that must be reduced before the logical volume can
be reduced.
# fsadm -F vxfs b 32m /app
Then, you should be able to reduce the appvol logical volume.
# lvreduce L 32 /dev/vg02/appvol
When a logical volume is reduced useful data might get
lost; do you really want the command to proceed (y/n): y

Rev. 14.21 HP Confidential For training purposes only L4 7


HP-UX Boot Camp

6. At this point, you are wasting a great deal of space in the volume group; you
have three disks, but are only using about 104MB of space! Perhaps it would
make sense to take one of the disks out of the volume group for use elsewhere
on the system. Lets remove the second disk from the disk group. Which
command can you use to determine which logical volumes have extents on the
second disk currently?

Answer:
# pvdisplay v /dev/disk/diskx | more

7. Move the extents that are currently on the second disk to the third disk, then
remove the second disk from the volume group. After removing the disk from the
volume group, remove the LVM headers from the disk as well. Do not execute
mediainit!

Answer:
# pvmove /dev/disk/diskx /dev/disk/disky
# vgreduce vg02 /dev/disk/diskx
# pvremove /dev/rdisk/diskx

8. Now that you have removed one disk from the volume group, lets go a step
further and remove the volume group itself. What happens if you simply attempt
to vgremove the volume group at this point? Try it!
# vgremove -X vg02

Answer:
Fails! You cant remove a volume group until all of the logical volumes in the
volume group, and all but the last disk in the volume group, have first been
removed. At this time you still have two physical volumes present in the VG.2

9. Do whatever is necessary to remove the volume groups logical volumes, then try
to remove the volume group again.

Answer:
# umount /app
# lvremove f /dev/vg02/datavol
# lvremove f /dev/vg02/appvol
# lvremove f /dev/vg02/lvol2
# vgremove X vg02

L4 8 HP Confidential For training purposes only Rev. 14.21


Configuring and managing disks with LVM

10. Remove one of the remaining physical volumes from the volume group, then try
to remove the volume group again. Dont forget to remove volume groups
directory in /dev manually, or via the vgremove X option.

Answer:
# vgreduce vg02 /dev/disk/disky
# vgremove X vg02

Rev. 14.21 HP Confidential For training purposes only L4 9


HP-UX Boot Camp

Exercise 3 Exploring the SMH fsweb interface


(optional)
Most administrators manage LVM from the command line. However, HP-UX does
offer a graphical interface for managing LVM. If time permits, explore the Disks and
File Systems functional area in the SMH. If you create any new file systems or logical
volumes in the SMH, remove them before proceeding.
Perform these steps:
1. Your class is using the HPVL lab equipment, there is an SMH button on the lab
course page labeled Connect to SMH. This button will automatically open a
browser on the HPVL webtop and point the browser to your servers SMH home
page.

2. Allow the SMH autostart daemon to redirect your browser to


https://192.168.241.xx:2381/, by selecting Continue to this website (not
recommended).

3. Login as root. From the SMH Home Page, under the System Configuration area,
click Disks and File Systems, and click the Volume Group tab. If you wish, you
may create some test volume groups from this tab, and some logical volumes
from the Logical Volumes tab. However be sure to remove them before
proceeding to next Lab..

Note
A similar Disks and File Systems functional area exists in sam in earlier versions
of HP-UX.

Note
If AutoComplete Passwords window appears, check Dont offer to remember any
more passwords, and click No to proceed.

Note
After you are done with exploring the SMH interface for Disks and File System,
make sure that you remove all additional volume groups and release all disks
you used during this lab.

L4 10 HP Confidential For training purposes only Rev. 14.21


Configuring and managing LVM boot disks on
Integrity servers
Module 5 lab

Objectives
After completing this lab, you should be able to make a mirror of an Integrity LVM
boot disk for HP-UX 11iv2 and 11iv3.

Note
Carefully follow the instructions below. This lab should be completed in teams,
using shared MP console interface.

Requirements
To complete this lab, you will need:
Credentials to access HPVL
One properly configured HP Integrity server (assigned by your instructor)
Credentials for MP access to one Integrity server (available on the HPVL login
page)
Root credentials to access the system through the shared MP console session
(available on the HPVL login page)

Rev. 14.21 HP Confidential For training purposes only L5 1


HP-UX Boot Camp

IntroductionMirroring an HP Integrity LVM boot


disk
This lab describes the procedure required to mirror an 11i v3 boot disk. The lab
assumes that diska is the existing boot disk and diskb will be the new mirror. To
determine your boot disk device file, execute the lvlnboot v command.
# lvlnboot v

Execute the following script to determine which disks are free:


# for d in /dev/rdisk/disk*
do
diskowner $d
done
# strings /etc/lvmtab

Select one available disk drive from the previous output, eliminating the boot disk
and the DVD drive.
diska = .................... (existing boot disk, which will be corrupted and replaced)
diskb = ................................. (new mirror created and reinitialized as a clone)

L5 2 HP Confidential For training purposes only Rev. 14.21


Configuring and managing LVM boot disks on Integrity servers

Exercise 1Configuring the mirrors partition table


First, create three EFI partitions on the new boot mirror using this process:
1. Use ioscan and diskinfo to verify that the new boot disk is at least as large
as the existing boot disk:
# ioscan -kfnNC disk
# diskinfo /dev/rdisk/diska
# diskinfo /dev/rdisk/diskb

2. Create an idisk description file (/tmp/idf) that defines the desired sizes of
the EFI partitions. The EFI system partition should be at least 500MB. The HPSP
partition should be at least 400MB. Allow the HP-UX OS partition to use all of
the remaining space. Execute idisk with the w (write) option to create the
partitions described in /tmp/idf. The f option identifies the idisk
description file that contains the desired partition sizes.
# vi /tmp/idf
3
EFI 500MB
HPUX 100%
HPSP 400MB
# idisk wf /tmp/idf /dev/rdisk/diskb

3. Execute idisk again without the wf options to view the partition table and
verify that the partitions were successfully created:
# idisk /dev/rdisk/diskb
Partition 1 (EFI):
Partition Type GUID = c12a7328-f81f-11d2-ba4b-
00a0c93ec93b
Unique Partition GUID = ee47f8f6-71f8-11dc-8000-
d6217b60e588
Starting Lba Lo = 0x40
Starting Lba Hi = 0x0
Ending Lba Lo = 0xf9fff
Ending Lba Hi = 0x0
Partition 2 (HP-UX): Partition Type GUID = 75894c1e-
3aeb-11d3-b7c1-7b03a0000000
Unique Partition GUID = ee47f914-71f8-11dc-8000-
d6217b60e588
Starting Lba Lo = 0xfa000
Starting Lba Hi = 0x0
Ending Lba Lo = 0x430e7ff
Ending Lba Hi = 0x0
Partition 3 (HPSP):
Partition Type GUID = e2a1e728-32e3-11d6-a682-
7b03a0000000
Unique Partition GUID = ee47f932-71f8-11dc-8000-
d6217b60e588
Starting Lba Lo = 0x430e800
Starting Lba Hi = 0x0
Ending Lba Lo = 0x43d66bf
Ending Lba Hi = 0x0
...

Rev. 14.21 HP Confidential For training purposes only L5 3


HP-UX Boot Camp

4. Use insf to create DSFs for the new partitions:


# insf eC disk

5. Use ioscan to verify that the DSFs were created successfully. There should be
block and raw DSFs for each EFI partition on the new mirror.
# ioscan kfNn /dev/disk/diskb
Class I H/W Path Driver S/W State H/W Type
Description

==============================================================
disk 2 64000/0xfa00/0x2 esdisk CLAIMED DEVICE HP Disk
/dev/disk/diskb /dev/rdisk/diskb
/dev/disk/diskb_p1
/dev/rdisk/diskb_p1
/dev/disk/diskb_p2
/dev/rdisk/diskb_p2
/dev/disk/diskb_p3
/dev/rdisk/diskb_p3

L5 4 HP Confidential For training purposes only Rev. 14.21


Configuring and managing LVM boot disks on Integrity servers

Exercise 2Populating the mirrors system partition


After you recreate the partition table, populate the system partition:
1. Populate the /efi/hpux/ directory in the new EFI system partition with the
mkboot command. This command copies the hpux.efi boot loader and other
files to the system partition.
# mkboot e l /dev/rdisk/diskb
2. Verify your work. Standard UNIX commands such as ls cant read the FAT32
file system in the system partition. Use the efi_ls command instead to verify
that the system partitions /efi/hpux/ directory contains an hpux.efi kernel
loader and an auto file.
# efi_ls d /dev/rdisk/disk#_p1 /efi/hpux/
FileName Last Modified Size
. 10/ 3/2007 0
.. 10/ 3/2007 0
HPUX.EFI 10/ 3/2007 654025
NBP.EFI 10/ 3/2007 24576
AUTO 10/ 3/2007 12

3. By default, the LVM quorum rules require at least 51% of the disks in vg00 to be
available at boot time. However, you want to be able to boot the system when
just 50% of the mirrors in vg00 are available. Thus, you must disable the default
quorum check by changing the auto file boot string to boot vmunix lq on
both disks. Use the mkboot command to modify the file on both disks:
# mkboot a boot vmunix lq /dev/rdisk/diska
# mkboot a boot vmunix lq /dev/rdisk/diskb

4. Verify your work. Standard UNIX commands such as cat and more cant
access files in FAT32 file systems. Instead, use the efi_cp command to copy
the auto file from the system partition to your terminal device, /dev/tty.
Repeat for each mirror.
# efi_cp d /dev/rdisk/diska_p1 u /efi/hpux/auto /dev/tty
boot vmunix -lq
# efi_cp d /dev/rdisk/diskb_p1 u /efi/hpux/auto /dev/tty
boot vmunix lq

Rev. 14.21 HP Confidential For training purposes only L5 5


HP-UX Boot Camp

Exercise 3Populating the mirrors OS partition


Next, configure the OS partition. Recall that the OS partition is essentially an
encapsulated LVM boot disk.
1. Initialize the OS partition with pvcreate, add it to vg00 with vgextend, and
verify your work with vgdisplay v. vgdisplay -v should list two disks in
the volume group. Be sure to use the p2 device file; otherwise, pvcreate
overwrites the partition table and system partition configured previously.
# pvcreate B /dev/rdisk/diskb_p2
# vgextend vg00 /dev/disk/diskb_p2

2. Use vgdisplay to verify your work. vgdisplay should list both disks as
members of the vg00 volume group:
# vgdisplay v vg00 | grep -e "PV Name" e "PV Status"
PV Name /dev/disk/diska_p2
PV Status available
PV Name /dev/disk/diskb_p2
PV Status available

3. Mirror all of the vg00 logical volumes with lvextend. The logical volumes
must be extended in the same order that they are configured on the original
boot disk. Use pvdisplay -v to determine the list of logical volumes and their
order.
# pvdisplay -v /dev/disk/diska_p2 | grep 'current.*0000 $'
00000 current /dev/vg00/lvol1 00000
00038 current /dev/vg00/lvol2 00000
00550 current /dev/vg00/lvol3 00000
00583 current /dev/vg00/lvol4 00000
00608 current /dev/vg00/lvol5 00000
00611 current /dev/vg00/lvol6 00000
00923 current /dev/vg00/lvol7 00000
01252 current /dev/vg00/lvol8 00000

4. If the logical volumes are arranged in sequence lvol1-8, simply use the for
loop shown below. If not, you may have to lvextend the logical volumes one
by one. Use the 11i v3 parallel synchronization feature.
# for lv in /dev/vg00/lvol*
do
lvextend s m 1 $lv
done
# lvsync T /dev/vg00/lvol*

L5 6 HP Confidential For training purposes only Rev. 14.21


Configuring and managing LVM boot disks on Integrity servers

5. Use vgdisplay -v to verify your work. The LV Status field for each logical
volume should report syncd.
# vgdisplay -v vg00 | grep -e "LV Name" -e "LV Status"
LV Name /dev/vg00/lvol1
LV Status available/syncd
LV Name /dev/vg00/lvol2
LV Status available/syncd
LV Name /dev/vg00/lvol3
LV Status available/syncd
LV Name /dev/vg00/lvol4
LV Status available/syncd
LV Name /dev/vg00/lvol5
LV Status available/syncd
LV Name /dev/vg00/lvol6
LV Status available/syncd
LV Name /dev/vg00/lvol7
LV Status available/syncd
LV Name /dev/vg00/lvol8
LV Status available/syncd

6. Use lvlnboot R to update/refresh the LABEL file and BDRA information:


# lvlnboot R
Volume Group configuration for /dev/vg00 has been saved
in /etc/lvmconf/vg00.conf

7. Use lvlnboot v to verify your work. You should see references to both disks
in the boot, root, and swap portions of the output. Dump data isnt mirrored, so
the dump entry will only reference the first disk in the volume group.
# lvlnboot v
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/disk/diska_p2 -- Boot Disk
/dev/disk/diskb_p2 -- Boot Disk
Boot: lvol1 on: /dev/disk/diska_p2
/dev/disk/diskb_p2
Root: lvol3 on: /dev/disk/diska_p2
/dev/disk/diskb_p2
Swap: lvol2 on: /dev/disk/diska_p2
/dev/disk/diskb_p2
Dump: lvol2 on: /dev/disk/diska_p2, 0

8. Add a line to /stand/bootconf so SDUX knows which disks are boot disks.
When patches are swinstalled for LIF area utilities, SDUX consults
/stand/bootconf to determine which disks have LIF areas that might need to
be patched. Be sure to specify the p2 OS partition!
# vi /stand/bootconf
l /dev/disk/diska_p2
l /dev/disk/diskb_p2

You wont populate the HPSP partition on the lab system. Proceed to rebuild the EFI
Boot Manager Menu.

Rev. 14.21 HP Confidential For training purposes only L5 7


HP-UX Boot Camp

Exercise 4Adding the mirror to the EFI boot


manager menu
Update stable storage so your new mirror is listed as the high availability alternate
boot disk. You can do this via the EFI boot manager maintenance menu, but youll
use the HP-UX setboot command instead to avoid rebooting.
1. Specify the mirrors persistent DSF name as the HAA path:
# setboot -p /dev/disk/diska
Primary boot path set to 1/1/1/1.0x1.0x1 (/dev/disk/diska)
# setboot -h /dev/disk/diskb
HA Alternate boot path set to 2/2/2/2.0x2.0x2
(/dev/disk/diskb)

2. Execute setboot again without any options to verify your work:


# setboot
Primary bootpath : 1/1/1/1.0x1.0x1 (/dev/rdisk/diska)
HA Alternate bootpath : 2/2/2/2.0x2.0x2 (/dev/rdisk/diskb)
Alternate bootpath :

L5 8 HP Confidential For training purposes only Rev. 14.21


Configuring and managing LVM boot disks on Integrity servers

Exercise 5Changing the primary swap volumes


consistency recovery policy
Note
This exercise is optional, at your instructors discretion.

Recall that mirror write performance on swap logical volumes may be enhanced by
disabling the Mirror Write Cache. If the primary swap volume is also configured as a
dump volume, its critical to change the consistency recovery policy to NONE to avoid
corrupting dump data in case of a system panic.
Changing the MWC policy for primary swap is a bit tricky since primary swap is
usually activated even in single-user mode!
LVM maintenance mode boots the system without activating vg00, or enabling
primary swap. Without primary swap activated, you should be able to change the
consistency recovery policy on lvol2.
1. Check the current consistency recovery policy on lvol2:
# lvdisplay /dev/vg00/lvol2
Consistency Recovery MWC

2. Reboot the system:


# shutdown ry 0

3. Interrupt the boot process and boot to LVM maintenance mode. At HPUX prompt
enter boot vmunix lm command and press Enter:
HP-UX Boot Loader for IA64 Revision 1.71
Press Any Key to interrupt Autoboot
\EFI\HPUX\AUTO ==> boot vmunix
Seconds left till autoboot 10

HPUX> boot vmunix lm

4. Activate vg00, change the consistency recovery policy, and update the BDRA:
# vgchange a y vg00
# lvchange M n c n /dev/vg00/lvol2
# lvlnboot R

5. Use lvdisplay to verify that the change succeeded:


# lvdisplay /dev/vg00/lvol2
Consistency Recovery NONE

6. Always reboot after using the LVM maintenance mode:


# reboot

Rev. 14.21 HP Confidential For training purposes only L5 9


HP-UX Boot Camp

Exercise 6Booting from the new mirror


After completing the mirroring process, it is a good idea to verify your work by
booting from the new mirror:
1. If you didnt reboot to the EFI boot manager main menu at the end of the
previous step, do so now:
# shutdown ry 0

2. Interrupt the EFI boot manager autoboot by pressing Escape at this screen:

L5 10 HP Confidential For training purposes only Rev. 14.21


Configuring and managing LVM boot disks on Integrity servers

3. Select your mirrored disk from the boot manager selection menu and press
Enter:

4. Verify which disk you booted from when the boot process completes. Corellate
the output of grep command with the result of the execution of setboot
command:
# grep Boot device /var/adm/syslog/syslog.log
vmunix: Boot device's HP-UX HW path is: 2/2/2/2.2.2
# setboot

Rev. 14.21 HP Confidential For training purposes only L5 11


HP-UX Boot Camp

L5 12 HP Confidential For training purposes only Rev. 14.21


Booting Integrity systems and using iLO and EFI
file system
Module 6 lab

Objectives
After completing this lab, you should be able to:
Gracefully shut down and reboot the HPUX server
Interact with the EFI Boot Manager
Work with the HPUX kernel loader from the EFI shell

Note
This lab was designed to be performed in teams using the shared MP system
console session.

Requirements
To complete this lab, you will need:
Credentials to access HPVL
One properly configured HP Integrity server (assigned by your instructor)
Credentials for MP access to one Integrity server (available on the HPVL login
page)
Root credentials to access the system through the shared MP console session
(available on the HPVL login page)

Introduction
A portion of this lab requires you to interact with the EFI and HPUX interfaces, which
can only be accomplished via a console login. If you are using remote lab
equipment, access your systems console interface via the MP.

Rev. 14.21 HP Confidential For training purposes only L6 1


HP-UX Boot Camp

Exercise 1Shutting down the system


Perform these steps:
1. Currently, your system should be in multi-user mode. Note which file systems are
mounted, and how many processes are running.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# mount v
# ps -ef | wc l

2. Shut down to single-user mode. Then check to see what processes and mounted
file systems remain. What differences do you see between single- and multi-user
modes?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# cd /
# shutdown -y 0
# mount v
# ps -ef | more

There are few file systems mounted in single-user mode, and few processes
running. Single-user mode is a good place to do kernel configuration, file system
maintenance with fsck, and other maintenance activities that require a quiet
system.

L6 2 HP Confidential For training purposes only Rev. 14.21


Booting Integrity systems and using iLO and EFI file system

3. From single-user mode, take your machine down to the halt state. What can you
do in the halt state? Why might it be necessary to take your system down to the
halt state?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# reboot h

Nothing is running in the halt state and no logins are possible. It is necessary to
bring the system to a halt state before powering off the system to install new
peripherals and interface cards.

4. Reset your server. On some models, you can use the MP rs command to reset
the system from the halt state. On other models, it may be necessary to power
on the system via the MP pc command. Return to the console interface and get
ready to press any key to interrupt the autoboot sequence.

Answer:
# ^b
MP> cm
MP:CM> rs or pc
At tis point MP might ask you if you want to power ON the system. Select ON, and
navigate to main menu by using the ma command.
MP:CM> ma
MP> co

Rev. 14.21 HP Confidential For training purposes only L6 3


HP-UX Boot Camp

Exercise 2Interacting with the EFI Boot Manager


Perform these steps:
1. If you didnt already do so in the previous part of the lab, reboot your system
and interrupt the EFI autoboot process by moving your arrow key down when
you see the below screen.

2. If you miss the EFI boot Manager menu, you can configure to not autoboot to
primary disk drive from HPUX interface, and then reboot the system:
# setboot B off
# shutdown ry 0

3. Boot from the primary boot disk. However, as soon as the HPUX kernel loader
countdown begins, press any key to drop out to the HPUX> kernel loader
prompt.

Answer:
HP-UX Boot Loader for IPF -- Revision 2.043

Press Any Key to interrupt Autoboot


\EFI\HPUX\AUTO ==> boot vmunix lq
Seconds left till autoboot - 4
Type 'help' for help

HPUX>

L6 4 HP Confidential For training purposes only Rev. 14.21


Booting Integrity systems and using iLO and EFI file system

4. At the HPUX> prompt, type exit to return to the EFI Boot Manager menu.

Answer:
HPUX> exit

You should be back at the EFI Boot Manager menu now.

5. Select the Boot Configuration option.

Answer:

Rev. 14.21 HP Confidential For training purposes only L6 5


HP-UX Boot Camp

6. Select the Boot from File option on the Boot Option Maintenance Menu and
review the list of devices available in the menu.
a. How many EFI partitioned disks are available on the Boot from a File
menu?
b. Is there a DVD drive?
c. Is there a tape drive that supports tape boot?
d. Are there any LAN interfaces?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:

Available hardware will vary from system to system. There should be at least one
disk with a system partition. Look for a device whose hardware path includes
Part1 (partition 1).
If there is a DVD drive, it should be prefixed with the string Removable Media.
If there is a tape drive, it should be prefixed with the string Load File and
should include a SCSI component in the hardware path.
If there is a LAN interface on the same subnet as an Ignite-UX install server,
there should be Load File entry that includes the string Load File [Core LAN
A] (or B).

L6 6 HP Confidential For training purposes only Rev. 14.21


Booting Integrity systems and using iLO and EFI file system

In the following steps you will use the File System Explore menu to navigate to
find the HPUX kernel loader. Manually boot the \efi\hpux\hpux.efi kernel
loader from partition 1 on the default boot disk. However, as soon as the HPUX
kernel loader countdown begins, press any key to drop out to the HPUX> kernel
loader prompt.

Answer:

7. Select the boot disk hardware path that contains Part1. It should be the first
one on the list.
Use the prompts that follow to select EFI and press Enter.

Rev. 14.21 HP Confidential For training purposes only L6 7


HP-UX Boot Camp

Select HPUX and press Enter.

L6 8 HP Confidential For training purposes only Rev. 14.21


Booting Integrity systems and using iLO and EFI file system

Select hpux.efi entry and press Enter.

Press any key to interrupt the HPUX autoboot sequence.


HP-UX Boot Loader for IA64 Revision 1.71
Press Any Key to interrupt Autoboot
\EFI\HPUX\AUTO ==> boot vmunix
Seconds left till autoboot 10 Escape
Type 'help' for help

8. At the HPUX> prompt, type exit to return to the EFI Boot Manager Boot
Configuration menu.

Answer:
HPUX > exit

Rev. 14.21 HP Confidential For training purposes only L6 9


HP-UX Boot Camp

In the following steps you will add a custom entry to the EFI Boot Manager
Menu that points to the \efi\hpux\hpux.efi kernel loader from partition 1
on the existing boot disk. Label the menu option My Boot Disk, in ASCII
format. Save the change to NVRAM and exit back to the main menu.

9. From the EFI Boot Manager select Boot Configuration, and then Add Boot Entry
and press enter.

Answer:

10. Select the device that includes the string Part1in the hardware path.

L6 10 HP Confidential For training purposes only Rev. 14.21


Booting Integrity systems and using iLO and EFI file system

Select EFI and press enter.

Select HPUX entry and press enter.

Rev. 14.21 HP Confidential For training purposes only L6 11


HP-UX Boot Camp

Select hpux.efi entry and press enter.

Enter My Boot Disk as the Description and then press enter.


When prompted for Load Options, do not enter anything and press enter.
Save the change to NVRAM.

L6 12 HP Confidential For training purposes only Rev. 14.21


Booting Integrity systems and using iLO and EFI file system

11. Return to the EFI Boot Manager Menu by pressing ESC and verify that your
custom menu item appears in the boot menu list.

Answer:
The main menu should look like this:

12. Select the new menu item to see if it boots. As soon as the HPUX kernel loader
countdown begins, press any key to drop out to the HPUX> kernel loader
prompt.

Answer:
HP-UX Boot Loader for IPF -- Revision 2.043

Press Any Key to interrupt Autoboot


\EFI\HPUX\AUTO ==> boot vmunix -lq
Seconds left till autoboot - 9
Type 'help' for help

HPUX>

13. At the HPUX> prompt, type exit to return to the EFI Boot Manager Menu.

Answer:
HPUX> exit

Rev. 14.21 HP Confidential For training purposes only L6 13


HP-UX Boot Camp

14. Use the Boot Configuration menu to remove the custom boot menu item that
you just added. Select Remove Boot Entry and press enter.

Answer:
EFI Boot Maintenance Manager ver 1.10 [14.61]

Select My Boot Disk, and click Y when prompted to save to NVRAM.

L6 14 HP Confidential For training purposes only Rev. 14.21


Booting Integrity systems and using iLO and EFI file system

15. Press ESC to return to the previous menu. From the Boot Menu select EFI Shell
[Built-In].

Answer:

16. Execute help a -b to view a list of available EFI Shell commands.

Answer:
Shell> help a b

17. Execute help b info to learn about the info command.

Answer:
Shell> help b info

18. Execute the info b all command to view your systems configuration.

Answer:
Shell> info b all

Rev. 14.21 HP Confidential For training purposes only L6 15


HP-UX Boot Camp

19. Exit the EFI shell.

Answer:
Shell> exit

L6 16 HP Confidential For training purposes only Rev. 14.21


Booting Integrity systems and using iLO and EFI file system

Exercise 3Interacting with the HPUX kernel loader


In this part of the lab, you will have a chance to explore the HPUX kernel loader.
Perform these steps:
1. From the EFI Boot Manager, boot the primary boot disk. Interrupt the HPUX
autoboot sequence to access the HPUX> prompt.

Answer:
HP-UX Boot Loader for IPF -- Revision 2.036

Press Any Key to interrupt Autoboot


\EFI\HPUX\AUTO ==> boot vmunix
Seconds left till autoboot - 10
Type 'help' for help

HPUX>

2. Type the help command to view a list of commands available at the HPUX>
prompt.

Answer:
HPUX> help

3. Which command can you use to list the kernels available in /stand? Try it!
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
HPUX> ll

Rev. 14.21 HP Confidential For training purposes only L6 17


HP-UX Boot Camp

4. Which command can you use to view the contents of the auto file? What is the
purpose of the auto file?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
HPUX> showauto

The auto file determines the default boot string.

5. Do whatever is necessary to boot vmunix to single-user mode.

Answer:
HPUX> boot vmunix is

6. Did the system prompt you for a password when you were brought to single-user
mode? When might this be helpful?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
By default, single-user mode does not prompt for a password. The administrator
is automatically logged in as root. This may be useful if the administrator forgets
the root password.

7. Reboot your system again, but this time let it boot unattended using the default
boot disk and kernel.

Answer:
# reboot

L6 18 HP Confidential For training purposes only Rev. 14.21


Recovering LVM disks and structures
Module 7 lab

Objectives
After completing this lab, you should be able to:
Rebuild missing LVM configuration files
Access a volume containing failed disks
Replace a failed LVM disk
Restore and backup logical volumes
Reset the root password using the System Recovery console

Note
This lab was designed to be performed in teams using the shared MP system
console session.

Requirements
To complete this lab, you will need:
Credentials to access HPVL
One properly configured HP Integrity server (assigned by your instructor)
Credentials for MP access to one Integrity server (available at the HPVL login
page)
Root credentials to access the system through the shared MP console session
(available at the HPVL login page)

Introduction
Carefully follow the instructions below. You will need two disks to complete these
exercises. Use the commands you have learned in the Lab 03 to identify two free
disks. For the reminder of this Lab, these disks will be called diskw and diskx.
diskw = ....................................................................................................
diskx = .....................................................................................................

Rev. 14.21 HP Confidential For training purposes only L7 1


HP-UX Boot Camp

Exercise 1Performing the preliminary steps


This lab requires two disks in vg01. If you already have a two-disk LVMv2.2 vg01
volume group, skip this exercise. If you dont have a two-disk LVMv2.2 vg01 volume
group, follow these instructions to create one:
1. Initialize two physical volumes. Create an LVMv2.2 vg01 volume group
containing two disks. Specify 2TB as the maximum volume group size and 4MB
as the extent size.

Answer:
# pvcreate /dev/rdisk/diskw
# pvcreate /dev/rdisk/diskx
# vgcreate V 2.2 S 2t s 4 vg01 /dev/disk/diskw
/dev/disk/diskx

2. Create a 16MB non-mirrored logical volume called simplevol on the first disk
in the volume group. Create a VxFS file system in the logical volume, mount the
file system on /simple, and copy a few files to the file system from
/usr/bin/.

Answer:
# lvcreate n simplevol vg01
# lvextend L 16 /dev/vg01/simplevol /dev/disk/diskw
# newfs /dev/vg01/rsimplevol
# mkdir /simple
# mount /dev/vg01/simplevol /simple
# cp /usr/bin/a* /simple 2>/dev/null

3. Create a 16MB mirrored logical volume called mirrorvol. Create a VxFS file
system in the logical volume, mount the file system on /mirror, and copy a few
files to the file system from /usr/bin/.

Answer:
# lvcreate n mirrorvol vg01
# lvextend L 16 /dev/vg01/mirrorvol /dev/disk/diskw
# lvextend m 1 /dev/vg01/mirrorvol /dev/disk/diskx
# newfs /dev/vg01/rmirrorvol
# mkdir /mirror
# mount /dev/vg01/mirrorvol /mirror
# cp /usr/bin/a* /mirror 2>/dev/null

L7 2 HP Confidential For training purposes only Rev. 14.21


Recovering LVM disks and structures

4. List the contents of /etc/lvmconf/ to verify that vgcfgbackup automatically


made a backup of the updated vg01 headers.

Answer:
# ll /etc/lvmconf/

5. Use the vgcfgrestore lv command to view the contents of the


/etc/lvmconf/vg01.conf backup.

Answer:
# vgcfgrestore n vg01 lv

Rev. 14.21 HP Confidential For training purposes only L7 3


HP-UX Boot Camp

Exercise 2 Rebuilding missing /etc/lvmtab or


/etc/lvmtab_p files
What happens when the /etc/lvmtab or /etc/lvmtab_p files are lost or
corrupted? In this part of the lab, you will find out!
1. Move /etc/lvmtab_p to /etc/lvmtab_p.bkp.

Answer:
# mv /etc/lvmtab_p /etc/lvmtab_p.bkp

2. What impact does this have on the following commands?


# ls /mirror
# vgdisplay v vg01
# lvextend L 32 /dev/vg01/mirrorvol

.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
The ls command succeeds. LVM commands fail.

3. Use the vgscan command to recreate the /etc/lvmtab_p file. Include the
option to use persistent device files. Since you eliminated the /etc/lvmtab_p
file, you may see some warning messages; these can be safely ignored. How
does this command determine which disks belong to which volume groups?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# vgscan -N

The command searches the PVRA/VGRA headers to determine which volume


group each disk belongs to.

L7 4 HP Confidential For training purposes only Rev. 14.21


Recovering LVM disks and structures

4. Verify your recovery succeeded. Check if lvmtab was recreated.

Answer:
# lvmadm l
# ll /etc/lvmtab_p*

Rev. 14.21 HP Confidential For training purposes only L7 5


HP-UX Boot Camp

Exercise 3Accessing a volume group containing


failed disks
This portion of the lab demonstrates the effect that a failed or corrupted disk has on
LVM. You will simulate a disk failure by overwriting the LVM headers on the first disk
in vg01. Perform these steps:
1. Unmount the file systems before proceeding.

Answer:
# umount /mirror
# umount /simple

2. Deactivate the volume group.

Answer:
# vgchange a n vg01
Volume group "vg01" has been successfully changed.

3. Simulate corruption by writing 64MB of zeroes to the first disk in the volume
group. This should be more than adequate to overwrite the LVM and file system
headers.

Answer:
# dd if=/dev/zero of=/dev/rdisk/diskw bs=8k count=8k
8192+0 records in
8192+0 records out

4. Now attempt to reactivate the volume group. What happens?


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# vgchange a y vg01
vgchange: Warning: Couldn't attach to the volume group
physical
volume "/dev/disk/diskw":
Physical volume contains no LVM information.

L7 6 HP Confidential For training purposes only Rev. 14.21


Recovering LVM disks and structures

vgchange: Couldn't activate volume group "vg01":


Quorum not present, or some physical volume(s) are missing.
vgchange: Warning: couldn't query physical volume
"/dev/disk/diskw":
The specified path does not correspond to physical volume
attached to this volume group
vgchange: Warning: couldn't query all of the physical
volumes.

Re-activation fails because activation quorum is not present.

5. Is the volume group activated? Execute vgdisplay v to find out.


.................................................................................................................
.................................................................................................................

Answer:
# vgdisplay v vg01
vgdisplay: Volume group not activated.
vgdisplay: Cannot display volume group "vg01".

6. What can you do to activate the volume group without quorum? Make it so!
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# vgchange a y q n vg01
vgchange: Warning: Couldn't attach to the volume group
physical volume "/dev/disk/diskw":
Physical volume contains no LVM information.
Activated volume group.
vgchange: Couldn't resynchronize stale partitions of
the logical volume: I/O error
Volume group "vg01" has been successfully changed.

This still generates error messages, but at least the volume group was activated.

Rev. 14.21 HP Confidential For training purposes only L7 7


HP-UX Boot Camp

7. Now does vgdisplay indicate that there is a problem?


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# vgdisplay v vg01

Yes! vgdisplay displays the volume group, but includes error messages
regarding the missing physical volume.

L7 8 HP Confidential For training purposes only Rev. 14.21


Recovering LVM disks and structures

8. What happens if you attempt to back up the LVM headers by executing


vgcfgbackup vg01?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# vgcfgbackup vg01
vgcfgbackup: Warning: couldn't query physical volume
"/dev/disk/diskw":
The specified path does not correspond to physical volume
attached to this volume group
vgcfgbackup: Warning: couldn't query all of the
physical volumes.
vgcfgbackup: Couldn't query physical volume
"/dev/disk/disk14":
The specified path does not correspond to physical volume
attached to this volume group

The command fails. vgcfgbackup only works if all physical volumes in the
volume group are available.

9. Can you access vg01s logical volumes? Attempt to mount


/dev/vg01/simplevol and /dev/vg01/mirrorvol. What happens?
Why?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# mount /dev/vg01/mirrorvol /mirror
# mount /dev/vg01/simplevol /simple
/dev/vg01/simplevol: unrecognized file system

The mirrored logical volume should mount successfully, since the logical volumes
data is still accessible via the remaining mirror. The non-mirrored logical volume
mount request should fail, since the only disk in the logical volume is no longer
accessible.

Rev. 14.21 HP Confidential For training purposes only L7 9


HP-UX Boot Camp

Exercise 4Replacing a failed disk


Now lets see if you can restore the failed LVM disk. Perform these steps:
1. Use mount v to verify that simplevol, the non-mirrored logical volume, is
not mounted. mirrorvol may remain mounted.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# mount v

Note
If the disk had physically failed, this is the point where you would detach the disk
with pvchange, physically replace the failed disk and execute the scsimgr
and io_redirect_dsf commands to re-associate the instance numbers and
DSFs. You can skip these steps in the lab since the disk did not physically fail.

2. Use vgcfgrestore to restore the LVM headers to the disk.


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# vgcfgrestore n vg01 /dev/rdisk/diskw
Volume Group configuration has been restored to
/dev/rdisk/diskw

L7 10 HP Confidential For training purposes only Rev. 14.21


Recovering LVM disks and structures

3. Since you are not using LVM OLR, there is no need to re-attach the disk with
pvchange; use vgchange to reactivate the entire volume group and recognize
the restored disk instead.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# vgchange a y vg01
Volume group "/dev/vg01" is already active in requested mode.

4. Resynchronize the logical volumes in vg01.


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# vgsync vg01
Resynchronized logical volume "/dev/vg01/simplevol".
Resynchronized logical volume "/dev/vg01/mirrorvol".
Resynchronized volume group "vg01".

5. Verify that all logical volumes are synchronized.


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# vgdisplay v vg01| grep e LV Name e LV Status
LV Name /dev/vg01/simplevol
LV Status available/syncd
LV Name /dev/vg01/mirrorvol
LV Status available/syncd

Rev. 14.21 HP Confidential For training purposes only L7 11


HP-UX Boot Camp

Exercise 5Restoring logical volumes


You restored the LVM headers, but your logical volumes still require some attention.
Perform these steps:
1. The LVM headers have been restored, but did it restore the volume contents, too?
Attempt to mount the /dev/vg01/simplevol file system and explain the
results.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# mount /dev/vg01/simplevol /simple
/dev/vg01/simplevol: unrecognized file system

The file system metadata was corrupted by the dd command.

2. Use newfs to recreate the file system metadata structures in


/dev/vg01/rsimplevol and then remount the file system. How can you
restore the data that was in this file system?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# newfs F vxfs /dev/vg01/rsimplevol
# mount /dev/vg01/simplevol /simple

Unfortunately, since this logical volume was not mirrored, the data must be
restored from tape, or re-copied from /usr/bin/.
# cp /usr/bin/a* /simple 2>/dev/null

L7 12 HP Confidential For training purposes only Rev. 14.21


Recovering LVM disks and structures

3. Recall that you already successfully mounted mirrorvols file system in this
logical volume, even while one of the mirrors was unavailable. Did the user data
survive the disk failure, too?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ls /mirror

The user data should be fine, too.

4. The vgchange a y command several steps back should have synchronized


mirrorvols extents on the replacement disk. Execute lvdisplay v to verify
that the extents are current.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# lvdisplay v /dev/vg01/mirrorvol

Rev. 14.21 HP Confidential For training purposes only L7 13


HP-UX Boot Camp

Exercise 6Cleaning up
Before proceeding to the next exercise, remove the vg01 volume group and its
device files.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# umount /mirror
# umount /simple
# lvremove f /dev/vg01/mirrorvol
# lvremove f /dev/vg01/simplevol
# vgreduce vg01 /dev/disk/diskx
# vgremove X vg01

L7 14 HP Confidential For training purposes only Rev. 14.21


Recovering LVM disks and structures

Exercise 7Resetting the root password


Sometimes it is necessary to reset the system root password. There are two methods
to do so:
By using the single user mode
By using the system rescue image
Using the single user mode is faster and easier method to change root password, but
it might not work always. If your system has enhanced security enabled, HP-UX will
require the root password before allowing the access to the single user mode.
The method described in this exercise will always work, but you have to be very
careful not to damage the running system. In production, you might not have Ignite-
UX to boot from. In that case, you will have to use Installation CD to boot into the
Single User Mode.
1. Reboot your running system. As the root user, use the following command:
# shutdown ry 0

2. At EFI Boot Manager, interrupt the system boot, and select Core LAN A as boot
device. Note the hardware path used for boot, on the EFI Boot Manager marked
as HP-UX Primary Boot.

3. At the prompt to select the operating system to install, select the option 2 to
install the OS version B.11.31. Do NOT leave system unattended at this time, since
it will default to the incorrect target and you will have to start again from step 1.
Downloading file AUTO (226 bytes)
1. target OS is B.11.23 IA
2. target OS is B.11.31 IA
3. Exit Boot Loader

Rev. 14.21 HP Confidential For training purposes only L7 15


HP-UX Boot Camp

Choose an operating system to install that your hardware


supports: 2

4. Wait for the prompt, and press Enter to cancel batch-mode installation. Answer
y and press Enter again to proceed with the manual installation. Be carefull to
capture the moment prompt appears. Otherwise you will have to reboot and
lose a lot of time waiting.
WARNING: The configuration information calls for a non-
interactive
installation.

Press <Return/Enter> within 10 seconds to cancel


batch-mode installation: [Enter]

Really cancel non-interactive install and start the


user-interface? ([y]/n): y

5. Use the TAB key to navigate to the Run an Expert Recovery Shell option and
press Enter to continue.

L7 16 HP Confidential For training purposes only Rev. 14.21


Recovering LVM disks and structures

6. At the prompt Networking must be enabled in order to load a shell. (Press any
key to continue.), press Enter.
7. To select lan0 as the default network interface, press Enter.

8. At the Network Configuration screen, dont change anything. Choose OK to


continue.
9. At the HP-UX Network System Recovery Main Menu, type r and press Enter to
select the option to recover an unbootable system.
10. At the Device File Verification Menu, confirm the hardware path shown to you is
indeed the correct hardware path of your boot disk (/ ROOT). If the
information is correct, type a and press Enter to continue.
DEVICE FILE VERIFICATION MENU

This menu is used to specify the path of the root file


system.
When the information is correct, select 'a'.

INFORMATION to verify:
Device file used for '/'(ROOT) is c0t0d0.
The hardware path to disk is 0/3/0/0/0/0.0.0.

Select one of the following:


a. The above information is correct.
b. WRONG!! The device file used for '/'(ROOT) is
incorrect.

m. Return to the 'HP-UX Recovery MENU.'


x. Exit to the shell.

Selection: a [Enter]

Rev. 14.21 HP Confidential For training purposes only L7 17


HP-UX Boot Camp

11. At the HP-UX Recovery Menu, type a and press Enter to mount the root disk and
exit to a shell.
HP-UX Recovery MENU

Use this menu to select the level of recovery desired.

Select one of the following:


a. Mount the root disk and exit to a shell only.
b. Recover the bootlif/os partitions.
v. Read information about LVM recovery (LVM.RECOVER).

m. Return to 'HP-UX Recovery Media Main Menu'.


x. Exit to the shell.

Selection: a [Enter]

12. At the File System Check Menu, type a and press Enter to perform the file system
check before mounting.
FILE SYSTEM CHECK MENU

The file system check 'fsck -y /dev/rdsk/c0t0d0s4'


will now be executed.

Select one of the following:


a. Run fsck -y.
b. Prompt for the fsck execution string on c0t0d0s4.

m. Return to the 'HP-UX Recovery MENU.'

Selection: a [Enter]

13. At this point, the System Rescue Image is loaded to the RAM. Your actual root
device is mounted in read only mode on /ROOT/stand. To look around, use
the ls l command. Note that output on your system might look different.
log replay in progress
replay complete - marking super-block as CLEAN
Mounting /dev/dsk/c0t0d0s4 to /ROOT/stand as read only.
Loading /sbin/mount...
Creating temporary ROOT partition.
Loading /sbin/umount...
umount /ROOT/stand.
Executing fsck on /ROOT file system.
Loading /sbin/fsck...
fsck -F vxfs -y /dev/rdsk/c0t0d0s5
log replay in progress
replay complete - marking super-block as CLEAN
Mount /ROOT file system.
/sbin/fs/vxfs/mount /dev/dsk/c0t0d0s5 /ROOT
Loading /sbin/mount...
Mount /ROOT/stand again
/sbin/mount -F vxfs /dev/dsk/c0t0d0s4 /ROOT/stand

===============================================================
==
The root disk has been mounted under /ROOT. If you would like
to
L7 18 HP Confidential For training purposes only Rev. 14.21
Recovering LVM disks and structures

chroot to this directory, execute the commands:


loadfile chroot
chroot /ROOT /sbin/sh

To exit from the above optional chroot: use 'exit'.


To exit from this shell: use 'menu' to return to the menu
environment and select (b) Reboot.

# ls l
total 56
-rw------- 1 root sys 16 Mar 3 06:51
.sh_history
drwxr-xr-x 7 root root 96 Mar 3 05:10
RAMFS1
drwxr-xr-x 8 root root 1024 Mar 3 05:10
RAMFS2
drwxr-xr-x 16 root root 8192 Feb 28 10:39 ROOT
dr-xr-xr-x 2 bin bin 24 Jun 16 2011 cdev
d--------- 2 bin bin 24 Jun 16 2011 core
lrwxr-xr-x 1 root sys 12 Mar 3 05:11 dev -
> ./RAMFS1/dev
drwxr-xr-x 2 bin bin 24 Jun 16 2011 disc
dr-xr-xr-x 4 bin bin 1024 Mar 3 05:23
duped_root
lrwxr-xr-x 1 root sys 12 Mar 3 05:11 etc -
> ./RAMFS2/etc
-rw-r--r-- 1 root sys 546 Mar 3 05:11
installfs.cfg
drwxr-xr-x 2 root root 4096 Jun 16 2011
lost+found
lrwxr-xr-x 1 root sys 12 Mar 3 05:11 opt -
> ./RAMFS2/opt
drwxr-xr-x 5 bin bin 1024 Mar 3 06:49 sbin
drwxr-xr-x 2 bin bin 1024 Mar 3 06:49 stand
-rw-r--r-- 1 root sys 19 Mar 3 06:46
tempfile
lrwxr-xr-x 1 root sys 12 Mar 3 05:11 tmp -
> ./RAMFS2/tmp
lrwxr-xr-x 1 root sys 12 Mar 3 05:11 usr -
> ./RAMFS2/usr
lrwxr-xr-x 1 root sys 12 Mar 3 05:11 var -
> ./RAMFS2/var

Rev. 14.21 HP Confidential For training purposes only L7 19


HP-UX Boot Camp

14. You might notice that several important system directories, such as opt, dev,
var, usr, tmp point to the RAMFS device. That means that the file system you
are using at the moment does not represents the real root device, but the Rescue
System Image which is loaded to the RAM File System. To access the real disk
device, you have to issue chroot command. System image is kept at minimal
size (8MB), so before using the chroot command, you have to load it to the
Rescue Environment by executing the loadfile command.
# loadfile chroot
# chroot /ROOT /sbin/sh

15. You are ready to change the root password. Issue standard UNIX passwd
command to do that. Please note that if you mistype the root password at this
time, you have to repeat the procedure again which will demand more time. If
you want, you can omit the next command in the lab environment, just to be sure
that the password remains the same.
# passwd root
New password: hp [Enter]
Re-enter new password: hp [Enter]

16. To finish the chroot session, at the root prompt, type exit and press Enter.
# exit

17. Type menu and press Enter to return to the HP-UX Network System Recovery
Main Menu.
# menu

18. In the HP-UX Network System Recovery Main Menu, type b to reboot the system.
Press Enter and wait for system to reboot. After reboot is finished, you will be
able to log in using your previously assigned password.
HP-UX NETWORK SYSTEM RECOVERY
MAIN MENU

s. Search for a file


b. Reboot
l. Load a file
r. Recover an unbootable HP-UX system
x. Exit to shell

This menu is for listing and loading the tools contained on the
core media.
Once a tool is loaded, it may be run from the shell. Some tools
require other
files to be present in order to successfully execute.

Select one of the above: b [Enter]

L7 20 HP Confidential For training purposes only Rev. 14.21


Creating and managing DRD clones
Module 8 lab

Objectives
After completing this lab, you should be able to clone, mount, unmount, and activate
DRD clones.

Note
Ask your instructor which disk you should use as your boot disk clone. This lab
was designed to be performed in teams using the shared MP system console
session.

Requirements
To complete this lab, you will need:
Credentials to access HPVL
One properly configured HP Integrity server (assigned by your instructor)
Credentials for MP access to one Integrity server (available at the HPVL login
page)
Root credentials to access the system through the shared MP console session
(available at the HPVL login page)
One disk to be used as your boot disk clone

Introduction
For the rest of this lab, you will need to know DSF name of the disk to receive system
image during the DRD cloning process. Use command lvlnboot, ioscan and
strings to select disk which is NOT in use by the system.
# lvlnboot v
# ioscan kfnNC disk
# strings /etc/lvmtab

Fill in the information about the disk NOT being used by the system below:
New DRD clone = .............................................. (represented as diskz below)

Rev. 14.21 HP Confidential For training purposes only L8 1


HP-UX Boot Camp

ExerciseCreating and managing DRD clones


To create and manage DRD clones, perform these steps:
1. Verify that the DynRootDisk product is installed on your system.
# swlist DynRootDisk

2. Clone the existing boot volume group to the disk /dev/disk/diskz. Include x
overwrite=true in case there are old headers remaining on the clone disk
from previous labs. Copying the files to the new disk may take up to an hour,
depending on your lab system configuration. Be patient.
# drd clone -t /dev/disk/diskz -x overwrite=true
3. Execute drd status to verify that the clone was successfully created.

Answer:
# drd status

4. Check the contents of the mount table. The clone is currently inactive, so should
not appear in the mount table.

Answer:
# mount v

5. Simulate an accidental boot disk misconfiguration and see how DRD can help
recover. Execute the vipw command to edit the /etc/passwd file on the active
image. Delete the line in /etc/passwd associated with user www, which is
used by the Apache web server. Then try to start Apache.
# vipw
www:*:30:1::/:
# /opt/hpws22/apache/bin/apachectl start

You should get a message indicating that the daemon cant start because the
www username is missing:
httpd: bad user name www

Fortunately you have a backup copy of the /etc/passwd file on the DRD
clone!
Temporarily mount the clones file systems.
Answer:
# drd mount
# mount v

L8 2 HP Confidential For training purposes only Rev. 14.21


Creating and managing DRD clones

The clones file systems should be mounted on mount points under


/var/opt/drd/mnts/sysimage_001/.

6. Use the diff command to view differences between the active and inactive
system images /etc/passwd files.

Answer:
# diff /etc/passwd /var/opt/drd/mnts/sysimage_001/etc/passwd

7. Use vipw and the output from the diff command to add the www line back
into the active images /etc/passwd file.

Answer:
# vipw
www:*:30:1::/:

8. Try to start Apache again. This time it should work.

9. Stop the daemon before proceeding.


# /opt/hpws22/apache/bin/apachectl start
# /opt/hpws22/apache/bin/apachectl stop

10. Unmount the DRD clone file systems.

Answer:
# drd umount

11. DRD allows the administrator to manage software without affecting the active
system image. Use drd runcmd to list the software installed on the inactive
DRD image.

Answer:
# drd runcmd swlist

Rev. 14.21 HP Confidential For training purposes only L8 3


HP-UX Boot Camp

12. Activate the cloned system image to verify that it works.

Answer:
# drd activate

Activating the image simply changes the boot paths in NVRAM. The clone disk
should now be the primary boot device.

13. Shut down and reboot from the clone disk.

Answer:
# shutdown ry 0

14. When the system returns, execute drd status again to verify that the system
booted from the clone disk. Use the output of command to check the DSF of the
Original Disk, Clone Disk and Booted Disk.

Answer:
# drd status

* Clone Disk: /dev/disk/diskz
* Clone EFI Partition: Boot loader and AUTO file present
* Clone Creation Date: 07/18/08 21:07:29 EDT
* Clone Mirror Disk: None
* Mirror EFI Partition: None
* Original Disk: /dev/disk/diska
* Original EFI Partition: Boot loader and AUTO file present

* Booted Disk: Original Disk (/dev/disk/diskz)


* Activated Disk: Original Disk (/dev/disk/diskz)

L8 4 HP Confidential For training purposes only Rev. 14.21


Creating and managing DRD clones

15. Run drd activate and reboot again to reactivate the original system image.

Answer:
# drd activate x reboot=true

16. Use the drd status command to verify which disk you booted from.
# drd status

17. To verify if the drd clone drive content is not modified, issue following
commands:
# drd mount
# mount -v
# more /var/opt/drd/mnts/sysimage_001/etc/passwd

18. Add a new user account on the system.


# useradd m s /usr/bin/sh user25

19. Will drd sync recognize this change in /etc/passwd? Execute drd sync
in the preview mode to find out!
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# drd sync p may take several minutes

20. To prove the data sync, once more issue the following command
# more /var/opt/drd/mnts/sysimage_001/etc/passwd

Rev. 14.21 HP Confidential For training purposes only L8 5


HP-UX Boot Camp

21. Review the list of files that need to be synchronized.

Answer:
# more /var/opt/drd/sync/files_to_be_copied_by_drd_sync

22. Run the synchronization command without the preview option.

Answer:
# drd sync may take several minutes

23. To unmount the drd clone, issue the following command:


# drd unmount

24. Clobber the clone that you created by overwriting the top of the disk with
zeroes.
# dd if=/dev/zero of=/dev/rdisk/diskz bs=1048576
count=1024

L8 6 HP Confidential For training purposes only Rev. 14.21


Managing software with SD-UX
Module 9 lab

Objectives
After completing this lab, you should be able to install and remove applications and
patches using HPs SD-UX suite of software management utilities.

Note
This lab was designed to be performed in teams using the shared MP system
console session.

Requirements
To complete this lab, you will need:
Credentials to access HPVL
One properly configured HP Integrity server (assigned by your instructor)
Credentials for MP access to one Integrity server (available at the HPVL login
page)
Root credentials to access the system through the shared MP console session
(available at the HPVL login page)

Rev. 14.21 HP Confidential For training purposes only L9 1


HP-UX Boot Camp

Exercise 1Preparing to use SD-UX


Perform these steps:
1. Before running any of the SD-UX utilities, all file systems must be mounted. Check
to ensure that your file systems are mounted.

Answer:
# mount v

2. The swagentd daemon must be running before you can install or remove
software on your host. Check to ensure that swagentd is running on your host.

Answer:
# ps -ef | grep swagentd

L9 2 HP Confidential For training purposes only Rev. 14.21


Managing software with SD-UX

Exercise 2Listing installed software


To list the installed software, perform these steps:
1. Before installing any new software, you may want to see what software is
already installed on your system. The swlist command allows you to list the
bundles, products, and filesets available on your machine. Try these commands:
# swlist -l bundle
# swlist -l product
# swlist -l fileset

2. What fields of information are provided in the swlist output?


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
By default, swlist shows three fields:
Product/bundle name
Version number
Description of the product/bundle

3. Do you have the JFS product installed on your system? Do you have OnlineJFS?
How can you use the swlist command to find out?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# swlist JFS OnlineJFS

Both products should be installed.

Rev. 14.21 HP Confidential For training purposes only L9 3


HP-UX Boot Camp

4. HP-UX also offers an interactive version of swlist with a graphical interface.


Run the interactive version by typing:
# swlist i

To navigate Text User Interface, use arrow keys (Up / Down), Enter to confirm
action, and TAB key to switch between the menu and main window.
a. View a list of the products that are included in the BaseLVM bundle. (Use
the arrow keys Up / Down).
b. View a list of the sub-products included in the LVM product. (Once you
position the cusor on the LVM Product row, press enter to view sub-
products).
c. View a list of the filesets included in the MinimumRuntime sub-product.
d. View a list of the files included in the LVM-RUN fileset.
5. Exit out of swlist. Use the TAB key to access the File menu, and press enter to
expand it. Use arrow keys to navigate to Exit, and press enter to terminate swlist
command.

Answer:
Select File Exit.

L9 4 HP Confidential For training purposes only Rev. 14.21


Managing software with SD-UX

Exercise 3Installing and removing software


To install and remove software, perform these steps:
1. Do you have any depots available on your system? Use swlist to find out!
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# swlist l depot

Since we determined that /labs/depts directory is not listed, we need to perform


following steps to install it.
2. What product(s) are available in the /labs/depots/echoapp.depot
depot?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# swlist l product d @ /labs/depots/echoapp.depot

3. Install the EchoApp product from the depot.

Answer:
# swinstall s /labs/depots/echoapp.depot x autoreboot=true
EchoApp

Rev. 14.21 HP Confidential For training purposes only L9 5


HP-UX Boot Camp

4. View the /var/adm/sw/swinstall.log file. Did the installation succeed?


Were there any errors or warnings?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# more /var/adm/sw/swinstall.log

5. What happens if you swinstall the EchoApp product again? Try it! Watch
the resulting logfile messages carefully. Is there any indication that the product
has already been installed?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# swinstall s /labs/depots/echoapp.depot x autoreboot=true
EchoApp

You should see a message reporting:


3 filesets have the selected revision already installed.

6. Use the swremove command to remove EchoApp.

Answer:
# swremove EchoApp

L9 6 HP Confidential For training purposes only Rev. 14.21


Managing software with SD-UX

Exercise 4Completing preliminary steps for


installing patches
To prepare for installing patches, perform these steps:
1. Run the swinstall utility to install the EchoApp utility on your machine.
EchoApp should be available in a local depot on your machine called
/labs/depots/echoapp.depot.

Answer:
# swinstall s /labs/depots/echoapp.depot \
x autoreboot=true EchoApp

Note that the backslash is not part of the command and is only here to indicate
line continuation because the command spans onto 2 lines but needs to be ran
onto 1 line only.

2. List the products installed on your host and verify that EchoApp is installed? Try
running echoapp to see what it does.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# swlist EchoApp
# /opt/echoapp/bin/echoapp

Rev. 14.21 HP Confidential For training purposes only L9 7


HP-UX Boot Camp

Exercise 5Installing and removing patches


To install and remove patches, perform these steps:
1. Often administrators download and install patches from HP's SupportLine web
site. For this lab exercise, that won't be necessary. The patch you will install,
PHSS_01111, is already in your /labs directory. It is embedded in a patch
package called /labs/patches.tgz. To start, copy the patch package to the
/tmp directory.

Answer:
# cp /labs/patches.tgz /tmp

2. cd to the /tmp directory, unzip, and untar the patch package. What files are
created as a result?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# cd /tmp
# gzip -d /tmp/patches.tgz
# tar xvf /tmp/patches.tar

Yields the file PHSS_01111.

3. Unpack the patch's shar archive. Read the .text file. What problem does this
patch fix? Will the patch perform an automatic reboot?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# sh /tmp/PHSS_01111 # Yields PHSS_01111.text and
PHSS_01111.depot
# more /tmp/PHSS_01111.text

L9 8 HP Confidential For training purposes only Rev. 14.21


Managing software with SD-UX

4. Follow the directions in the patch's .text file to install the patch. Since you
may need to remove this patch eventually, do not to use the
patch_save_files=false option. Try running echoapp again. Did the
patch seem to work?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# swinstall -x autoreboot=true -x patch_match_target=true \
-s /tmp/PHSS_01111.depot
# /opt/echoapp/bin/echoapp

Again, note that the backslash is not the part of the command. It is used to split
the comand in two lines.
5. swinstall keeps copies of all files that have been replaced by patches in the
/var/adm/sw/save directory. Take a look at the PHSS_01111 files under this
directory. Which two files were replaced by the PHSS_01111 patch?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# cd /var/adm/sw/save
# ll | grep PHSS_01111
# cd PHSS_01111; ll
ECHOAPP-MISC-DOC
ECHO-RUNTIME

6. Run echoapp to see what has changed?

Answer:
# /opt/echoapp/bin/echoapp

Rev. 14.21 HP Confidential For training purposes only L9 9


HP-UX Boot Camp

7. Now run swremove to remove the patch. Again look at the files under
/var/adm/sw/save. What changed?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# swremove PHSS_01111
# ll /var/adm/sw/save/PHSS_01111
# /opt/echoapp/bin/echoapp

8. Now remove the EchoApp product as well.

Answer:
# swremove EchoApp

L9 10 HP Confidential For training purposes only Rev. 14.21


Managing software with SD-UX

Exercise 6Installing and removing patches with


applications
To install and remove patches with applications, perform these steps:
1. Try installing EchoApp again, but this time install the product from
/labs/depots/echoapp+patch.depot. Note that this depot contains both
the EchoApp product and the PHSS_01111 patch.

Answer:
# swinstall s /labs/depots/echoapp+patch.depot x \
autoreboot=true EchoApp

2. Run echoapp. Based on this experiment, what is the advantage of having


products and their associated patches in the same depot?

Note
This feature is new with 11.x.

.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# /opt/echoapp/bin/echoapp
# ll /var/adm/sw/save/PHSS_01111

Applicable patches are automatically installed with the product.

Rev. 14.21 HP Confidential For training purposes only L9 11


HP-UX Boot Camp

3. Now remove the EchoApp product. Afterward, use swlist to see if PHSS_01111
is still installed on your system. When you remove a product, what happens to
the patches associated with that product?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# swremove x autoreboot=true EchoApp

4. Confirm your conclusion in the previous step by running swlist.

Answer:
# swlist EchoApp PHSS_01111
# ll /var/adm/sw/save/PHSS_01111

L9 12 HP Confidential For training purposes only Rev. 14.21


Managing software with SD-UX

Exercise 7Committing patches


To commit patches, perform these steps:
1. Install EchoApp and the PHSS_01111 patch again from the
echoapp+patch.depot.

Answer:
# swinstall s /labs/depots/echoapp+patch.depot x \
autoreboot=true EchoApp

2. As you install patches on your system, the /var/adm/sw/save directory can


consume a significant amount of disk space. You can save some space in
/var/adm/sw/save by committing a patch. Try committing the PHSS_01111
patch. What effect does the swmodify command have on the
/var/adm/sw/save directory? Use find and du to find out.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# find /var/adm/sw/save/PHSS_01111
# du sk /var/adm/sw/save
# swmodify -x patch_commit=true PHSS_01111
# find /var/adm/sw/save/PHSS_01111
# du sk /var/adm/sw/save

Rev. 14.21 HP Confidential For training purposes only L9 13


HP-UX Boot Camp

3. Try to remove the patch. What appears to be the downside of committing a


patch?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# swremove x autoreboot=true PHSS_01111

4. Can you still remove the product associated with the patch? Try it. Then swlist
both the EchoApp product and the patch.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# swremove x autoreboot=true EchoApp
# swlist EchoApp PHSS_01111

L9 14 HP Confidential For training purposes only Rev. 14.21


Working with HP-UX services
Module 10 lab

Objectives
After completing this lab, you should be able to:
Manualy start and stop services
Enable and disable services to run at the system boot

Note
This lab was designed to be performed in teams using the shared MP system
console session.
Also, portions of this lab may disable your LAN interface card. If you are using
remote lab equipment, log in via the MP console interface for the duration of the
lab.

Requirements
To complete this lab, you will need:
Credentials to access HPVL
One properly configured HP Integrity server (assigned by your instructor)
Credentials for MP access to one Integrity server (available at the HPVL login
page)
Root credentials to access the system through the shared MP console session
(available at the HPVL login page)

Rev. 14.21 HP Confidential For training purposes only L10 1


HP-UX Boot Camp

Exercise 1Exploring the startup/shutdown scripts


You have seen in this chapter that many system and network services are started
automatically during the boot process via "S" scripts in the /sbin/rc*.d
directories. You can view a list of these scripts by typing:
# ls /sbin/rc*.d/S*

Answer the questions below using the output from the ls command above:
1. At which run level does the NFS client functionality start?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ls /sbin/rc*.d/S* | grep nfs
The NFS client functionality starts at run level 2.

2. At which run level does the NFS server functionality start?


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ls /sbin/rc*.d/S* | grep nfs
The NFS server functionality starts at run level 3.

3. At which run level does your system set its hostname?


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ls /sbin/rc*.d/S* | grep hostname
The host name is set at run level 1.

L10 2 HP Confidential For training purposes only Rev. 14.21


Working with HP-UX services

4. At which run level does the "net" script set your IP address?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ls /sbin/rc*.d/S* | grep net
Run level 2.

5. At which run level does the sendmail daemon begin delivering mail?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ls /sbin/rc*.d/S* | grep mail
Run level 2.

6. At which run level does the NIS service become available?


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ls /sbin/rc*.d/S* | grep nis
Run level 2.

Rev. 14.21 HP Confidential For training purposes only L10 3


HP-UX Boot Camp

7. At which run level does the system enable access to ftp, telnet, and other Internet
services?

Hint
Internet services are started by the inetd Internet daemon.

.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ls /sbin/rc*.d/S* | grep inet
Run level 2.

L10 4 HP Confidential For training purposes only Rev. 14.21


Working with HP-UX services

Exercise 2Starting and stopping services


Most services may be manually started and stopped using the startup scripts in the
/sbin/init.d directory:
1. Is the sendmail daemon currently running on your machine?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ps -ef | grep sendmail

On most systems, sendmail should be running by default.

2. Stop the sendmail daemon using the init.d script.

Answer:
# /sbin/init.d/sendmail stop

3. Is the sendmail daemon running?


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ps -ef | grep sendmail

Sendmail is not running. The output on your terminal might end with grep
sendmail. Thats not sendmail daemon running, but actual grep command
captured by ps ef.

Rev. 14.21 HP Confidential For training purposes only L10 5


HP-UX Boot Camp

4. Restart sendmail properly and then check to ensure the daemon is running.

Answer:
# /sbin/init.d/sendmail start
# ps -ef | grep sendmail

The daemon should be running.

L10 6 HP Confidential For training purposes only Rev. 14.21


Working with HP-UX services

Exercise 3Enabling, disabling, and configuring


services
There are many network and system services available, but you may not need all of
those services to be enabled. For instance, if you don't use networked file systems,
you may choose to disable NFS. Most services may be enabled or disabled via their
control variables. Usually control variables match the name of the service they
control; for example, the sendmail daemon is controlled by the SENDMAIL control
variable.
Setting a control variable to "1" enables that service at next boot, while setting the
control variable to "0" disables the service at next boot. Control variables are set in
configuration files in /etc/rc.config.d/*. Sometimes the configuration file
matches the name of the service. You can always use the grep command to find the
proper configuration file for a service. For instance, the output from the following
grep command suggests that the sendmail control variable is defined in
/etc/rc.config.d/mailservs.
# grep -il sendmail /etc/rc.config.d/*
/etc/rc.config.d/mailservs

To determine if service is configure to be automatically enabled at the boot time, use


the following command:
# more /etc/rc.config.d/mailservs

See if you can find the /etc/rc.config.d configuration files for each of the
services below, and determine which of those services are enabled on your system.

Service name Configuration filename Enabled?


nfs.server /etc/rc.config.d/nfsconf Y
nfs.client /etc/rc.config.d/nfsconf Y
nis.server /etc/rc.config.d/namesvrs N
nis.client /etc/rc.config.d/namesvrs N
sendmail /etc/rc.config.d/mailservs Y
Sshd /etc/rc.config.d/sshd Y
xntpd /etc/rc.config.d/netdaemons N

Rev. 14.21 HP Confidential For training purposes only L10 7


HP-UX Boot Camp

L10 8 HP Confidential For training purposes only Rev. 14.21


Configuring and troubleshooting network
connectivity
Module 12 lab

Objectives
After completing this lab, you should be able to:
Configure a new host name and IP address for each system in your classroom
Troubleshoot network connectivity problems

Requirements
To complete this lab, you will need:
Credentials to access HPVL
One properly configured HP Integrity server (assigned by your instructor)
Credentials for MP access to one Integrity server (available at the HPVL login
page)
Root credentials to access the system through the shared MP console session
(available at the HPVL login page)

Introduction
In this lab, you will configure a new host name and IP address for each system in
your classroom. Your instructor will assign you a host name to work with.
The first two octets for all Lab Groups will be 192.168, and should be consistent
across all hosts within your classroom.
When configuring new LAN interface, use the lan1 network interface. During this
lab, you will lose SSH connectivity to your server. Make sure that you are using
System Console through the Management Processor to maintain connectivity.
Within the lab environment, you have no external connectivity. During the lab, you
will have to test your network settings by querying the IP address of the server from
the other Lab Group. Ask your instructor what other theam you should be working
with.

Rev. 14.21 HP Confidential For training purposes only L12 1


HP-UX Boot Camp

Exercise 1Performing the preliminary steps


Portions of this lab may disable your LAN interface card. If you are using remote lab
equipment, log in via the GSP/MP console interface for the duration of the lab.
Complete these steps:
1. Just in case something goes wrong during the lab, make a backup copy of all
network configuration files. There is a shell script in your labs directory
designed specifically for this purpose. The shell script will save a tar archive of
your network configuration files in the file you specify. Add the l option to
verify the backup.
# /labs/netfiles.sh -s ORIGINAL
# /labs/netfiles.sh l
# /labs/netfiles.sh l ORIGINAL

2. There should be a script in the /labs directory called netsetup.sh. This


script will ask you for your hostname, your LAN interface name (use lan1), and
the first two IP octets. Use the following table to find your hostname:

Lab Group 1 chicago

Lab Group 2 atlanta

Lab Group 3 nyc

Lab Group 4 paris

Lab Group 5 london

Lab Group 6 bonn

After you enter the requested information, the script will display your assigned IP
address and a variety of other network settings that you will use later in the
class. The script will also create a new hosts file in /tmp/hosts. Run the script,
then review the /tmp/hosts file. By default, the script doesnt actually change
your network configuration.
# /labs/netsetup.sh
# cat /tmp/hosts

3. Changing your host name and IP on a running system can wreak havoc on CDE
and other applications. Kill CDE before going any further:
# /sbin/init.d/dtlogin.rc stop

L12 2 HP Confidential For training purposes only Rev. 14.21


Configuring and troubleshooting network connectivity

Exercise 2Configuring a LAN interface


Perform these steps:
1. How many LAN cards does your system have and what are their hardware
paths?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
The following commands may be used to view your LAN card hardware paths:
# lanscan or
# nwmgr or
# ioscan funC lan

2. Verify that the Networking product is installed on your machine. Is any


additional networking software installed on your machine to support LAN
interface cards?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# swlist l product Networking
# swlist l bundle | grep HW=

Every machine should have the Networking product loaded. Other LAN
software will vary from system to system.

Rev. 14.21 HP Confidential For training purposes only L12 3


HP-UX Boot Camp

3. Does your kernel contain the drivers necessary to support your LAN cards?
Which command will tell you if a driver has CLAIMED your LAN cards?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ioscan funC lan

The drivers should already be installed, and all cards should be CLAIMED.

4. Determine the interface names for each of your LAN cards.


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# lanscan or...
# nwmgr

Note that the solutions below assume that your default LAN card is lan0

5. Determine your interface cards MAC address.


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# lanscan or...
# nwmgr

L12 4 HP Confidential For training purposes only Rev. 14.21


Configuring and troubleshooting network connectivity

6. From the command line, set your interface cards current speed/duplex setting to
auto_on.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# lanadmin X auto_on 0 or...
# nwmgr --set --attribute speed=auto_on -c lan0

7. Did the previous step work? Verify your interface cards speed/duplex setting.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# lanadmin x 0 or...
# nwmgr --get --attribute speed -c lan0

8. Use nwmgr to make the speed/duplex change permanent in the appropriate


/etc/rc.config.d/ file.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# nwmgr --set --attribute all --sa --from current -c lan0

Rev. 14.21 HP Confidential For training purposes only L12 5


HP-UX Boot Camp

9. From the command line, change your IP address to the address suggested at the
top of the /tmp/hosts file. Be sure to change your netmask to 255.255.0.0,
too!
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# more /tmp/hosts
# ifconfig lan1 w.x.y.z netmask 255.255.0.0 # replace w.x.y.z with
your IP address

10. Is your new IP address set properly? How can you find out?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ifconfig lan1

ifconfig should indicate that the IP and netmask have been set properly.

11. Modify the /etc/rc.config.d/netconf file to make your IP address


change permanent.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# vi /etc/rc.config.d/netconf
INTERFACE_NAME[0]=lan0 use your interface name here
IP_ADDRESS[0]=w.x.y.z use your new IP here
SUBNET_MASK[0]=255.255.0.0
BROADCAST_ADDRESS[0]=""
INTERFACE_STATE[0]=""
DHCP_ENABLE[0]="" change value from 1 to
INTERFACE_MODULES[0]=""

L12 6 HP Confidential For training purposes only Rev. 14.21


Configuring and troubleshooting network connectivity

12. If a default route is currently defined in /etc/rc.config.d/netconf, delete


it. You will have a chance to configure a new default route later. Look for the
ROUTE_GATEWAY[0] variable, and make sure the value of the variable is null.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
ROUTE_DESTINATION[0]=default
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]=""
ROUTE_COUNT[0]=""
ROUTE_ARGS[0]=""
ROUTE_SOURCE[0]=""

13. From the command line, disable IP forwarding by setting the ndd
ip_forwarding parameter to 0.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ndd set /dev/ip ip_forwarding 0

14. Did the IP forwarding parameter change? How can you find out?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ndd get /dev/ip ip_forwarding

Rev. 14.21 HP Confidential For training purposes only L12 7


HP-UX Boot Camp

15. Modify the appropriate /etc/rc.config.d/ file to make your IP forwarding


change permanent.

Note
Use array index 0.

.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# vi /etc/rc.config.d/nddconf
TRANSPORT_NAME[0]=ip
NDD_NAME[0]=ip_forwarding
NDD_VALUE[0]=0

16. From the command line, change the TCP/IP and UUCP hostnames to the
hostname suggested at the top of your /tmp/hosts file.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# hostname sanfran # use your assigned hostname
# uname -S sanfran # use your assigned hostname

17. Verify that the hostname change succeeded.


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# hostname
# uname n

L12 8 HP Confidential For training purposes only Rev. 14.21


Configuring and troubleshooting network connectivity

18. Modify the appropriate /etc/rc.config.d/ file to make your hostname


change permanent.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# vi /etc/rc.config.d/netconf
HOSTNAME=sanfran

19. Copy the /tmp/hosts file into place as the default /etc/hosts file. Also
define your instructors first name as an alias for hostname corp.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# cp /etc/hosts /etc/hosts.old
# cp /tmp/hosts /etc/hosts
# vi /etc/hosts

20. Modify the hostname in your /etc/issue file that HP-UX displays at login
time. Your /etc/issue file may be slightly different than the sample file below.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# vi /etc/issue
your_new_hostname [Location: Alpahretta, GA USA] (see
/etc/issue)

Rev. 14.21 HP Confidential For training purposes only L12 9


HP-UX Boot Camp

21. Reboot to see if your changes worked!


.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# shutdown ry 0

L12 10 HP Confidential For training purposes only Rev. 14.21


Configuring and troubleshooting network connectivity

Exercise 3Checking the new configuration


Perform these steps:
1. Check your LAN card's IP address. Did the configuration work?
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ifconfig lan1 use your interface name

The configuration should have succeeded!

2. The hostname command will display your system host name. Check to ensure
that your host name is set properly.

Answer:
# hostname

Your host name should be set properly (it will fail if the hostname was not set).

3. Try to ping the IP address of the server from other lab group. Does this work?
You will have to wait for another Lab Group to have server configured in order
to make ping working.
.................................................................................................................
.................................................................................................................
.................................................................................................................
.................................................................................................................
Answer:
# ping hostname # ask your instructor what IP to use here

Assuming the hostname you ping has been added to /etc/hosts and that the
host is configured properly, this should work.

Rev. 14.21 HP Confidential For training purposes only L12 11


HP-UX Boot Camp

Exercise 4Troubleshooting network connectivity


Troubleshooting LAN problems can be difficult because a variety of hardware and
software components may be involved and because the problem impacting your
system may originate in another part of the network. This exercise provides quick fix
solutions to common network problems by providing answers to the most frequently
asked troubleshooting questions. Look through the problems identified to see if your
problem fits into any of these categories. If so, you may be able to quickly identify
and recover from the problem without any further investigation.

Performance
Question:
I've noticed a significant drop in system response time and performance. What
steps can I take to improve it?
Answer:
Performance may be affected by many different factors. Sometimes removing
pseudo drivers from the kernel for networking software that you may not be
using improves performance.
The problems may also be in the upper layer software (ftp or telnet). Also, it is
possible that too little memory is allocated to hold fragmented messages in the
IP layer. IP messages may be fragmented into smaller parts when the message is
sent through the system. The fragments must be held in memory for some time so
that the entire message can be reassembled because the fragments arrive at the
destination at different times and possibly out of order. Normally, fragmentation
reassembly memory is limited arbitrarily so that incomplete messages do not
consume all of memory, which could cripple the system.
During stressful networking activity, some fragments might never be delivered
because they are typically dropped in transit; for example, due to a collision or
resource limitations on an intermediate system. However, fragments might also
not be delivered (dropped) if there is insufficient fragmentation reassembly
memory on the destination system during periods of high network activity. This
can degrade performance due to retransmissions of data. If the problem is due
to a high number of fragments dropped after time-out (see the output from the
command netstat -sp ip), you might want to increase the size of the
fragmentation reassembly memory by changing the ip_reass_mem_limit
value using the ndd command. (The default is 2MB for the system.) Enter the
command /usr/bin/ndd -h to display ndd parameters and their use.

L12 12 HP Confidential For training purposes only Rev. 14.21


Configuring and troubleshooting network connectivity

New system disrupts LAN


Question:
I tried to attach a new system to our site LAN. To make the installation process
faster, I copied over an /etc/rc.config.d/netconf file from another
system on the site LAN and used it on the new system. When I booted up the
system, the site LAN went down.
Answer:
You probably didn't assign a new IP address and host name prior to rebooting
the system. If any two systems on the LAN have the same IP address and host
name, the LAN will go down. Check the IP address in the
/etc/rc.config.d/netconf file against the IP address of your system and
other systems on your network map to be sure that no duplicate IP addresses
exist on the LAN.

Note
Related documentation: Refer to the ifconfig(1M) man page.

Determining interface name


Question:
How do I determine the name of the interface to be configured?
Answer:
Use the lanscan or nwmgr command to determine the hardware path of the
interface card that you want to configure. Then use the value displayed for the
Net-Interface Name PPA field as the interface name.

Multiple LAN interfaces, intermittent failures


Question:
I have been having problems getting the two LAN interfaces on my system to
operate at the same time. Occasionally the Ethernet cards stop communicating
with remote systems. When this happens, the remote system also cannot
communicate with the local system.
Answer:
Check that the two interfaces on your system do not have the same network
number or, if you are subnetting, the same subnet address. If both LAN
interfaces have the same value in the network (subnet) address portions of the IP
address, the cards may not be enabled simultaneously (although they may both
run separately). Check the content of /etc/rc.config.d/netconf file, and
output of netstat rn command to collect the information.

Rev. 14.21 HP Confidential For training purposes only L12 13


HP-UX Boot Camp

New system cant reach some subnets


Question:
I recently tried to add a new system onto a subnet on our site LAN, and I am not
able to communicate successfully with all LANs on the network.
Answer:
Check the routing table to make sure the route for the LAN you are trying to
communicate with has been properly configured. Execute netstat -rvn on
both ends. Verify the subnet address, netmask and gateway.

Configuring address 127.0.0.1


Question:
I tried to add the IP address, 127.0.0.1, but the system won't accept it.
Answer:
Addresses with the format 127.n.n.n are reserved as loopback addresses. Select
another IP address.

Displaying station address


Question:
How do I locate the station address of my LAN card?
Answer:
Use the nwmgr or lanscan command to display the station addresses of all
LAN cards in the system:
nwmgr

or
lanscan

Note
Related documentation: Refer to the nwmgr (1M) or lanscan(1M) man page.

L12 14 HP Confidential For training purposes only Rev. 14.21


Configuring and troubleshooting network connectivity

Resetting LAN card


Question:
How do I reset the LAN card?
Answer:
Run the lanadmin diagnostic by entering the following sequence of commands,
where x is the Physical Point of Attachment (PPA) of the interface you want to
reset. (Use the lanscan or nwmgr command to determine the PPA of the
interface on the system.)
lanadmin
lan
ppa
x
reset
quit

Note
Related documentation: Refer to the lanadmin(1M) man page.

Note
You can also reset the LAN card using the reset operation of the nwmgr
command. See nwmgr(1M) for details.

Tracing
Question:
What's the best way to obtain and format tracing information when I am using
the nettl utility?
Answer:
HP field engineers recommend the following commands.
To begin LAN and loopback tracing, execute:
nettl -tn pduin pduout -e ns_ls_driver -f filename

To end LAN tracing, execute:


nettl -tf -e all

To format your entire LAN trace (no filtering), execute:


netfmt -Nnl -f filename.TRC1 > fmt1
netfmt -Nnl -f filename.TRC0 > fmt0

Rev. 14.21 HP Confidential For training purposes only L12 15


HP-UX Boot Camp

The file filename.TRC0 is the most recent trace file. If this file does not
contain the trace information you are looking for, check the filename.TRC1 file.
To format your LAN trace using a filter file, execute:
netfmt -c filterfile -N -f filename.TRC0 > fmt0

nettl appends TRC0 or TRC1 to the name you give the raw trace file.

Intermittent networking problems


Question:
I'm experiencing intermittent networking problems on my computer. What should
I check to ensure proper operation of my networking software?
Answer:
Upper layer software often requires loopback. Check
/etc/rc.config.d/netconf to be sure that the loopback entry is correct.
The line in the netconf file should read:
LOOPBACK_ADDRESS=127.0.0.1

No such interface in boot logs


Question:
After I booted my server, I found that networking failed. I found the following
error in the /var/adm/rc.log file:
ifconfig lan0: no such interface

How do I resolve this problem?


Answer:
This problem is caused by the LAN driver software disabling the LAN card
because it was not connected to the LAN, or the LAN was down. Use
lanadmin or the reset operation of the nwmgr command to reset the LAN card
and run ifconfig to bring the card up. See lanadmin(1M) or nwmgr(1M)
for details.

No such interface report by ifconfig


Question:
When I configure an interface, ifconfig returns the error no such interface.
What should I do?
Answer:
The numeric portion of the interface name is incorrect. Run the lanscan or
nwmgr command to obtain a list of interface names.

Plumbing error
Question:
L12 16 HP Confidential For training purposes only Rev. 14.21
Configuring and troubleshooting network connectivity

When I configure an interface, ifconfig returns a Plumbing error message.


What should I look for?
Answer:
The interface name specified in the ifconfig run string is not defined in the
/dev directory or is not a streams driver. The network device files /dev/ip and
/dev/tcp are not defined. Use ll command to check the /dev direcroty, and
ioscan kC lan command to list available NIC. Compare output with
configuration found in /etc/rc.config.d/netconf.

Cant communicate outside local supernet


Question:
I recently tried to set up a supernet on my LAN. The systems in the supernet can
communicate with one another, but they cannot communicate with systems
outside the supernet.
Answer:
Check the routing table on your system and the node you want to communicate
with. If the system you want to communicate with does not support supernetting,
you will have to configure a network route for each of the networks in the
supernet. If the system you want to communicate with supports supernetting, you
will only need to add a network route for the supernet. To check the routing
table use netstat rn command. To adjust the route, modify the content of
/etc/rc.config.d/netconf file. To thrace the network path, use
traceroute command.

Rev. 14.21 HP Confidential For training purposes only L12 17


HP-UX Boot Camp

L12 18 HP Confidential For training purposes only Rev. 14.21


Installing the OS with Ignite-UX
Module 13 lab

Objectives
After completing this lab, you should be able to perform the installation of the HP-UX
server using the Ignite-UX service.

Requirements
To complete this lab, you will need:
Credentials to access HPVL
One properly configured HP Integrity server (assigned by your instructor)
Credentials for MP access to one Integrity server (available at the HPVL login
page)
Root credentials to access the system through the shared MP console session
(available at the HPVL login page)
One disk to perform the installation to (assigned by your instructor)

Rev. 14.21 HP Confidential For training purposes only L13 1


HP-UX Boot Camp

Exercise 1Rebooting the Integrity server


Perform these steps:
1. Log into the Management Processor using the connection provided by the HPVL
environment.
2. If you are currently logged into the HPUX server, press CTRL+b to return to the
Management Processor interface. At the MP Main Menu, select the option CM to
access the Command Menu.
MP MAIN MENU:

CO: Console
VFP: Virtual Front Panel
CM: Command Menu
SMCLP: Server Management Command Line Protocol
CL: Console Log
SL: Show Event Logs
HE: Main Help Menu
X: Exit Connection

[rx26-412] MP> CM

3. At the Command Menu prompt, enter the command PC to enter the Power
Control menu, and use command C to power cycle the system.
[rx26-nnn] MP:CM> pc
PC
Current System Power State: On

Power Control Menu:


C - Power Cycle
ON - Power On
OFF - Power Off
G - Graceful Shutdown

Enter menu item or [Q] to Quit: C

4. To confirm that you want to reboot the OS, answer Y at the prompt. MP will
return the prompt. After initiating Power Cycle, press the Ctrl+b command
sequence to return to the main MP menu.
5. System will be power cycled.
You must shut down the OS manually before this command is
executed.
Failure to do this can cause problems when the OS is
restarted.
Confirm? (Y/[N]): Y

-> System is being powered off.


-> Please wait 30 seconds for power supplies to power down
completely.
System Power will be turned on in 30 seconds.

L13 2 HP Confidential For training purposes only Rev. 14.21


Installing the OS with Ignite-UX

[rx26-412] MP:CM>
[Ctrl+b]

6. At the main MP menu, use the CO command to connect to the System Console.
MP MAIN MENU:

CO: Console
VFP: Virtual Front Panel
CM: Command Menu
SMCLP: Server Management Command Line Protocol
CL: Console Log
SL: Show Event Logs
HE: Main Help Menu
X: Exit Connection

[rx26-412] MP> CO

Rev. 14.21 HP Confidential For training purposes only L13 3


HP-UX Boot Camp

Exercise 2Selecting the boot path to boot from the


Ignite-UX server
Perform these steps:
1. Wait for server to reach the EFI Boot Manager, and then select the Core LAN A
as device to boot from.
If you already missed this screen, press CTRL+b, enter cm command and then rs
to initiate power cycle. Return to the system console by pressing CTRL+b and
then co.

2. At the operating system prompt, select option 2 to install the OS version B.11.31.
Downloading file AUTO (226 bytes)
1. target OS is B.11.23 IA
2. target OS is B.11.31 IA
3. Exit Boot Loader

Choose an operating system to install that your hardware


supports: 2

3. The lab environment you are connected to is made for unintended installation.
At this point, if you leave the Installer running, it will silently boot, install the
predefined operating environment and return at the login prompt after the
installation. Since you want to explore the installation user interface, watch
carefully as the for the installation procedure prompting you to press Enter to
interrupt the automatic boot.
If you are not carefull enough, you will have to reset the server again and then
start from the step 1. To reset the server, press CTRL+b, enter cm command and

L13 4 HP Confidential For training purposes only Rev. 14.21


Installing the OS with Ignite-UX

then rs to initiate power cycle. Return to the system console by pressing CTRL+b
and then co.
To proceed with the interactive installation, you will have to press Enter at the
prompt below, and then Y to confirm.
WARNING: The configuration information calls for a non-
interactive installation.
Press <Return/Enter> within 10 seconds to cancel
batch-mode installation: [Enter]
Really cancel non-interactive install and start the
user-interface? ([y]/n): Y

4. As the system reaches Welcome to Ignite-UX! screen, select the Install HP-UX
choice (accept default) and press Enter.

5. Press Enter on the Advanced Installation choice (accept default).

Rev. 14.21 HP Confidential For training purposes only L13 5


HP-UX Boot Camp

6. Press Enter on the lan0 choice (accept default).

7. On the Network Configuration screen, change the answer to No on question Is


this networking information only temporary? and select OK to continue. Failure
to do so will result with the installation different compared to the steps from this
lab guide!
Use the TAB key to Navigate to the area you want to modify and press space
bar to modify the entry to No. Then TAB again to navigate to OK and press
Enter.
8. On the confirmation screen, use the TAB key to select No as the answer to the
question Do you with to retain these settings for the current session?

9. Once on the Basic tab, navigate to the Configurations field using the TAB key.

L13 6 HP Confidential For training purposes only Rev. 14.21


Installing the OS with Ignite-UX

10. Use the Space bar to select HP-UX B.11.31 Boot Camp is selected and press
Enter.

11. Use the TAB key to navigate to the Go! button and press Enter.

12. At the Confirmation screen, you will receive a warning because your disk
contains a file system. You can disregard this warning for lab purpose by using
the TAB key again to navigate to the Go! button and press Enter.
HP-UX Installation will continue unattended and will last about 30 minutes.

Rev. 14.21 HP Confidential For training purposes only L13 7


HP-UX Boot Camp

L13 8 HP Confidential For training purposes only Rev. 14.21

Vous aimerez peut-être aussi