You are on page 1of 29

How would I know if my machine is capable of running AIX 5L Version 5.3?

AIX 5L V5.3 runs on all currently supported Common Hardware Reference Platform
(CHRP)-based POWER hardware.

How would I know if my machine is CHRP-based?


Run the prtconf command. If it's a CHRP machine, the chrp string appears on the Model
Architecture line.

How would I know if my Power Systems machine is 32-bit or 64-bit?


To display if the hardware is 32-bit or 64-bit, type bootinfoy. A 64-bit hardware is
required to run the 64-bit kernel.

How much real memory does my machine have?


To display real memory in kilobytes (KB), type bootinfor or lsattrElsys0
arealmem.

How many processors does my system have?


To display the number of processors on your system, type lscfg|grepproc.

How many hard disks does my system have and which ones are in use?
To display the number of hard disks on your system, type lspv.

How do I list information about a specific physical volume?


To find details about hdisk1, for example, run the following comand: lspvhdisk1.

How do I get a detailed configuration of my system?


Type lscfg. You can obtain very similar information by running the prtconf command.

AIX

What version, release, and maintenance level of AIX is running on my system?


Type oslevelr or lslpphbos.rte.

How can I determine which fileset updates are missing from a particular AIX level?
To determine which fileset updates are missing from 5300-04, for example, run the
following command: oslevelrl530004.

What service pack (SP) and/or technology level (TL) is installed on my system?
To see which SP is currently installed, run the oslevels command. Sample output for
an AIX 5L Version 5.3 system, with TL4, and SP2 installed would be:

oslevels
53000402

Is a concluding service pack (CSP) installed on my system?


To see if a CSP is currently installed on the system, run the oslevels command.
Sample output for an AIX 5L Version 5.3 system, with TL3, and CSP installed would be:

oslevels
530003CSP

How do I create a file system?


The following command will create, within volume group testvg, a jfs file system of 10
MB with mounting point /fs1:

crfsvjfsgtestvgasize=10Mm/fs1

The following command will create, within volume group testvg, a jfs2 file system of 10
MB with mounting point /fs2 and having read only permissions:

crfsvjfs2gtestvgasize=10Mprom/fs2

How do I change the size of a file system?


To increase the /usr filesystem size by 1000000 512-byte blocks, type chfs
asize=+1000000/usr. In AIX 5.3, the size of a JFS2 file system can be decreased as
well.

How do I mount a CD?


Type the following: mountVcdrfsoro/dev/cd0/cdrom.

How do I mount a file system?


The following command will mount file system /dev/fslv02 on the /test directory:

mount/dev/fslv02/test

How do I mount all default file systems (all standard file systems in the
/etc/filesystems file marked by the mount=true attribute)?
The following command will mount all such file systems: mount{a|all}.

How do I unmount a file system?


Type the following command to unmount /test file system: umount/test.

How do I display mounted file systems?


Type the following command to display information about all currently mounted file
systems: mount.

How do I remove a file system?


Type the following command to remove the /test file system: rmfs/test.

Which fileset contains a particular binary?


To show bos.acct contains /usr/bin/vmstat, type lslppw/usr/bin/vmstat. To show
bos.perf.tools contains /usr/bin/svmon, type which_filesetsvmon.
How do I determine if a fix is installed on my system?
To determine if IY24043 is installed, type instfixikIY24043.

How do I install an individual fix by APAR?


To install APAR IY73748 from /dev/cd0, for example, enter the command instfix
kIY73748d/dev/cd0.

How do I determine the amount of paging space allocated and in use?


Type the following: lspsa.

How do I increase a paging space?


You can use the chps -s command to dynamically increase the size of a paging space. For
example, if you want to increase the size of hd6 with three logical partitions, you issue
the following command: chpss3hd6.

How do I reduce a paging space?


You can use the chps -d command to dynamically reduce the size of a paging space. For
example, if you want to decrease the size of hd6 with four logical partitions, you issue the
following command: chpsd4hd6.

How would I know if my system is capable of using simultaneous multi-threading


(SMT)?
Your system is capable of SMT if its a POWER5 or higher running AIX 5L Version 5.3.

How would I know if SMT is enabled for my system?


If you run the smtctl command without any options, it tells you if SMT is enabled. SMT
is supported for both 32-bit and 64-bit kernel.

How do I enable or disable SMT?


You can enable or disable SMT by running the smtctl command.

Kernel

How would I know if I am running a 32-bit kernel or 64-bit kernel?


To display if the kernel is 32-bit enabled or 64-bit enabled, type bootinfoK.

How do I know if I am running a uniprocessor kernel or a multiprocessor kernel?


/unix is a symbolic link to the booted kernel. To find out what kernel mode is running,
enter lsl/unix and see what file /unix it links to. The following are the three possible
outputs from the lsl/unix command and their corresponding kernels:

/unix>/usr/lib/boot/unix_up#32bituniprocessorkernel
/unix>/usr/lib/boot/unix_mp#32bitmultiprocessorkernel
/unix>/usr/lib/boot/unix_64#64bitmultiprocessorkernel

