PK8YF A40 Instructorhints PDF
PK8YF A40 Instructorhints PDF
PK8YF A40 Instructorhints PDF
cover
AIX 6 System
Administration I:
Implementation
(Course code AU14)
Trademarks
The reader should recognize that the following terms, which appear in the content of this
training document, are official trademarks of IBM or other companies:
IBM is a registered trademark of International Business Machines Corporation.
The following are trademarks of International Business Machines Corporation in the United
States, or other countries, or both:
AIX AIX 5L AIX 6 (logo)
AS/400 CICS/6000 DB2
Domino HACMP iSeries
Language Environment Lotus Magstar
MVS Network Station Notes
OS/2 POWER POWER4
POWER5 POWER6 PowerPC
pSeries Requisite RISC System/6000
RS/6000 SecureWay SP
System p System/370 System Storage
Tivoli 400
VMware and the VMware "boxes" logo and design, Virtual SMP and VMotion are
registered trademarks or trademarks (the "Marks") of VMware, Inc. in the United States
and/or other jurisdictions.
Alerts is a registered trademark of Alphablox Corporation in the United States, other
countries, or both.
PS/2 is a trademark or registered trademark of Lenovo in the United States, other
countries, or both.
PostScript is either a registered trademark or a trademark of Adobe Systems Incorporated
in the United States, and/or other countries.
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the
United States, other countries, or both.
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other
countries, or both.
The information contained in this document has not been submitted to any formal IBM test and is distributed on an as is basis without
any warranty either express or implied. The use of this information or the implementation of any of these techniques is a customer
responsibility and depends on the customers ability to evaluate and integrate them into the customers operational environment. While
each item may have been reviewed by IBM for accuracy in a specific situation, there is no guarantee that the same or similar results will
result elsewhere. Customers attempting to adapt these techniques to their own environments do so at their own risk.
Copyright International Business Machines Corporation 1997, 2008. All rights reserved.
This document may not be reproduced in whole or in part without the prior written permission of IBM.
Note to U.S. Government Users Documentation related to restricted rights Use, duplication or disclosure is subject to restrictions
set forth in GSA ADP Schedule Contract with IBM Corp.
Instructor Exercises Guide with hints
TOC Contents
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Exercises description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
TMK Trademarks
The reader should recognize that the following terms, which appear in the content of this
training document, are official trademarks of IBM or other companies:
IBM is a registered trademark of International Business Machines Corporation.
The following are trademarks of International Business Machines Corporation in the United
States, or other countries, or both:
AIX AIX 5L AIX 6 (logo)
AS/400 CICS/6000 DB2
Domino HACMP iSeries
Language Environment Lotus Magstar
MVS Network Station Notes
OS/2 POWER POWER4
POWER5 POWER6 PowerPC
pSeries Requisite RISC System/6000
RS/6000 SecureWay SP
System p System/370 System Storage
Tivoli 400
VMware and the VMware "boxes" logo and design, Virtual SMP and VMotion are
registered trademarks or trademarks (the "Marks") of VMware, Inc. in the United States
and/or other jurisdictions.
Alerts is a registered trademark of Alphablox Corporation in the United States, other
countries, or both.
PS/2 is a trademark or registered trademark of Lenovo in the United States, other
countries, or both.
PostScript is either a registered trademark or a trademark of Adobe Systems Incorporated
in the United States, and/or other countries.
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the
United States, other countries, or both.
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other
countries, or both.
Intel is a trademark or registered trademark of Intel Corporation or its subsidiaries in the
United States and other countries.
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or
both.
Other company, product, or service names may be trademarks or service marks of others.
If the files are not there, you need to load them from the diskette
that was provided with your instructor materials.
For detailed lab set up instructions, refer to the Lab Setup Guide for
this course. These instructions also include how to set up X
Terminals and enable the AIX V6.1 online documentation.
Text highlighting
The following text highlighting conventions are used throughout this book:
Bold Identifies file names, file paths, directories, user names and
principals.
Italics Identifies links to Web sites, publication titles, and is used
where the word or phrase is meant to stand out from the
surrounding text.
Monospace Identifies attributes, variables, file listings, SMIT menus, code
examples of text similar to what you might see displayed,
examples of portions of program code similar to what you might
write as a programmer, and messages from the system.
Monospace bold Identifies commands, daemons, menu paths and what the user
would enter in examples of commands and SMIT menus.
<text> The text between the < and > symbols identifies information the
user must supply. The text may be normal highlighting, bold or
monospace, or monospace bold depending on the context.
Estimated time
00:10
Introduction
Typically the system administrator should not use root as their normal
login account. Instead, they should use the su command to become
root for a short period of time to do administrative tasks.
Copyright IBM Corp. 1997, 2008 Exercise 1. root login methods 1-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Preface
Two versions of these instructions are available; one with hints and one without. You can
use either version to complete this exercise. Also, please dont hesitate to ask the instructor
if you have questions.
All exercises of this chapter depend on the availability of specific equipment in your
classroom.
If your lab environment uses remote System p platforms, the instructor provide you with
instructions for accessing the remote environment. For example, this may involve using a
Web browser to access a Web server which provides access to a virtual private network
(VPN) or it may involve using a toll that extends a remote VPN to your desktop machine.
Once you have access to the remote environment you can choose a tool to connect to your
assigned machine. Once again, your instructor provides you with the addressing (IP
address or hostname) and instructions for accessing the remote machine. Your network
utility may be a telnet client, an X-Windows server, or a VNC client. Whatever tool you are
using, at various points in the labs, you may need to re-launch your remote access tool to
obtain a new login prompt.
If you are using an ascii based network client, such as PuTTY, be sure to specify the telnet
protocol in addition to providing the IP address of your assigned lab system. You may also
want to customize the terminal emulation, such as configuring the keyboard mapping to
generate <ctrl-H> when the backspace key is pressed. You might also wish to adjust the
window appearance characteristics such as the font size. If you did not customize before
launching the terminal emulation, you can make the changes later by right clicking on the
title bar and selecting change settings.
If you are using a VNC viewer (to access CDE environment), you need to enter (when
prompted) the IP address of your assigned lab system, immediately followed by :#, where
# is the port number for the vncserver. For example: 192.168.22.5:1.
The output shown in the answers is an example. Your output and answers based on the
output may be different.
All hints are marked with a >> sign.
EXempty See the discussion in the above preface. Your instructor provides you with more
specific instructions such as the IP address of your assigned system.
__ 3. Log in as the user root. The password is ibmaix.
At the username prompt, enter: root
At the password prompt, enter root's password: ibmaix (You do not see the
password appear on the screen)
(you may only be prompted for a password - assume it is roots password)
__ 4. Open a terminal. (if necessary)
If you are using a CDE graphic interface:
On the tool bar at the bottom, click the small triangle above the pencil and paper
icon (fourth icon from the left). This will open a drawer of icons.
Click ONCE on the Terminal icon. This should bring up a terminal window. All of
the commands for this exercise should be typed at the command line in this
window. You may wish to resize the terminal window or adjust the font size being
used.
# pwd
/
# echo $HOME
/
__ 6. To verify that you do, in fact, have root privileges, cat out the file
/etc/security/passwd. This file holds the encrypted passwords for the users on your
system. Only root can look at this file. More details on this file are mentioned later in
the course. Did you see the contents of the file? __________ Yes.
# cat /etc/security/passwd
Copyright IBM Corp. 1997, 2008 Exercise 1. root login methods 1-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Click Continue logout. A new log in box should appear (if using a local
terminal).
Otherwise, type exit to logout of the telnet window.
__ 13. Now, switch user to root without using the - (dash) option.
$ su or $ su root
root's Password: ibmaix
Copyright IBM Corp. 1997, 2008 Exercise 1. root login methods 1-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 18. Did the su and the cd to /etc (in the resulting subshell) affect the current directory
after exiting the subshell? ______ No
$ pwd
/tmp
__ 19. Now, try using the su command with the - (dash) option. What is your home
directory? If you're not sure, check before performing the su.
/home/team01.
$ echo $HOME
/home/team01
$ su - or su - root
#
EXempty
Note
Make sure you include a space before and after the - (dash) root's Password:
ibmaix
End of exercise
Copyright IBM Corp. 1997, 2008 Exercise 1. root login methods 1-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Exercise Review/Wrap-up
Consider the following questions:
What is the difference between the su command used with and without the dash?
What situations would it be helpful to use the dash and not use the dash?
Are there disadvantages of logging in directly as root?
Estimated time
00:20
Introduction
This exercise is designed to give you experience working with the
system management tools supplied with AIX. In most classrooms,
there are two students per AIX system. In many cases, only one
person is able to perform the task at a time. You need to work together
with your teammate. Be sure to take turns at the keyboard.
the command line. Also, <ctrl-c> may not work if students are
running a command when shelled out in SMIT.
When the students get to the place when they are presented with the
login screen for CDE, they may at first have difficulty logging in with
the command line. If they delay too long in logging in, the CDE login is
again displayed.
Students get confused over the different interfaces. You may need to
help them determine the benefits of each. Try to hold the discussion
until after the exercise. The exercise contains detailed instruction for
each interface.
There is a difference in function key activity between the ASCII
interface and the Motif interface. For example, in Motif, there is NO
function key to shell out to a command line (F9 in ASCII). It is assumed
that you can simply open another window and run the command.
If the class is being held with the System p platforms in a remote
location and you are using a tool (such as VNC) which is only
configured to support a specific graphic interface (such as CDE), warn
the students in Step 11 to leave CDE as the default interface.
Changing to a command line interface may prevent that tools from
working. If that happens, they will need to use telnet to get back into
the machine and change the user interface back.
__ 4. Add five users to the system. They should be named team100 through team104.
Take all of the defaults. Customizing the attributes is covered later in the course.
Assign a password for each user that is the same as the user name. When the five
users and their passwords have been entered, exit from SMIT.
In SMIT, select:
__ 5. Start SMIT using the options to redirect the smit.script and smit.log files to the
/home/team100 directory. From the main SMIT menu, select Processes &
Subsystems. Display all the current process running on your system. Examine the
output.
Which command do you think was executed? _______.
ps -ef
How can you find out? ___________________________________________
Pressing the F6 Command key from the output screen, displays a pop-up box
that shows the command that was executed.
Return to the main menu.
# smitty -s /home/team100/smit.script -l /home/team100/smit.log
Processes & Subsystems
Processes
Show All Current Processes
A Show THREADS information? pop-up box is displayed. Select no.
F6 (to view the command).
F3 - Cancel until you are back at the System Management screen.
__ 6. In a similar manner, select each of the main SMIT menu entries, examine the
submenu, then use the F3 key to back up to the previous menu. Do not execute
EXempty any commands that may cause changes to the system. Because you are logged
in as root, you must be very careful.
Select each entry.
Press F3.
Repeat as appropriate.
__ 7. Shell out (F9) and execute the date command. Return to SMIT and do the following:
1) Stop syslogd subsystem.
2) View the command that was executed.
3) List ALL subsystems to see that syslogd is inoperative.
4) Restart syslogd.
5) Continue to the next step. Do not press F3 or exit SMIT.
F9; Enter
# date
<ctrl-d> to return to SMIT.
From the Main menu, select:
Processes and Subsystems ->
Subsystems ->
Stop Subsystem ->
Stop a Single Subsystem
F4 (to see the list of Subsystem Process IDs).
Select syslogd.
Enter (to stop the subsystem).
F6 (to view the command).
F3 (repeatedly) to return to the Subsystems menu.
Select List All Subsystems (syslogd should be inoperative).
F3 back to Subsystems menu.
Select Start a Subsystem.
F4 (to see the list of Subsystem Name).
Select syslogd.
Enter (to start the subsystem).
__ 8. You should have the COMMAND STATUS screen displayed. Capture an image of
this screen. Exit SMIT.
Press F8=(Image) and Enter.
F10
__ 9. Look at the SMIT history files using pg or more. Look for the image you captured in
the previous step.
What information is in each of these files? ____________________________
_____________________________________________________________
The smit.log file contains a reference to each menu screen selected, the
commands executed, output from the commands, and all screen images. The
smit.script file contains the high-level commands executed, preceded by a
comment showing the date and time when the command was executed.
Why should these files be monitored?
_____________________________________________________________
Both files should be monitored regularly and purged periodically so disk space is
not wasted.
# pg /home/team100/smit.log
# pg /home/team100/smit.script
__ 10. Look at the ownership of the SMIT history files of user team100 with ls -al.
Was it a good idea to create these files as root? ____ No
What will happen if user team100 will use SMIT?
_____________________________________________________________
User team100 is not the owner of the SMIT history files and has no write access
these files. If user team100 starts using SMIT, user team100 gets an error
message saying Could not open SMIT log file: ./smit.log.
# ls -al /home/team100/smit.log
# ls -al /home/team100/smit.script
__ 11. As the system administrator, you can select the default interface that the users can
use. Depending on your classroom environment, you may be able to set a different
interface. Ask your instructor if you would like to change the interface. For the new
interface to take effect, you need to reboot your system. Log out when you are done.
EXempty
Note
If you are using VNC for remote graphics, do not change the system user interface
in this step; your VNC server is configured to only work with a CDE user interface.
# smitty
Select:
System Environments ->
Change System User Interface
At Select System Login User Interface, generate a list (F4) to see your choices.
Typically, your interface is set to AIX CDE 1.0. If you prefer the Command Line
interface, select it and press Enter. If you don't want to change the interface, press
F3 until you are out of SMIT and then logout (this is not an option if you are using a
remote LPAR system).
Press F3 twice to get back to the System Management screen.
If you did not make a change to the interface, select F3 - Cancel until you have
exited SMIT and log out. You are finished with Part 1 of the exercise.
If you changed the interface, you need to reboot the machine before it takes effect.
From this SMIT screen, select Stop the System.
* MESSAGE to all users on the system [No Message]
INTERACTIVE shutdown [no]
RESTART the system after shutdown [yes]
* TIME the system goes down [0]
Press Enter.
-OR-
This step could be achieved from the command line with:
# /usr/dt/bin/dtconfig -d (to disable CDE)
# shutdown -Fr
Upon reboot, your new interface should appear.
__ 12. If you did not change your System User Interface (and thus did not need to reboot),
terminate smit and log off of your system.
press F10
# exit
Note
If you are not sure how to login in an X-Windows environment, ask your instructor.
__ 14. If necessary, open a terminal window. If one already exists, skip to the next step.
CDE environment:
On the tool bar at the bottom, click the small triangle above the pencil and paper
icon (fourth icon from the left). This will open a drawer of icons.
Click once on the Terminal icon. This should bring up a terminal window. All of
the commands for this exercise should be typed at the command line in this
window.
X-Windows environment:
Move the cursor to an empty area on the screen and press and HOLD the right
mouse button.
While holding the mouse button down, drag the cursor to the first item on the
menu, New Window, and release the button. A new window should appear.
__ 15. Add five users to the system. They should be named team200 through team204.
Take all the defaults. Do not assign passwords for these users. When the five
users have been entered, exit from SMIT.
EXempty # smit
Click Security & Users.
Click Users.
Click Add a User.
At the User NAME field, type in the user name team200 and click OK.
When you see the running man (at the top) stop and stand with his arms up in
victory, click Done to return to the Add a User menu.
Add users team201 through team204 in the same way.
When the five users are added, click Cancel to return to the Users window.
Once all users are added, click Cancel and then Exit to exit SMIT and return to the
command line.
__ 16. In a similar manner, select each of the main SMIT menu entries, examine the
submenu, and then use the Cancel button to go back to the previous menu. Do not
execute any commands that may cause changes to the system. Because you
are logged in as root, you must be very careful.
Select each entry.
Cancel.
Repeat as appropriate.
__ 17. Exit from SMIT. Look at the SMIT history files with pg or more.
What information is in each of these files?
_____________________________________________________________
The smit.log file contains a reference to each menu screen selected, the
commands executed, output from the commands, and all screen images. The
smit.script file contains the high-level commands executed, preceded by a
comment showing the date and time when the command was executed.
Why should these files be monitored?
_____________________________________________________________
Both files should be monitored regularly and purged periodically so disk space is
not wasted. Unlike the SMIT ASCII interface, the Motif interface automatically
records all screen images. The F8 key in the Motif interface will show you the
SMIT fastpath command instead.
Point and click Exit.
Select Exit SMIT.
# pg /smit.log
# pg /smit.script
End of exercise
Estimated time
00:30
Introduction
If there are two or more students per system, you must work as a
single team throughout this exercise. All instructions involve using the
system unit for starting and stopping the system in various modes.
Copyright IBM Corp. 1997, 2008 Exercise 3. System startup and shutdown 3-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Note
If this is the first time you log in using the user name, you are prompted to change
your password. Keep it the same as the user name.
__ 2. Page out the /etc/inittab file. Take a moment to become familiar with its contents.
What is the run level of shdaemon? _______ 2
What does it mean? The run level for rc is 2. It represents AIX multi-user mode.
___________________________________
# pg /etc/inittab
__ 3. Log out of this session.
# exit
Copyright IBM Corp. 1997, 2008 Exercise 3. System startup and shutdown 3-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Userid: hscroot
Password: abc1234
You may also get an error about pop-ups being disabled. Click OK on the
error box. In Mozilla, pull down the Tools menu, select the Options
item, click on the Content icon, and uncheck the Block Popup Windows
option. Click OK. Then repeat the above sequence.
EXempty
You may also get a screen entitled Choose a Disconnected Session. Do
not use someone elses disconnected hscroot session. Click on the New
Session button and obtain a brand new hscroot session.
Expand the Systems Management selection in the Navigation window.
Expand the Servers selection in the Navigation window.
Click the server for your assigned LPAR. You may need to ask your instructor. All the
configured lpars appear in the Contents window.
__ 9. If you are using a local non-partitioned system (otherwise skip to the next step): As
the root user, shut down and reboot the system to the System Management
Services mode. As soon as you see the keyboard and hear a beep, you should
press the numeric 1 key or <F1> key to access SMS.
# shutdown -Fr
When the first screen appears (PowerPC screen), after the keyboard icon but
before the last icon appears, press F1 (or 1, depending upon your environment). The
System Management Services screen then displays.
Copyright IBM Corp. 1997, 2008 Exercise 3. System startup and shutdown 3-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 10. System Management Services (SMS) menus and contents vary from one System p
machine/model to another. Take a few moments to explore the menu options which
display on your system. Do not make any changes or run any tests. Also, dont click
Exit on the main SMS screen until you are finished exploring the other options.
The following menu items may be different than what you see on your system.
Navigating the menu also may vary from system to system. On some systems, you
have a graphic interface and click the EXIT icon to return to a previous menu or
eventually exit from SMS. On other systems with an ASCII interface, you press the
<ESC> key to return to a previous menu or use the x response to exit from SMS.
Select Language - Type 1 and press <Enter>.
This shows a list of various languages to use while in the SMS menus.
Return to the previous menu <Esc>.
Set up Remote IPL - Type 2 and press <Enter>.
This prompts you for which interface you want to use for remote IPL and then
would prompt for networking information needed for a network boot.
Return to the previous menu <Esc>.
Change SCSI Settings - Type 3 and press <Enter>.
This lists two options to modify: Hard Drive Spin Up Delay and Change SCSI
ID.
Return to the previous menu < Esc>.
Select Console - Type 4 and press <Enter>.
This will display a message on all eligible terminals to select as console. Press 0
(zero).
Return to the previous menu <Esc>.
Select Boot Options - Type 5 and press <Enter>.
This provides boot options to select an install/boot device, configure the boot
device order, or enable/disable Multi-boot Startup Mode.
Return to the previous menu <Esc>.
__ 11. When you are done exploring, exit the SMS program and allow the system to reboot
in multi-user mode.
Enter X and press <Enter> at the SMS screen. This will cause the system to
reboot in multi-user mode.
__ 13. Using the appropriate SRC commands, stop the syslogd subsystem. Check that it
is inoperative. Restart it. Check that it is active.
# stopsrc -s syslogd
# lssrc -s syslogd
# startsrc -s syslogd
# lssrc -s syslogd
Copyright IBM Corp. 1997, 2008 Exercise 3. System startup and shutdown 3-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Userid: hscroot
Password: abc1234
You may also get an error about pop-ups being disabled. Click OK on the
error box. In Mozilla, pull down the Tools menu, select the Options
item, click on the Content icon, and uncheck the Block Popup Windows
option. Click OK. Then repeat the above sequence.
EXempty You may also get a screen entitled Choose a Disconnected Session. Do
not use someone elses disconnected hscroot session. Click on the New
Session button and obtain a brand new hscroot session.
Expand the Systems Management selection in the Navigation window.
Expand the Servers selection in the Navigation window.
Click the server for your assigned LPAR. You may need to ask your instructor. All the
configured lpars appear in the Contents window.
__ 18. Reset the run level to Single User Mode without rebooting the system.
# shutdown -m
You will see several messages appear. Enter the root password when you
see the following:
INIT: Single-User Mode
PASSWORD:
__ 20. Verify that there are few processes running on the system.
# ps -ef | more
Copyright IBM Corp. 1997, 2008 Exercise 3. System startup and shutdown 3-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 21. Run /etc/rc.net to start the network interfaces and then reset the Run Level to
Multi-User Mode.
#/etc/rc.net
# telinit 2
__ 22. Ensure that all normal subsystems have been started and are working properly. If
you have been using CDE, and CDE fails/hangs now, you forgot to run /etc/rc.net
in the previous step.
login: root
root's Password: <Enter root's password.>
# lssrc -a | pg
__ 23. Shut down and reboot the system one more time.
# shutdown -Fr
End of exercise
Copyright IBM Corp. 1997, 2008 Exercise 3. System startup and shutdown 3-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Estimated time
00:25
Introduction
This exercise is designed to give you experience working with the
installation facilities supplied with AIX. If there is more than one
student sharing a system, then only one person can actually perform
these steps. All other students on that system should observe while
the steps are being done.
In this exercise, you install two software packages:
bos.dosutil
bos.games
In this exercise, you may also install a fix to already installed software
packages.
The instructions are written assuming you are using SMIT in ASCII
mode. However, it is easy to interpret the instructions so that they can
be used with SMIT in the AIXWindows environment. Feel free to use
SMIT in either mode.
When you select an item while using the ASCII user interface, use the
cursor keys on the keyboard to highlight a menu item, then press
Copyright IBM Corp. 1997, 2008 Exercise 4. AIX software installation 4-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Enter. On a graphics display, choose (that is, click) the selected item
with the left mouse button.
The fix installation and display of the fix history is optional. It requires
that the lab setup for the exercises used an AIX 5L V5.3 TL6 base
installation. If the image used in your lab environment has additional
maintenance already installed and committed, you may not be able to
successfully complete the optional steps.
Copyright IBM Corp. 1997, 2008 Exercise 4. AIX software installation 4-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
While viewing the output, use Find ( / ) to verify that the bos.games and
bos.dosutil packages are not installed on your system.
Use F3 (repeatedly) to return to the Software Installation and Maintenance
menu.
__ 3. Now it is time to install the two software packages, bos.dosutil and bos.games:
These packages have been preloaded (but not installed) in a directory called
/usr/sys/inst.images. The procedure to install these packages from this directory
are the same as those to install software from CD or tape.
Use SMIT to install the bos.games and bos.dosutil packages. When this task has
successfully completed, return to the AIX command line.
In the SMIT Software Installation and Maintenance screen, select:
Install and Update Software ->
Install Software ->
* INPUT device / directory for software [/usr/sys/inst.images]
(Use F4 to select this standard repository location off the list)
SOFTWARE to install [bos.dosutil,bos.games]
(Use F4 to list the available packages from which to choose)
When selecting the packages, be sure to install the entire package. Use F7 to
indicate which packages to install.
Press Enter to perform the installation.
Verify that the output is correct and then press F10 to return to the command line.
__ 4. Verify that the bos.games fileset installed correctly and list the games which are
available.
# lslpp -L bos.games
# cd /usr/games
# ls
EXempty __ 6. If not doing the optional Part 2 - Working with AIX Fixes, log off the system at this
point.
Copyright IBM Corp. 1997, 2008 Exercise 4. AIX software installation 4-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 7. We have already downloaded AIX 5.3 TL6 Service Pack 1 and stored the fix files in
the /usr/sys/inst.images/fixes directory. Use SMIT to run a Comparison Report
between this fix repository and what is currently installed on your system. Only
report on installed software that is at a lower level than what is in the fix repository.
Briefly examine the generated report. Can you tell what problems or new capabilities
are included in which fileset update? ________________________________
# smit install
Software Service Management ->
Comparison Reports ->
Compare Installed Software to Fix Repository
FIX REPOSITORY location [/usr/sys/inst.images/fixes]
FILE location of lslpp -Lc output []
(Leave blank to compare against this system.)
Select which reports to run.
Installed Software that is at a LOWER level yes +
(lowerlevel.rpt)
Installed Software that is at a HIGHER level no +
(higherlevel.rpt)
Updates for filesets that are NOT INSTALLED no +
(notinstalled.rpt)
Installed Software with NO UPDATES found no +
(no_update_found.rpt)
DIRECTORY location for reports. [/tmp]
(Leave blank to omit.)
The report is only a listing of filesets and their version, release,
mod, and fix level.
__ 8. Return to the Software Installation and Maintenance menu and choose the menu
sequence which allows you to list software that is on installation media (which could
be a directory). List the APARs that are addressed by the filesets in the
/usr/sys/inst.images/fixes directory. Briefly examine the output.
Press F3 repeatedly to return to the Software Installation and Maintenance menu
List Software and Related Information ->
List Software on Media and Related Information
List Software Fixes (APAR) on the Installation Media
INPUT device / directory for software [/usr/sys/inst.images/fixes] +
EXempty __ 9. Return to the Software Installation and Maintenance menu and follow a menu
sequence that presents a dialogue panel which allows you to install a fix by
specifying the related APAR number. Request to use our /usr/sys/inst.images/fixes
directory as the source of the fixes.
Press F3 repeatedly to return to the Software Installation and Maintenance menu
Install and Update Software ->
Update Software by Fix (APAR)
INPUT device / directory for software [/usr/sys/inst.images/fixes] +
__ 10. There is a bug in AIX 5L V5.3 TL6 where the usrck command can (incorrectly) lock
all user accounts. You do not want that to happen. In the dialogue panel, get a listing
of APARs which are available to be installed. Find the APAR which was just
described. Select and install that fix. Examine the output to verify that the fix was
installed. What filesets have been installed?
______________________________________________________________
______________________________________________________________
Use F4 on the FIXES to install line to get a list.
Use F7 to select the desired fix
FIXES to install [IY59384] +
PREVIEW only? (update operation will NOT occur) no +
Press <Enter> to install the fix.
The installed filesets were bos.rte.install and bos.rte.security
Press F10 to exit smit
__ 11. View the history of the installed filesets using the lslpp command.
# lslpp -h bos.rte.install
# lslpp -h bos.rte.security
__ 12. Log off from the system.
End of exercise
Copyright IBM Corp. 1997, 2008 Exercise 4. AIX software installation 4-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Estimated time
01:00
Introduction
The Hardware Management Console (HMC) and Configuration
Assistant are graphics-based applications that assist the system
administrator with various tasks. These applications are used to
perform the installation of the operating system and system
configuration respectively.
Copyright IBM Corp. 1997, 2008 Exercise 5. AIX 6.1 installation and configuration 5-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Userid: hscroot
Password: abc1234
You may also get an error about pop-ups being disabled. Click OK on the
error box. In Mozilla, pull down the Tools menu, select the Options
item, click on the Content icon, and uncheck the Block Popup Windows
option. Click OK. Then repeat the above sequence.
Copyright IBM Corp. 1997, 2008 Exercise 5. AIX 6.1 installation and configuration 5-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
If you are performing this task using the HMC, follow the steps below:
a) Select your lpar by clicking the Select box to the left
b) Click on the arrows which appeared to the right of the lpar
c) Drag the mouse to Operations, Shutdown, and then click Shutdown
[DO NOT EXECUTE AN IMMEDIATE SHUTDOWN OF THE PARTITION FROM THE HMC.
THIS CAN CAUSE DISK CORRUPTION ON A RUNNING AIX SYSTEM]
d) Click Operating System Immedediate, and then OK
( After awhile, the Reference Code will show all zeros)
__ 7. If you currently have a virtual terminal open, close that window.
Click on the upper right corner of the window to close it.
(there were older versions of the HMC where this would not be sufficient and you
would also need to close the virtual session from the HMC menus)
__ 8. Boot your system in SMS mode. Open a console session if you are using a lpar
system and HMC configuration.
If you are performing this task using the HMC, follow the steps below:
a) If your lpar is not already selected, click the Select box to the
left of the lpar name.
b) Click the arrows which appeared to the right of the lpar
c) Drag the mouse to Operations, Activate and then click Activate
d) Check Open a terminal window or console session, and then click the
Advanced... button
e) Click the drop-down menu for the Boot mode, select SMS, and then
click OK
(Do not change anything with the Keylock position)
f) This should return you to the Activate screen again. Click OK to
start the activation.
If you have a local System p machine and locally attached console in front of you:
a) Power on your machine.
b) Soon after the LED reads E1F1, the keyboard is discovered and the
distinctive beeping will sound. Between that time and before the
system begins to search for the boot image, press either the F1 key
or numeric 1 key (depending on the type of machine) to invoke the
Service Mode boot list.
__ 9. Configure your system Remote IPL parameters. You need the correct subnet mask,
plus the IP addresses of the NIM server and the gateway. These must be configured
to boot off the network adapter. The instructor provides you with the NIM and
gateway addresses.
__ 10. Assign your network adapter as the first and only boot device. Be sure the location
of the adapter matches what you recorded earlier.
a) From the SMS Main menu, select Select Boot Options by entering
the number to the left <5>, and pressing <Enter>.
b) From the Multiboot menu, select Configure Boot Device Order, by
entering the number to the left <2>, pressing <Enter>.
c) From this menu, select Select 1st Boot Device by entering the
number to the left <1>, pressing <Enter>.
d) From this menu, select Network by entering the number to the left
<6>, pressing <Enter>.
e) From this menu, select the network adapter by entering the number to
the left <1>, pressing <Enter>.
f) From this menu, select Set Boot Sequence, by entering the number to
the left <2>, pressing <Enter>.
(You should see the Current Boot Sequence displayed, with the
network adapter as the first and only device.
g) Exit the SMS menu by press X. You will be prompted Are you sure.
Type the number for YES <1> and press <Enter>.
h) Your system should start booting and connecting to your NIM server.
__ 11. Your system should be downloading an AIX network boot image at this time. The
download and execution of the network boot image takes 2 to 3 minutes. When
done, you see a prompt; select the terminal console and the English during
installation.
Copyright IBM Corp. 1997, 2008 Exercise 5. AIX 6.1 installation and configuration 5-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Type 1 and press <Enter> for console, then type 1 and press <Enter> again to have
English during install.
__ 12. On the Main Installation and Maintenance menu, select Change/Show Setting and
Install.
Type 2 and press <Enter>.
__ 13. Verify that the Method of Installation is set to Migration and the Disk to Install is
the one you previously identified as the boot disk (probably hdisk0). When verified,
enter 0 to start the installation.
__ 14. You may get prompted once or twice for other verifications. For example, it may give
you the option of listing filesets and configuration files that are replaced. You may
choose to examine these; the lists are not very large. Eventually respond with a 0 to
continue with the migration.
When you see the Installing Base Operation System, you can take a break (though
the instructor may wish to use this time to discuss another topic).
This takes 30 to 40 minutes.
Type # and press <Enter> (the value of # depends on what you want to examine or
if you just want to continue.
__ 15. Once the install is complete, the system automatically reboots. Once the reboot is
completed, there will be a login prompt on the system console. At that point,
continue to the next step.
__ 16. Log in as root user and start the Configuration Assistant.
If you are using a graphical interface, type:
# install_assist
-OR-
# configassist
EXempty __ 18. Familiarize yourself with some of the other options. When youve finished, exit from
Configuration Assistant and select the option to Finish now, and do not restart
Configuration Assistant when restarting AIX.
Click Exit the Configuration Assistant, then click Next.
Click Finish now, and do not restart Configuration Assistant when restarting
AIX, then click Finish.
End of exercise
Copyright IBM Corp. 1997, 2008 Exercise 5. AIX 6.1 installation and configuration 5-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Exercise Review/Wrap-up
Have the students discuss the various things that can be configured with the Configuration
Assistant.
Estimated time
00:20
Introduction
This exercise is designed to give you experience working with the
Web-based System Manager in AIX. If you are sharing the machine,
only one person should perform each step. You must work from a
graphical interface for this exercise.
If your classroom is networked, you can configure and test the
Web-based System Manager for client machine access. The client
machine can be another AIX system or a PC. In both cases, the client
platform must have a browser that is Java-enabled.
Copyright IBM Corp. 1997, 2008 Exercise 6. Web-based System Manager 6-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 3. If you are in a CDE environment and there is no terminal emulation window, open
the Personal Application subpanel (arrow over the pencil and paper icon) and click
on the Terminal icon.
Access the Web-based System Manager.
$ wsm &
__ 4. View system processes by both details and tree details. Viewing processes by tree
detail provides a pictorial view of the parent/child relationship of the processes.
EXempty Return to the view of the task icons for Processes when you have completed this
task.
From the Web-based System Manager Contents area (on the right), double-click
Processes, then double-click All Processes. Once the Processes window
displays, scroll through the output.
There are two ways to display the processes as a tree:
Click View on the menu bar and then click Tree Details.
On the tool bar, click the Details icon, which is just to the left of the rightmost
one. Note: If you rest the mouse pointer over the icon, the icon name is
displayed.
Once you have reviewed the output, go back to the Processes plug-in by clicking
the back arrow on the title bar.
__ 5. View the Web-based System Manager window that displays the current system date
and time.
Single-click System Environment in the Navigation area.
In the System Environment window, double-click Settings.
Double-click Date/Time.
View the Date and Time and then click a Time Zone option. Since you are not the
root user, you will not be able to make any changes.
When you are done, click Cancel to close this task. window.
__ 6. Close the Web-based System Manager Launch Pad window and log out of the
system.
Close the Web-based System Manager by clicking the upper left of the title bar
(Console) and then clicking Exit on the pull-down menu.
Click the Exit Now button in the pop-up.
Click and hold the right mouse button in the root window area.
If in CDE environment, log-off by clicking the Log out menu item.
When prompted, click on Continue logout
If in a native Xwindows/Motif environment, click on the End Session menu item.
This brings up a sub-menu; click the Quit menu item.
If exiting the graphics environment results in a ASCII command prompt, type exit to
complete the log out of AIX.
Copyright IBM Corp. 1997, 2008 Exercise 6. Web-based System Manager 6-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 7. Log into the WebSM Client system as root and using the correct root password.
__ 8. On the WebSM Client system, make sure you are in the AIX windows or CDE
environment. If you are in a CDE environment and there is no terminal emulation
window, open the Personal Application subpanel (arrow over the pencil and paper
icon) and click the Terminal icon.
Access the Web-Based System Manager on the client platform, but specify the IP
address or hostname of the Web-based System Manager server machine.
# xinit (if using a local non-partitioned system and not in a windows environment)
# wsm -host <server IP address>
-OR-
# wsm -host <server hostname>
__ 9. Do a couple things to validate that the interface is working correctly and then close
down the application.
__ 10. At the Web-based System Manager server system, disable client-server (and
remote client) access. This way you can use the Web-based System Manager
locally on a platform but not allow remote client-server access.
# /usr/websm/bin/wsmserver -disable
EXempty __ 11. At the client platform, again start the Web-based System Manager specifying the IP
address or hostname of the Web-based System Manager server machine. Did it
work? _____
No
# wsm -host <server IP address>
-OR-
# wsm -host <server hostname>
__ 12. At the Web-based System Manager server platform, re-enable client-server (and
remote client) access.
# /usr/websm/bin/wsmserver -enable
Copyright IBM Corp. 1997, 2008 Exercise 6. Web-based System Manager 6-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 13. While a Web page server is not needed to use the Web-based System Manager
function, it is used to download the Web-based System Manager client to an remote
Linux or Windows platforms you might wish to work from. The HTTP Server Web
Server software (IHS2), which is delivered on the AIX 5L V5.3 Expansion Pack CD,
should already be pre-installed on your system.
Verify that it has been installed.
# smit list_software
List Installed Software and Related Information ->
List Installed Software
* SOFTWARE name [IHS2] +
SHOW superseded levels? no +
Press Enter
-OR-
# lslpp -L IHS2
__ 14. You need a graphic interface to configure the Web server support for providing the
WebSM PC client. In your graphic environment start a terminal emulation window
and execute configassist in the background.
EXempty Configure the Web server support for Web-based System Manager using the
following values.
The root document directory is: /usr/HTTPServer/htdocs
The root CGI directory is: /usr/HTTPServer/cgi-bin
The HTTPServer start command is: /usr/HTTPServer/bin/apachectl restart
# configassist
At the Configuration Assist task list, select:
Configure the Web Server for Web-based System Manger remote management
Click on next
Confirm or change the displayed values
Click on Next until you return to the task list
Then exit out of the Configuration Assistant.
__ 15. On the client PC, start the Web browser and enter a URL of:
http://<wsmservername>/remote_client.html
__ 16. Click the InstallShield hyperlink on the new Web page. (The Java Web Start
method requires additional security software to be installed on both client and server
platforms).
__ 17. Identify the client as either a Linux or Windows platform on the resulting Web page.
__ 18. On the File Download pop-up, click the Save to Disk button. In the Save In: field,
navigate to store it on the desktop and again click the Save button. In the
Download complete pop-up, click the Open button. This runs the Install Shield
wizard. (There will be a command prompt window launch to execute java.exe just
before the Installer window appears; do not do anything with the command prompt
window.)
On the Installer window, click the Next button.
Use the default install Directory name and click the Next button.
Note the location and size of the install and click the Next button.
After the install is complete, click the Finish button.
__ 19. You should now see an icon on your desktop labeled: Web Based System
Manager Application.
Open this new icon.
Copyright IBM Corp. 1997, 2008 Exercise 6. Web-based System Manager 6-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
In the Log On window, enter the Web-based System Manager server hostname
or IP address and click the Log On button.
After the handshake procedure is completed, enter root and the root password
and again click the Log On button.
__ 20. Once the Web System Manager window appears and has all the icons filled in, try a
few operations to prove it is operational and then exit the application.
End of exercise
Estimated time
00:30
Introduction
This exercise is designed for you to become familiar with the methods
you can use to discover what devices are on your system and how
they are configured. It deals exclusively with adapters and SCSI types
of devices. Future optional exercises will deal with terminals and
printers.
Part 5 - Configuring a defined device, can only be done if you have an
externally attached tape drive or CD-ROM. Most lab facilities do not
have this.
__ 1. Log in as a regular user and obtain a command prompt. If using a graphical interface
(ex. CDE), then start a terminal emulation window.
__ 2. su to the root user. If more than one person is using the same system you need to
work as a team.
$ su root
__ 4. List the configured devices on the system. Are your SCSI devices available?
____________________________________________________________
# lsdev -C -H | pg
- OR -
# smit
Devices ->
List Devices ->
List All Defined Devices
F3 to return to the menu.
__ 5. List information about the memory you have on the system. Record the amount of
memory you have.
# lsattr -E -l mem0
# lsattr -El sys0 -a realmem
-OR-
# smit
Devices ->
List Devices ->
Show Characteristics of a Defined Device
Cursor through the devices listed until you see the entries for memory. Select
one of the memory entries and press Enter.
F3 to return to the menu.
__ 6. List the disks on your system. Record how many you have.
# lsdev -C -c disk
-OR-
# smit
Devices ->
Fixed Disk ->
List All Defined Disks
F3 to return to the menu.
__ 8. Which attribute in the previous listing describes the number of processes a user can
run? _______________________________________
maxuproc
__ 9. By default, the system is configured so that each user can run no more than 128
processes at once. Change this value to 150 processes per user. The new value
takes effect immediately.
# chdev -l sys0 -a maxuproc=150
-OR-
# smit
System Environments ->
Change/Show Characteristics of Operating System
Maximum number of PROCESSES allowed per user [150]
F10 to return to the command line.
On our development system, en0 was Available and en1 was Defined. An interface
is not made available until it is configured with an IP address.
__ 11. For the interfaces which are only defined, select one and list the adapter which the
interface is using. For example, if the interface is en4, then the corresponding
network adapter device name is ent4 (the numbers always match). What is the
status of the adapter?
_______________________________________________________________
In our hints throughout this part you refer to the Ethernet adapter that you
have identified as entx.
# lsdev -l entx
-OR-
# lsdev -Cc adapter | grep -i ethernet
- OR-
# smit ethernet
Adapter =>
List All Ethernet Adapters
EXempty __ 12. Put the Ethernet adapter device into a Defined state. Be careful to specify the
correct adapter and not the one with a configured interface. Display the adapter and
verify its status.
# rmdev -l entx
# lsdev -l entx
-OR -
# lsdev -Cc adapter | grep ent
(entx should be Defined)
there is no smit panel for removing an Ethernet adapter.
__ 14. Rediscover and configure the Ethernet adapter. Check its status.
# cfgmgr
# lsdev -l entx
(entx should be Available)
-OR-
# smit devices
Install/Configure Devices Added After IPL
Input device / directory for software [none]
OK or Enter.
F3 to go back to the Devices Menu.
List Devices ->
List All Defined Devices
entx should be Available.
Your machine must have a an extra disk drive to continue with this section. Otherwise,
you are done with this exercise.
__ 15. Determine the logical names of your disk drives and the volume group they (if any)
that they are assigned to by using the lspv command. (We will be covering PVs and
VGs later in the course).
Which disks have a volume group of rootvg? ____________________________
Which disks have a volume group of none? _____________________________
# lspv
On our development system hdisk0 was in the rootvg and all other disks were listed
as none for the volume group column.
__ 16. Generate a device listing for the disk devices. Select one disk which was not in a
volume group and record the location of that disk. If it is SCSI attached, what is the
SCSI ID of the disk.
_______________________________________________________________
_______________________________________________________________
# lsdev -Cc disk
# lscfg | grep hdisk
-OR-
# smit
Devices ->
Fixed Disk ->
List All Defined Disks
On our development system the disk hdisk1 was SCSI attached with an AIX location
code of 03-08-00-4,0. The physical location code ended in P1-T10-L4-L0.
__ 17. Using the disk selected above, put that disk device into a Defined state.
# rmdev -l hdisk1
# lsdev -Cc hdisk
(hdisk1 should be Defined)
__ 19. Rediscover and configure that same disk for use. Does the device that appears
have the same location? _________________________________________
____________________________________________________________
# cfgmgr
# lsdev -Cc hdisk
# lscfg | grep hdisk
(hdisk1 should be Available)
-OR-
# smit devices
Install/Configure Devices Added After IPL
Input device / directory for software [none]
OK or Enter.
F3 to go back to the Devices Menu.
Devices ->
Fixed Disk ->
List All Defined Disks
hdisk1 should be Available.
On our development system, the disk that reappeared with the same logical device
name also had the same location code. This is not always the case; never assume
that it is the same device just because a device name is the same.
If you have an externally attached tape drive, continue with this section. Otherwise, skip
to Part 4 - Configure a CD-ROM device.
__ 20. Issue the shutdown command to bring your system down. If you have more than one
user on your system, coordinate this task with the other users.
# shutdown
-OR-
# shutdown -F
__ 23. Put the tape drive into the available state so it can be used. Use the name for the
tape drive that you recorded in the previous instruction.
Power on the tape drive.
# mkdev -l rmtx (where x stands for the drive recorded in the previous instruction)
-OR-
Power on the tape drive.
# smit
End of exercise
Exercise Review/Wrap-up
1. Review the commands that list information on configured devices.
Answer: lsdev, lscfg, lsattr
2. Review the differences between an available device and a defined device.
3. Ask students what different ways could be used to make a defined device available.
Answer: You could turn on the device then do a shutdown and a reboot or you could
turn on the device and go into SMIT under devices and select Install/Configure
Devices Added After IPL.
4. Ask the students what could make a device become defined.
Answer: Either the device was removed from the system, it was turned off during the
last system reboot, it is broken, or another device was added with the same physical
address.
Estimated time
00:15
__ 2. View the contents of /etc/filesystems and list the file systems on your machine.
# more /etc/filesystems
End of exercise
Estimated time
Parts 1 and 2 - 00:20
Parts 3, 4, and 5 - 00:40
Introduction
In this exercise you work extensively with SMIT to work with the
Logical Volume Manager. First, you investigate existing volume
groups, physical volumes and logical volumes. Once you are
comfortable with the layout of your storage, you have the opportunity
to add a physical volume to a volume group and then create a logical
volume. Finally, you make some changes to the logical volume
characteristics. In many cases, both the SMIT screens and the
command are provided in the Exercise Instruction With Hints
section. All tasks shown can also be done using the graphical version
of SMIT.
Copyright IBM Corp. 1997, 2008 Exercise 9. Working with LVM 9-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 2. Ensure you have a hard disk available to create a new volume group.
What is the name of the disk that is currently available? _______________
# lspv
__ 3. From the disk information that you determined in the step above, add a free disk into
rootvg.
Note
You need to substitute your free disk name when hdiskn is referenced.
# smit vg
Set Characteristics of a Volume Group ->
Add a Physical Volume to a Volume Group ->
Copyright IBM Corp. 1997, 2008 Exercise 9. Working with LVM 9-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
-OR-
# extendvg -f rootvg hdiskn
__ 5. Take the same disk that you added to rootvg, out of rootvg. Make sure you remove
the correct disk.
# smit vg
Set Characteristics of a Volume Group ->
Remove a Physical Volume from a Volume Group ->
__ 7. Using the free disk, create a new volume group called newvg.
# smit vg
Add a Volume Group ->
Add an Original Volume Group
Copyright IBM Corp. 1997, 2008 Exercise 9. Working with LVM 9-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 10. What is the maximum number of physical volumes that can be added to the
converted newvg? _________________________________________________
Select List Contents of a Volume Group
VOLUME GROUP name [newvg]
List OPTIONS status
Then, use F3 to return to the Volume Groups menu.
-OR-
# lsvg newvg
Look at the Max PVs field in the output to get the maximum number of physical
volumes.
The trade-off between PPs/PV and PVs/VG which you saw in step 8 is the same
here, except that in a big VG the default number of PVs/VG with a -t factor of 1 is
128. So a -t factor of 3 would result in 128/3 which would allow 42 PPs in our big
volume group, given the example 34 GB hard drive.
EXempty __ 11. Convert newvg into a scalable volume group. In order to make this change the
volume group must first be varied offline. Vary it back online when the conversion is
completed.
varyoffvg newvg
In SMIT, select:
Set Characteristics of a Volume Group ->
Change a Volume Group
VOLUME GROUP name [newvg]
Change to big scalable format yes
Then, use F3 to return to the Volume Groups menu.
-OR-
# chvg -G newvg
Answer y to the prompt, if asked.
# varyonvg newvg
__ 12. What is the maximum number of physical volumes that can be added to the scalable
format newvg? _________________________________________________
Select List Contents of a Volume Group
VOLUME GROUP name [newvg]
List OPTIONS status
Then, use F3 to return to the Volume Groups menu.
-OR-
# lsvg newvg
Look at the Max PVs field in the output to get the maximum number of physical
volumes.
The scalable VG has even more space in the VGDA to manage its constituent PVs.
And the management of the PPs is no longer on a PV by PV basis. Instead the PPs
are managed globally within the VG. You notice that there is no maximum number of
PPs per PV characteristic in a scalable VG.
__ 13. Remove the newvg volume group.
There are two Volume Groups menu items in SMIT that let you remove a volume
group. You can select Set Characteristics of a Volume Group and remove the
disk from the volume group. The volume group is automatically deleted when the
last disk is removed. Since there is only one disk in the newvg volume group,
removing that disk removes the volume group. The other menu choice of removing
the VG is obvious; yet, under the covers it is only doing a series of reducevg
requests until the last disk has been removed. Use this second choice.
Copyright IBM Corp. 1997, 2008 Exercise 9. Working with LVM 9-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Note
__ 14. Verify that hdiskn is not associated with any volume group. If it is not, repeat the
steps above. You need to have this disk free for a later exercise.
# lspv
__ 16. List all of the system's volume groups. If you use SMIT, before pressing Enter for the
output, try using the F6 key to see the command that is being built.
# smit
System Storage Management (Physical & Logical Storage) ->
Logical Volume Manager ->
Volume Groups ->
List All Volume Groups
__ 17. List the contents of the rootvg volume group. If you are using SMIT, for List
OPTION use status.
Find the information that is necessary to answer the following questions about your
environment:
F3 to go back to the Volume Groups menu.
-> List Contents of a Volume Group
VOLUME GROUP name [rootvg]
List OPTION status
-OR-
# lsvg rootvg
Copyright IBM Corp. 1997, 2008 Exercise 9. Working with LVM 9-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
c) How many total physical partitions are there for this volume group?_________
Check the field: TOTAL PPs.
d) How many of those physical partitions are free? ________________________
Check the field: FREE PPs.
e) How large are the physical partitions? _______________________________
Check the field: PP SIZE.
f) What is the Logical Track Group size? _______________________________
Check the field: LTG size.
g) What is the maximum number of PPs per physical volume? _______________
Check the field: Max PPs per PV.
__ 18. List the contents of the rootvg volume group once again this time selecting
physical volumes for the List OPTION. Note: the free distribution of physical
partitions is shown relative to the position on disk. These positions represent outer
edge, outer middle, center, inner middle, inner edge. Make a note of the free
partitions and their position on disk. ______ ______ ______ ______ ______
F3 to go back to the List Contents of a Volume Groups menu.
__ 20. List the contents of any physical volume on your system. If you are using SMIT, for
List OPTION use status.
Find the information that is necessary to answer the following questions about your
environment:
EXempty a) To which volume group does the physical volume belong? _______________
Check the field: VOLUME GROUP.
b) What is the physical partition size? _________________________________
Check the field: PP SIZE.
c) How many total physical partitions are there? __________________________
Check the field: TOTAL PPs.
d) How many of those physical partitions are used? _______________________
Check the field: USED PPs.
e) What is the maximum transfer size? _________________________________
Check the field: MAX REQUEST.
Try other options for listing information about the physical volume you select.
F3 to go back to the Physical Volumes menu.
List Contents of a Physical Volume
__ 21. List all of the logical volumes in the rootvg volume group.
F3 (three times) to go back to the Logical Volume Manager menu.
Logical Volumes ->
List all Logical Volumes by Volume Group
Note
This will list all volume groups. You will have to look through the list for rootvg, then
note the logical volumes for rootvg.
-OR-
Copyright IBM Corp. 1997, 2008 Exercise 9. Working with LVM 9-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
# lsvg -l rootvg
__ 22. Show the characteristics for the logical volume hd4. If you are using SMIT, for List
OPTION use status.
Find the information that is necessary to answer the following questions about your
environment:
a) To which volume group does it belong? ______________________________
Check the field: VOLUME GROUP.
b) How many copies? ______________________________________________
Check the field: COPIES.
c) How many physical partitions is it? __________________________________
Check the field: PPs.
d) How large is the logical volume in megabytes? _________________________
This is calculated: PP SIZE * PPs.
Important
Only one user per AIX system may complete this section. Please consult your
teammates before continuing.
__ 23. Only one physical volume has been defined to be a member of the rootvg volume
group. Using an available physical volume located on your system, create a new
volume group called datavg. Verify that the new volume group was successfully
created.
F3 (three times) to go back to the Logical Volume Manager menu.
Volume Groups ->
Add a Volume Group ->
Add an Original Volume Group
Copyright IBM Corp. 1997, 2008 Exercise 9. Working with LVM 9-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 24. Add a logical volume, which is one partition in size, to the datavg. (Note: If you only
have one disk on your system, create the logical volume in rootvg.) Allocate the
partitions on the outer edge of the disk. Allow the system to default the logical
volume name and note the system generated name.
__________________________________
F3 (three times) to go back to the Logical Volume Manager menu.
Logical Volumes ->
Add a Logical Volume
Logical volume NAME []
VOLUME GROUP name datavg
(or rootvg if you didn't add a new volume group)
Number of LOGICAL PARTITIONS [1]
PHYSICAL VOLUME names []
Logical volume TYPE []
POSITION on physical volume outer_edge
Note
...
-OR-
# mklv -a e datavg 1
__ 25. Rename the logical volume created above to yylv (where yy represents the initials
of your first and last name) instead of the system generated one, and verify that it
has been renamed.
F3 (two times) to go back to the Logical Volumes menu.
Set Characteristic of a Logical Volume ->
Rename a Logical Volume
CURRENT logical volume name [lv00]
NEW logical volume name [yylv]
-OR-
# chlv -n yylv lv00
To verify that your volume group has been created:
__ 26. Extend the yylv logical volume by one partition and specify that the added partition
be allocated on the outer edge of the disk. This logical volume is used in the next
exercise.
F3 to go back to the Logical Volumes menu.
-> Set Characteristic of a Logical Volume
-> Increase the Size a Logical Volume
LOGICAL VOLUME name [yylv]
Number of ADDITIONAL logical partitions [1]
POSITION on physical volume outer_edge
Note
Notice that this is already selected because it is the current location of the existing
PPs in the LV.
-OR-
# extendlv yylv 1
End of exercise
Copyright IBM Corp. 1997, 2008 Exercise 9. Working with LVM 9-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Exercise Review/Wrap-up
1. Review each of the LVM terms with the students being sure they understand the
relationships between them.
2. Ask the students how they can tell whether a logical volume is being mirrored.
Answer: By the number of copies there are from the status listing of a logical volume.
3. Ask the students if they know the number of PPs in a logical volume and if the PP size
can you tell what the size (in MB) the logical volume is. Then ask how.
Answer: Yes, by multiplying the number of PPs times the PP size.
Estimated time
00:20 Part 1
00:40 Parts 2 - 6
Introduction
In this exercise, you are using SMIT extensively to work with file
systems. You add a file system to the logical volume you created in the
previous exercise and then mount it so users can access the storage
space. You copy files into this file system and then experiment with
unmounting and mounting the file system once again but in different
locations. You also get an opportunity to remove a file system and
create a file system. The last portion of the exercise provides exposure
to creating a mirrored file system and then changing some
characteristics of the mirrored file system.
Copyright IBM Corp. 1997, 2008 Exercise 10. Working with file systems 10-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
EXempty Since, in the previous exercise, you used the second disk drive to
create a volume group, if students don't change the specification to
spread across multiple drives when they go to turn mirroring on, they
get a message that indicates there are not enough resources to satisfy
their request. They simply need to modify the appropriate field in SMIT
and try again.
In the first step in Part 6, if the student does not properly complete
reducevg for hdisk1 on the datavg, then the VGDA is still on the disk.
Attempting to specify that disk in the following extendvg would then
fail. First be sure the reducevg is properly completed. If necessary you
may use the -f (force) option on the extendvg command.
Copyright IBM Corp. 1997, 2008 Exercise 10. Working with file systems 10-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 1. If you are creating a JFS file system intended to store files that are smaller than 512
bytes in size, what would you choose for the following values?
Fragment Size: _____ 512 NBPI: _____ 512
Regular or Large-file enabled: __________ Regular
__ 2. If you are creating a JFS file system intended to store files about 8 KB in size, what
would you choose for the following values?
Fragment Size: 4096 NBPI: 4096
Regular or Large-file enabled: __________ Regular
__ 3. If you are creating a JFS file system intended to store files about 2 MB in size, what
would you choose for the following values?
Fragment Size: 4096 NBPI: 4096
Regular or Large-file enabled: __________ Regular
Copyright IBM Corp. 1997, 2008 Exercise 10. Working with file systems 10-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 6. Log in to the system and su to root. In order to use the space we set aside when we
created the logical volume in the previous exercise, we need to put a file system in it.
Create a journaled file system on the logical volume you created in the previous
exercise. Make the default mount point /home/teamxx/dir1 where the xx represents
your team number. (Wherever you see yylv substitute your initials for yy.) Request
that the filesystem be mounts at system restart.
$ su
# smit
System Storage Management (Physical & Logical Storage)->
File Systems ->
Add / Change / Show / Delete File Systems ->
Journaled File Systems ->
Add a Journaled File System on a Previously Defined Logical Volume ->
Add a Standard Journaled File System
* LOGICAL VOLUME name yylv
(where yy represents your initials)
* MOUNT POINT [/home/teamxx/dir1]
Mount AUTOMATICALLY at system restart? yes
OK or Enter.
-OR-
# crfs -v jfs -d yylv -m /home/teamxx/dir1 -A yes -p rw
EXempty OK or Enter.
F3 to go back to the File Systems menu
List All Mounted File Systems
F9 to launch a sub-shell (or open a window if in AIXWindows).
# ls -ld /home/teamxx/dir1
# chown teamxx.staff /home/teamxx/dir1
# cp -r /usr/samples /home/teamxx/dir1
# exit (to return to SMIT)
-OR-
# mount
# mount /home/teamxx/dir1
# mount
# ls -ld /home/teamxx/dir1
# chown teamxx.staff /home/teamxx/dir1
# cp -r /usr/samples /home/teamxx/dir1
__ 8. Create an enhanced journaled file system in the rootvg and let the system create
the logical volume for you. Have it mount automatically at system restart. Set its
default mount point to /home/teamxx/dir2. First try to create it with a size of 1 MB.
If that fails, create the file system with a size of 16 MB.
F3 to go back to the File Systems menu.
Add/Change/Show/Delete File Systems ->
Enhanced Journaled File Systems ->
Add a Enhanced Journaled File System
Volume group name [rootvg]
SIZE of file system
Unit Size [Megabytes]
Number of Units [1]
*MOUNT POINT [/home/teamxx/dir2]
Mount AUTOMATICALLY at system restart? yes
OK or Enter.
-OR-
#crfs -v jfs2 -g rootvg -a size=1M -m /home/teamxx/dir2 -A yes
__ 9. Check to see if it is mounted. It shouldn't be. Mount it. Verify that it is mounted.
Change the owner and group of the mount point to teamxx and staff.
Copyright IBM Corp. 1997, 2008 Exercise 10. Working with file systems 10-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 10. Add several files to the /home/teamxx/dir2 directory. (Note: A quick way to do this
is through the use of the touch command.)
# cd /home/teamxx/dir2
# touch file1 file2 file3 file4 file5 file6 file7
__ 11. List the files in the /home/teamxx/dir1 directory. Unmount /home/teamxx/dir1 and
list the files again. (Note: If you aren't root then su to root)
# cd /home/teamxx/dir1
# ls -a
# cd ..
# umount /home/teamxx/dir1
# ls -a dir1
__ 12. List the files in the /home/teamxx/dir2 directory. It should have all the files you
created in it from instruction 5. Then mount yylv on /home/teamxx/dir2 and list the
files in /home/teamxx/dir2.
# ls -a dir2
# mount /dev/yylv /home/teamxx/dir2
EXempty # ls -a dir2
# mount
What files are there now? _________________________________________
They are the files which were in the yylv logical volume which can be mounted at
any directory on the system.
Where did they come from? _______________________________________
These are the files that were copied from the /usr/samples directory.
What happened to the files that were originally seen in /home/teamxx/dir2?
_____________________________________________________________
The files that were originally seen in /home/teamxx/dir2 are still on the system,
they just can't be accessed at this time because the file system pointers are
pointing to the files in the yylv logical volume.
Copyright IBM Corp. 1997, 2008 Exercise 10. Working with file systems 10-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 14. Find out the names of the logical volumes on which the file systems are created.
(Hint: Use the Mount Point column in the output from the logical volume listing to
find the name of the logical volume.) Find the logical volumes the file systems are on
and the physical partitions in each file system and write it down.
# smit
System Storage Management (Physical & Logical Storage) ->
Logical Volume Manager ->
Logical Volumes ->
List All Logical Volumes by Volume Group
-OR-
# lsvg -o | lsvg -i -l
# df -m
EXempty How much did the file system actually get extended? ____________________
The file system actually got extended by the PPsize of your volume group.
Why didn't the size increase by 5,120 bytes? __________________________
Because the system allocates disk space in increments of physical partitions.
Did this change the size of the logical volume with which it is associated?____
Yes, it changed the size of the logical volume because in order for the file system
to expand, the logical volume has to expand as well.
F3 to go back to the System Storage Management menu.
File Systems ->
Add / Change / Show / Delete File Systems ->
Journaled File Systems ->
Change / Show Characteristics of a Journaled File System
Select the correct mount point from the selector screen.
SIZE of file system
Unit Size [512 bytes]
Number of Units [+10]
OK or Enter.
F3 to go back to the System Storage Management menu.
Logical Volume Manager ->
Logical Volumes ->
List All Logical Volumes by Volume Group
-OR-
# chfs -a size=+10 /home/teamxx/dir1
#lsvg -o | lsvg -i -l
# df -m
__ 17. Extend the size of the yylv logical volume by one physical partition.
What is the size of the logical volume? _______________________
What is the size of the file system? __________________________
Did this change the size of the file system? _____ No.
Why not? ______________________________________________________
______________________________________________________________
Copyright IBM Corp. 1997, 2008 Exercise 10. Working with file systems 10-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Extending the logical volume does not automatically extend the size of the file
system. However, in order for users to get access to that space, the file system
needs to then be expanded to fill the rest of the expanded logical volume.
Make it so the file system takes up all the space allocated to the logical volume.
F3 to go back to the Logical Volume Manager menu.
Logical Volumes ->
Set Characteristic of a Logical Volume ->
Increase the Size of a Logical Volume
LOGICAL VOLUME name [yylv]
Number of ADDITIONAL logical partitions [1]
OK or Enter.
F3 to go back to the System Storage Management menu
File Systems ->
Add / Change / Show / Delete File Systems ->
Journaled File System ->
Change/Show Characteristics of a Journaled File System
File System Name [/home/teamxx/dir1]
OK or Enter.
-OR-
# extendlv yylv 1
# lsvg -l datavg
# df -m
At this point, your logical volume should be one physical partition larger in size than
the size of the file system. Increase the size of the file system by one 512-byte block.
The system rounds up to the next physical partition boundary.
Change/Show Characteristics of a Journaled File System
SIZE of file system
Unit Size [512 bytes]
Number of Units [+1]
(This will expand the file system by 1 logical partition and thus to the size of the
logical volume.)
-OR-
# chfs -a size=+1 /home/teamxx/dir1
# df
__ 18. Change the characteristics of the /home/teamxx/dir1 standard file system to reduce
the size down to a final size of 1 megabyte.
Was this successful? ____________________________________________
This attempt failed because traditional journal file systems can only be shrunk
though a backup and restore procedure.
F3 to go back to the System Storage Management menu.
File Systems ->
Add / Change / Show / Delete File Systems ->
Journaled File Systems ->
Change / Show Characteristics of a Journaled File System
Select the correct mount point from the selector screen.
SIZE of file system
Unit Size [Megabytes]
Number of Units [1]
OK or Enter.
-OR-
# chfs -a size=1M /home/teamxx/dir1
__ 19. Change the characteristics of the /home/teamxx/dir2 enhanced journal file system
to increase the size by one 512 byte block.
What is the final size resulting from this? _____________________________
You will note that the file system increased by a full Physical Partition, since this
is the unit of allocation used for obtaining disk space from the volume group.
F3 to go back to the System Storage Management menu.
File Systems ->
Add / Change / Show / Delete File Systems ->
Enhanced Journaled File System ->
Change / Show Characteristics of an Enhanced Journaled File System
Select the correct mount point from the selector screen.
SIZE of file system
Unit Size [512 bytes]
Number of Units [+1]
OK or Enter.
Copyright IBM Corp. 1997, 2008 Exercise 10. Working with file systems 10-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
-OR-
# chfs -a size=+1 /home/teamxx/dir2
# df -m
__ 20. Change the characteristics of the /home/teamxx/dir2 enhanced journal file system
to reduce the size down to a final size of 16 megabytes. Was this successful?
________________________________________________________________
The dynamic reduction in size is supported by the enhanced journal file system, but
it will only reduce the size down to the nearest PPsize boundary and no less than
the 16 MB minimum allocation for JFS2.
F3 to go back to the System Storage Management menu.
File Systems
Add / Change / Show / Delete File Systems
Enhanced Journaled File System
Change / Show Characteristics of an Enhanced Journaled File System
Select the correct mount point from the selector screen.
SIZE of file system
Unit Size [Megabytes]
Number of Units [16]
OK or Enter.
-OR-
# chfs -a size=16M /home/teamxx/dir2
# df -m
__ 21. Remove the yylv logical volume, the one with /home/teamxx/dir1 as the mount
point. (where xx is the number of the logical volume assigned by the system when
you created the file system in Step 3.
Can it be done? ________________________________________________
No. Because the file system related to the logical volume is mounted.
F3 to go back to the System Storage Management menu.
Logical Volume Manager ->
Logical Volumes ->
Remove a Logical Volume
Copyright IBM Corp. 1997, 2008 Exercise 10. Working with file systems 10-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 23. Ensure that all references to the yylv logical volume and its mount point have been
removed by removing the file system.
Do you see any potential problems with removing a logical volume and then
removing the file system? _________________________________________
_____________________________________________________________
Yes, because if you remove the logical volume and forget to either remove the
entry in the /etc/filesystems file or remove the file system through SMIT, you
could create another file system that uses the same logical volume name
(especially if you allow the system to create the logical volume names) and then
remember at a later date that you needed to remove the old file system. If you
then do the remove operation through SMIT it uses the high level command rmfs
which also removes the logical volume. The logical volume it would be removing
is the new one which is not what you really wanted to do. For most situations, it is
best to remove the file system and let the system remove the logical volume for
you rather than removing the logical volume first and relying on remembering to
remove the file system right afterwards.
F3 to go back to the System Storage Management menu.
File Systems ->
Add / Change / Show / Delete File Systems ->
Journaled File Systems ->
Remove a Journaled File System
FILE SYSTEM name /home/teamxx/dir1
Remove Mount Point yes
OK or Enter.
-OR-
# rmfs -r /home/teamxx/dir1
# cat /etc/filesystems
__ 24. Normally you would mirror across multiple disks. If your system does not have two
disks in a volume group, this will not be possible, and, for this lab, you should place
both copies on the same disk. If your system has two disks but one of the disks is in
a second volume group then you may wish to remove that volume group and extend
the rootvg to include the available disk.
# reducevg datavg hdisk1
The physical volume being reduced from the volume group must not have any
logical volumes allocated on it. It is recommended that you identify the logical
volumes (lsvg -l datavg), and either delete any remaining logical volumes (rmlv)
or move them (migratepv) to a physical volume that remains in the volume group.
You may use the -d flag for reducevg to automatically delete any remaining logical
volumes.
# extendvg rootvg hdisk1
__ 25. Change the characteristics of the fslvxx logical volume so that mirroring is turned on
to have a single mirror (two copies). Be sure to allow creating a mirror on the same
disk if you do not have two drives in your volume group. Other than that, take all the
defaults.
F3 back to the Logical Volumes menu.
Set Characteristic of a Logical Volume ->
Add a Copy to a Logical Volume
*LOGICAL VOLUME name [fslvxx]
Copyright IBM Corp. 1997, 2008 Exercise 10. Working with file systems 10-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 27. Change the characteristics of your mirrored logical volume to do sequential writes.
Synchronize the copies. Fix the problem based on the message you receive and try
again. Be sure it is mounted before continuing to the next instruction.
Try changing the write policy:
F3 back to the Logical Volumes screen.
Set Characteristic of a Logical Volume ->
Change a Logical Volume
Copyright IBM Corp. 1997, 2008 Exercise 10. Working with file systems 10-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
-OR-
# lslv fslvxx
__ 30. Remove the, now unused, second disk from the rootvg.
F3 back to the System Storage Management menu.
Logical Volume Manager ->
Logical Volumes ->
Set Characteristic of a Logical Volume ->
Remove a Physical Volume from a Volume Group->
*VOLUME GROUP name [rootvg]
*PHYSICAL VOLUME name [hdisk1]
-OR-
# reducevg rootvg hdisk1
End of exercise
Copyright IBM Corp. 1997, 2008 Exercise 10. Working with file systems 10-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Exercise Review/Wrap-up
JFS2 requires a minimum allocation of 16 MB. If the volume group has a PPsize which is
equal to or greater than this minimum, then a 1 MB request would result in a large enough
allocation to satisfy the requirement. If the PPsize is less than 16 MB, then a request for 1
MB would result in an allocation that is less than the requirement and thus the allocation
would fail.
1. Ask students what the difference is between adding a file system to a previously
created logical volume and simply adding a file system letting the system create the
logical volume. Why would you want to do it one way versus the other?
Answer: When you create a logical volume you have the ability to specify exactly
where on the disk and which disk within a volume group you wish to use. Thus, you
have some control on positioning for performance or availability. If you let the system
create both the file system and logical volume at the same time, you lose any control
over where the file system gets placed on disk.
2. Ask students what happens to files in a directory if you mount another logical volume
over it.
Answer: The files are still there, you just can't get to them because the file system
pointers now take you to the contents of a different location on disk.
3. Ask students how they think mirroring affects file system performance.
Answer: On writes it would degrade file system performance because two write
operations have to be scheduled. If the scheduling policy is sequential, that would slow
things down as well. On reads, it could improve performance because the quickest copy
to get to is read first.
4. Ask students what the discovered in the Removing A File System section.
Answer: They should have discovered that just because the logical volume has been
removed it doesn't mean that all references to the logical volume and the file system
have been removed as well.
5. Ask students what happens to a file system and all its data when you remove the logical
volume.
Answer: The file system and all its data gets deleted too.
6. Ask then if all data gets deleted, when might you want to remove a logical volume.
Answer: If a file system gets broken, you might wish to remove it, recreate it and then
restore from backup. You would remove it when the contents of it are no longer needed
or you might remove it when you are trying to relocate it to another volume group after
you have already created a new one and copied the necessary data into it.
Estimated time
00:25
Introduction
In this exercise you perform many of the activities required of a system
administrator to manage disk space. Most of these activities require
use of commands on a command line. This exercise requires the
successful completion of the last two exercises; Working with LVM and
Working with File Systems.
Throughout this exercise you are asked to change several times from
your regular user name, teamxx, to root and then back again. It is a
good idea to use exit to return to the previous user after completion of
a task by the current user instead of continually executing the su
command.
Copyright IBM Corp. 1997, 2008 Exercise 11. Managing file systems 11-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 2. If you aren't already logged in, log in to your system and then su to root.
Recursively, copy the files under /usr/samples under your /home/teamxx/dir2
directory. Assume you have already determined that the /home/teamxx/dir2 file
system is close to full. Try to determine which of the directories is the biggest user of
the space. Then, try finding out which is the biggest file in that directory. Use the
sort command to organize the output in order of highest to lowest use. Finally,
determine who is the owner of that file.
# cp -r /usr/samples /home/teamxx/dir2
# du /home/teamxx/dir2/samples | sort -nr | pg
# du -a /home/teamxx/dir2/samples/snmpd | sort -nr | pg
# ls -l /home/teamxx/dir2/samples/snmpd/dpi2/dpi20ref.txt
(Note: your system may have a different directory and file as the big
users of disk space then what we have listed above.)
__ 3. Let's assume that you have concluded that more space is needed (as opposed to
removing files to free up space); therefore, the file system needs to be expanded.
Expand the file system by the size of 1 physical partition. Verify the usage of this file
system.
# smit
Copyright IBM Corp. 1997, 2008 Exercise 11. Managing file systems 11-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 4. For this exercise, you create two JFS file systems, one with a fragment size of 512
bytes and the other with the default fragment size of 4096. For both file systems, use
a value of 512 for NBPI. Allocate 50000 512-byte blocks for each file system and put
them in the datavg volume group. Use /tmp/frag512 as the mount point for the file
system with a fragment size of 512 and /tmp/frag4096 as the mount point for the
one with the default fragment size. If more than one student is performing this part of
the exercise separately on the same System p system, it is necessary to modify the
file system names in order to make them unique. Once the file systems are created,
mount them.
# smit crjfs
Add A Standard Journaled File System
Select datavg for the Volume group name.
Volume group name datavg
SIZE of file system
Unit Size [512 bytes]
Number of Units [50000]
MOUNT POINT [/tmp/frag512]
Mount AUTOMATICALLY at system restart? yes
Fragment Size (bytes) 512
Number of bytes per inode 512
OK or Enter.
F3 to go back to the Add a Journaled File System screen.
Add A Standard Journaled File System.
Volume group name datavg
*SIZE of file system
Unit Size [512 bytes]
Number of Units [50000]
*MOUNT POINT [/tmp/frag4096]
Mount AUTOMATICALLY at system restart? yes
Fragment Size (bytes) 4096
Number of bytes per inode 512
OK or Enter.
F3 to return to the menu.
Press F10 to exit SMIT.
# mount /tmp/frag512
# mount /tmp/frag4096
Copyright IBM Corp. 1997, 2008 Exercise 11. Managing file systems 11-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 5. Check both file systems with df -v and note any used space.
# df -v /tmp/frag512 /tmp/frag4096
You test the efficiency of the two file systems you just created for storing a large number
of very small files.
__ 6. First, you need a source file to use as input in the next step. Use the
/home/workshop/mkfile script to create a file that is 512 bytes in size. This script
requires the file size parameter to be passed to it and uses the suffix of bytefile. For
example: /home/workshop/mkfile 512 creates a file in your current directory called
512bytefile. Run this command from the /tmp directory creating a 512-byte file.
# cd /tmp
# /home/workshop/mkfile 512
__ 7. To test the number of 512-byte files that can be stored in each file system, run the
shell script /home/workshop/fragcopy. The shell script has the usage:
fragcopy numfiles dir/sourcefilename dir/targetfilename.
The fragcopy script creates copies of the sourcefilename until either the file
system is full or the numfiles value is reached. The files are put in the directory
specified in dir/targetfilename with the targetfilename as the prefix followed by
a . and a number which represents the count of the file currently being created.
While fragcopy processes, a count is displayed showing the number of files that
have been successfully copied. Have fragcopy copy /tmp/512bytefile 500 times
and have as the dir/targetfilename value: /tmp/frag512/frag500.
# /home/workshop/fragcopy 500 512bytefile frag512/frag500
__ 8. Look at the contents of the /tmp/frag512 directory. Note how many files are in this
directory.
# ls -l /tmp/frag512 | wc -l
The ls -l command output results in an extra line in the report, thus giving the
wrong number of files. Replace ls -l with ls.
__ 9. Do the same as step 7 only this time create copies of the 512bytefile in
/tmp/frag4096
# /home/workshop/fragcopy 500 512bytefile frag4096/frag500
EXempty __ 10. Look at the contents for /tmp/frag4096. Note how many files are in this directory.
# ls -l /tmp/frag4096 | wc -l
The ls -l command output results in an extra line in the report, thus giving the
wrong number of files. Replace ls -l with ls.
__ 11. Now that there are two file systems with the same number of files, see how much
disk space each has utilized.
How many 512-byte blocks have the files used in /tmp/frag512? _____ 17048
How many inodes have the files used in /tmp/frag512? _______ 517
How many 512-byte blocks have the files used in /tmp/frag4096? _____ 20528
How many inodes have the files used in /tmp/frag4096?_______ 517
What can you conclude from this? __________________________________
For small files, a disk fragment size of 512 provides a more efficient use of
blocks for disk space and to store inode information.
# df -v /tmp/frag512 /tmp/frag4096
__ 12. When you are finished reviewing the results, unmount and remove both file systems.
# umount /tmp/frag512
# umount /tmp/frag4096
# rmfs -r /tmp/frag512
# rmfs -r /tmp/frag4096
Copyright IBM Corp. 1997, 2008 Exercise 11. Managing file systems 11-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 14. Create a third file system (the same size as the two file systems you just created and
also in the datavg volume group) that does not use compression, that also has a
fragment size of 2048 and an NBPI of 2048, that has a mount point of
/tmp/uncompress, and that is automatically mounted at system restart. This will be
used for purposes of comparison.
F3 to go back to the Add a Journaled File System menu.
Add a Standard Journaled File System
__ 15. Check that the journaled file systems have been correctly created.
Exit SMIT.
# lsfs -q | pg
__ 17. Next, check the performance of the compressed file system by creating a 4 MB file
named bigfile by using the script /home/workshop/mkfile and then move it to
/home/workshop. Then copy it to each file system, and measure the performance
using timex. First, check that the logical volume configuration is similar. Then,
record copy times.
Real time for compress512: ____________________________________
Real time for compress: _______________________________________
Real time for uncompress: _____________________________________
# /home/workshop/mkfile 4194304
# mv 41943046bytefile /home/workshop/bigfile
#timex cp /home/workshop/bigfile /tmp/compress512
#timex cp /home/workshop/bigfile /tmp/compress
#timex cp /home/workshop/bigfile /tmp/uncompress
Copyright IBM Corp. 1997, 2008 Exercise 11. Managing file systems 11-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 18. Use du to check how much space is really used and how efficient the compression
is.
Disk usage for compress512: _____________________________________
Disk usage for compress: _________________________________________
Disk usage for uncompress: ______________________________________
# du /tmp/compress512
# du /tmp/compress
# du /tmp/uncompress
__ 19. Use ls -l to verify the normal size of each file. What is the amount of data in the
bigsize file in each filesystem?
File size of bigfile in compress512: ____________________________________
File size of bigfile in compress: _______________________________________
File size of bigfile in uncompress: _____________________________________
# ls -l /tmp/compress512
# ls -l /tmp/compress
# ls -l /tmp/uncompress
__ 20. Using the defragfs command, find out the current state of the file system
/tmp/compress512.
# smit
System Storage Management (Physical & Logical Storage) ->
File Systems ->
Add / Change / Show / Delete File Systems ->
Journaled File Systems ->
Defragment a File System
File System Name /tmp/compress512
Perform, Query, or Report? query
Click OK or press Enter.
F3 to return to the menu.
-OR-
# defragfs -q /tmp/compress512
__ 22. Perform a check on the /home/teamxx/dir2 file system so that if it finds something
wrong you are prompted as to whether or not to take any action.
# fsck /home/teamxx/dir2
What kind of message did you get?
The current volume is /dev/fslv00
File System is currently mounted.
Copyright IBM Corp. 1997, 2008 Exercise 11. Managing file systems 11-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
End of exercise
Copyright IBM Corp. 1997, 2008 Exercise 11. Managing file systems 11-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Exercise Review/Wrap-up
1. In Part 1 - step 2, Why does the du -a size and the ls -l size for dpi20ref.txt differ?
Answer: du -a gives the amount of disk space allocated to the file while ls -l gives
the size of the file from the application perspective. If you are using a fragment size of 4
KB and the application writes a 100 byte file, then what size would each of these
commands return?
2. Ask students when they think they would want to defragment a file system.
Answer: When there is a strong indication that file system performance is being
impacted by file system fragmentation. Some file systems are set up to be fragmented
across disks (that is, striped) to improve performance through multiple actuator and
possibly multiple scsi adapter access. The performance of these file systems would be
reduced, not improved, if defragmented.
Estimated time
00:20
Introduction
In this exercise you work with paging logical volumes, adding, deleting,
and changing them. To do this exercise, you need to work in teams -
one team per AIX system. Only one team member is able to do the
exercise, the other team members provide support and assistance
where needed.
Copyright IBM Corp. 1997, 2008 Exercise 12. Paging space 12-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 1. If you are not already logged into your system, log in as teamxx and su to root.
Check the current memory size on the system and then check the paging space.
$ su
# lsattr -E -l mem0
# lsps -a
__ 2. If you have two disks on your system and successfully created another volume
group named datavg during the Working with LVM exercise, create two page
spaces: first one in the rootvg volume group with a size of one partition and then the
other in the datavg volume group with an equivalent amount of space. (Be careful,
the volume groups may have different ppsize values.) Otherwise, create both page
spaces in the rootvg volume group. If you are short of space in rootvg, put both
paging spaces in datavg. Make them one partition each.
Have them become active now and at system restart.
# smit
System Storage Management (Physical and Logical Storage) ->
Logical Volume Manager ->
Paging Space ->
Add Another Paging Space ->
Select rootvg for the volume group.
Volume group name rootvg
SIZE of paging space (in logical partitions [1]
Start using this paging space NOW? yes
Use this paging space each time the system is RESTARTED? yes
OK or Enter.
__ 3. Check to be sure the new paging spaces are active. Create some system activity
and monitor the % of paging space used.
Exit SMIT.
# lsps -a
The following example commands use up memory on your system. Depending on
the amount of memory, you still may not be able to force paging.
# wsm & (if you are in a CDE graphical environment)
# find / -type f | xargs grep teasure >/dev/null &
# ls -laR / > /dev/null &
# lsps -a
Check the % used on the paging spaces.
What conclusion can you come to based on these observations?
_____________________________________________________________
The system begins to use active page spaces immediately and tries to
spread its usage across them as much as possible. Items in memory at the
time new page spaces are created and activated are not relocated but as
new system activity occurs, the new space begins to be used.
Copyright IBM Corp. 1997, 2008 Exercise 12. Paging space 12-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
If necessary, run these commands again and notice how the page space usage
becomes balanced over time. Note that your system may have so much memory
that this step may not use enough to trigger an noticeable increase in paging space
utilization.
__ 4. Change the size of paging00 to four partitions. Check to be sure that paging00 has
been increased.
# smit
System Storage Management (Physical and Logical Storage) ->
Logical Volume Manager ->
Paging Space ->
Change / Show Characteristics of a Paging Space
At the selector screen pop-up select paging00
Paging space name paging00
NUMBER of additional logical partitions [3]
OK or Enter.
F3 back to the Paging Space menu.
List All Paging Spaces
F3 to return to the menu.
-OR-
# chps -s 3 paging00
# lsps -a
__ 5. Reduce the size of paging00 by one partition. Check to be sure that paging00 has
been decreased.
# smit
System Storage Management (Physical and Logical Storage) ->
Logical Volume Manager ->
Paging Space ->
Change / Show Characteristics of a Paging Space
At the selector screen pop-up select paging00
Paging space name paging00
NUMBER of logical partitions to remove [1]
OK or Enter.
F3 back to the Paging Space menu.
List All Paging Spaces
F3 to return to the menu.
EXempty -OR-
# chps -d 1 paging00
# lsps -a
End of exercise
Copyright IBM Corp. 1997, 2008 Exercise 12. Paging space 12-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Exercise Review/Wrap-up
1. Review the steps students need to take to remove a paging space.
Answer: To remove a paging space, first you need to deactivate it and then remove it.
In AIX 5L V5.2 and later versions, this can be done without rebooting the system.
2. Review the reasons why additional page space may be needed and where it is best to
locate additional page space.
Answer: The amount of paging space required depends on the type of activities on the
system. If paging space runs too low, processes may be lost and if it gets full, the
system may halt completely. Since the performance of processes depend on access to
items in memory, the best place to put paging space is where you can get the best
performance. Thus, it is recommended to allocate paging space in the middle (center)
of the disk to reduce disk arm travel and to use multiple paging spaces, each allocated
on a separate physical volume. If there are multiple SCSI adapters on the system,
putting the paging spaces on disks on separate SCSI adapters may also help
performance.
Estimated time
Part 1 - 00:20
Parts 2, 3 and 4 - 00:40
Copyright IBM Corp. 1997, 2008 Exercise 13. Using backup and restore 13-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Important
You are backing up the file system that you created in the Working with File Systems
exercise; therefore, that exercise must have been completed successfully before
continuing with this exercise. When referencing the file system you can use either the
logical volume name, /dev/fslvxx or the file system name, /home/teamxx/dir2.
Preface
Two versions of these instructions are available; one with hints and one without. You
can use either version to complete this exercise. Also, please dont hesitate to ask the
instructor if you have questions.
All exercises of this chapter depend on the availability of specific equipment in your
classroom.
The output shown in the answers is an example. Your output and answers based on the
output may be different.
All hints are marked with a >> sign.
Copyright IBM Corp. 1997, 2008 Exercise 13. Using backup and restore 13-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 3. Make sure the backup completes successfully before doing this step. Remove the
datavg volume group. The volume group must not have any physical partitions
allocated to logical volumes. In order to remove these logical volumes in the datavg,
you must first make sure that they are all closed. In others words, the file systems
must be unmounted and the paging spaces must be inactive.You need to unmount
all mounted file systems in datavg first.
# smit vg
Select Remove a Volume Group
*VOLUME GROUP name [datavg]
OR
# reducevg -df datavg hdiskn
Copyright IBM Corp. 1997, 2008 Exercise 13. Using backup and restore 13-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 7. Log in as teamxx and su to root. Use su with out the dash so that you retain the
teamxx home directory.
$ su
__ 8. Create a new file system in datavg named /home/bkupxx, where xx is your login
team number. Make the file system one partition in size.
# smit
System Storage Management (Physical & Logical Storage) ->
File Systems ->
Add / Change / Show / Deleted File Systems ->
Journaled File System ->
Add a Journaled File System ->
Add a Standard Journaled File System
From the Volume Group Name pop-up box, select datavg.
Volume group name datavg
SIZE of file system
Unit Size Megabytes +
* Number of units [1] #
* MOUNT POINT [/home/bkupxx]
Mount AUTOMATICALLY at system restart? yes +
OK or Enter.
OR
# crfs -v jfs -g datavg -a size=1M -m /home/bkupxx -A yes -p rw
__ 10. Make sure the file system you created in the Working with File Systems exercise,
/home/teamxx/dir2 in logical volume /dev/fslvxx, is mounted. If it isn't, mount it.
# mount (check mounted file systems)
# mount /home/teamxx/dir2 (if not mounted)
__ 11. Ensure that all files from the /usr/samples directory were copied into the
/home/teamxx/dir2 file system. You are backing up these files to the new file
system, /home/bkupxx, which you created in Step 8.
# ls /home/teamxx/dir2 (check if data is in the file system)
# cp -r /usr/samples /home/teamxx/dir2 (if necessary)
Copyright IBM Corp. 1997, 2008 Exercise 13. Using backup and restore 13-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 12. The bos.rte.archive fileset contains the backup and restore utilities. Check that the
bos.rte.archive fileset has been installed.
# lslpp -l bos.rte.archive
__ 14. Back up the entire file system in inode format. Make sure to update
/etc/dumpdates. Your output media will be a file named weekly in the
/home/bkupxx file system.
# backup -0 -u -f /home/bkupxx/weekly /home/teamxx/dir2
OR
# smit
System Storage Management ->
File Systems ->
Backup a File System
*FILESYSTEM to Backup [/home/teamxx/dir2]
*Backup DEVICE [/home/bkupxx/weekly]
__ 15. Display the table of contents of the /home/bkupxx/weekly backup to ensure that all
files in the /home/teamxx/dir2 file system were backed up properly. How are the
files listed? __ ____________________________________________________
The inode and relative path name of the files are displayed.
In SMIT, F3 back to the File Systems menu.
Select List Contents of a Backup
*Backup DEVICE [/home/bkupxx/weekly]
OK or Enter.
F10 to exit SMIT.
OR
# restore -T -f /home/bkupxx/weekly
Note
If there is more than one team on your system, you will be writing to
/etc/dumpdates simultaneously. Analyze the information that relates to your
logical volume name. You see the other team's logical volumes listed as well.
# pg /etc/dumpdates
__ 17. Mount the /home/teamxx/dir2 file system and simulate a daily change to the file
named /home/teamxx/dir2/samples/tcpip/resolv.conf. Add your name in
uppercase to the first line of the file.
# smit
System Storage Management ->
File Systems ->
Mount a File System
FILE SYSTEM name [/dev/fslvxx]
DIRECTORY over which to mount [/home/teamxx/dir2]
OK or Enter.
Copyright IBM Corp. 1997, 2008 Exercise 13. Using backup and restore 13-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 18. Now unmount the file system. Verify it is unmounted. Perform an incremental inode
backup of /home/teamxx/dir2 to the file /home/bkupxx /daily. It should backup just
the changed file, resolv.conf. You are simulating the fact that you have a base
backup in /home/bkupxx/weekly (analogous to the monthly backup explained in
class) and an incremental backup in /home/bkupxx/daily (analogous to the daily
backup explained in class).
In SMIT, go back to the File System menu.
Select Unmount a File System
NAME of file system to unmount [/home/teamxx/dir2]
F3 back to the File System menu.
Select List all Mounted File Systems
F3 back to the File System menu.
Select Back up a File System
FILESYSTEM to backup [/home/teamxx/dir2]
Backup DEVICE [/home/bkupxx/daily]
Backup LEVEL [1]
RECORD backup in /etc/dumpdates [yes]
OK or Enter.
OR
# cd /home/teamxx
# umount /home/teamxx/dir2
# mount
# backup -u -1 -f /home/bkupxx/daily /home/teamxx/dir2
EXempty
__ 19. Display the table of contents of the /home/bkupxx/daily backup to ensure that just
the changed file was backed up. Record the EXACT name of the file.
In SMIT, F3 back to the File System menu.
Select List Contents of a Backup
Backup DEVICE [/home/bkupxx/daily]
OR
# restore -T -f /home/bkupxx/daily
Note
The next few steps show command line hints rather than SMIT screens because of
the extra steps of removing files and destroying file systems, which is necessary to
perform simulated recovery functions. You may continue to use the SMIT F9
shellout feature to execute the crash procedures.
__ 21. Simulate a user accident and recover the lost file using the above backup:
Mount the file system. Change directory to /home/teamxx/dir2. Remove the
samples/tcpip/resolv.conf file. Check that it no longer exists.
# mount /home/teamxx/dir2
# cd /home/teamxx/dir2
# rm samples/tcpip/resolv.conf
# ls samples/tcpip/resolv.conf
__ 22. Before you start the restore, be sure you are in the directory /home /teamxx/dir2.
Why is this important? ______________________________________________
The files were backed up with relative path names. To restore them to their original
locations, you must be in the original directory.
You will see messages displayed before the restore takes place. When prompted to
specify next volume #, type in 1. When prompted to set owner/mode, type in no.
# pwd (if not in correct directory, cd to it)
Copyright IBM Corp. 1997, 2008 Exercise 13. Using backup and restore 13-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 23. Now, you perform a crash of the entire /home/teamxx/dir2 file system and then
restore it using your backups. Ensure you are in the /home/teamxx/dir2 directory.
Remove all files and directories in this file system. Check to see that they were all
removed. Restore the file system and check to ensure all the files were restored.
Which backup should you use first? ____________________________________
Use the weekly backup first, then the daily backup.
# cd /home/teamxx/dir2
# rm -r /home/teamxx/dir2/*
# ls -lR (total 0)
# restore -rvf /home/bkupxx/weekly (Notice the messages on a level 0 backup)
# restore -rvf /home/bkupxx/daily (Notice the messages on a level 1 backup)
# ls -lR (You should see all your files)
__ 24. The restoresymtable file is created or updated upon each restore when working
with incremental inode backups. Do a long listing on this file to see that it exists.
Remove the restoresymtable.
Note
The restoresymtable file keeps track of links and deleted files that were created
between the backups. This file is only created when working with the -r restore
option. The system does not know when you are finished restoring all your
incremental inode backups, so it leaves you with the chore of cleaning up this
control file. This file did not appear during the single file restore. This is because
EXempty the -r option is not appropriate for a single file restore. The -x option is the
option of choice when restoring a single file and the unusual problems of restoring
links and deleted files correctly is not an issue.
# ls -l restoresymtable
# rm restoresymtable
The next three steps demonstrate the advantage of backing up by relative path
name, by restoring into a directory that is different from where the files originally
resided.
__ 25. Create a new directory named /home/teamxx/mybkup. Change and verify that you
are in the new directory.
# mkdir /home/teamxx/mybkup
# cd /home/teamxx/mybkup
# pwd
Copyright IBM Corp. 1997, 2008 Exercise 13. Using backup and restore 13-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 27. Check the directory /home/teamxx/mybkup. It should contain the contents of the
weekly backup. You can see that backing up files by relative path name allows you
to restore them back to ANY directory.
# ls -lR
__ 29. Back up the file system by name using the backup command. Also, use the full path
name to reference the file system. Once again, you use /home/bkupxx/weekly as
your output media instead of a tape.
# smit
System Storage Management
Files & Directories
Backup a File or Directory
__ 30. List the table of contents to verify the backup was successful.
How were the files listed? _________________________________________
The files are listed with full path names.
# smit
System Storage Management ->
File Systems ->
List Contents of a Backup
Copyright IBM Corp. 1997, 2008 Exercise 13. Using backup and restore 13-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 31. Let's take a look at the difference between relative and full path backups by
restoring by relative path name. First, cd to /home/teamxx/mybkup directory and
delete all the files. Ensure the directory is empty.
# cd /home/teamxx/mybkup
# rm -r /home/teamxx/mybkup/* (if necessary)
# ls -lR (total 0)
__ 32. The goal is to restore the files from /home/bkupxx/weekly into the
/home/teamxx/mybkup directory. Restore the files and note the way the files are
listed in the output of the restore command. Take a look at the contents of the
/home /teamxx/mybkup directory.
During restore where the filenames full or relative path? _________________
The file names are listed by their full path names.
Does it contain any files? _________________________________________
No. The files were restored by their full path name, which put them into the
/home/teamxx/dir2 file system.
# smit
System Storage Management ->
Files and Directories ->
Restore a File or Directory
EXempty __ 33. Back up the file system by name, but use a relative path name. Make sure you are in
/home/teamxx/dir2. List the contents of weekly. The file names should be in
a ./filename (relative path name) format.
# cd /home/teamxx/dir2
# smit
System Storage Management ->
Files & Directories ->
Backup a File or Directory
__ 34. Now, you should be able to restore these files into the /home/teamxx/mybkup
directory. Change to the /home/teamxx/mybkup directory. Perform the restore.
# cd /home/teamxx/mybkup
# smit
System Storage Management ->
Files & Directories ->
Restore a File or Directory
Copyright IBM Corp. 1997, 2008 Exercise 13. Using backup and restore 13-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
# cd /home/teamxx/mybkup
# restore -xvf /home/bkupxx/weekly
__ 35. List the contents of the /home/teamxx/mybkup directory. All of the files should be
listed.
# ls -lR /home/teamxx/mybkup
__ 36. The /home/teamxx/dir2 file system should still be mounted from the previous
restore. Once again, delete all the files and directories in the file system. (If you
clean out the file system now, it is much easier to see if your restore is working
properly later.) Double check to make sure the files are removed.
# mount
# rm -r /home/teamxx/dir2/*
# ls -lR /home/teamxx/dir2 (should see total 0)
__ 38. Change to the directory mount point and perform the restore.
# cd /home/teamxx/dir2
# smit
System Storage Management ->
File Systems ->
Restore a File system
Copyright IBM Corp. 1997, 2008 Exercise 13. Using backup and restore 13-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
# pwd
# restore -rvf /home/bkupxx/weekly
__ 39. Mount the file system and look at the contents to make sure that the restore worked.
Does the file system contain any files?_______ No
Why? ________________________________________________________
The files were restored to the /home/teamxx/dir DIRECTORY. When you
mounted the file system to the MOUNT POINT /home/teamxx/dir, you overlaid
the directory with the file system contents.
# mount /home/teamxx/dir2
# mount
# ls -lR
__ 40. Unmount the file system and list the files in the mount point directory. You see that
this is where your files went when you performed the restore.
# cd /home/teamxx
# pwd
# umount /home/teamxx/dir2
# ls -lR /home/teamxx/dir2
__ 41. Clean up the mount point by deleting all the files in the /home/teamxx/dir2
directory.
# rm -r /home/teamxx/dir2/*
# ls -lR /home/teamxx/dir2 (total 0)
__ 43. Now that you have the file system mounted, try the restore again. List the files after
you are through with the restore.
# cd /home/teamxx/dir2
# smit
End of exercise
Copyright IBM Corp. 1997, 2008 Exercise 13. Using backup and restore 13-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Estimated time
00:30
Copyright IBM Corp. 1997, 2008 Exercise 14. (Optional) Using tar and cpio 14-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 2. Make sure that the /home/teamxx/dir2 file system is mounted. tar does not back
up file systems unless they are mounted. If it is not mounted, mount it.
# mount
# mount /home/teamxx/dir2 (if not mounted)
__ 3. Change directory to the file system and create a directory called myjunk. In that
directory, create four zero-length files named file1, file2, file3, and file4.
# cd /home/teamxx/dir2
# mkdir myjunk
# cd myjunk
# touch file1 file2 file3 file4
__ 4. Back up the file system using the tar command to the file /home/bkupxx/tardata
using relative path names. List the contents of tardata to ensure all files are backed
up.
# cd /home/teamxx/dir2
# tar -cvf /home/bkupxx/tardata . (note the dot as an argument)
__ 5. Since the backup was done using relative path names, restore them to a different
directory. Use tar to restore the contents of the tardata directory to the
/home/teamxx/mybkup directory. Verify that all files were restored.
# cd /home/teamxx/mybkup
# tar -xpvf /home/bkupxx/tardata
# ls -lR /home/teamxx/mybkup
__ 7. You have been using relative path names up to this point with tar. Specify a full path
name and tar backs it up in full path name format. Backup the contents of the file
system to tardata directory using full path names.
# tar -cvf/home/bkupxx/tardata /home/teamxx/dir2
__ 8. Check the contents of tardata. All file names should be referenced by full path
name. If you restored the files, they would restore back to the same directory that
you copied them from.
# tar -tvf /home/bkupxx/tardata
Copyright IBM Corp. 1997, 2008 Exercise 14. (Optional) Using tar and cpio 14-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 10. Back up the file system using the cpio command to the file
/home/bkupxx/cpiodata using a relative path name. List the contents of cpiodata
to ensure all files were backed up.
# cd /home/teamxx/dir2
# find . | cpio -ov > /home/bkupxx/cpiodata
# cpio -itv < /home/bkupxx/cpiodata
__ 11. Since this backup was done using a relative path names, restore them, using cpio,
to the directory /home/teamxx/mybkup. FIRST remove all the files from the
/home/teamxx/mkbkup directory.
# cd /home/teamxx/mybkup
# rm -r /home/teamxx/mybkup/*
# cpio -idv < /home/bkupxx/cpiodata
# ls -lR /home/teamxx/mybkup
EXempty __ 13. You have been using relative path names up to this point with cpio. Specify a full
path name with the find command and cpio backs it up with a full path name
format. Back up the contents of the file system to cpiodata using full path names.
# find /home/teamxx/dir2/ | cpio -ov > /home/bkupxx/cpiodata
__ 14. Check the contents of cpiodata. All the file names should be referenced by full path
names. If you restored the files, they would restore back to the same directory that
you copied them from.
# cpio -itv < /home/bkupxx/cpiodata
End of exercise
Copyright IBM Corp. 1997, 2008 Exercise 14. (Optional) Using tar and cpio 14-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Estimated time
00:30
Introduction
During this exercise, you are given an opportunity to look at some of
the files discussed in the unit. You also have a chance to work with the
SUID and sticky bits.
Copyright IBM Corp. 1997, 2008 Exercise 15. Security files 15-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 2. Exit SMIT if you are in SMIT, and display the groups of which root is a member.
Next, without logging out, display the groups of which your teamxx login is a
member.
F10 to exit SMIT (if you are in SMIT).
# groups -OR- # setgroups
# groups teamxx
__ 3. Display the contents of the file that keeps track of the successful and failed su
attempts.
How can you determine the failed attempts? _________
__ 4. When a user logs in successfully, the login program writes the associated
information in the two files /var/adm/wtmp and /etc/utmp. Using the who command,
examine the contents of these two files.
# who /var/adm/wtmp
# who /etc/utmp
__ 5. Display in reverse chronological order, all previous logins and logouts recorded in
/var/adm/wtmp for your login user name, teamxx, and root.
# last teamxx
# last root
__ 6. Check to see if there were any invalid login attempts on your system due to an
incorrect login name or password.
How can you tell? ______________________________________________
Login names that are not recognized will be logged as UNKNOWN.
# who /etc/security/failedlogin
Copyright IBM Corp. 1997, 2008 Exercise 15. Security files 15-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 7. Create a listing of all SUID programs on the system in a file called allsuids.
Page through allsuids to see all the programs that are SUID programs. Look for
some of the commands that you have already learned and executed.
# find / -perm -4000 > /tmp/allsuids
# pg /tmp/allsuids
__ 8. As an ordinary user, you have been executing the su command to switch user to
root to perform privileged tasks. The su program has the SUID bit turned on. Do a
long listing on /usr/bin/su to see the SUID bit.
# ls -l /usr/bin/su
__ 9. Turn the SUID bit off. Verify that the bit is turned off.
# chmod u-s /usr/bin/su
# ls -l /usr/bin/su (An x bit should replace the s bit.)
__ 10. Exit back to your teamxx login shell and try to su to root.
Can you? _____________________________________________________
No, because the SUID has been taken off the su program. Sometimes it is
necessary for unprivileged users to be able to accomplish tasks that require
privileges. When a SUID program is run, its effective UID becomes that of the
owner of the program rather than the user that is running it. When you did a long
listing on /usr/bin/su you saw that the owner was security.
$ su
Cannot su to root: Authentication is denied
__ 11. Since you cannot su to root to turn the SUID bit back on, login over yourself as root
and set SUID on the program /usr/bin/su. Verify that the SUID bit is turned on.
$ login root
# chmod u+s /usr/bin/su
# ls -l /usr/bin/su
__ 13. Do a long listing on the /tmp directory. Locate the sticky bit that is set on the
directory.
# ls -ld /tmp
__ 14. Exit back to your teamxx login shell. Ensure you are in your teamxx home directory.
Create a subdirectory in your home directory named stickydir.
Change the bits on the stickydir directory for full access by user, group, and others
with the sticky bit turned on. Verify that the change was made.
# exit
$ pwd (You should be in /home/teamxx.)
$ mkdir stickydir
$ chmod 1777 stickydir
$ ls -ld stickydir
__ 16. Now, su to a teamyy user name that is not being used on your system.
Check with any other teams that may be sharing your system. The existing user
names should be team01 - team05 with passwords the same as the user name.
As this other teamyy user, try to first add and then remove a file named sticky2.
Can you do it? __________________________________________________
Yes. As a member of the staff group, teamyy has write authority to the stickydir
directory.
As this other teamyy user, try and remove the teamxx file named sticky1.
Can you do it? __________________________________________________
No. As the creator, teamxx, of the directory, stickydir, you set the mode of
/home/teamxx/stickydir so any user can create or delete their own files in this
directory, but cannot delete another user's files. The /tmp directory is the most
widely used directory with this feature.
$ su teamyy (where teamyy is a different user name from your login name).
Copyright IBM Corp. 1997, 2008 Exercise 15. Security files 15-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
$ touch sticky2
$ rm stickey2
$ rm /home/teamxx/stickydir/sticky1
Because you are not the owner the system should properly respond with Not
owner.
End of exercise
Copyright IBM Corp. 1997, 2008 Exercise 15. Security files 15-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Estimated time
00:40 Parts 1-5
00:10 Parts 6-7
Introduction
This exercise has two parts. Be sure to do only the currently assigned
part of the exercise.
This exercise concentrates on the SMIT interface for creating and
maintaining users and groups.
The exercise instructions direct you to create users usera, userb and
userc. If two students are sharing an AIX system, and performing this
exercise separately, create users useraxx, userbxx, usercxx where
xx represents the student's initials. This will ensure unique user IDs.
Copyright IBM Corp. 1997, 2008 Exercise 16. User administration 16-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Copyright IBM Corp. 1997, 2008 Exercise 16. User administration 16-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 3. List the user attributes. Exit SMIT and look at the /etc/security/user file. Compare
the defaults in this file with the attributes listed for usera.
Go back to the Users menu.
Change/Show Characteristics of a User
User Name [usera]
OK or Enter.
F10 to exit SMIT.
# pg /etc/security/user
__ 7. Do a long listing of all files including hidden files in usera's home directory.
What files were created? ______________________________ .profile
# ls -al /home/usera
__ 8. Test the new user ID. Log off and log in as usera. When prompted to change the
password, type in the same password assigned in step 6 to test the reuse restriction
set on the user ID from step 2. After you get the reuse error message, proceed to
change usera's password to something different. After successfully logging in as
usera, log out.
# exit
login: usera
usera's Password: <enter original password>
You are required to change your password.
Please choose a new one.
usera's New password: <enter the original password again>
Password was recently used and is not valid for reuse.
usera's New password: <enter new password>
Enter the new password again: <enter password>
$ exit
__ 9. Suppose usera is going on an extended vacation. Log in as root and using SMIT,
lock usera's login account.
# smit
Security & Users ->
Login Controls ->
Change/Show Login Attributes for a User
User NAME [usera]
Is this user ACCOUNT LOCKED [true]
OK or Enter.
F3 to return to the menu.
__ 10. Exit SMIT and test the account lock by attempting to log in as usera. You should not
be able to. If you could, redo step 9 and test it again.
Copyright IBM Corp. 1997, 2008 Exercise 16. User administration 16-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 11. Log in as root and try to su to usera. Change to useras environment at the same
time.
Could you? _______ Yes
Why? _____ ___________________________________________________
root is not locked out of any restrictions placed on a user. Along with the account
locked feature, when you added usera you also put the restriction that no other
user could su to this account. As with the account locked feature, root is exempt
from this restriction as well.
Kill the subshell and return to root. Unlock usera's account.
# su - usera
$ <ctrl-d>
# smit login_user
User NAME [usera]
Is this user ACCOUNT LOCKED [false]
OK or Enter.
F3 to return to the menu.
__ 12. Some users may try to guess other user's passwords. To help prevent illegal logins,
set the number of failed login attempts to two for usera. Exit SMIT and log out.
Use F3 to go back to the Change/Show Login Attributes for a User dialogue
panel
User NAME [usera]
Number of FAILED LOGINS before [2]
user account is locked
OK or Enter.
F10 to exit SMIT.
# exit
__ 13. Test the change by trying to log in as usera and entering an incorrect password
three times. On the fourth attempt, enter the correct password. If you are in a
Windows session, exit and execute this instruction from an ASCII command line.
__ 14. Log in as root and reset the failed login count for usera.
login root
# smit user
Reset Users Failed Login Count
* User NAME [usera] +
Press <Enter>
F10 to exit SMIT.
__ 15. Attempt to login at usera with the correct password. Was it successful?
# exit
login usera
__ 16. Log in as root and change the failed login attempts limit to 0 for usera to disable the
failed login check.
# smit login_user
User Name [usera]
Number of FAILED LOGINS [0]
OK or Enter.
F3 to return to the menu.
F10 to exit SMIT.
Copyright IBM Corp. 1997, 2008 Exercise 16. User administration 16-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 17. As your company grows you may need to add additional system administrators to
perform certain administrative tasks. As root, create a user named helper that
assists you in user and group administration only, by being a member of the
security group. Add security to helper's group set, not the primary group. Make
the password the same as the user name.
# smit
Security & Users ->
Users ->
Add a User
User NAME [helper]
Group SET [security]
OK or Enter.
F3 to return to the menu.
Go back to Security & Users menu.
Passwords ->
Change a Users Password
User NAME [helper]
Changing password for "helper"
helper's New password: helper
Re-enter helper's New password: helper
OK or Enter.
F3 to return to the menu.
__ 18. Exit SMIT. Page through the /etc/group file. Locate security and ensure that helper
is listed there.
F10 to return to the command line
pg /etc/group
__ 19. Log out and back in as helper. Execute the groups command to ensure that you
belong to two groups, staff and security. As a new system administrator, add a new
group called budget. List all groups to verify the addition of the new group.
# exit
login: helper
helper's Password: <enter password>
__ 20. Now add two new users, userb and userc making both members of budget as their
group set.
Go back to Security & Users menu.
Users ->
Add a User
User NAME [userb]
Group SET [budget]
OK or Enter.
F3 to return to the menu.
Go back to Add a User menu.
User NAME [userc]
Group Set [budget]
OK or Enter.
F3 to return to the menu.
__ 21. Exit SMIT. Assign the passwords for userb and userc. Make the password for each
user the same as the user name.
Exit SMIT
$ pwdadm userb
Changing password for "userb"
helper's Password: <type helper>
userb's New password: <type userb>
Re-enter userb's new password: <type userb>
$ pwdadm userc
Changing password for "userc"
helper's Password: <type helper>
Copyright IBM Corp. 1997, 2008 Exercise 16. User administration 16-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 23. Let's test to see if a member of the budget group can edit the file report. Log out
and back in as userc. As in the step above, this is userc's first time to log in.
Change the password accordingly. Edit report and add your name. Log out.
Did userc have to issue any special command before editing the file? _____ No
Why? _________________________________________________________
When userc tries to edit the file in userb's directory, the group budget is
checked in /etc/group. Since userc's name appears in the budget group,
access is permitted.
$ exit
login: userc
userc's Password: <enter password>
EXempty $ vi /home/userb/report
(type your name)
$ exit
Copyright IBM Corp. 1997, 2008 Exercise 16. User administration 16-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 24. When a user is created, the default .profile file is copied into the user's home
directory. As a system administrator, login, su to root, and edit the default .profile
file so that all newly created users have by default the EDITOR variable automatically
set up to /usr/bin/vi and their primary prompt string reflects the user's current
directory. (Hint: remember that the PS1 variable is for the primary prompt string and
the PWD variable contains the value of the current directory.)
Note
You may want to go back and remove the PS1 variable assignment from the
/etc/security/.profile file so the $ becomes the primary prompt string.
$ su - root
# vi /etc/security/.profile
EDITOR=/usr/bin/vi
PS1='$PWD=> '
export PATH EDITOR PS1
__ 25. Create a user named userd. Assign a password to userd. Log out and back in as
userd. You should see the current directory listed as your prompt. Next display the
value of the EDITOR variable. If the results are not what you expected, repeat the
previous step and try again.
# smit mkuser
User NAME [userd]
OK or Enter.
F3 to return to the menu.
Exit SMIT
# pwdadm userd
# exit
login: userd
userd's Password: <enter password>
/home/userd=> echo $EDITOR
/usr/bin/vi
__ 26. Log in as root. Before you remove userb from the system, locate the stanza for
userb in /etc/security/passwd.
# pg /etc/security/passwd
__ 27. Remove userb from the system. Take the default to the option Remove
AUTHENTICATION which is yes.
What is this doing? ______________________________________________
When removing authentication, the stanza for userb is removed from the
/etc/security/passwd file. If you were to select no, userb's stanza would remain
in the file. The reason the option is given is to provide continued support to an
additional authentication method, should one be customized for your system.
Authentication methods are not covered in this course.
# smit rmuser
User NAME [userb]
OK or Enter.
F10 to exit SMIT
__ 28. Page through the /etc/security/passwd file to ensure that the stanza for userb was
removed.
# pg /etc/security/passwd
__ 29. When a user is removed from the system, the user's home directory and files owned
by the user are NOT removed. Verify that userb's home directory and files still exist.
Remove all files and directories associated with userb.
# ls -ld /home/userb
# ls -al /home/userb
# rm -r /home/userb
Copyright IBM Corp. 1997, 2008 Exercise 16. User administration 16-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 30. As root, edit /etc/motd and add to the file in all uppercase "TODAY IS USERA'S
BIRTHDAY. SURPRISE CAKE AT 11:00."First, check that the user access
permissions on the file have write permission. If not, set write for user.
# ls -l /etc/motd
# chmod u+w /etc/motd (if necessary)
# vi /etc/motd
TODAY IS USERA'S BIRTHDAY. SURPRISE CAKE AT 11:00
__ 33. As root, create a file named newsitem in the /var/news directory. Type in a few
lines. Log out and back in as teamxx and read the news.
$ su
# cd /var/news
# vi newsitem1
(Type a few lines)
# exit
# exit
login: teamxx
teamxx's Password: <enter password>
$ news
EXempty __ 34. To do this step you must have more than one user on your local system. If you are
the only person on your system and you have two terminals, log in on both terminals
using two different teamxx IDs. Perform the exercise from one terminal and look for
the message on the other terminal. As root, send a note to all users on the system
that the system shuts down in 30 minutes.
# wall The system will be shutdown in 30 minutes
Copyright IBM Corp. 1997, 2008 Exercise 16. User administration 16-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 35. As root, examine any of the security files you have not yet seen.
$ su root
# more /etc/passwd
# more /etc/security/passwd
# more /etc/security/user
# more /etc/group
# more /etc/security/group
# more /etc/profile
# more /etc/environment
# more /etc/security/environ
# who /etc/security/failedlogin
# more /etc/security/login.cfg
__ 36. If you are sharing your machine with other students, you need to work together to
configure the new login prompt. ONLY ONE PERSON PER MACHINE CAN
PERFORM THIS STEP.
You can customize the login prompt that appears on an individual terminal or
customize it so that all terminals use the same login herald depending on what
stanza you change in /etc/security/login.cfg. In this step, you set up a global
default herald.
The herald should read:
. Your Company Name
Unauthorized users will be prosecuted.
login:
First, make a backup of the /etc/security/login.cfg file. If you corrupt this file, you
are not able to log in again.
# cp /etc/security/login.cfg /etc/security/login.cfg.bk
__ 37. Edit the default stanza in /etc/security/login.cfg and add the herald line.
Tip! - Do not use <Enter> at what looks like the end of the line. Let vi wrap the line.
The \r and \n are escape sequences that will signal to the <RETURN> and <NEW
LINE> for you. Note that for some terminal emulations, the \r <carriage return> is
displayed as a literal. On those emulations, the \n <new line> handles both the
carriage return and new line feed.
When finished, save the file and log out.
# vi /etc/security/login.cfg
default:
sak_enabled = false
logintimes =
logindisable = 0
logininterval = 0
loginreenable = 0
logindelay = 0
herald = "\n\n YOUR COMPANY NAME\r\nUnauthorized users will be
prosecuted..\r\nlogin: "
# exit
$ exit
Copyright IBM Corp. 1997, 2008 Exercise 16. User administration 16-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 38. Check to see if the login prompt is what you expect. You must be using an ascii
interface to see the effect of the change.
For students using a local console: If you are using an ASCII screen, your new
herald should be displayed. If you are using CDE, you cannot see your changes
unless you select the Option button and selection Command Line. If you don't see
your new herald, then check your entry in /etc/security/login.cfg.
For student using remote access, attempt a new remote connection. For example
you might use a telnet protocol either via a telnet command or via PuTTY.
End of exercise
Copyright IBM Corp. 1997, 2008 Exercise 16. User administration 16-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Estimated time
00:30
Introduction
You can issue a command by entering it on the command line. It can
run in the foreground or the background. A command can also be
issued with nohup allowing you to log off and go home while the
command is still running. The scheduling utilities covered in this
exercise allow you to schedule commands to run after you have left for
the day.
AIX V4.2 and later uses a version of the BSD mail daemon which may
cause problems when performing some of the steps in this exercise.
The BSD mail daemon assumes the use of DNS rather than
/etc/hosts. Thus, if /etc/hosts is used instead, it takes quite a while
for mail to appear. To fix this situation, it is necessary for the
/etc/hosts file to contain entries which look like the following:
10.0.0.1 sys1. sys1
To improve performance further, do the following:
vi /etc/netsvc.conf
Add the line: hosts=local and then save the file
chmod 400 /etc/netsvc.conf
In the June 2005 update of these materials, a series of steps that
depended on the students ability to view the LEDs of the lab system
being used were rewritten to facilitate offering of this course using a
wider range of hardware platforms and in a wider range of
environments, particularly with remote lab systems.
Part 1 - Using at
__ 1. Log in as teamxx. Submit a single at job that immediately echoes the message
Running an at command. and then echoes another message This is it! Check
your mail. Notice the shell script name assigned to your job.
$ at now
echo Running an at command
echo This is it!
<ctrl-d>
$ mail
Hint
Wait for a minute or so for the mail daemon to process and forward the mail. Keep
checking for new mail.
__ 2. Repeat the above instruction, but this time force your output to your screen.
(Suggestion: Use the tty command to get your device name.)
Hint
Enter tty at the command line to find out what your /dev/xxxx device name is.
$ at now
echo Running an at command > /dev/xxxx (xxxx is replaced by your device
name)
echo This is it! >/dev/xxxx
<ctrl-d>
__ 3. Experiment with the time specifications of next week and next month. After
entering jobs to be executed next week and next month, list the at jobs waiting to
run and check to see whether the jobs you just submitted appear in the list.
$ at now next week
echo $PWD
<ctrl-d>
$ at now next month
echo $PWD
<ctrl-d>
$ at -l
__ 4. Let's take a look at the environment when an at job executes. Change directory to
/etc. Submit an at job that returns the current directory to your screen and have it
execute in one minute. Now change directory to /var/adm and repeat the at
request. Change directory to the /(root) directory, list the at queued jobs, then wait
for the execution of your two jobs.
$ cd /etc
$ at now +1 min
echo $PWD >/dev/xxxx (xxxx is device you are using)
<ctrl-d>
$ cd /var/adm
$ at now +1 min
echo $PWD >/dev/xxxx (xxxx is device you are using)
<ctrl-d>
$ cd /
$ at -l
Wait for your jobs to run.
What can you deduce from the results you obtained in this exercise step?
_____________________________________________________________
The commands all execute relative to the directory you were in when you
executed the command. The first execution of echo $PWD was associated with
the /etc directory, where you were when you issued the command. The second
execution of echo $PWD was associated with the /var/adm directory, where you
were when you issued the command. When you switched to the /root directory
and waited for the commands to execute, it did not matter. The script was set up
when you did a <ctrl-d> to submit the job.
EXempty __ 5. You should now have several at jobs scheduled. su to root to give yourself proper
permission for viewing these jobs. Change to the directory /var/spool/cron/atjobs.
Examine some of the files in this directory and notice the additional statements that
are created for the at job besides the ones that the user entered.
Note
pg won't work very well because lines get truncated. For one thing, you should see
that the directory for the at job does indeed get set specifically within the at job
itself. If the content of a file looks disjointed, it is because nulls are used as field
delimiters within the file. When you have finished, return to your teamxx ID.
$ su root
# cd /var/spool/cron/atjobs
# ls -l
# cat <filename>
# <ctrl-d>
__ 6. As teamxx, list your at jobs. Use the appropriate option to cancel several of them.
Note
$ at -l
$ at -r <jobname>
# pg at.deny
# ls -l /var/adm/cron
(Notice there is no at.allow file.)
# exit
__ 11. Create a zero length file called datefile in the /tmp directory.
$ touch /tmp/datefile
__ 12. In your home directory, create a file called cron00 (which will be used as a crontab
file) which specifies that the output of the date command will be appended (using
the >> operator) to the file /tmp/datefile every minute from now on. Remember to
use full path names for commands used in crontab files. Remember, there can be
NO blank lines in the file including lines created by pressing Enter after the last
entry.
$ vi cron00
* * * * * /usr/bin/date >> /tmp/datefile
__ 13. Place your crontab file in the crontabs directory via the crontab command. Then,
use the appropriate option with crontab to look at the crontab entry that you
created.
$ crontab cron00
$ crontab -l
__ 14. Use the -f option of the tail command to check for additions to the file
/tmp/datefile. If you have done the last few steps correctly, you should see an
addition to the file in 1 minute, another in 2 minutes, and so on. Wait to see 3 or 4
additions to the file, then terminate the tail -f session.
$ tail -f /tmp/datefile
^c
$
__ 15. As teamxx, use the appropriate option of the crontab command to remove your
current crontab file. Verify that it has been removed.
$crontab -r
$crontab -l
__ 16. Continuing as teamxx, cd back to your home directory and create a shell script
called sizechk to:
__ a. Echo the message Active files over 2 blocks in /home.
__ b. Display the date and time.
__ c. Display the names of all files that are larger than 2 blocks in /home and that have
been modified within the last 2 days.
Hint
__ d. Echo Done.
__ e. Make sure all output goes to the screen.
__ f. Make the script executable.
$ cd /home/teamxx
$ vi sizechk
echo Active files over 2 blocks in /home > /dev/xxxx
date > /dev/xxxx
find /home -size +2 -mtime -2 -print > /dev/xxxx 2>/dev/null
echo Done > /dev/xxxx
$ chmod +x sizechk
__ 17. Test your script. If you don't get any output, change the blocksize to 1.
$ sizechk
__ 18. Run sizechk as an at job without redirecting output here (let the script do it). Make
sure that your at job runs and that your output goes to your screen.
$ at now < sizechk
__ 19. Verify the system date and time. Create a file called cron01 that causes sizechk to
be invoked every minute for the next 5 minutes for today only. Remember to use full
path names for commands used in crontab files. Remember, there can be NO blank
lines in the file including lines created by pressing Enter after the last entry.
$ date
$ vi cron01
25-29 3 12 5 * /home/teamxx/sizechk
(This is just an example to be tailored for the current date and time. 25-29
represents each of the next 5 minutes, 3 represents the current hour using
military time, 12 represents the current day of the month, 5 represents the
current month of the year, * is in the position of the current day of the week, and
the last field contains the actual command. Make this execute for the current
date and time.)
__ 20. Place your crontab file in the crontabs directory via the crontab command. Wait
for the next 1 minute interval and check that your sizechk script did indeed get
invoked by cron and that it executed successfully. While you are waiting, use the
appropriate option with crontab to look at the crontab entry that you created.
$ crontab cron01
$ crontab -l
__ 21. Switch user to root. Change directory to /var/spool/cron/crontabs and look at the
files that are in this directory. Your cron01 should be there with the name teamxx.
Examine the contents of several of the files. They may contain statements that are
commented and could be uncommented and/or modified based on specific
installation requirements. They provide a starting point for the execution of some
administrative commands in different areas.
$ su
root's Password:(enter password)
# cd /var/spool/cron/crontabs
# ls -l
# pg teamxx
__ 22. Return to teamxx. Edit the current crontab file by adding to the existing crontab
data a line that executes the sizechk script on the hour, every hour of every day
except Sunday. Wait a moment, and then verify that this line has been added to your
crontab. Once you are done, remove this particular entry so it does not drive you
crazy the rest of the week. Verify that it was removed.
EXempty # <ctrl-d>
$ crontab -e (add the following line and close the file)
0 * * * 1-6 /home/teamxx/sizechk
$ crontab -l
$ crontab -e (delete the lines you just added)
$ crontab -l
__ 23. Switch to root. Examine the file /etc/inittab and notice how the cron daemon
actually gets started.
$ su
root's Password: (enter password)
# pg /etc/inittab
cron will respawn if it is not running. Why is this important?
_____________________________________________________________
You never have to worry about the cron daemon not running on your system as
it is respawned anytime it dies. If you are depending on cron to run jobs after
hours, it must remain up without operator intervention.
Return to your teamxx ID.
# exit
End of exercise
Exercise Review/Wrap-up
1. How many crontab files can a user have?
Answer: Each user can only have one crontab file
2. Why are crontab files given the name of the user id rather than letting a user name
their own file?
Answer: To ensure that no one overwrites someone else's crontab file accidentally by
giving it the same name that another user has used.
3. What is the major difference between at and cron?
Answer: at should be used for one-time jobs. cron is used for jobs that must be run
multiple times.
4. What happens if you submitted an at job to run at midnight and the system goes down
at 23:00 and doesn't come back up until 8:00 the next morning?
Answer: Luckily, because the at job is stored in the /var/spool/cron/atjobs directory, it
should run as soon as the system comes up.
5. What happens if you submitted a cron job to run at midnight and the system goes down
at 23:00 and doesn't come back up until 8:00 the next morning?
Answer: Unlike at and batch, cron jobs do NOT execute when the system comes back
up. You need to know if your system crashed and check to see if there were any
crontab files that should have run that did not.
6. Using at, where does standard out go by default?
Answer: The screen. You have to redirect standard out with the commands you specify
to at.
Estimated time
00:40
Introduction
This exercise is designed for you to become familiar with adding a
printer and a queue. In the area of printing, there are many commands
that can be used to do the same thing. In many of these cases, we
have provided only one command method and the other method takes
you through SMIT. If you are already comfortable with certain UNIX
commands for handling print activities, like submitting a print job,
please feel free to use that command. Some of the functions provided
by AIX can only be accessed through the command shown or through
SMIT.
Printer configurations vary widely in the classrooms. Check with your
instructor for specific instruction for your site.
If more than one student is sharing an AIX system, but performing this
exercise separately, be sure that the queue names are unique. For
example, name one of the queues xxdraft where xx is the student's
initials. Wherever you see draft in the exercise instructions, use your
unique name. Wherever you see the queue name quality, use a
queue name such as xxquality where the xx is the student's initials.
Copyright IBM Corp. 1997, 2008 Exercise 18. Printers and queues 18-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 2. Log in and su to root. Check that the AIX Print Spooling system is activated. Using
SMIT, configure your printer with a local queue called quality.
Note
If you don't have the correct software support you will be prompted to install the
software first before adding the printer and the queue. If this is the case, go to the
Part 2 - Installing Printer Support Software.
login: teamxx
Password: <password-for-teamxx>
$ su
root's Password: ibmaix
# smit
Print Spooling ->
AIX Print Spooling ->
Add a Print Queue
Copyright IBM Corp. 1997, 2008 Exercise 18. Printers and queues 18-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
You then get a series of pop-up menus that prompt you for selections of where the
printer is attached, who the manufacturer is, the model of the printer, the type of
printer interface and the parent adapter. The following shows the selections that
should be made for each pop-up menu:
Select local for the ATTACHMENT TYPE
Select the manufacturer of your printer, like IBM
Select the printer model you have, like 4201-2
At this point, you may get a menu titled Printer Support Not Installed if the
software support for the printer you selected was not installed.This notification
window takes you through the SMIT software installation screens. Use these to
install the printer support from the installation media or in the course environment
from /usr/sys/inst.images. When prompted for the input device, press F4 for a
listing of valid devices. Select the installation device, then press Enter.
You are prompted for the SOFTWARE to install:
Press F4 to get a listing of software that is on the installation media.
Cursor through the selections until you find the listing for your printer. When the
printer drivers you need are selected, press Enter.
Ensure that Preview Only is set to NO. Press Enter to install the software. This
takes a couple of minutes.
Now, continue with the following steps:
Select parallel for the Printer Interface
Select ppa0 Standard I/O Parallel Port Adapter for the Parent Adapter
This brings you to the dialog screen:
*Name of new PRINT QUEUE to add [quality]
__ 3. Using SMIT, add a second queue to the printer and name it draft.
# smit
Print Spooling ->
AIX Print Spooling ->
Add a Print Queue
Once again, you are presented with a series of pop-up menus (similar to the ones in
the previous step) that prompt you for selections of where the printer is attached,
who the manufacturer is, the model of the printer, the type of printer interface and
the parent adapter. The following shows the selections that should be made for each
pop-up menu:
Select local for the ATTACHMENT TYPE
Select the manufacturer of your printer, like IBM
Select the printer model you have, like 4201-2
(Select the same printer that you selected in the previous step).
EXempty The next pop-up prompts you to either Add a new printer or select the existing
printer below. Select the existing printer.
This brings you to the dialog screen:
*Name of new PRINT QUEUE to add [draft]
Copyright IBM Corp. 1997, 2008 Exercise 18. Printers and queues 18-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 10. Examine the /etc/qconfig file to confirm the addition of the new queue and device
stanzas. Notice the location of the quality queue relative to the draft queue.
Which queue is listed first? ______ quality
# pg /etc/qconfig
__ 11. Using the qchk command, check the status of your newly created queues. They
should be marked READY.
Which queue is listed first? _______ quality
Which queue do you think is the default queue? ____________
The one that is listed first in the /etc/qconfig file.
# qchk -A
__ 12. Using SMIT, make the draft queue the system default queue.
# smit
Print Spooling ->
AIX Print Spooling ->
Manage Print Queues ->
Set the System's Default Print Queue
*System DEFAULT QUEUE name [draft]
__ 13. Exit out of SMIT and check the status and order of your queues.
Press F10 to exit SMIT
# qchk -A
__ 14. Create a file that can be used as a print test file. Put the file in the /tmp directory and
name the file printxx, where xx represents your initials. Put about 10 lines of data in
it.
# vi /tmp/printxx
Press i to begin inserting text.
Put 10 lines of anything you want in it.
<esc> to change to command mode < : >.
At the command entry prompt, type wq which will save and exit.
Copyright IBM Corp. 1997, 2008 Exercise 18. Printers and queues 18-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 15. Test your queues and printer by sending the printxx file you created in the step
above to both the draft queue and to the quality queue.
# qprt /tmp/printxx
# qprt -Pquality /tmp/printxx
-OR-
# lp /tmp/printxx
# lp -dquality /tmp/printxx
-OR-
# lpr /tmp/printxx
# lpr -Pquality /tmp/printxx
-AND-
# qchk -A
__ 16. If you do not have a physical printer in the lab, you are not able to see the effects of
your changed job attributes, but it is still useful to know where to set these defaults.
Using SMIT, change the attributes of the quality queue by adjusting some printer
characteristics. These may be different depending on the printer used. Try making
some changes. Basically, change the look of the printed output. Here is a list of
some changes you might try (depending on your printer):
Use double spacing
Set a top margin of 20 lines
Specify 50 lines per page
Use double high printing
Provide a separator page at the head of the job
# smit
Print Spooling ->
AIX Print Spooling ->
Change/Show Print Queue Characteristics
__ 17. If you have physical printers, send the printxx file to the quality queue to ensure
that the changes were successfully made to the queue.
# qprt -Pquality /tmp/printxx
-OR-
# lp -dquality /tmp/printxx
Copyright IBM Corp. 1997, 2008 Exercise 18. Printers and queues 18-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
-AND-
# qchk -A
__ 19. Change the queue characteristics of the draft queue so that its discipline is set to
sjn, shortest job next. Check the status of the queues to verify that the change was
made successfully.
# chque -q draft -a 'discipline = sjn'
-OR-
# smit
EXempty
__ 20. Send the file /etc/security/user to the draft queue and check to see that it is in the
queue.
Next, send the /tmp/printxx file you created in the previous exercise to the draft
queue and again display the job queues.
Which job is scheduled to run first after the queue is brought back up?
________ /tmp/printxx
Why? ________________________________________________________
It is the smaller of the two files and the queuing discipline has been set up as
shortest job next.
# qprt /etc/security/user
# lpstat
# qprt /tmp/printxx
# lpstat
Copyright IBM Corp. 1997, 2008 Exercise 18. Printers and queues 18-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 21. Bring down the quality queue, if not already down. Check the status of your queues
to be sure that both queues are down.
# disable quality
# lpstat
__ 22. Send the files /etc/qconfig and /etc/filesystems to the quality queue and send the
file /etc/motd to the draft queue.
# qprt -Pquality /etc/qconfig
# qprt -Pquality /etc/filesystems
# qprt /etc/motd
__ 23. Check the order of the print jobs waiting in the two queues. They should all have the
same priority value (Pri). In the quality queue, the /etc/filesystems file should be
behind the /etc/qconfig file, because it was submitted later.
Change the print priority of the /etc/filesystems job to 25 so that it becomes the
first print job scheduled for the quality queue.
# lpstat -t
# qpri -#<job number> -a 25
# qchk -L -P quality
-OR-
# lpstat -t
# smit
Print Spooling ->
AIX Print Spooling ->
Manage Print Jobs ->
Prioritize a Print Job
*Print JOB NUMBER [] (Use F4 to list)
*Priority LEVEL [25]
Press Enter.
Press F10 to exit SMIT.
# qchk -L -P quality
__ 24. Let us assume that you really wanted the /etc/filesystems printed with the
characteristics associated with the draft queue. Move the /etc/filesystems print job
to the draft queue.
# lpstat
__ 25. You realize that you already printed /etc/security/user and you don't need to do it
again. Cancel the job.
# cancel <job number>
# lpstat
-OR-
# qcan -x<job number>
# lpstat
-OR-
# smit
# lpstat
Copyright IBM Corp. 1997, 2008 Exercise 18. Printers and queues 18-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 26. You want to print all the jobs currently in your queues except for the
/etc/filesystems job, which you want to print at a later time. Put a hold on the
/etc/filesystems job, verify the job is being held, and then bring up your two queues.
# qhld -#<job number>
# lpstat
# enable quality draft
# lpstat
-OR-
# smit
__ 27. Check to see all jobs have printed successfully. Then, release the /etc/filesystems
job so it too can print.
# qhld -r -#<job number>
-OR-
EXempty # smit
Copyright IBM Corp. 1997, 2008 Exercise 18. Printers and queues 18-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 28. Work with another team to do remote printing. One team acts as the print server and
the other will act as the print client. Record, below, the IP address of the other
teams AIX system (not your own).
______________________________________________________________
# host $(hostname)
__ 29. Each team log in and su to root
__ 30. On both platforms, add a name resolution entry to you local hosts file for the other
teams machine if not already resolvable.
# host <hostname of other teams system>
if there is no resolution, then continue with the following steps:
# smit hosts
Add a Host
* INTERNET ADDRESS (dotted decimal) [other team IP address]
* HOST NAME [other team hostname]
press Enter
F10 to exit SMIT
__ 31. On the server platform, using SMIT, add print access for the client system and start
the print server subsystem (lpd daemon).
smit
Print Spooling ->
AIX Print Spooling ->
Manage Print Server ->
Add Print Access for a Remote Client
Name of the REMOTE CLIENT [client-hostname]
Press Enter.
F3 back to the Manage Print Server menu.
Select Start the Print Server Subsystem.
Take the defaults.
Press Enter.
F10 to exit SMIT.
EXempty __ 32. On the client system, using SMIT, configure a remote print queue (called remote)
with your server systems hostname as the server with and a server print queue
name of quality. Define it with a timeout value of 1 minute.
smit
Print Spooling ->
AIX Print Spooling ->
Add a Print Queue ->
Select remote for the ATTACHMENT TYPE
Select standard processing for the Type of Remote Printing
Name of the QUEUE to add [remote]
HOSTNAME of the remote server [server-hostname]
Name of QUEUE on the remote server [quality]
Backend TIMEOUT period [1]
Press Enter.
__ 33. On the client system, send the files /etc/motd and /etc/filesystems to the remote
queue.
# qprt -Premote /etc/motd
# qprt -Premote /etc/filesystems
__ 34. On the client system, check to see the status of the print jobs.
# qchk -A
__ 35. On the server, see if the remote print jobs are in the quality queue.
# qchk -A
End of exercise
Copyright IBM Corp. 1997, 2008 Exercise 18. Printers and queues 18-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Optional Exercise
__ 37. As the root user, run the script /home/workshop/lab6. This script creates problems
with the printing subsystem. Try printing a file. Look at the error message and check
the file that is being referenced. Try to fix the problem and try printing a file again. If
the problem originally presented was fixed, a new error message is generated.
Make sure the resource mentioned in the error message is working and then try
printing a file again.
# ksh /home/workshop/lab6
# qprt /etc/motd
The error message you get looks something like this:
digest: error in config file /etc/qconfig, line 94.
digest: (FATAL ERROR): No device line in queue stanza.
enq: (FATAL ERROR): Error from digester /usr/lib/lpd/digest,
status=1024, rv = 11924.
The error numbers may be different depending on what is in /etc/qconfig.
# pg /etc/qconfig
# vi /etc/qconfig
<ESC>: set nu <shift G> (To get to the end of the file).
Look around line 94 (Or whatever line number your message indicated).
dd (Delete the line with the stray character).
<shift zz> (To save and quit the file).
# qprt /etc/motd
The error message you get looks something like this:
enq: (WARNING): Qdaemon appears to be dead.
enq: errno = 2 No such file or directory
enq: WARNING):Cannot awaken qdaemon.(request accepted anyway)
(The last 2 messages you will get several times)
# lpstat (Check to see if your job is in the queue).
# lssrc -s qdaemon
# startsrc -s qdaemon
End of exercise
Copyright IBM Corp. 1997, 2008 Exercise 18. Printers and queues 18-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Estimated time
00:40
Introduction
TCP/IP has been configured on your systems prior to class in order to
support the NIM-based installation/migration exercise and to provide
remote access to the lab systems. In this exercise, you record the
existing network configuration and then you remove that configuration.
At that point you only have access to the system from the system
console (either a local terminal or via an HMC virtual console). From
the console, you configure TCP/IP using the same values as it had
before.
For Ethernet, be sure to tell the students which cable type to use in the
lab system. In most cases they can select n/a (the adapter connection
type can be auto-detected) or tp. Some local system environments
might be using BNC, though that would be rare these days.
Userid: hscroot
Password: abc1234
You may also get an error about pop-ups being disabled. Click OK on the
error box. In Mozilla, pull down the Tools menu, select the Options
item, click on the Content icon, and uncheck the Block Popup Windows
option. Click OK. Then repeat the above sequence.
__ 5. Log in to your assigned partition as teamxx and su to root. This acts as your system
console during the exercise.
$ su root
#
__ 7. Identify a partner team with whom you validate network connectivity (this may have
been assigned by your instructor or this could be left to you to work out with other
students). Exchange IP address and hostname information with that partner team.
Record their configuration information below:
IP address: ____________________________________________________
IP address name resolution: _______________________________________
__ 8. ping your partner teams system to verify this currently works.
# ping <IP address or hostname of other system>
__ 9. Detach both the en0 and et0 interfaces.
# ifconfig en0 detach
# ifconfig et0 detach
__ 10. Remove your network interface (en0) and network adapter (ent0) from the ODM.
# rmdev -dl en0 -d
# rmdev -dl ent0
__ 11. Set your hostname to a null string and rename /etc/hosts to /etc/hosts.bak
# hostname ""
# mv /etc/hosts /etc/hosts.bak
__ 12. Run the configuration manager so that it rebuilds the adapter and interface you just
deleted. Once this is complete, you are ready to proceed with the TCP/IP
configuration.
# cfgmgr
__ 13. ping your partner teams system to verify that you cannot communicate.
# ping <IP address or hostname of other system>
__ 14. Display the network interfaces to show that the interface is not configured.
# netstat -in (you should only see the loopback interface)
__ 16. Verify that the above action automatically set the hostname and the name
resolution for your own system.
# host $(hostname)
__ 17. Add an entry for your partner system in the /etc/hosts file. You may use SMIT or vi.
# vi /etc/hosts
-OR-
# smit
__ 19. Use the network command, ping, to test connectivity to your partner system. ping
by IP address and then by host name. If you can not get a response back display the
contents of your /etc/hosts file to ensure you have an entry for the system and it is
correct. Ensure that the system you are trying to reach has completed the
configuration steps.
# ping <partner hostname>
<ctrl-c> (to stop the output)
# ping <partner IP address
<ctrl-c> (to stop the output)
__ 20. Execute the host command for the hostname of your partner system and, again, for
the IP addresses of your partner system.
# host <hostname of partner system>
# host <ip address of partner system>
__ 21. Execute the netstat -i command to display the status of the communication
adapter(s) on your system.
# netstat -i
__ 23. While remotely logged in to your partner's system, create a file named sysxfile
where x is the number of your system. You use this file later in this exercise. List the
contents of root's directory to verify that your file exists.
# vi sysxfile
(Type a few lines that will identify this file as yours)
# ls
__ 24. Close the connection and verify that you are back on your local system by executing
hostname. You should see your host name.
# <ctrl-t>
telnet> close
# hostname
-OR-
# <ctrl-d>
# hostname
__ 26. Change to your teamxx's home directory ON YOUR system and list its contents.
Pick out a small file that you can transfer to your partner system's /home/teamxx
directory. Since you are root, you should not have any problems with permissions.
You may want to ask your partner which teamxx home directory to use.
ftp> lcd /home/teamxx
ftp> !ls -l
ftp> put <filename>
__ 27. End the file transfer session and verify that you are back on your local system.
ftp> quit
# hostname
End of exercise
Estimated time
Unknown
Introduction
This exercise is designed to give you experience in installing a system
as if you had just received a new machine without anything on it. You
should be using the same type of distribution media you would get
from IBM.
If you have more than one student sharing a system (all systems have
a minimum of two terminals attached to them), then only one person
can actually perform these steps. All other students on that system
should observe while the steps are being done.
Requirements
A local system capable of running AIX 5L V5.3 with a CD-ROM
drive attached to it and at least 128 MB of memory and 2.2 GB of
physical disk space
Installation media (CD)
Copyright IBM Corp. 1997, 2008 Appendix A. Optional exercise: AIX 5L V5.3 installation A-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 1. If your system is already on, log in as root. Then, shut down the system.
Console login: root's Password: ibmaix
# shutdown -F
When you see the Halt Completed message on the console, shutdown is
complete. The system then shuts itself off.
__ 2. Turn on all attached external devices, such as terminals, CD-ROM drives, tape
drives, monitors, and external disk drives. DO NOT TURN THE SYSTEM UNIT ON
YET.
__ 4. If you are using a graphics display, skip to the next step. If you are using an ASCII
terminal, be sure the communications options on the terminal are set as follows:
Line Speed (baud rate) = 9600
Word Length (bits per character) = 8
Parity = no (none)
Number of Stop Bits = 1
Interface = RS-232C (or RS-422A)
Line Control = IPRTS
Be sure the keyboard and display options are set as follows:
Screen = normal
Row and Column = 24x80
Scroll = jump
Auto LF (line feed) = off
Line Warp = on
Forcing Insert = line (or both)
Tab = field
Copyright IBM Corp. 1997, 2008 Appendix A. Optional exercise: AIX 5L V5.3 installation A-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 5. Turn the system unit power on. Press F5 after you see the keyboard icon on the
screen. The system will begin booting from the installation media.
__ 6. After about five minutes, a screen appears on all directly attached terminal or
display devices asking you to define the system console. Notice that you are given
these instructions in many different languages. Follow the instructions as they
appear on the device you wish to use as the system console.
Type the number of your choice and press Enter. Choice is indicated by >>>.
88 Help ?
99 Previous Menu
EXempty __ 9. The Installation and Settings menu is displayed. Select item 1, System Settings.
Either type 0 and press Enter to install with current settings or type
the number of the setting you want to change and press Enter.
1 System Settings
Method of Installation............. Preservation
Disk Where You Want to Install......hdisk0
__ 10. The Change Method of Installation menu is displayed. You are now given the
opportunity to change the method of installation. Select item 1, New and Complete
Overwrite.
Change Method of Installation
2 Preservation Install
Preserves SOME of the existing data on the disk selected for
installation.
Warning: This method overwrites the usr (/usr), variable (/var),
temporary (/tmp), and root (/) file systems. Other product
Copyright IBM Corp. 1997, 2008 Appendix A. Optional exercise: AIX 5L V5.3 installation A-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
3 Migration Install
Upgrades the Base Operating System to current release. Other product
(application) files and configuration data are saved.
88 Help ?
99 Previous Menu
__ 11. The Change Disks Where You Want To Install menu is displayed. You are now
given the opportunity to select the disk drives where you want the system to be
loaded. Select the disk drive with the greatest amount of space on it, minimum of 2.2
GB, as long as it is marked bootable. If not, select both drives or if there isn't a single
drive with greater than 2.2 GB on it, select both drives.
__ 12. You are taken back to the Installation and Settings menu. Select item 2, Primary
Language Environment Settings (AFTER install).
Either type 0 and press Enter to install with current settings or type
the number of the setting you want to change and press Enter.
1 System Settings
Method of Installation............. Preservation
Disk Where You Want to Install......hdisk0
Type the number for the Cultural Convention (such as date, time, and
money), Language and Keyboard for this system and press Enter, or type
106 and press Enter to create your own combination.
88 Help ?
99 Previous menu
Choice [1]:
Copyright IBM Corp. 1997, 2008 Appendix A. Optional exercise: AIX 5L V5.3 installation A-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 14. You should now be back at the Installation and Settings menu. If you are happy
with your selections, select 0 to continue with the new and complete overwrite
installation.
Either type 0 and press Enter to install with current settings or type
the number of the setting you want to change and press Enter.
1 System Settings
Method of Installation............. New and Complete Overwrite
Disk Where You Want to Install......hdisk0
__ 15. Once the installation begins, a status screen appears. Note the progress indicator at
the bottom of the screen. The installation process will take approximately one hour.
Copyright IBM Corp. 1997, 2008 Appendix A. Optional exercise: AIX 5L V5.3 installation A-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Estimated time
Unknown
EXempty only execute these scripts against an ASCII terminal. Below are the contents of each script.
Be sure to make them executable for all users.
lab5
this_tty=`tty`
cat /bin > $this_tty
lab5.1
this_tty=`tty`
stty 38400
If students request these scripts, refer them to Appendix B of the Student Guide.
You get a pop-up screen which lists the available tty devices. Select the terminal
from the list which corresponds to your terminal.
Keep definition in database [no]
OK or Enter.
The system should not have allowed you to remove an active terminal. You must
disable the terminal before you attempt to remove it.
Cannot perform the requested function because the specified device is busy.
F10 to return to the command line.
__ 4. Return to SMIT and complete the process of removing the ASCII terminal.
After you complete this step, be sure to do the next section, Part 2 - Add a terminal
because you will need this terminal for later exercises.
# smit
Devices ->
TTY ->
Remove a TTY
You get a pop-up screen which lists the available tty devices. Select the terminal
from the list which corresponds to your terminal.
Keep definition in database [no]
OK or Enter to perform the action.
F10 to return to the command line.
__ 7. On the Server console run the penable command that sends a login prompt to your
ASCII terminal.
# penable tty0
__ 9. If SMIT did not run change the terminal type so you can use SMIT and then try
starting SMIT again.
# export TERM=ibm3151
# smit
__ 11. Once this change is complete on the system, can you work with the terminal? __ No
Why not? _________________________________________________________
Because the terminal settings don't match the port settings on the system.
Change the settings on your terminal so it can communicate with your system.
To change the settings on your terminal, follow the steps shown in Step 6 in Part 4
-Check Terminal Communications Settings. Look for the portion of these
instructions that deal with the Communication menu.
Note
The lab5 shell script caused a problem because it attempted to cat several binary
files to your ASCII terminal.
__ 13. DO NOT DO THIS FROM AN LFT. As root, from the ASCII terminal, run the shell
script /home/workshop/lab5.1. This shell script causes display problems with the
ibm3151 terminal. Determine what the problem symptoms are, such as a hung
terminal (doesn't show any character when you try to type), or strange characters
displayed when you try to type something. As part of troubleshooting, check the port
attributes, like the baud rate, and whether or not there are any processes running
associated with the terminal. Try to fix the problem using the suggestions in the
student notebook before taking the last resort of turning the terminal off then on.
# /home/workshop/lab5.1
From another terminal attached to the same system:
- # stty -a < /dev/ttyx
(Notice that the baud rate is different than the terminal setting.)
- # stty 9600 < /dev/ttyx (if this doesn't work then try ...)
# pdisable ttyx
# penable ttyx
Turn off the terminal and turn it back on again.
Note
The lab5.1 shell script caused a problem by using the stty command to reset the
baud rate on the ASCII terminal to something that did not match the terminal setup.
End of exercise
Estimated time
Unknown
Introduction
This exercise reinforces the material covered in the System V Print
Subsystem appendix. It consists of questions and hands-on activities.
There are two levels of information:
Exercise Instructions
Exercise Instructions with Hints
Use any level that facilitates your learning process. Use all available
resources: team members, documentation, your instructor.
Requirements
System running AIX 5L with connected local printer.
Copyright IBM Corp. 1997, 2008 Appendix C. Optional exercise: The System V print subsystem C-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
If your classroom does not have printers, you can perform most of these exercises by
printing to a file. Notes are provided in the instructions for this option.
__ 2. If the System V print subsystem is active, change to the AIX print subsystem.
What command did you use? ____________________ switch.prt -s AIX
Copyright IBM Corp. 1997, 2008 Appendix C. Optional exercise: The System V print subsystem C-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 8. Log in as root.
EXempty
Step Action
Use SMIT fastpath smit pdp to open the Printer/Plotter Devices
1
menu.
2 Move the cursor to select Add a Printer/Plotter; press <Enter>.
3 Scroll through the device list and select the printer device.
4 Select the type of interface (connection).
5 Select the parent adapter.
For parallel connected printers, enter <p> in the PORT number field and
6
press <Enter>.
For serial connected printers, enter the port number in the PORT
7
number field, fill in the baud rate and so forth and press <Enter>.
__ 11. Use lpadmin to define a new System V printer using the printer device you just
created. Use the information you gathered in steps 1 and 2 to configure the printer.
What command did you use? ___________________________________
# lpadmin -p printer_name -v device_name -T printer_type \
-I content_type -m interface_script
Copyright IBM Corp. 1997, 2008 Appendix C. Optional exercise: The System V print subsystem C-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 15. Using the output from the previous step, answer these questions:
What users are allowed to access this printer? ____________________ all
What action will be taken On fault? (This is the default Alert action.) _________
mail to root once
__ 20. Enable queueing using the accept command. (Dont enable printing yet.)
What command did you use? _____________________ accept printer_name
__ 24. Examine the request file (X-0) and answer these questions:
What file will be printed? ____________________ File to be printed is the F line
What is the files size? ______________ size is in the O line, the flist attribute
__ 25. Submit another request to print /etc/motd, but this time, request that the print
service copy the file to the spool directory.
What command did you use? _____________ lp -d printer_name -c /etc/motd
Copyright IBM Corp. 1997, 2008 Appendix C. Optional exercise: The System V print subsystem C-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
__ 29. Your print jobs should begin printing as soon as you enabled the printer.
Use lpstat -p while the printer is printing to show what job is being printed.
(If your jobs do not print, ask the instructor for help.)
__ 36. One team configures their system as a print server machine (see Section 3.3 in the
Redbook). The other team configures their system to use the other machines
remote printer (see Section 3.1 in the Redbook).
__ 37. Test your configuration by attempting to print from the client machine to the printer
on the server machine.
__ 38. Make notes below of the steps you took and your results.
End of exercise
Copyright IBM Corp. 1997, 2008 Appendix C. Optional exercise: The System V print subsystem C-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Instructor Exercises Guide with hints
Exercise Review
In the exercise the following material was covered:
switch.prt was used to display the active print subsystem and to switch print
subsystems
SMIT was used to configure a printer device
lpadmin was used to define a System V printer
lpadmin -x was used to remove a System V printer
lpstat -a and lpstat -p were used to display queueing status and printing status
(respectively)
The printer configuration file (/etc/lp/printers/printer_name/configuration) was
examined
lp was used to submit print jobs
accept was used to enable queueing
reject was used to disable queueing
lpstat -o was used to display job status
enable was used to enable printing
disable was used to disable printing
Spool files (/var/spool/lp/tmp/host_name/*)were examined
The request log (/var/lp/logs/requests) was examined
backpg
Back page