Académique Documents
Professionnel Documents
Culture Documents
AIX QuickStart
Version 1.0.0
Date: 3/29/10
This document is w ritten based upon AIX 6.1, not all commands or concepts apply to previous versions of AIX.
Overview
Design Philosophy
AIX is primarily a tool-managed Unix. While some Unices
have a file-managed interface, AIX tends to use stanza
files and ODM databases as data stores for configuration
options. This makes many configuration options rather
difficult or simply impossible with just a text editor. The
AIX alternative is to leverage an expansive set of
specialized tools for all configuration options.
AIX is well integrated with System P hardware. As typical
with big-Unix implementations, AIX has a tight
integration with the hardware it runs on. The result of
this integration is an OS that not only provides extensive
diagnosis and reporting of hardware issues, but also is
designed to exploit numerous hardware features. IBM
extends this integration even more by allowing AIX
insight into the virtualization layer with abilities like
virtual processor folding.
IBM tends to lead with hardware and follow with the OS.
Major releases of the OS tend to coincide with new
open in browser PRO version Are you a developer? Try out the HTML to PDF API
pdfcrowd.com
information.
PVID - Physical Volume IDentifier. A unique ID that is used
to track disk devices on a system. This ID is used in
conjunction with the ODM database to define /dev
directory entries. See the LVM section for additional
information.
SMIT - System Management Interface Tool. An extensible X
Window / curses interface to administrative commands.
See the SMIT section for additional information.
SPOT - Shared Product Object Tree. This is an installed
copy of the /usr file system. It is used in a NIM
environment as a NFS mounted resource to enable
remote booting and installation.
SPP - Shared Processor Pool. This is an organizational
grouping of CPU resources that allows caps and
guaranteed allocations to be set for an entire group of
LPARs. Power 5 systems have a single SPP, Power 6
systems can have multiple.
VG - Volume Group. A collection of one or more PVs
(Physical Volumes) that have been divided into PPs
(Physical Partitions) that are used to construct LVs
(Logical Volumes). See the LVM section for additional
information.
VGDA - Volume Group Descriptor Area. This is a region of
each PV (Physical Volume) in a VG (Volume Group) that is
reserved for metadata that is used to describe and
manage all resources in the VG. See the LVM section for
additional information.
pdfcrowd.com
Legacy
Big
-B
Scalable -S
Notes
32
256
3512
C an be converted to Big
VG
128
512
130048
pdfcrowd.com
/home
hd2
/usr
hd3
/tmp
hd4
root
hd5
hd6
Paging space
hd8
JFS2 log
hd9var
/var
hd10opt
/opt
hd11admin /admin
livedump
New in 6.1
pdfcrowd.com
livedump
Management
List all PVs in a system (along) with VG membership
lspv
List all LVs on PV hdisk6
lspv -l hdisk6
List all imported VGs
lsvg
List all VGs that are imported and on-line
lsvg -o
The difference between lsvg and lsvg -o are the
imported VGs that are offline.
List all LVs on VG vg01
lsvg -l vg01
List all PVs in VG vg02
lsvg -p vg02
List filesystems in a fstab-like format
lsfs
Get extended info about the /home filesystem
lsfs -q /home
Create the datavg VG on hdisk1 with 64 MB PPs
mkvg -y datavg -s 64 hdisk1
Create a 1 Gig LV on (previous) datavg
mklv -t jfs2 -y datalv datavg 16
Create a log device on datavg VG using 1 PP
mklv -t jfs2log -y datalog1 datavg 1
Format the log device created in previous example
logform /dev/datalog1
Place a filesystem on the previously created datalv
crfs -v jfs2 -d datalv -m /data01 -A y
open in browser PRO version Are you a developer? Try out the HTML to PDF API
pdfcrowd.com
NFS
Many of the NFS commands accept the -I, -B, or -N
switches. These three switches are used to control the
persistence of the command. -B is now and future boots,
-I is future boot (but not now), and -N is now (but not
next boot). The -B option tends to be the default. The
pdfcrowd.com
-I
-B
-N
exportfs -i -o rw,root=vishnu:varuna \
/varuna_nfs
The root users on vishnu and varuna are given root
access to this share. This export was used to create
a system WPAR called varuna on a LPAR called
vishnu that can be found in the WPAR section below.
Export all entries in /etc/exports
exportfs -av
(Temporarily) unexport the /proj share
exportfs -u /proj
Permanently export the /proj share
mknfsexp -d /proj -t rw
The -N, -I, and -B options are valid with this
command. Here, the -B is implied. If the NFS services
are not set to re-start on boot then this export will
technically not be "permanent" as the share, even
though this entry is permanent, will not be enabled
after next boot.
List clients of this host with share points
showmount -a
Add an entry to the /etc/filesystems file
mknfsmnt -f /projects -d /proj \
-h mumbai -A -E
Note that the -A and -E switches cannot be stacked
(-AE). -A specifies to mount on boot and -E specifies
the intr mount option.
Command reference: showmount, chnfs, mknfs, rmnfs,
nfso, automount, chnfsexp, chnfsmnt, exportfs, lsnfsexp,
lsnfsmnt, mknfsexp, mknfsmnt, rmnfsexp, rmnfsmnt,
mount
Other
open in browser PRO version
pdfcrowd.com
Networking
Concepts
Ethernet devices are entX devices while enX and etX
devices represent different frame types that run on the
underlying entX device. Typically the enX device is what is
plumbed on most networks and etX is not used.
Attributes of the entX device are physical layer connection
pdfcrowd.com
Hostname
lookup
order
is
determined using
/etc/irs.conf, then /etc/netsvc.conf and finally
$NSORDER. (The order of precedence is reverse - meaning,
for example, a value set in $NSORDER will be used over
the other two methods.) The irs.conf and $NSORDER
methods are typically not used.
Network related tunables can be set globally, perinterface, or per-socket connection. Most global tunables
are managed with the no command. Interface specific
tunables are set on the entX or the enX devices using
the chdev command. AIX now recognizes a ISNO
(Interface Specific Network Option) flag that overrides
many of the global settings and uses the settings for
each interface over those set globally. This is an
important concept as much application documentation
still refers to the global settings while the default is now
to use the local settings. ISNO can be determined from
querying with the no command or looking at ifconfig
results. Examples of retrieving the defaults, ranges, and
current values as well as setting new values are shown
in the next section.
Settings for the HEA (Host Ethernet Adapter) are not
always set from the OS. Physical layer settings for this
device are typically set from the ASMI menus or from the
HMC.
Changes were made to the AIX 6.1 network tunables.
The no command will list many tunables as "restricted".
IBM recommends against changing a restricted tunable
from the default.
Management
The assumption of this section is that rc.net / ODM is
used for IP configuration. If the configuration is not
stored in the ODM and is configured via script then many
open in browser PRO version Are you a developer? Try out the HTML to PDF API
pdfcrowd.com
pdfcrowd.com
-a netmask=0xffffff00
Permanently add an alias to an interface
chdev -l en0 -a \
alias4=192.168.1.3,255.255.255.0
Remove a permanently added alias from an interface
chdev -l en0 -a \
delalias4=192.168.1.3,255.255.255.0
Remove all TCP/IP configuration from a host
rmtcpip
View the settings on inet0
lsattr -El inet0
This can be run for ent0 and en0 as well. These
settings are typically stored in the ODM object
repository CuAt and are retrievable via odmget -q
name=inet0 CuAt.
Determine if rc.bsdnet is used over rc.net
lsattr -El inet0 -a bootup_option
Find actual (negotiated) speed, duplex, and link
entstat -d ent0
The interface must be up (ifconfig en0 up) for stats
to be valid. The netstat -v ent0 command gives
similar results.
Set (desired) speed is found through the entX device
lsattr -El ent0 -a media_speed
Set the ent0 link to Gig full duplex
chdev -l ent0 -a \
media_speed=1000_Full_Duplex -P
Auto_Negotiation is another option (see the next
example).
View all configurable options for speed and duplex
lsattr -Rl ent0 -a media_speed
Find the MTU of an interface
netstat -I en0
values.
Get a description of the use_isno tunable
no -h use_isno
These descriptions were expanded in AIX 6.1.
Additionally many will be listed as restricted where
they were not in previous versions.
Turn off Interface Specific Network Options
no -p -o use_isno=0
The following tcpdump examples are simplistic and limited,
an extended usage description for tcpdump is beyond the
scope of this document. The intent is to give a few easy
examples that can be expanded to the users needs.
Additional help with filter expressions and command line
options is available on the tcpdump InfoCenter page.
Also note that while efforts have been made to account
for line wraps in the printed version, these commands
remain un-wrapped for readability.
Watch all telnet packets from aachen
tcpdump -Nq 'host aachen and (port telnet)'
-N gives short host names.
Watch connect requests
tcpdump -q 'tcp[tcpflags] & tcp-syn != 0'
-q gives abbreviated packet info.
Watch all connection requests to port 23
tcpdump -q 'tcp[tcpflags] & tcp-syn != 0 and port
telnet'
Command reference: mktcpip, rmtcpip, ifconfig, netcdctrl,
no, tcpdump, chdev, lsattr, entstat, netstat, route, host,
hostname
pdfcrowd.com
pdfcrowd.com
lvm
mkuser
pgsp
_nfs
F4 (Esc-4)
F6 (Esc-6)
F5 (Esc-5)
F8 (Esc-8)
Tab
pdfcrowd.com
subserver
inetd config
mpio
chgenet
vlan
mkvg
SRC
The SRC (System Resource Controller) is a process
manager that is used to spawn, monitor, and control
services. Many of the standard Unix daemons are
managed via this interface on AIX.
SRC does not have a persistent "service profile" and
therefore does not comprehend persistence beyond the
current boot. For this reason, it is necessary to find
where the service is started and add or remove the
startsrc (service start) command there. The most
popular locations for this are rc.tcp and inittab.
SRC controlled processes must be started and stopped
via the SRC interface. If a SRC process dies or is killed
the srcmstr daemon will re-spawn that process and log
an error to the system error log.
The core process for SRC (srcmstr) is spawned from
pdfcrowd.com
splat
spray
svmon
curt
entstat
fcstat
fddistat
fileplace
filemon
gprof
iostat
ipcrm
truss
uptime
vmstat
pdfcrowd.com
ipcrm
ipcs
iptrace
istat
kdb
lparstat
lvmstat
mpstat
svmon -P 274676
Get a filename for an inode from previous results
ncheck -i 1041 /dev/hd4
Once again, this example is of a local (to this
system) inode value. In this case svmon returned the
inode and filesystem of the file - the actual filename
was desired.
Enable advanced statistics gathering on VG datavg
lvmstat -v datavg -e
Use -e to enable, -d to disable.
Monitor network throughput for ent0
while [ 1 ] ; do entstat -r ent0 | grep Bytes ;
sleep 2 ; done
First column is transmit and second is receive. This is
a non-curses based example, see the next example
for a topas based solution.
Monitor network throughput for all interfaces
topas -E
Paging - in use
svmon -i 2
The -i 2 parameter tells to iterate every two
seconds.
Paging - activity
vmstat 2
Show top-like CPU usage by process
topas -P
Show system wide CPU usage
mpstat 2
Get NFS server statistics
while [ 1 ] ; do nfsstat -s ; sleep 2 ; done
Generate CPU load
dd if=/dev/random of=/dev/null
List I/O stats organized by adapter
iostat -a 2
pdfcrowd.com
pstat
rmss
ODM
The ODM (Object Data Manager) is a database store for
system information on AIX. The ODM is primarily used for
system items such as device instances and the
configuration options for those devices but may also be
used for applications such as SMIT.
The ODM is a collection of object classes (files) that are
primarily in
/etc/objrepos but
also
stored
in
/usr/lib/objrepos, /usr/share/lib/objrepos and the
BLV. The copy and/or location of the ODM to use is
specified either by an application or the ODMDIR / ODMPATH
environmental variables. For example, the SMIT screens
are stored in object classes in /usr/lib/objrepos but
can be stored in an alternate ODM source.
See the "Extending SMIT For Common Localized
Tasks" page for info on using an alternate ODM
source for SMIT.
open in browser PRO version Are you a developer? Try out the HTML to PDF API
long
long
0x000dcfac
0x000caa1c
CuAt:
name = "inet0"
attribute = "hostname"
value = "mumbai"
type = "R"
generic = "DU"
rep = "s"
nls_index = 24
Example of odmadd/odmget stanza syntax. (Actual output from a
system.)
pdfcrowd.com
odmdrop
odmshow
odmadd Bloat.data
odmshow saves the table definition. odmget saves the
table data. odmcreate re-creates the table. odmadd
restores the data. This is not a popular task on AIX.
The example here is more to relate the purposes of
the commands and give some insight into how they
can be used.
Determine the ODM files opened by lsattr
truss -topen lsattr -El inet0
Query CuAt for the inet0 config
odmget -o CuAt -q name=inet0
The SMIT customization page has more ODM command
examples.
Command reference: odmget, odmadd, odmchange,
odmcreate, odmdelete, odmdrop, odmshow
pdfcrowd.com
Software Management
A fileset is the smallest manageable component in the
LPP (Licensed Program Product) hierarchy. A package is a
collection of related filesets. An LPP is a group of
packages that tend to fall within one product type, such
as "bos" - the base operating system.
Filesets are divided by what part of the system they
install to. This is either "root", "usr", or "share". These
divisions are determined by install location as well as
platform dependence / independence. Use the lslpp -O
flag with r, u, or s options to list filesets from only one
location. (Additional discussion of this is found in the
ODM section and the three separate lpp ODM data
stores - one for each fileset install location.)
Most administrators perform installs via the SMIT or NIM
methods. SMIT is most popular for simple one-off installs
and smaller environments. Use of installp directly from
the command line is significantly more complex than SMIT
or NIM.
The most popular SMIT fast paths are install_latest
and update_all. The install fast path requires that a
package repository be specified on the first screen then
presents the user with a screen of install options to
include the option to browse and select from the
supplied repository.
Bundles are simply formatted lists of packages to be
installed as a unit. Bundle files are stored locally in
/usr/sys/inst.data/sys_bundles
and
/usr/sys/inst.data/user_bundles. Bundles
can be
installed using the smitty easy_install command.
Filesets can be installed in the applied or committed
inutoc,
lslpp,
emgr,
Users / Groups
AIX users and groups have an administrative attribute
that determines who can make changes to that user or
pdfcrowd.com
user
admin
attribute =
root
user
security
group
true
Yes
No
N/A
false
Yes
Yes
N/A
Yes
No
No
Yes
Yes
Yes
group true
false
chuser
mkuser
lsuser
roles
chrole
mkrole
lsrole
rmrole
authorizations mkauth
chauth
lsauth
pdfcrowd.com
rmauth
chgrpmem favorite
privcmds
privfiles
privdevs
Other
Boot Process
The normal numbers represent what you see as the step
c31
pdfcrowd.com
c31
c32, c33, or
c34
c33
Hardware initialization
20EE000B
rm -f /etc/nologin
Phase 1 (rc.boot 1)
RAM FS is resized
Logging begins
inittab
548
510
511,554
Phase 2 (rc.boot 2)
551,552,554,556
fsck of /
517,555
mount of /
517,557
517,518
517,518
517
swapon /dev/hd6
517
517
530
pdfcrowd.com
/etc/objrepos
RAM FS version of /dev copied to disk
mount /var
517
517,518
517
rc.boot 2 is finished
553
553
Phase 3
553
553
553
517,518
517
517
517
517, 521-529
(Service)
C ontinued
The kernel loaded from hd5 (the BLV) is the kernel the
system will run under for the entirety of the boot (until
the system is shutdown or restarted). For this reason it
is important to re-run bosboot every time that the kernel
is updated or some boot-time kernel options are set.
This is an abbreviated list of boot codes. cfgmgr (alone)
produces numerous display messages and potential
error codes, far more than is practical to display here.
Command reference: bosboot, bootlist
Error Logging
AIX has three error logging and reporting methods; alog,
errlog, and syslog. The alog is an extensible collection of
logs, but primarily is used for boot and console logging.
errlog is used primarily for system and hardware
messages. syslog is the traditional logging method.
HMC managed systems will also have a log of serviceable
events relating to all systems on that HMC.
Both errpt and alog keep binary circular logs. For this
reason, neither requires the rotation process that is
used for syslog logs.
A curses based error log browser can be found locally on
pdfcrowd.com
WPAR
WPARs (Workload PARtitions) are an AIX 6.1 feature that
can be used to capture a process tree and lock it into its
own environment. An AIX system can host multiple
WPARs that each appear to be nearly identical to a
regular system. All processes in the WPAR are subject to
the environment of that WPAR such as devices,
pdfcrowd.com
pdfcrowd.com
other WPARs.
By default the /usr, /opt, and /proc filesystems of a
system WPAR are shared with the global environment via
a read-only "namefs" vfs type. (/proc is mounted readwrite in each of the non-global WPARs.) As a result,
software and updates cannot be applied to these readonly WPAR views of the filesystems from the WPAR.
Filesystems that are local to the WPAR (such as /home, /,
/tmp, and /var) can be modified from within the WPAR.
Examples in this section show the default read-only and
alternate options for these filesystems.
Some options for system WPAR filesystems include:
Using a dedicated VG or external NFS mount for WPAR
filesystems. (Unless otherwise specified, system WPAR
filesystems are created from rootvg.)
Using a single LV for all local filesystems. (The default
filesystem layout is similar to traditional AIX installs in
that it will be broken into multiple LVs / filesystems.)
Creating a dedicated (local copy) of the /usr and /opt file
systems. (In the default filesystem setup /home, /, /tmp,
and /var are unique to the WPAR while /usr and /opt
are views on the actual file systems in the global
environment.)
Creating additional filesystems dedicated to the WPAR.
(This can take the form of a NFS mount or a dedicated
filesystem just for the WPAR.)
A number of commands support a new -@ flag for WPAR
related output. The required parameters and output of
the -@ flag varies by command, and what environment
the command is run in (WPAR or global).
A system WPAR is started and stopped much like a
separate OS with the startwpar and stopwpar
commands. These act effectively as boot and shutdown
operations. The shutdown will be the most familiar, while
the boot operation is significantly different from booting
open in browser PRO version Are you a developer? Try out the HTML to PDF API
pdfcrowd.com
#!/bin/sh
if (( `uname -W > /dev/null 2>&1` ))
then
echo "global"
else
hostname
fi
Sample source of wparname command.
pdfcrowd.com
pdfcrowd.com