AIX 5L Version 5.3 does not support a uniprocessor kernel.


How can I change from one kernel mode to another?
During the installation process, one of the kernels, appropriate for the AIX version and
the hardware in operation, is enabled by default. In AIX 5.2, the 32-bit kernel is installed
by default. In AIX 5.3, the 64-bit kernel is installed on 64-bit hardware and the 32-bit
kernel is installed on 32-bit hardware by default. Let us use the method from the previous
question and assume the 32-bit kernel is enabled. Let us also assume you want to boot it
up in the 64-bit kernel mode. This can be done by executing the following commands in
sequence:

lnsf/usr/lib/boot/unix_64/unix
lnsf/usr/lib/boot/unix_64/usr/lib/boot/unix

bosbootad/dev/hdiskxx
shutdownr

The /dev/hdiskxx directory is where the boot logical volume /dev/hd5 is located. To find
out what xx is in hdiskxx, run the following command: lslvmhd5.

As you know, AIX has a vast array of commands that enable you to do a multitude of
tasks. Depending on your needs, you use only a certain subset of these commands. These
subsets differ from user to user and from need to need. However, there are a few core
commands every user will commonly use.

In the first part of the series, I discussed commands that help you answer questions
related to your OS hardware, version of AIX and kernels. In this article, Ill outline
information related to volume groups and logical volumes, networks, workload partitions
and other performance monitoring tools. The intent is to provide a list you can use as a
ready reference. While the behavior of these commands should be identical in all releases
of AIX, they have been only tested in AIX 5.3.

Volume groups and logical volumes

How do I know if my volume group is normal, big, or scalable? Run the lsvg
command on the volume group and look at the value for MAX PVs. The value is 32 for
normal, 128 for big and 1,024 for scalable volume group.
How do I create a volume group? Use the following command, where s partition_size
sets the number of megabytes (MB) in each physical partition where the partition_size is
expressed in units of MB from one through 1,024. (It's one through 131,072 for AIX 5.3.)

mkvgyname_of_volume_groupspartition_sizelist_of_hard_disks

The partition_size variable must be equal to a power of two (for example: one, two, four
or eight). The default value for standard and big volume groups is the lowest value to
remain within the limitation of 1,016 physical partitions per physical volume. The default
value for scalable volume groups is the lowest value to accommodate 2,040 physical
partitions per physical volume.

How can I change the characteristics of a volume group? You use the chvg command
to change the characteristics of a volume group.

How do I create a logical volume? Type the following:

mklvyname_of_logical_volumename_of_volume_groupnumber_of_partition

How do I increase the size of a logical volume? To increase the size of the logical
volume represented by the lv05 directory by three logical partitions, for example, type
extendlvlv053.

How do I display all logical volumes that are part of a volume group (e,g, rootvg)?
You can display all logical volumes that are part of rootvg by typing the following
command: lsvglrootvg/

How do I list information about logical volumes? Run the following command to
display information about the logical volume lv1: lslvlv1.

How do I remove a logical volume? You can remove the logical volume lv7 by running
the following command: rmlv lv7. The rmlv command removes only the logical volume,
but does not remove other entities, such as file systems or paging spaces that were using
the logical volume.

How do I remove a copy of a logical volume? You can use the rmlvcopy command to
remove copies of logical partitions of a logical volume. To reduce the number of copies
of each logical partition belonging to logical volume testlv, ente: rmlvcopytestlv2.
Each logical partition in the logical volume now has at most two physical partitions.

Queries about volume groups: To show volume groups in the system, type lsvg. To
show all the characteristics of rootvg, type lsvg rootvg. To show disks used by rootvg,
type lsvgprootvg.

How to add a disk to a volume group? Type the following:


extendvgVolumeGroupNamehdisk0hdisk1...Hdiskn

How do I replace a disk?

1. extendvgVolumeGroupNamehdisk_new
2. migratepvhdisk_badhdisk_new
3. reducevgdVolumeGroupNamehdisk_bad

How do I mirror a logical volume?

1. mklvcopyLogicalVolumeNameNumberofcopies
2. syncvgVolumeGroupName

How can I clone the rootvg? You can run the alt_disk_copy command to copy the
current rootvg to an alternate disk. The following example shows how to clone the rootvg
to hdisk1: alt_disk_copydhdisk1.

Network

How can I display or set values for network parameters? The no command sets or
displays current or next boot values for network tuning parameters.

How do I get the IP address of my machine? Type one of the following: ifconfiga
or hostFully_Qualified_Host_Name. For example, hostcyclop.austin.ibm.com.

How do I identify the network interfaces on my server? Either of the following two
commands will display the network interfaces: lsdevCcif or ifconfiga. To get
information about one specific network interface, for eaxample tr0, run the command
ifconfigtr0.

How do I activate a network interface? To activate the network interface tr0, run the
command ifconfigtr0up.

How do I deactivate a network interface? For example, to deactivate the network


interface tr0, run the command: ifconfigtr0down.

How do I display routing table, interface and protocol information? To display


routing table information for an Internet interface, type netstatrfinet. To display
interface information for an Internet interface, type netstatifinet. To display
statistics for each protocol, type netstatsfinet.

Workload Partitions
Workload Partitions (WPARs), a set of completely new software-based system
virtualization features, were introduced in IBM AIX Version 6.1.

How do I create a workload partition? To create a workload partition named temp with
IP Address xxx.yyy.zzz.nnn, type

mkwparntempNaddress=xxx.yyy.zzz.nnn

To create a workload partition with the specification file wpar1.spec, type

mkwparf/tmp/wpar1.spec

How do I start a workload partition? To start the workload partition called temp, type
startwpartemp.

How do I view the characteristics of workload partitions? To view the characteristics


of all workload partitions, type lswpar.

NameStateTypeHostnameDirectory

barASbar.austin.ibm.com/wpars/bar
fooDSfoo.austin.ibm.com/wpars/foo
triggerAAtrigger/

How do I run a command in a workload partition? To run the /usr/bin/ps command as


user root in a workload partition named howdy, type cloginhowdylroot
/usr/bin/ps.

How do I remove a workload partition? To remove the workload partition called temp,
type rmwpartemp. To stop and remove the workload partition called temp preserving
data on its file system, type rmwparpstemp.

Performance Monitoring Tools

How do I display virtual memory statistics? To display a summary of the virtual


memory statistics since boot, type vmstat.

How do I display statistics for all TTY commands, CPUs and disks? To display a
single set of statistics for all TTY, CPU, and Disks since boot, type iostat.

How do I display a detailed local and remote system statistics? Type the following
command:

topas
topasP displays process
topasL displays logical partition
topasD displays disk metric
topasF displays file system

How do I report system unit activity? Type the sar command. To report processor activity
for the first two processors, enter saruP0,1. This produces output similar to the
following:

cpu%usr%sys%wio%idle
0454555
1276535

Admittedly, a list such as this can be helpful in quickly answering some of your own
questions. However, it doesnt cover everything that you might need. You can extend the
usefulness of such a list by adding other commands that answer additional questions not
addressed here.

Backup and Restore With AIX

Most articles on backing up AIX partitions approach the subject tend to focus on database
archiving and more sexier subjects like high availability or disaster recovery/business
continuity solutions. Its important to make a distinction between failover systems,
disaster-recovery (DR) systems and archival systems. Having either a failover or DR
server in no way precludes you from the responsibility of backing up your data. Thats
because neither a failover or DR server allows you to selectively restore specific files,
directories or an entire partition from a given point in time. In this article Ill discuss
different options, including a discussion on some third-party tools that may fit your
needs. These tools must have a strong focus on IBMs AIX OS, meaning that they arent
just the by-product of a quick port or a developer thats been instructed to come out with
an AIX version of their software just so they can say they have a cross-platform solution.

AIX Tools

As most systems administrators can attest, there is absolutely nothing wrong with using
the utilities that come preloaded with your OS to perform standard backup and recovery.
While its true that in most cases you do get what you pay for, these tools work very well,
though they might not scale as well off-the-shelf products you must purchase. I should
also point out that using standard OS tools usually means having to rely on several
backup utilities in order to properly safeguard all your system data.

There are three ways in which to kick-off AIX utilities for backup: the System
Management Interface Tool (known as SMIT or smitty), WebSM and the command line. I
strongly suggest you use the command line for utilities such as tar, cpio and even mksysb,
though I usually have no problems using SMIT for most of the other utilities.

Some of the archiving commands available to you include:

mksysbThis is the most important utility you should know. Only mksysb lets
you recreate your root volume group. Actually, this command will only back up
rootvg. There are many flags that you can use with mksys, so I strongly suggest
you look at the man pages and fully understand this powerful utility.
tarTar is usually used to archive files and directories rather than entire
filesystems. It allows one to create, view or retrieve archived data from either
external media or shared network drives.
cpioThis command copies from and to archive storage device. Its often used to
copy files from UNIX to AIX systems. Though not as widely used, I prefer using
cpio to tar because it can restore empty directories.
ddThis powerful, albeit rarely used, command allows one to make a block-by-
block representation of data. Its very useful in terms of moving data from
disparate environments. Decades ago I remember using dd to move ASCII data
from my SCO servers to IBM mainframes in EBCDIC, all with dd.
savevgThis command backs up data belonging to a specific volume group. In
many ways its similar to mksysb, but for non-rootvg volume groups.
alt_disk_installThis utility allows one to actually clone systems. Its used
frequently by administrators that have several physical devices in their rootvg.
Cloning allows administrators to upgrade their OS and then fall back to other
disks in case of a problem.
multibosThis command allows the root user to make and preserve two versions
of the OS in the root filesystem as bootable copies. This option is only available
in AIX 5.3.tl3 and higher.

Lets look at some of these tools.

tar

If you dont need to perform a backup of the rootvg but only backup a filesystem or
directory, use this syntax:

#tarcvf/dev/rmt0/yourdata
This command creates a new archive at the beginning of the /dev/rmt0 tape device and
each file is listed during backup.

Restore using the x flag:

#tarxvf/dev/rmt0/yourdata

mksysb

In the AIX OS, perhaps the single most important command is mksysb. A little known bit
of trivia is that IBM was the first vendor who came up with a utility which provided for a
full system restoremksysb. Its purpose isnt to back up user data, but to create an
installable image of the root volume group (rootvg). To reiterate, user data should be kept
out of the rootvg. The format of a mksysb includes:

Base Operating System boot image


Base Operating System install image
Dummy table of contents (TOC)
Actual data on the volume group

Its important to note that any user-defined paging spaces, unmounted filesystems and
raw devices arent backed up in a mksysb, so they need to be recreated. Interestingly
enough, the mksysb command uses the backup command to create its archive image:

#mksysbi/dev/rmt0

This command also creates an /image.data file, which is generated by the mkszfile
command. The mkszfile command overwrites the existing /image.data file with new
information. The information includes system installation information, logical volume
information for the root volume group and filesystem information.

The syntax in using mkszfile is:

#mkszfilef

With mksysb you can do a complete restore or alternatively selectively restore files. To
perform a manual restore of file from a mksysb archive:

#restorexqvf/dev/rmt0/myrestorationfile

savevg

In this example Ill use savevg to backup an entire filesystem:

savevgf/dev/rmt0oravg
To restore the filesystem on to one of the physical disks:

restvgf/dev/rmt0hdisk6

Third-Party Tools

I love Tivoli Storage Manager For System Backup and Recovery, though I admit I liked
it more before it was swallowed up by TSM. Among other features it handles multiple
volume groups and backups striped over multiple backup devices. It can even restore to a
different platformin this sense its more useful than mksysb and savevg. You can even
run this tool using SMIT. It also allows you to choose between varying types of backups
including full system (installation image), volume group, filesystem, file or directory, and
raw logical volumes. It can also backup and restore non-rootvg data.

SBAdmin from Storix is a turnkey solution which lets you rebuild your entire AIX
system from the ground up, including LVM. It can individually back up and restore files,
directories, filesystems, raw partitions, volume groups, raw logical volumes or the entire
system in case of a disaster. Backups can be archived to local or remote tape or disk on
any AIX or Linux system. It also has full support for AIX 6.1. SBAdmin records your
system and storage configuration with each system backup, allowing you to restore your
data to different hardware.

Back Up Your Data

Ill reiterate that while there are some strong third-party tools available to you, dont be
afraid of the standard AIX toolset to archive your data. If the complexity of your
environment requires you to have more options available to you in a more simplistic
manner, look into third-party tools, which in many cases function as more of a turn-key
backup solution that using standard AIX commands. Whatever you decide to use, make
sure you perform daily backups of your critical data. While backing up your data can be
tedious, theres no larger responsibly you have than to back up your data.

AIX commands you should not leave home without

Introduction

As you know, AIX has a vast array of commands that enable you to do a multitude of
tasks. Depending on what you need to accomplish, you use only a certain subset of these
commands. These subsets differ from user to user and from need to need. However, there
are a few core commands that you commonly use. You need these commands either to
answer your own questions or to provide answers to the queries of the support
professionals.

In this article, I'll discuss some of these core commands. The intent is to provide a list
that you can use as a ready reference. While the behavior of these commands should be
identical in all releases of AIX, they have been only tested under AIX 5.3.

Note:
The bootinfo command discussed in the following paragraphs is NOT a user-level
command and is NOT supported in AIX 4.2 or later.

Back to top

Commands

Kernel

How would I know if I am running a 32-bit kernel or 64-bit kernel?

To display if the kernel is 32-bit enabled or 64-bit enabled, type:

bootinfo -K

How do I know if I am running a uniprocessor kernel or a multiprocessor kernel?

/unix is a symbolic link to the booted kernel. To find out what kernel mode is running,
enter ls -l /unix and see what file /unix it links to. The following are the three
possible outputs from the ls -l /unix command and their corresponding kernels:

/unix -> /usr/lib/boot/unix_up # 32 bit uniprocessor


kernel
/unix -> /usr/lib/boot/unix_mp # 32 bit multiprocessor
kernel
/unix -> /usr/lib/boot/unix_64 # 64 bit multiprocessor
kernel

Note:
AIX 5L Version 5.3 does not support a uniprocessor kernel.

How can I change from one kernel mode to another?


During the installation process, one of the kernels, appropriate for the AIX version and
the hardware in operation, is enabled by default. Let us use the method from the previous
question and assume the 32-bit kernel is enabled. Let us also assume that you want to
boot it up in the 64-bit kernel mode. This can be done by executing the following
commands in sequence:

ln -sf /usr/lib/boot/unix_64 /unix


ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix

bosboot -ad /dev/hdiskxx


shutdown -r

The /dev/hdiskxx directory is where the boot logical volume /dev/hd5 is located. To find
out what xx is in hdiskxx, run the following command:

lslv -m hd5

Note:
In AIX 5.2, the 32-bit kernel is installed by default. In AIX 5.3, the 64-bit kernel is
installed on 64-bit hardware and the 32-bit kernel is installed on 32-bit hardware by
default.

Hardware

How would I know if my machine is capable of running AIX 5L Version 5.3?

AIX 5L Version 5.3 runs on all currently supported CHRP (Common Hardware
Reference Platform)-based POWER hardware.

How would I know if my machine is CHRP-based?

Run the prtconf command. If it's a CHRP machine, the string chrp appears on the
Model Architecture line.

How would I know if my System p machine (hardware) is 32-bit or 64-bit?

To display if the hardware is 32-bit or 64-bit, type:

bootinfo -y

How much real memory does my machine have?

To display real memory in kilobytes (KB), type one of the following:


bootinfo -r

lsattr -El sys0 -a realmem

Can my machine run the 64-bit kernel?

64-bit hardware is required to run the 64-bit kernel.

What are the values of attributes for devices in my system?

To list the current values of the attributes for the tape device, rmt0, type:

lsattr -l rmt0 -E

To list the default values of the attributes for the tape device, rmt0, type:

lsattr -l rmt0 -D

To list the possible values of the login attribute for the TTY device, tty0, type:

lsattr -l tty0 -a login -R

To display system level attributes, type:

lsattr -E -l sys0

How many processors does my system have?

To display the number of processors on your system, type:

lscfg | grep proc

How many hard disks does my system have and which ones are in use?

To display the number of hard disks on your system, type:

lspv

How do I list information about a specific physical volume?

To find details about hdisk1, for example, run the following command:
lspv hdisk1

How do I get a detailed configuration of my system?

Type the following:

lscfg

The following options provide specific information:

-p
Displays platform-specific device information. The flag is applicable to AIX 4.2.1 or
later.
-v Displays the VPD (Vital Product Database) found in the customized VPD object class.

For example, to display details about the tape drive, rmt0, type:

lscfg -vl rmt0

You can obtain very similar information by running the prtconf command.

How do I find out the chip type, system name, node name, model number, and so
forth?

The uname command provides details about your system.

uname -p Displays the chip type of the system. For example, PowerPC.
uname -r Displays the release number of the operating system.
uname -s Displays the system name. For example, AIX.
uname -n Displays the name of the node.
uname -a Displays the system name, nodename, version, machine ID.
uname -M Displays the system model name. For example, IBM, 9114-275.
uname -v Displays the operating system version.
uname -m Displays the machine ID number of the hardware running the system.
uname -u Displays the system ID number.

AIX
What version, release, and maintenance level of AIX is running on my system?

Type one of the following:

oslevel -r

lslpp -h bos.rte

How can I determine which fileset updates are missing from a particular AIX level?

To determine which fileset updates are missing from 5300-04, for example, run the
following command:

oslevel -rl 5300-04

What SP (Service Pack) is installed on my system?

To see which SP is currently installed on the system, run the oslevel -s command.
Sample output for an AIX 5L Version 5.3 system, with TL4, and SP2 installed would be:

oslevel s
5300-04-02

Is a CSP (Concluding Service Pack) installed on my system?

To see if a CSP is currently installed on the system, run the oslevel -s command.
Sample output for an AIX 5L Version 5.3 system, with TL3, and CSP installed would be:

oslevel s
5300-03-CSP

How do I create a file system?

The following command will create, within volume group testvg, a jfs file system of
10MB with mounting point /fs1:

crfs -v jfs -g testvg -a size=10M -m /fs1

The following command will create, within volume group testvg, a jfs2 file system of
10MB with mounting point /fs2 and having read only permissions:
crfs -v jfs2 -g testvg -a size=10M -p ro -m /fs2

How do I change the size of a file system?

To increase the /usr file system size by 1000000 512-byte blocks, type:

chfs -a size=+1000000 /usr

Note:
In AIX 5.3, the size of a JFS2 file system can be shrunk as well.

How do I mount a CD?

Type the following:

mount -V cdrfs -o ro /dev/cd0 /cdrom

How do I mount a file system?

The following command will mount file system /dev/fslv02 on the /test directory:

mount /dev/fslv02 /test

How do I mount all default file systems (all standard file systems in the
/etc/filesystems file marked by the mount=true attribute)?

The following command will mount all such file systems:

mount {-a|all}

How do I unmount a file system?

Type the following command to unmount /test file system:

umount /test

How do I display mounted file systems?

Type the following command to display information about all currently mounted file
systems:
mount

How do I remove a file system?

Type the following command to remove the /test file system:

rmfs /test

How can I defragment a file system?

The defragfs command can be used to improve or report the status of contiguous space
within a file system. For example, to defragment the file system /home, use the following
command:

defragfs /home

Which fileset contains a particular binary?

To show bos.acct contains /usr/bin/vmstat, type:

lslpp -w /usr/bin/vmstat

Or to show bos.perf.tools contains /usr/bin/svmon, type:

which_fileset svmon

How do I display information about installed filesets on my system?

Type the following:

lslpp -l

How do I determine if all filesets of maintenance levels are installed on my system?

Type the following:

instfix -i | grep ML

How do I determine if a fix is installed on my system?


To determine if IY24043 is installed, type:

instfix -ik IY24043

How do I install an individual fix by APAR?

To install APAR IY73748 from /dev/cd0, for example, enter the command:

instfix -k IY73748 -d /dev/cd0

How do I verify if filesets have required prerequisites and are completely installed?

To show which filesets need to be installed or corrected, type:

lppchk -v

How do I get a dump of the header of the loader section and the symbol entries in
symbolic representation?

Type the following:

dump -Htv

How do I determine the amount of paging space allocated and in use?

Type the following:

lsps -a

How do I increase a paging space?

You can use the chps -s command to dynamically increase the size of a paging space.
For example, if you want to increase the size of hd6 with 3 logical partitions, you issue
the following command:

chps -s 3 hd6

How do I reduce a paging space?


You can use the chps -d command to dynamically reduce the size of a paging space. For
example, if you want to decrease the size of hd6 with four logical partitions, you issue the
following command:

chps -d 4 hd6

How would I know if my system is capable of using Simultaneous Multi-threading


(SMT)?

Your system is capable of SMT if it's a POWER5-based system running AIX 5L Version
5.3.

How would I know if SMT is enabled for my system?

If you run the smtctl command without any options, it tells you if it's enabled or not.

Is SMT supported for the 32-bit kernel?

Yes, SMT is supported for both 32-bit and 64-bit kernel.

How do I enable or disable SMT?

You can enable or disable SMT by running the smtctl command. The following is the
syntax:

smtctl [ -m off | on [ -w boot | now]]

The following options are available:

-m off Sets SMT mode to disabled.


-m on Sets SMT mode to enabled.
-w Makes the SMT mode change effective on next and subsequent reboots if you run
boot the bosboot command before the next system reboot.
-w now Makes the SMT mode change immediately but will not persist across reboot.

If neither the -w boot or the -w now options are specified, then the mode change is made
immediately. It persists across subsequent reboots if you run the bosboot command
before the next system reboot.

How do I get partition-specific information and statistics?


The lparstat command provides a report of partition information and utilization
statistics. This command also provides a display of Hypervisor information.

Volume groups and logical volumes

How do I know if my volume group is normal, big, or scalable?

Run the lsvg command on the volume group and look at the value for MAX PVs. The
value is 32 for normal, 128 for big, and 1024 for scalable volume group.

How to create a volume group?

Use the following command, where spartition_size sets the number of megabytes (MB)
in each physical partition where the partition_size is expressed in units of MB from 1
through 1024. (It's 1 through 131072 for AIX 5.3.) The partition_size variable must be
equal to a power of 2 (for example: 1, 2, 4, 8). The default value for standard and big
volume groups is the lowest value to remain within the limitation of 1016 physical
partitions per physical volume. The default value for scalable volume groups is the lowest
value to accommodate 2040 physical partitions per physical volume.

mkvg -y name_of_volume_group -s partition_size list_of_hard_disks

How can I change the characteristics of a volume group?

You use the following command to change the characteristics of a volume group:

chvg

How do I create a logical volume?

Type the following:

mklv -y name_of_logical_volume name_of_volume_group number_of_partition

How do I increase the size of a logical volume?

To increase the size of the logical volume represented by the lv05 directory by three
logical partitions, for example, type:

extendlv lv05 3
How do I display all logical volumes that are part of a volume group (for example,
rootvg)?

You can display all logical volumes that are part of rootvg by typing the following
command:

lsvg -l rootvg

How do I list information about logical volumes?

Run the following command to display information about the logical volume lv1:

lslv lv1

How do I remove a logical volume?

You can remove the logical volume lv7 by running the following command:

rmlv lv7

The rmlv command removes only the logical volume, but does not remove other entities,
such as file systems or paging spaces that were using the logical volume.

How do I mirror a logical volume?

1. mklvcopy LogicalVolumeName Numberofcopies


2. syncvg VolumeGroupName

How do I remove a copy of a logical volume?

You can use the rmlvcopy command to remove copies of logical partitions of a logical
volume. To reduce the number of copies of each logical partition belonging to logical
volume testlv, enter:

rmlvcopy testlv 2

Each logical partition in the logical volume now has at most two physical partitions.

Queries about volume groups

To show volume groups in the system, type:

lsvg
To show all the characteristics of rootvg, type:

lsvg rootvg

To show disks used by rootvg, type:

lsvg -p rootvg

How to add a disk to a volume group?

Type the following:

extendvg VolumeGroupName hdisk0 hdisk1 ... hdiskn

How do I find out what the maximum supported logical track group (LTG) size of
my hard disk?

You can use the lquerypv command with the -M flag. The output gives the LTG size in
KB. For instance, the LTG size for hdisk0 in the following example is 256 KB.

/usr/sbin/lquerypv -M hdisk0
256

You can also run the lspv command on the hard disk and look at the value for MAX
REQUEST.

What does syncvg command do?

The syncvg command is used to synchronize stale physical partitions. It accepts names
of logical volumes, physical volumes, or volume groups as parameters.

For example, to synchronize the physical partitions located on physical volumes hdisk6
and hdisk7, use:

syncvg -p hdisk4 hdisk5

To synchronize all physical partitions from volume group testvg, use:

syncvg -v testvg
How do I replace a disk?

1. extendvg VolumeGroupName hdisk_new


2. migratepv hdisk_bad hdisk_new
3. reducevg -d VolumeGroupName hdisk_bad

How can I clone (make a copy of ) the rootvg?

You can run the alt_disk_copy command to copy the current rootvg to an alternate disk.
The following example shows how to clone the rootvg to hdisk1.

alt_disk_copy -d hdisk1

Network

How can I display or set values for network parameters?

The no command sets or displays current or next boot values for network tuning
parameters.

How do I get the IP address of my machine?

Type one of the following:

ifconfig -a

host Fully_Qualified_Host_Name

For example, type host cyclop.austin.ibm.com.

How do I identify the network interfaces on my server?

Either of the following two commands will display the network interfaces:

lsdev -Cc if

ifconfig -a

To get information about one specific network interface, for example, tr0, run the
command:

ifconfig tr0
How do I activate a network interface?

To activate the network interface tr0, run the command:

ifconfig tr0 up

How do I deactivate a network interface?

For example, to deactivate the network interface tr0, run the command:

ifconfig tr0 down

Back to top

Conclusion

Admittedly, a list such as this can be helpful in quickly answering some of your own
questions. However, it does not cover everything that you might need. You can extend the
usefulness of such a list by adding other commands that answer additional questions not
addressed here.

Hardware Management Console 101

Most of the time administrators perform their functions on the Hardware Management
Console (HMC) using the Web browser-based interface that comes with version 7.
However, there are times when its necessary or quicker to perform administrative
functions via the command-line interface. These functions can range from opening a
terminal, to gathering a systems plan to obtaining information about what is on the HMC.
In this article, Ill explain some important Web browser-based management functions and
command-line functions that may be useful to you.

Web Browser-Based Functions


Enabling Remote AccessIf you plan to use HMC command-line functions, then this
capability needs to be enabled from the physical HMC itself. Once youre logged into the
HMCm click on HMC Management and then Remote Command Execution. Make
sure "Enable Remote Command Execution Using the SSH Facility" is checked. This
allows a user to secure shell (SSH) into the HMC from a remote terminal. While still in
HMC Management, click on Remote Operation and ensure its enabled. Remote
operation provides the capability to control the HMC from a Web browser on a remote
workstation. Finally click "Remote Virtual Terminal" and enable this so the vterms will
work from the remote clients. Performing these functions enables remote access using
vterms to the LPARs, SSH to the HMC and remote Web-browser access to the HMC.

Backup ActivitiesThe HMC should be backed up regularly to ensure important data is


recoverable. If the HMC fails and needs to be restored from the recovery DVD, it will
query the service processors to get back the information about the LPARs, but you must
restore from a data backup to recover custom data.

The first step in taking a backup is formatting the media. The HMC is very fussy about
the media it will support and only supports specific DVD-RAM media. Reference 5
provides a link to the latest list of supported media for HMC backups. The Format Media
option can be used to correctly format a DVD-RAM or USB flash drives. Alternative
options for backups are also available.

There are two kinds of backups that need to be taken. The first, the Save Upgrade Data
option, allows you to save data before an upgrade, either to DVD, the HMC hard drive or
to a USB flash drive. This task uses a wizard to save upgrade datafiles that were
created or customized while running the current software levelto the media. Saving this
data should always be performed prior to an HMC software upgrade.

The second kind of backup is under the Backup HMC Data option and its sometimes
referred to as the Backup Critical Console Data option. This allows you to backup critical
data to the DVD or to an NFS-mounted file system. Alternatively, you can send the data
to a remote site. Ths kind of backup should be taken before and after any HMC changes
such as adding LPARs. I also take these backups before an upgrade. This option backs up
user-created data such as user information and preferences, platform configuration files,
log files, updates, network definitions, etc. This backup is only used if the HMC is being
reinstalled from the product DVD after a disaster.

Using Line Commands on the HMC

Occasionally its quicker to SSH into the HMC to execute commands. The HMC is
actually a Linux system with a restricted command set. Common actions that may be
performed at the command line include: opening and controlling vterms, listing dynamic
IP addresses, getting details of an LPAR or systems configuration, rebooting the HMC or
an LPAR and powering a system on or off.
vterm OperationsOne useful command to know is the vtmenu commandwhich
provides a list of managed systems you can work with. You can then select the system
and the LPAR to open the vterm to. To escape a terminal session selected in this way type
in "~." Figure 1 shows an example of the vtmenu command.

Alternatively, the mkvterm command can be used to open a vterm to an LPAR. The
command below will open a vterm to the LPAR that allows a user to then login once they
receive the login prompt.

~>mkvtermmp65208203E4A06A8A94pp6vios1

Instead of -p p6vios1 you could use -id 3, where 3 is the LPAR ID. To exit the vterm you
will need to type in "~~." or to use rmvterm.

rmvtermmp65208203E4A06A8A94pp6vios1

Rebooting the HMCIts possible to reboot the HMC using a line command. From the
HMC login type in hmcshutdown -r -t now. This reboots the HMC immediately.

Controlling an LPAR via the HMC Command LineIf there are issues with the Web-
browser interface its still possible to shutdown, activate or reboot an LPAR from the
HMC command line. Its also possible to power a managed server off or on. The
following commands would shutdown and reboot the LPAR that is partition ID 3 (or that
is named p6l1) on the managed system that is listed below. Its an immediate shutdown as
the command specifies immed.

chsysstaterlparmp65208203E4A06A8A94oshutdownimmed
restartid3
chsysstaterlparmp65208203E4A06A8A94oshutdownimmed
restartnp6lpar1

If an LPAR is already shutdown then it is possible to activate the LPAR as follows:

chsysstaterlparmp65208203E4A06A8A94rlparoonnp6lpar1
fdefaultbnormal Above, the -f default would use the profile called default and
the -b could be normal or sms, depending on whether this is a normal reboot or a boot
into sms mode. Its also possible to replace the -n p6lpar1 with the LPAR ID by using -id
3. Finally the whole machine can be powered on using the following:

chsysstatemmanagedsystemnameoonrsys

Commands to get Configuration InformationThere are additional commands that will


provide configuration information if it needs to be gathered in a hurry. The first of these
will list the dynamic IP addresses served out by the HMC along with other network
settings.
The lshmcncommand will list the hostname for the HMC, its domain
information, the IP addresses for the public and private networks, the subnet
mask, the gateway and nameserver plus additional network information, including
the media access control (MAC) addresses of the network cards in the HMC.
The lssysconn command is used to list all of the known managed systems for the
HMC along with certain attributes. Specifically, (see Figure 2) the serial number
for the managed system, its connection status and the DHCP that it was assigned
are all listed.

The lssyscfg command is used to get information about the attributes of


managed systems. Typing in lssyscfgr sys will cause all the attributes for all
of the managed systems to be listed. The output can be limited to a specific
system by using:

lssyscfgrsysname=p65208203E4A06A8A94

System PlansSystem plans are a critical component of systems documentation and can
be invaluable if its necessary to recover a server. The lssysplan command can be used
to provide a list of the current sysplans on the HMC.

lssysplan

name=mar2509plan.sysplan,description=Systemplancreatedfromp6520
8203E4A06A8A94,source=HMCV7R3.4.0.0,version=HMC1.5,"date=Mar25,
200910:20:03PM"

In order to create a system plan the command would be:

mksysplanfp6520jaqui.sysplanmp65208203E4A06A8A94

System plans can be taken from the GUI as well, but if there are problems with that
method then the command-line version usually works. If youre taking advantage of file-
backed optical, then sometimes this causes problems for the system plan. Modifying the
command to still probe the other LPARs but to not probe the virtual I/O servers will
usually get around this. You can do this with the following command:

mksysplanfp6520jaqui.sysplanmp65208203E4A06A8A94novios
lssysplan

nowshows:name=p6520jaqui.sysplan,description=,source=HMC
V7R3.4.0.0,version=HMC1.5,"date=Jun7,20098:31:34PM"

Other options on the mksysplan include noprobe, noinvscout and nohwdisc. These
are all explained clearly in the man pages for mksysplan on the HMC. Once the sysplan
is created, it can then be viewed through the Web-browser interface or FTPd to a desktop
and viewed using the Systems Planning Tool. For more information on SPT, read Using
the Systems Planning Tool for Disaster Recovery.
Utilizing HMC

Understanding how to properly use the HMC is a critical part of the administrators role.
Knowing how to use the command line and GUI to ensure smooth operation can make a
huge difference in the capability to support the managed systems and its users. In all
cases, the man command should be used beforehand to ensure the correct command
syntax is being used. There are additional links in the references section that include
general HMC information as well as the link to the command-line reference manual.
Taking backups is a critical part of administering the HMCthese should be part of your
regular backup cycle and should be sent off-site along with the LPAR backups, if thats
your company practice. Understanding the HMC command line can also save significant
time and can be used to get around some of the issues that occasionally arise using the
GUI interface.

You might also like