aix quick start

Upload: amessi-young

Post on 06-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 Aix Quick Start

    1/24

    Main Page -> QuickSheets -> AIX QuickStart

    AIX QuickStart

    Version 1.0.0Date: 3/29/10

    This document is written 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. Whilesome Unices have a file-managed interface, AIXtends to use stanza files and ODM databases asdata stores for configuration options. Thismakes many configuration options ratherdifficult or simply impossible with just a texteditor. The AIX alternative is to leverage anexpansive set of specialized tools for allconfiguration options.

    AIX is well integrated with System P hardware.As typical with big-Unix implementations, AIXhas a tight integration with the hardware it runson. The result of this integration is an OS thatnot only provides extensive diagnosis andreporting of hardware issues, but also isdesigned to exploit numerous hardwarefeatures. IBM extends this integration evenmore by allowing AIX insight into thevirtualization layer with abilities like virtualprocessor folding.

    IBM tends to lead with hardware and follow withthe OS. Major releases of the OS tend tocoincide with new hardware features andleverage those advances in the hardware. Whileother Unices may take a software-centricapproach to a solution, IBM tends to rely uponall layers of the system to an end. One goodexample of this is the maturity and depth of virtualization technologies that permeate theSystem P product line.

    Commands in AIX generally follow a verb-nounsyntax. The verbs tend to be ls (list), mk(make), rm (remove), and ch (change). Thenouns vary by the target area such as dev, fs,vg, and ps. Even many of the odd-namedvariants follow a similar syntax such as crfs,reducevg, and installp.

    Both System P hardware and AIX are heavilygeared towards virtualization. AIX is practicallya para-virtualized environment in how well it isintegrated with the System P virtualizationtechnologies. At the user level, all performanceand management commands have beenmodified to account for differences that occur ina virtualized environment. Despite and becauseof these changes, a virtualized environment isvirtually indistinguishable from a non-virtualized environment to the user.

    AIX has a stable interface. While themanagement tools and style of those tools hasnot changed within AIX for over a decade, thetechnologies supported by AIX has grownconsiderably. This is a significant feature of AIXin that it introduces new technologies within aconsistent, approachable, and well designedinterface.

    The LVM integration with AIX is thorough andmature. From the install, management, andmaintenance every aspect of LVM designdovetails into other components of the OS,firmware, and hardware to create anunparalleled environment. It is for this reasonthat AIX systems are more likely to be SANbooted and less likely to have 3rd party LVMproducts layered on top than other Unices.

    A central focus of IBM design has been on RASfeatures. Particularly with Power 6 systems,IBM has designed extensive error detection andrecovery into the products. AIX is just oneenabling component to this end. All systemsfrom CPU, memory, I/O busses, to systemprocesses are considered and accounted for inthis design.

    Acronyms & Definitions

    CoD - Capacity on Demand. The ability to addcompute capacity in the form of CPU ormemory to a running system by simply

    MSPP - Multiple Shared Processor Pools. This is acapability introduced in Power 6 systems thatallows for more than one SPP.

    Page 1 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    2/24

    activating it. The resources must be pre-stagedin the system prior to use and are (typically)turned on with an activation key. There areseveral different pricing models for CoD.

    DLPAR - Dynamic Logical Partition. This was usedoriginally as a further clarification on theconcept of an LPAR as one that can haveresources dynamically added or removed. Themost popular usage is as a verb; ie: to DLPAR(add) resources to a partition.

    HEA - Host Ethernet Adapter. The physical port of the IVE interface on some of the Power 6systems. A HEA port can be added to a portgroup and shared amongst LPARs or placed inpromiscuous mode and used by a single LPAR.(See IVE)

    HMC - Hardware Management Console. An"appliance" server that is used to managePower 4, 5, and 6 hardware. The primarypurpose is to enable / control the virtualizationtechnologies as well as provide call-homefunctionality, remote console access, andgather operational data.

    IVE - Integrated Virtual Ethernet. The capabilityto provide virtualized Ethernet services toLPARs without the need of VIOS. Thisfunctionality was introduced on several Power 6systems.

    IVM - Integrated Virtualization Manager. This is amanagement interface that installs on top of the VIOS software that provides much of theHMC functionality. It can be used instead of aHMC for some systems. It is the only option forvirtualization management on the blades asthey cannot have HMC connectivity.

    LHEA - Logical Host Ethernet Adapter. The virtual

    interface of a IVE in a client LPAR. Thesecommunicate via a HEA to the outside /physical world. (See IVE)

    LPAR - Logical Partition. This is a collection of system resources (CPU, Memory, I/O adapters)that can host an operating system. To theoperating system this collection of resourcesappears to be a complete physical system.Some or all of the resources on a LPAR may beshared with other LPARs in the physical system.

    LV - Logical Volume. A collection of one or moreLPs (Logical Partitions) in a VG (Volume Group)that provide storage for filesystems, journallogs, paging space, etc... See the LVM section

    for additional information.LVCB - Logical Volume Control Block. A LVMstructure, traditionally within the LV, thatcontains metadata for the LV. See the LVMsection for additional information.

    MES - Miscellaneous Equipment Specification. Thisis a change order to a system, typically in theform of an upgrade. A RPO MES is for RecordPurposes Only. Both specify to IBM changesthat are made to a system.

    NIM - Network Installation Management /Network Install Manager (IBM documentationrefers to both expansions of the acronym.) NIMis a means to perform remote initial BOSinstalls, and manage software on groups of AIXsystems.

    ODM - Object Data Manager. A database andsupporting methods used for storing systemconfiguration data in AIX. See the ODM sectionfor additional information.

    PP - Physical Partition. An LVM concept where adisk is divided into evenly sized sections. ThesePP sections are the backing of LPs (LogicalPartitions) that are used to build volumes in avolume group. See the LVM section foradditional information.

    PV - Physical Volume. A PV is an LVM term for anentire disk. One or more PVs are used toconstruct a VG (Volume Group). See the LVMsection for additional information.

    PVID - Physical Volume IDentifier. A unique IDthat is used to track disk devices on a system.This ID is used in conjunction with the ODMdatabase to define /dev directory entries. Seethe LVM section for additional information.

    SMIT - System Management Interface Tool. Anextensible X Window / curses interface toadministrative commands. See the SMITsection for additional information.

    SPOT - Shared Product Object Tree. This is aninstalled copy of the /usr file system. It is usedin a NIM environment as a NFS mountedresource to enable remote booting andinstallation.

    SPP - Shared Processor Pool. This is anorganizational grouping of CPU resources that

    allows caps and guaranteed allocations to beset for an entire group of LPARs. Power 5systems have a single SPP, Power 6 systemscan have multiple.

    VG - Volume Group. A collection of one or morePVs (Physical Volumes) that have been dividedinto PPs (Physical Partitions) that are used toconstruct LVs (Logical Volumes). See the LVMsection for additional information.

    VGDA - Volume Group Descriptor Area. This is aregion of each PV (Physical Volume) in a VG(Volume Group) that is reserved for metadatathat is used to describe and manage allresources in the VG. See the LVM section for

    additional information.

    Page 2 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    3/24

    Disks, LVM, & Filesystems

    Concepts

    LVM (Logical Volume Manager) is the ever-present disk and volume managementframework for AIX. The level of integration isvisible not only in fileystem commands thatunderstand the underlying LVM, but in other,higher level, commands like the install andbackup utilities that can optionally growfilesytems when necessary.

    Physical disks (hdisks) are placed under LVMcontrol by adding them to a VG (volume group).Within LVM, these disks are referred to as PVs(Physical Volumes).

    Each PV in a VG contains a unique ID called aPVID. The PVID of a disk is used to track alldisks in a VG, but also provides a device nameindependence that makes importing, exporting,and disk management much simpler. Becausethe unique characteristics of the disk becomethe identifier, the device name remainsconsistent but does not need to as (properly)renaming / reordering disks under LVM controlis of little consequence.

    Once a hdisk is placed into a VG it is divided intoPP (Physical Partitions). PPs are then used tocreate LVs (Logical Volumes). An additionallayer of abstraction is placed between an LV anda PP called a LP (Logical Partition) that allowsfor more than one PP to be used (i.e. mirrored)to back each portion of a LV.

    A simplistic logical view of two PVs in a VG providingmirrored PPs for a LV.

    Several on-disk structures are responsible forholding all LVM information. The VGDA resideson each disk and holds structural informationsuch as the member PVs. The VGSA also resideson each disk and contains status information onall member devices. The LVCB varies by VG typebut traditionally has resided in the first part of an LV (when it exists as a separate structure).In addition to the basic LVM commands thatmanage these structures, there are a number of

    The ODM is central to managing off-disk LVMstructures and physical device to hdiskmappings. When a VG is created or importedthis information is added to the ODM as well asother system files such as /etc/filesystems .

    AIX LVM supports several versions of VGs thathave been introduced over the lifetime of theproduct. The VG types are normal, big, andscalable. Normal VGs were the original creationand are more limited than the big or scalabletypes. The easiest way to tell the type of anexisting VG is to look at the Max PV value forthe VG (see example in the next section).VGType

    mkvgoption

    MaxPV

    MaxLV

    MaxPP

    Notes

    Legacy 32 256 3512 Can beconverted toBig VG

    Big -B 128 512 130048 LVCB data isstored in thehead of thedata area inthe LV

    Scalable -S 1024 4096 2097152 Default LVand PP valuesare lower andcan beincreased toshownmaximums

    The default filesystem on AIX is JFS2. JFS2, andit predecessor JFS, are both journalingfilesystems that utilize the fundamental Unixfilesystem structures such as i-nodes, directorystructures, and block allocations. (Technically,JFS2 allocates blocks in groups called"extents".)

    JFS2 is not an implementation of UFS andexpands considerably over basic filesystemfeatures with such capabilities as snapshots,dynamic i-node allocation, online growth,extended attributes, and encryption. AIXprovides a layer of abstraction over allsupported filesystems that map filesystemspecific structures to standard Unix filesystemtools so that filesystems like JFS2 appear as animplementation of UFS.

    While most journaled Unix filesystemimplementations use inline logs (within thefilesystem structure), AIX tends to use aspecial type of LV that is created only tocontain log data. The jfs(2)log LV can providelogging capability for more than one filesystemLV. The log type must match the filesystemtype. JFS2 can log to an inline log, but these

    Page 3 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    4/24

    lower level LVM commands that accesses thismetadata more directly.

    The first disk in a VG will have two copies of theVGDA, and a two disk VG will have one disk witha single VGDA and the other with two copies.For three disk and larger VGs, each disk has asingle copy of the VGDA.

    The concept of quorum is achieved when > 50%of the copies of the VGSA/VGDAs are online. If quorum is lost then the VG can be taken offline.

    Quorum is problematic for two disk VGs becausethe loss of the two VGDA disk means a loss of the entire VG. In a mirrored configuration (atypical case for two-disk VGs) it is inappropriateto offline the VG for a single disk failure. For thisreason, quorum rules can be turned off in thecase of a two disk mirrored VG.

    implementations tend to be the exception tothe rule.

    The default filesystems that are installed withAIX:hd1 /homehd2 /usrhd3 /tmphd4 / roothd5 BLV (Boot

    Logical Volume)hd6 Paging spacehd8 JFS2 loghd9var /varhd10opt /opthd11admin /admin New in 6.1livedump /var/adm/ras/livedump New in 6.1 TL3

    /proc procfs pseudofilesystem

    Management

    List all PVs in a system (along) with VGmembershiplspv

    List all LVs on PV hdisk6lspv -l hdisk6

    List all imported VGslsvg

    List all VGs that are imported and on-linelsvg -o The difference between lsvg and lsvg -o

    are the imported VGs that are offline .List all LVs on VG vg01

    lsvg -l vg01List all PVs in VG vg02

    lsvg -p vg02List filesystems in a fstab -like format

    lsfsGet extended info about the /home filesystem

    lsfs -q /homeCreate the datavg VG on hdisk1 with 64 MB PPs

    mkvg -y datavg -s 64 hdisk1Create a 1 Gig LV on (previous) datavg

    mklv -t jfs2 -y datalv datavg 16Create a log device on datavg VG using 1 PP

    mklv -t jfs2log -y datalog1 datavg 1Format the log device created in previous

    examplelogform /dev/datalog1

    Place a filesystem on the previously createddatalvcrfs -v jfs2 -d datalv -m /data01 -A y A jfs2 log must exist in this VG and be

    logform (ed). (This was done in theprevious steps.) -m specifies the mountpoint for the fs, and -A y is a option toautomatically mount (with mount -a ).

    Find the file usage on the /var filesystemdu -smx /var

    List users & PIDs with open files in /data04mountfuser -xuc /data04

    List all mounted filesystems in a factor of Gigabytesdf -g (-m and -k are also available)

    Find what PV the LV called datalv01 is onlslv -l datalv01 The "COPIES" column relates the mirror

    distribution of the PPs for each LP. (PPsshould only be listed in the first part of theCOPIES section. See the next example.)The "IN BAND" column tells how much of the used PPs in this PV are used for this LV.The "DISTRIBUTION" column reports thenumber of PPs in each region of the PV.(The distribution is largely irrelevant formost modern SAN applications.)

    Create a LV with 3 copies in a VG with a single PVmklv -c 3 -s n -t jfs2 -y badlv badvg 4 Note: This is an anti -example to

    demonstrate how the COPIES columnworks. This LV violates strictness rules. TheCOPIES column from lslv -l badlv lookslike: 004:004:004

    Move a LV from hdisk4 to hdisk5migratepv -l datalv01 hdisk4 hdisk5

    Move all LVs on hdisk1 to hdisk2migratepv hdisk1 hdisk2 The migratepv command is an atomic

    command in that it does not return untilcomplete. Mirroring / breaking LVs is analternative to explicitly migrating them.

    Page 4 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    5/24

    Create a scalable VG called vg01 with two disksmkvg -S -y vg01 hdisk1 hdisk2

    Create a FS using the VG as a parametercrfs -v jfs2 -g simplevg -m /data04 \

    -A y -a size=100M The VG name here is "simplevg". A default

    LV naming convention of fslv XX will beused. The LV, and in this case log-LV, will

    be automatically created.Take the datavg VG offlinevaryoffvg datavg

    Vary-on the datavg VGvaryonvg datavg By default the import operation will vary-

    on the VG. An explicit vary-on will berequired for concurrent volume groups thatcan be imported onto two (or more)systems at once, but only varied-on on onesystem at a time.

    Remove the datavg VG from the systemexportvg datavg

    Import the VG on hdisk5 as datavgimportvg -y datavg hdisk5 The VG in this example spans multiple

    disks, but it is only necessary to specify asingle member disk to the command. TheLVM system will locate the other memberdisks from the metadata provided on thesingle disk provided.

    Import a VG on a disk by PVID as datavgimportvg -y datavg 00cc34b205d347fc

    Grow the /var filesystem by 1 Gigchfs -a size=+1G /var In each of the chfs grow filesystem

    examples, AIX will automatically grow the

    underlying LV to the appropriate size.Grow the /var filesystem to 1 Gigchfs -a size=1G /var

    List the maximum LPs for LV fslv00lslv fslv00 | grep MAX

    Increase the maximum LPs for fslv00 LVchlv -x 2048 fslv00

    Create a mirrored copy of fslv08mklvcopy -k -s y fslv08 2 syncvg -l fslv08 must be run if the -k

    (sync now) switch is not used formklvcopy .

    Add hdisk3 and hdisk4 to the vg01 VG

    extendvg vg01 hdisk3 hdisk4Mirror rootvg (on hdisk0 ) to hdisk1extendvg rootvg hdisk1mirrorvg -S rootvg hdisk1bosboot -ad hdisk0bosboot -ad hdisk1bootlist -m normal hdisk0 hdisk1 The -S option to mirrorvg mirrors the VG

    in the background. Running bosboot onhdisk0 is not required - just thorough.

    See additional migratepv , mirrorvg , andmklvcopy examples in this section.

    Put a PVID on hdisk1chdev -l hdisk1 -a pv=yes PVIDs are automatically placed on a disk

    when added to a VGRemove a PVID from a disk

    chdev -l hdisk1 -a pv=clear

    This will remove the PVID but not residualVGDA and other data on the disk. dd canbe used to scrub remaining data from thedisk. The AIX install CD/DVD also providesa "scrub" feature to (repeatedly) writepatterns over data on disks.

    Move (migrate) VG vg02 from hdisk1 to hdisk2extendvg vg02 hdisk2migratepv hdisk1 hdisk2reducevg vg02 hdisk1 Mirroring and then unmirroring is another

    method to achieve this. See the nextexample

    Move (mirror) VG vg02 from hdisk1 to hdisk2extendvg vg02 hdisk2mirrorvg -c 2 vg02unmirrorvg vg02 hdisk1reducevg vg02 hdisk1 In this example it is necessary to wait for

    the mirrors to synchronize before breakingthe mirror. The mirrorvg command in thisexample will not complete until the mirroris established. The alternative is to mirrorin the background, but then it is up to theadministrator to insure that the mirrorprocess is complete.

    Create a striped jfs2 partition on vg01

    mklv -C 2 -S 16K -t jfs2 -y vg01_lv01 \vg01 400 hdisk1 hdisk2

    This creates a stripe width of 2 with a(total) stripe size of 32K. This commandwill result in an upper bound of 2 (same asthe stripe size) for the LV. If this LV is tobe extended to another two disks later,then the upper bound must be changed to4 or specified during creation. The VG inthis example was a scalable VG.

    Determine VG type of VG myvglsvg myvg | grep "MAX PVs" MAX PVs is 32 for normal, 128 for big, and

    1024 for scalable VGs.Set the system to boot to the CDROM on next

    bootbootlist -m normal cd0 hdisk0 hdisk1 The system will boot to one of the mirror

    pairs ( hdisk0 or hdisk1 ) if the boot fromthe CD ROM does not work. This can bereturned to normal by repeating thecommand without cd0 .

    List the boot device for the next bootbootlist -m normal -o

    Page 5 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    6/24

    Command reference: lspv , lsvg , lslv, mkvg ,mklv , reducevg , extendvg , mklvcopy , chvg ,logform , lvmo , exportvg , importvg , varyonvg ,varyoffvg , bosboot , bootlist , /etc/filesystems ,crfs , chfs , lsfs , rmfs , mount , fuser , df , du

    NFS

    Many of the NFS commands accept the -I , -B ,or -N switches. These three switches are usedto control the persistence of the command. -Bis now and future boots, -I is future boot (butnot now), and -N is now (but not next boot).The -B option tends to be the default. Thefollowing table relates how these optionsmodify the NFS commands:Flag Now After Boot

    -I

    -B

    -N

    The NFS daemons are started outof /etc/inittab using the /etc/rc.nfs script.The mknfs and rmnfs commands toggle theinittab entries and control if the NFS systemstarts.

    The "share" commands are provided forcompatibility with other Unices. The sharecommands are links to the exportfs command.

    Enable NFS daemons now, and on next start

    mknfsDisable NFS daemons now, and on next start

    rmnfsSee if NFS will start on boot

    lsitab rcnfs This command simply lists the rcnfs entry

    in /etc/inittab . If one exists (and is notcommented out) then the rc.nfs script willbe run from inittab (and start NFS).

    Start NFS daemons now, but not at next bootmknfs -Nor startsrc -g nfs

    List the status of the NFS serviceslssrc -g nfs

    List all exported file systemsshowmount -eor exportfs

    Temporarily export the /varuna_nfs directoryexportfs -i -o rw,root=vishnu:varuna \

    /varuna_nfs The root users on vishnu and varuna are

    given root access to this share. This exportwas used to create a system WPAR calledvaruna on a LPAR called vishnu that can befound in the WPAR section below.

    Export all entries in /etc/exportsexportfs -av

    (Temporarily) unexport the /proj shareexportfs -u /proj

    Permanently export the /proj sharemknfsexp -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 onboot then this export will technically not be"permanent" as the share, even thoughthis entry is permanent, will not be enabledafter next boot.

    List clients of this host with share pointsshowmount -a

    Add an entry to the /etc/filesystems filemknfsmnt -f /projects -d /proj \-h mumbai -A -E

    Note that the -A and -E switches cannotbe stacked ( -AE ). -A specifies to mount onboot and -E specifies the intr mountoption.

    Command reference: showmount , chnfs ,

    mknfs , rmnfs , nfso , automount , chnfsexp ,chnfsmnt , exportfs , lsnfsexp , lsnfsmnt ,mknfsexp , mknfsmnt , rmnfsexp , rmnfsmnt ,mount

    Other

    The procfs is the single (default) pseudo fs.Interestingly, /proc is not used by commandslike ps or topas but is used by commands liketruss . Additional information on /proc can befound in the header file andthe /proc InfoCenter page.

    A list of supported filesystems can be found inthe /etc/vfs file.

    Mount DVD media in the DVD drivemount -v udfs -o ro /dev/cd0 /mnt

    Mount CD media in the CD/DVD drivemount -rv cdrfs /dev/cd0 /mnt Both the cdrfs and udfs are different

    types as defined in /etc/vfs , but bothseem to work for AIX DVD media.

    Page 6 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    7/24

    The cdromd daemon is used to automount CD /DVD media. It is not enabled by default.cdromd uses the /etc/cdromd.conf file toconfigure default options for the cd X devicesuch as the default mount directory.

    Paging spaces are specified inthe /etc/swapspaces file. The chps , mkps ,rmps , and lsps commands are used to modify /

    view this file.Find your CD/DVD ROMlsdev -Cc cdrom

    List all paging spaceslsps -a

    Grow the hd6 paging space by 4 LPschps -s 4 hd6 The current LP count and LP/PP size can be

    found using lslv hd6 .

    Command reference: chps , lsps , rmps , swapoff ,swapon , mount , umount , cdromd , cdeject ,cdmount , cdcheck , cdumount , cdutil

    Networking

    Concepts

    Ethernet devices are ent X devices while en X andet X devices represent different frame typesthat run on the underlying ent X device.Typically the en X device is what is plumbed onmost networks and et X is not used.

    Attributes of the ent X device are physical layerconnection settings such as speed and duplexas well as driver settings such as transmit andreceive queue sizes. Attributes of the en X device are configurable items such as IPaddress, subnet mask, and some TCP/IPtunables.

    Like the en X device, the inet0 device is not a physical device. It is a representation /management interface for the Internet(networking) subsystem. The hostname,routing info and TCP/IP configuration methodare attributes of this device.

    Networking is typically startedfrom /etc/rc.net using the settings stored inthe ODM (and not from rc.tcpip ). Whenstarted in this manner several helpercommands are responsible for pulling the configfrom the ODM and configuring devices.Alternatively, /etc/rc.net can be configured

    to use ifconfig commands or /etc/rc.netcan be bypassed completelyand /etc/rc.bsdnet can be used instead. Thesetting that determines which method ( rc.netor rc.bsdnet ) is used is stored as an attributeto the inet0 device. (The point here is notnecessarily to recommend the use thealternative methods but to point to where theoptions are set and where additional details onthe process can be found.)

    The /etc/resolv.conf uses a traditionalformat, but can be managed via the namerslvand *namsv commands. The /etc/netsvc.conffile is the AIX version of the nsswitch.conf filein that it determines the service lookup orderfor name services.

    Hostname lookup order is determinedusing /etc/irs.conf , then /etc/netsvc.confand finally $NSORDER. (The order of precedenceis reverse - meaning, for example, a value setin $NSORDER will be used over the other twomethods.) The irs.conf and $NSORDERmethods are typically not used.

    Network related tunables can be set globally,per-interface, or per-socket connection. Mostglobal tunables are managed with the nocommand. Interface specific tunables are set onthe ent X or the en X devices using the chdevcommand. AIX now recognizes a ISNO(Interface Specific Network Option) flag thatoverrides many of the global settings and usesthe settings for each interface over those setglobally. This is an important concept as muchapplication documentation still refers to theglobal settings while the default is now to use

    the local settings. ISNO can be determinedfrom querying with the no command or lookingat ifconfig results. Examples of retrieving thedefaults, ranges, and current values as well assetting new values are shown in the nextsection.

    Settings for the HEA (Host Ethernet Adapter)are not always set from the OS. Physical layersettings for this device are typically set fromthe ASMI menus or from the HMC.

    Changes were made to the AIX 6.1 networktunables. The no command will list many

    Page 7 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    8/24

    AIX supports trunking (EtherChannel /802.3ad), tagged VLANs (802.1q), Virtual IPaddresses (VIPA), dead gateway detection(multiple default gateways), IP multippathrouting, and network adapter backup. Thenetwork adapter backup does not requireEtherChannel but is part of the smittyEtherChannel setup section.

    tunables as "restricted". IBM recommendsagainst changing a restricted tunable from thedefault.

    Management

    The assumption of this section is that rc.net /ODM is used for IP configuration. If theconfiguration is not stored in the ODM and isconfigured via script then many of these"temporary" commands could be used topersistently configure the IP settings.

    The following examples also assume the use of en0 over et0 .

    List all Adapters in the system

    lsdev -Cc adapter

    List all interfaces in the systemlsdev -Cc if

    Initial setup of an interfacemktcpip Note that mktcpip has an exceptional

    amount of options. They are not listed herebecause this command is a prime exampleof when to use SMIT. See next item formore typical use.

    Smitty interface to initial TCP/IP setupsmitty mktcpip This command is usually run once for a

    system (typically in the post-install setup if run from CD/DVD), additional changes canbe done directly via the chdev command orvia the smitty configtcp menu screen.

    Permanently set the hostnamechdev -l inet0 -a hostname=bombay

    Temporarily add a default routeroute add default 192.168.1.1

    Temporarily add an address to an interfaceifconfig en0 192.168.1.2 \

    netmask 255.255.255.0Temporarily add an alias to an interface

    ifconfig en0 192.168.1.3 \netmask 255.255.255.0 alias

    To permanently add an IP address to en1chdev -l en1 -a netaddr=192.168.1.1 \

    -a netmask=0xffffff00Permanently 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 aninterfacechdev -l en0 -a \

    delalias4=192.168.1.3,255.255.255.0Remove all TCP/IP configuration from a host

    rmtcpip

    To view the (current) route tablenetstat -r

    To view the (persistent) route table from the ODMlsattr -EHl inet0 -a route

    Add an entry for "rhodes" to the hosts filehostent -a 192.168.1.101 \

    -h "rhodes.favorite.com rhodes" The hostent is a command for editing

    the /etc/hosts file. Most edits on this fileare done by hand. The hostent commandis mentioned here first for its potential useas a scripting tool, but also as an exampleof the pervasive tool-managed nature of AIX.

    List all services represented by inetdlssrc -ls inetd

    List all open, and in use TCP and UDP portsnetstat -anf inet

    List all LISTENing TCP portsnetstat -na | grep LISTEN

    Flush the netcd DNS cachenetcdctrl -t dns -e hosts -f

    Get (long) statistics for the ent0 deviceentstat -d ent0or netstat -v ent0 Remove the -d option from entstat for

    shorter results. The output of entstatvaries by device type. Virtual, physical, andIVE (LHEA) devices all produce differentresults. Use caution and test throughlywhen scripting this command.

    List all network tunablesno -a

    List all tunable settings in long formatno -L The "long" format is more readable as well

    as displaying current, default, persistent,min and max values.

    Get a description of the use_isno tunableno -h use_isno These descriptions were expanded in AIX

    6.1. Additionally many will be listed asrestricted where they were not in previousversions.

    Turn off Interface Specific Network Optionsno -p -o use_isno=0

    The following tcpdump examples are simplisticand limited, an extended usage description for

    Page 8 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    9/24

    View the settings on inet0lsattr -El inet0 This can be run for ent0 and en0 as well.

    These settings are typically stored in theODM object repository CuAt and areretrievable via odmget -q name=inet0CuAt .

    Determine if rc.bsdnet is used over rc.net

    lsattr -El inet0 -a bootup_optionFind actual (negotiated) speed, duplex, and link

    entstat -d ent0 The interface must be up ( ifconfig en0

    up ) for stats to be valid. The netstat -vent0 command gives similar results.

    Set (desired) speed is found through the ent X devicelsattr -El ent0 -a media_speed

    Set the ent0 link to Gig full duplexchdev -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 duplexlsattr -Rl ent0 -a media_speed

    Find the MTU of an interfacenetstat -I en0

    tcpdump is beyond the scope of this document.The intent is to give a few easy examples thatcan be expanded to the users needs. Additionalhelp with filter expressions and command lineoptions is available on the tcpdump InfoCenterpage . Also note that while efforts have beenmade to account for line wraps in the printedversion, these commands remain un-wrapped

    for readability.Watch all telnet packets from aachentcpdump -Nq 'host aachen and (porttelnet)' -N gives short host names.

    Watch connect requeststcpdump -q 'tcp[tcpflags] & tcp-syn !=0' -q gives abbreviated packet info.

    Watch all connection requests to port 23tcpdump -q 'tcp[tcpflags] & tcp-syn != 0and port telnet'

    Command reference: mktcpip , rmtcpip , ifconfig ,

    netcdctrl , no , tcpdump , chdev , lsattr , entstat ,netstat , route , host , hostname

    System Configuration & Management

    Devices

    Physical device to /dev device representationsare mapped via ODM database entries. Actual

    locations of devices can be retrieved using thelscfg or lsdev commands. The mappingprovided by the ODM provides a persistent binding for device names across boots of thesystem.

    The mapping of physical devices to the logicaldevices in /dev is an automated processperformed by the operating system. It istypically not required to move or otherwise re-order these devices. In a highly dynamicenvironment where devices are added andremoved, it may be advantageous to clearprevious instances of a device from the ODMand /dev directory.

    New devices are added to the system with thecfgmgr command. Logical instances of of devices can be removed from the system viathe rmdev command. rmdev simply tells thesystem to forget the device, so unless thephysical device is actually removed it willsimply be found and re-created when thecfgmgr command is run again (e.g. at nextboot).

    Device support requires that the appropriatepackages (drivers) are installed for each device.

    Get device address of hdisk1getconf DISK_DEVNAME hdisk1

    or bootinfo -o hdisk1 This is the same information available from

    other commands, just not requiringgrep ing or awk ing to retrieve this specificdata. bootinfo is not officially supportedas an administrative command.

    Get the size (in MB) of hdisk1getconf DISK_SIZE /dev/hdisk1or bootinfo -s hdisk1 Note that a full path to the device is

    required for the getconf version.Find the possible parent devices of hdisk0

    lsparent -Cl hdisk0 This lists all devices that support that

    device type, not the specific parent of thisdevice. See the following lsdev examplesfor methods of finding parent devices.

    List all child devices of scsi1lsdev -Cp scsi1

    List all disks belonging to scsi1lsdev -Cc disk -p scsi1

    Test if hdisk2 is a child device of scsi2lsdev -Cp scsi2 -l hdisk2

    Page 9 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    10/24

    The default AIX install includes support fordevices not on the system. If a device is neweror a minimal OS install was done then supportmay not be included for new devices. In thiscase the cfgmgr command will flag an errorthat an unsupported device has been found.

    Device configuration options are stored in thepre-defined device databases of the ODM.

    Information about actual devices are stored inthe configured device databases of the ODM.These configured options include instances andwell as configuration options to the devices /drivers.

    The lsdev command is used to list devices inthe predefined and configured device (ODM)databases. The lscfg command is used todisplay VPD (Vital Product Data) informationabout each device. To find all devices thesystem knows or has configured at one timeuse the lsdev command. To search for a deviceby a specific type, class, parent device or othercomplex criteria use the lsdev command. To

    find the serial number or device specificidentifier of a device use the lscfg command. List all devices on a system

    lsdev lsdev queries the predefined or configured

    databases using the -P and -C flagsrespectively. In this case the -C flag isimplied. Addition of the -H option includescolumn header info.

    List all disk devices on a systemlsdev -Cc disk See next example for a list of potential

    classes as arguments to the -c option.List all customized device classes

    lsdev -Cr class Customized device classes mean that they

    exist (or have existed) on the system. Fora list of predefined devices (ones that AIXcould support) change the -C option for -P .

    List locations of all hdisks in the systemlscfg -l 'hdisk*' This can be accomplished via the lsdev

    command. The point here is to show theuse of wildcards in a lscfg option.

    Remove hdisk5rmdev -dl hdisk5

    The -d option removes the configureddevice entry from the ODM. Unless thedevice is physically removed, cfgmgr willbring it back.

    This command will list all devices thatmeet the criteria of being hdisk2 andbelonging to scsi2 . Either it will list adevice or it will not.

    Find the location of an Ethernet adapterlscfg -l ent1

    Find device specific info of an Ethernet adapterlscfg -vl ent1

    One key piece of device specific info wouldbe the MAC address. This command worksfor HBAs and other addressed adapters.The *stat commands also tend to returnaddresses, often formatted in a morereadable manner. See the next example foran HBA / with the grep command to isolatethe address.

    Find the WWN of the fcs0 HBA adapterlscfg -vl fcs0 | grep Network

    Get statistics and extended information on HBAfcs0fcstat fcs0 Similar *stat commands exist for

    numerous types of devices such asentstat , ibstat , tokstat , fddistat , etc..

    List all MPIO paths for hdisk0lspath -l hdisk0

    Temporarily change console output to /cons.outswcons /cons.out Use swcons to change back.

    Find the slot of a PCI Ethernet adapterlsslot -c pci -l ent0 The lsslot command is used to find cards

    that are hot-swappable. Not all systemswill support this command.

    Command reference: lsdev , lsparent , lscfg ,lsattr , chdev , rmdev , cfgmgr , lscons , swcons ,fcstat , entstat , ibstat , getconf getconf , lsslot ,drslot

    SMIT (System Management Interface Tool)

    SMIT is a system management tool that assiststhe administrator with AIX utilities by providingan ASCII (curses) / X-Window GUI interface tothose tools. SMIT provides pick lists and menus

    SMIT can be invoked from the command lineusing smit or smitty . smit will start either thecurses based version or the X Window versiondepending upon the presence of the X Window

    Page 10 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    11/24

    for command line options to AIX tools. Theinterface is designed to aid with recognition of more obscure switches, provide additionalsecurity & accounting, and perform somevalidation on the input to those commands.

    The SMIT interface is not a monolithic binary,but an extensible framework of screens thatrelies upon underlying OS commands to do thework. Each SMIT screen is stored as a collectionof ODM objects in SMIT specific object classes.

    Stepping through the complex menu system canbe avoided by jumping directly to a screenwhen a fastpath is specified when SMIT isinvoked. Fast paths are single word (no spaces)phrases that typically are the command thatwill be run in that screen. The fast path for thecurrent screen can be determined by using theF8 key while in that screen.

    Sample fastpaths:mktcpip Initial TCP/IP setuplvm Root of the LVM menusmkuser Screen to add a userpgsp Root of the paging space menus

    _nfs Root of NFS menussubserver inetd configmpio Root screen for all MPIO operationsetherchannel Root of EtherChannel / 802.3ad

    memuschgenet Configure paramaters on the ent

    device(s)vlan Root of menus to manage VLAN

    configurationsmkvg Beginning screen to create a new VG

    SMIT will save a script of runnable commands in

    ~/smit.script and ~/smit.transaction aswell as a log of commands run in ~/smit.log .When invoked with the -x switch, SMIT will notrun any of the commands but will write thecommands it would run to ~/smit.script and~/smit.transaction . (Note: With the -xswitch SMIT will still run the discoverycommands to build lists and finddefault/existing values but not the actioncommands.)

    system. smitty will always start the curses(tty) version.

    Additional information on customizing the SMITinterface can be found on the " Extending SMITFor Common Localized Tasks " page.

    Key sequences (for the curses version)

    F3 (Esc-3) Exit current screen

    F4 (Esc-4) Generate a pop-up list that can bechosen from

    F6 (Esc-6) List the command that will be runF5 (Esc-5) Reset the field to the original / default

    valueF8 (Esc-8) Show the fast-path tag for this screenF10 (Esc-0) Exit SMIT

    / phrase Search for phrase in a listn Used to find the next occourence of the

    search phraseTab Used to alternatively select items from

    a "ring" (a short list).

    Symbols that denote field data requirements:* This is a required field# This field requires a numeric value

    / This field requires a pathX This field requires a hexadecimal number? The data entered will not be displayed+ Data can be retrieved from a list

    SRC

    The SRC (System Resource Controller) is aprocess manager that is used to spawn,monitor, and control services. Many of thestandard Unix daemons are managed via thisinterface on AIX.

    SRC does not have a persistent "service profile"and therefore does not comprehend persistencebeyond the current boot. For this reason, it isnecessary to find where the service is startedand add or remove the startsrc (service start)

    Start the cdromd servicestartsrc -s cdromd There is not a persistent flag for the

    startsrc command. For this service toautomatically start on the next boot, achange must be made to one of the systeminitialization files. In this case, an entrymust be made in /etc/initttab .

    Stop the cdromd servicestopsrc -s cdromd

    Page 11 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    12/24

    command there. The most popular locations forthis are rc.tcp and inittab .

    SRC controlled processes must be started andstopped via the SRC interface. If a SRC processdies or is killed the srcmstr daemon will re-spawn that process and log an error to thesystem error log.

    The core process for SRC ( srcmstr ) is spawned

    from /etc/initttab . Services that run underSRC control do not leave their process group(ie: have a PPID of 1), but instead, staychildren of srcmstr .

    List the status of the cdromd service

    lssrc -s cdromdList the status of inetd subservices

    lssrc -l -s inetdList the status of all members of the NFS group

    lssrc -g nfs

    Send a refresh request to the syslogd servicerefresh -s syslogd This would typically be communicated via

    a HUP signal. Not all SRC controlledprocesses respond to a refresh request andmay require a HUP signal.

    Command reference: lssrc , startsrc , stopsrc ,

    refresh , srcmstr

    Performance / Kernel / Tuning

    The primary statistics provider for most basicperformance commands on AIX is the PerfstatAPI / kernel extension(See /usr/include/libperfstat.h .) This APIsupports most non-trace based performancerelated tools.

    The trace -based tools (denoted by a "T" in thelist below) utilize the trace facility. These toolsgenerate significantly more detail than theperfstat based tools. Unfortunately the level of detail provided by these tools comes at theexpense of performance. Caution should beused when running these tools on a production

    system. AIX 6.1 introduced probevue , a lightweightdynamic trace facility that provides trace-likeinsight but with a minimal performance impact.The probevue command utilizes scripts writtenin the Vue language to define what events tocapture data on and how to report that data.Additional information can be found on theProbeVue page .

    With the introduction of Micro-partitions manycommands were modified both to account forperformance statistic gathering in thevirtualized environment as well as reportingvirtual statistics. When WPARs were introduced

    many commands were extended to report per-WPAR or WPAR specific statistics. The WPARspecific options are typically enabled with the -@ switch. Commands in the following list thatsupport this option are marked with the "@"symbol.

    The *o commands ( vmo , schedo , no , nfso ,raso , ioo , and lvmo ) are used to view and setsystem related tunables. Persistent tunablesare saved in /etc/tunables/nextboot . Somepersistent tunables are inserted in and set from

    splat - [T] Simple Performance LockAnalysis Tool. Provides lockstatistics. Must be run on a systembooted with lock trace reportingenabled.

    spray - Network load generation tool usinga remote sprayd daemon. Requiresthe RPC daemon (rpc-sprayd) to beregistered.

    svmon - Displays general to detailed reportsof VM usage on the system as awhole or for individual processes.

    tcpdump - Capture network packets. Packetscan be filtered by type, port,interface, address, or other criteria.Packets can be captured with detailor in summary. See examples atthe end of the networking examplessection.

    topas - topas is a curses-based, interactive,multi-area, general performancereporting tool. topas is often thefirst tool used in a performancetuning exercise. New topas usersmay find useful info on the localintroduction to topas page .

    tprof - [T@] A trace based profiling tool.truss - Reports syscall, signals, and most

    aspects of system interaction by aprocess.

    uptime - Reports system uptime as well as 1,5, and 15 minute system loadaverages.

    vmstat - [@] Report statistics from thevirtual memory subsystem.

    Page 12 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    13/24

    the BLV (therefore they require that bosbootrun to set the value for next boot.

    The following is a list of general and lower-levelsystem commands for performance anddiagnostics:atmstat - Show statistics and device details

    for ATM adapterscurt - [T@] CPU Utilization Reporting

    Tool. A trace based tool formonitoring CPU activity.

    entstat - Show statistics and device detailsfor Ethernet adapters

    fcstat - Show statistics and device detailsfor FC HBAs

    fddistat - Show statistics and device detailsfor FDDI adapters

    fileplace - Show fragmentation and block / fsusage for a file.

    filemon - [T@] Generate a report of advanced / detailed disk statistics

    that highlights where I/O wasgenerated and what generated it.gprof - Generate profiling statistics for a

    binary.iostat - [@] Supports I/O statistics on

    multiple device types, but usedprimarily as a first line disk I/Ostatistic reporting tool.

    ipcrm - [@] Remove IPC (InterProcessCommunication) semaphores,message queues, and sharedmemory segments

    ipcs - [@] List IPC (InterProcess

    Communication) semaphores,message queues, and sharedmemory segments

    iptrace - Network packet tracing daemon.Results can be viewed with ipreport

    istat - A command line stat() tool. Itgives similar info to ls but inpotentially more scriptable output.

    kdb - An interactive user-spacecommand for viewing kernelstructures, memory locations,tables, etc... from a runningsystem or a dump of the kernel.

    lparstat - [@] Reports per-LPAR statistics -primarily memory and CPUutilization. Also reportsvirtualization-aware statistics suchas entitlement consumption andhypervisor calls. The WPAR flag onthis command is -W not -@.

    lvmstat - Reports I/O statistics on VGstructures (as opposed to per-diskstatistics). Statistics gathering

    Note: The examples section is not meant to becomprehensive or even well representative of the available options and performancemonitoring methods. The scope and design of this page does not allow for a full treatment of the performance tools. Each section requires acareful selection of the command examples andinformation that is of use. This section requiressignificantly more abbreviation to fit in areasonable space. The goal has been to give amix of some common examples along withsome that are slightly atypical.

    Most iterative commands here use two secondintervals. This is done only to make themconsistent when showing the iterative options.

    List processes in ptree-like output

    ps -T1List all file opens for the ls process

    truss -topen lsList all file opens for a running PID

    truss -topen -p 274676

    274676 is simply a PID that was active onthe system when I created the example.List all open files for a running PID

    procfiles -n 274676List all memory segments for a running PID

    svmon -P 274676Get 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 casesvmon returned the inode and filesystem of the file - the actual filename was desired.

    Enable advanced statistics gathering on VGdatavglvmstat -v datavg -e Use -e to enable, -d to disable.

    Monitor network throughput for ent0while [ 1 ] ; do entstat -r ent0 | grepBytes ; sleep 2 ; done First column is transmit and second is

    receive. This is a non-curses basedexample, see the next example for a topasbased solution.

    Monitor network throughput for all interfacestopas -E

    Paging - in usesvmon -i 2

    The -i 2 parameter tells to iterate everytwo seconds.Paging - activity

    vmstat 2Show top -like CPU usage by process

    topas -PShow system wide CPU usage

    mpstat 2Get NFS server statistics

    while [ 1 ] ; do nfsstat -s ; sleep 2 ;done

    Page 13 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    14/24

    must be enabled with the -e switchbefore use.

    mpstat - [@] Reports performance statisticssuch as interrupts, contextswitches, min/maj faults, systemcalls, and processor affinity.

    netpmon - [T@] Reports detailed network,socket, and NFS related statisticsover an interval.

    netstat - [@] Show networking status forTCP/UDP through physical layers.

    pmcycles - A tool to measure actual CPUspeed ( presumably for CPUs thatmay go into power save).

    pprof - [T@] Reports detailed statistics onkernel threads.

    probevue - Lightweight dynamic tracing toolthat utilizes the Vue language.Additional ProbeVue resources areavailable locally on the ProbeVuepage .

    ps - [@] List processespstat - Show the contents of several

    system tables from a core file oractive kernel.

    rmss - Tool to simulate a reduced memoryfootprint for an application.Running the LPAR with reducedmemory may be a more popularalternative to this command.

    Generate CPU loaddd if=/dev/random of=/dev/null

    List I/O stats organized by adapteriostat -a 2

    Get extended I/O stats on just two disksiostat -D hdisk0 hdisk1 2

    List I/O stats by file systemiostat -F 2

    Not supported on 5.3Show network statistics for interfacesnetstat 2

    ODM

    The ODM (Object Data Manager) is a databasestore for system information on AIX. The ODM isprimarily used for system items such as deviceinstances and the configuration options for thosedevices but may also be used for applications suchas SMIT.

    The ODM is a collection of object classes (files) thatare primarily in /etc/objrepos but also storedin /usr/lib/objrepos , /usr/share/lib/objreposand the BLV. The copy and/or location of the ODMto use is specified either by an application or theODMDIR / ODMPATH environmental variables. Forexample, the SMIT screens are stored in objectclasses in /usr/lib/objrepos but can be stored inan alternate ODM source. See the " Extending SMIT For Common

    Localized Tasks " page for info on using analternate ODM source for SMIT.

    While applications can create object classesanywhere they wish, the system object classesprimarily exist in the three directories listed in theprevious point. This is done to separate data basedupon the type of filesystem it is in. Data that isspecific to a system is stored in /etc/objrepos .Platform specific data that can be shared across

    Object classes are implemented as one or twofiles depending upon the data types used inthe definition of the object class. The primaryfile has the same name as the object class.An optional file ending in .vc is used forvariable length and multi-byte nchar data.The ODM data files are not recognized by thefile command so I have included a sampleMAGIC for both file types.

    0 long 0x000dcfac ODM data file0 long 0x000caa1c ODM variabledata file

    MAGIC entries for ODM files

    Many introductions to the ODM use typicaldatabase examples to show how data isstored and retrieved. While this is useful forunderstanding the structure of an object classit is counter-productive in that it masks whatis really stored in the ODM. Another methodof learning the ODM is to use the truss-querymethod. This means that you wrap acommand in truss ( truss -topen ) to capture

    Page 14 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    15/24

    systems (such as a network boot) is storedin /usr/lib/objrepos . Platform independent datathat can be share across systems is storedin /usr/share/lib/objrepos . One example of thisis the lpp object class that exists in all threelocations. The lslpp -l will query each of theseobject classes and display each in its own group.

    The primary benefits of the ODM is that it stores

    complex data, enforces data types on that data,and provides a rich API / set of command lineutilities to access it. The API supports locking thatinsures a view consistency that is not guaranteedwith flat files.

    When mapping ODM to database concepts, an ODMobject class is the equivalent of a database table,and is implemented as one or more files. An ODMobject would be a row in that table. An objectdescriptor would be the equivalent of a databasecolumn definition.

    The ODM supports relations in the form of the "link"data type. It does not allow for joins of the data,nor does it enforce referential integrity during

    inserts. The ODM does not enforce a primary key,specifically the unique constraint of a key. For thisreason, it is possible to have duplicate objects in aobject class.

    ODM command line tools:odmget Query data from an ODM object class.

    Specific queries are supported with the -qoption, but it is not possible to limit resultsto specific "columns" without using anothercommand like grep. If the query string isomitted, then all data will be returned. (Thisis an effecive way to back up the data fromthe object class.) The data will be returnedin the odmadd/odmget stanza format.

    odmadd Insert data into an ODM object class. Thedata must be in the odmadd/odmget stanzaformat. Because null values are notallowed, all "columns" must be filled withappropriate data.

    odmchange Change data in an ODM object class. Aquery syntax allows the user to specify alimited set of objects (rows). The datachanged is specified in a odmadd/odmgetstanza format. The stanza file does not need to be complete as only the descriptors(columns) present in the stanza file will bechanged in each matched object.

    odmcreate Creates an ODM object class based upon anodmcreate/odmshow "struct" file. The ODMfile will be created in the default directory.Existing object classes with the same namewill be overwritten without warning.

    odmdelete Will delete objects (rows) from an ODMobject class. The -q query syntax issupported to limit the objects deleted. If thequery is omitted, all items will be deleted.Selective delete operations can lead tobloated object class files.

    odmdrop Deletes an entire ODM object class. Allobjects (rows) and the object class itself will be deleted. All object class files are

    the file opens, then query the resulting objectclasses for the data they contain.

    The ODM command line tools work on twodifferent formats of input/output from theobject classes. The structure of the objectclasses are defined in a syntax that is verysimilar to a C struct. Actual object data isstructured in a stanza format.

    class my_object_class {short descriptor1;short descriptor2;vchar text[1024];

    };Example of odmcreate/odmshow struct. (Nonsensical

    table with two short int(eger)s and a string.)

    CuAt:name = "inet0"attribute = "hostname"value = "mumbai"type = "R"

    generic = "DU"rep = "s"nls_index = 24

    Example of odmadd/odmget stanza syntax. (Actualoutput from a system.)

    Steps to shrink an ODM object class called

    "Bloat"odmshow Bloat > Bloat.definitionodmget Bloat > Bloat.dataodmcreate Bloat.definitionodmadd Bloat.data odmshow saves the table definition.

    odmget saves the table data. odmcreatere-creates the table. odmadd restores thedata. This is not a popular task on AIX.The example here is more to relate thepurposes of the commands and givesome insight into how they can be used.

    Determine the ODM files opened by lsattrtruss -topen lsattr -El inet0

    Query CuAt for the inet0 configodmget -o CuAt -q name=inet0

    The SMIT customization page has more ODM

    command examples.

    Command reference: odmget , odmadd ,odmchange , odmcreate , odmdelete , odmdrop ,odmshow

    Page 15 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    16/24

    deleted. Future queries to this object classwill fail.

    odmshow Create a odmcreate/odmshow struct outputbased upon the description of the ODMobject class. The results will define eachdescriptor (column) in the object class(table) as well as have other data related tothe current contents of the object class incomment format. This output can be used

    to re-create an empty object class using theodmcreate command.

    Software Management

    A fileset is the smallest manageable componentin the LPP (Licensed Program Product)hierarchy. A package is a collection of relatedfilesets. An LPP is a group of packages thattend to fall within one product type, such as"bos" - the base operating system.

    Filesets are divided by what part of the systemthey install to. This is either "root", "usr", or"share". These divisions are determined byinstall location as well as platform dependence /independence. Use the lslpp -O flag with r , u ,or s options to list filesets from only onelocation. (Additional discussion of this is foundin the ODM section and the three separate lppODM data stores - one for each fileset installlocation.)

    Most administrators perform installs via theSMIT or NIM methods. SMIT is most popular forsimple one-off installs and smallerenvironments. Use of installp directly fromthe command line is significantly more complexthan SMIT or NIM.

    The most popular SMIT fast paths areinstall_latest and update_all . The installfast path requires that a package repository bespecified on the first screen then presents theuser with a screen of install options to includethe option to browse and select from thesupplied repository.

    Bundles are simply formatted lists of packagesto be installed as a unit . Bundle files are storedlocally in /usr/sys/inst.data/sys_bundlesand /usr/sys/inst.data/user_bundles .Bundles can be installed using the smittyeasy_install command.

    Filesets can be installed in the applied orcommitted states. Applied filesets retainprevious versions and can be rolled back to theprevious version (rejected). The first version of a fileset installed on a system is alwayscommitted.

    SUMA (Service Update Management Assistant)is a method to automate the retrieval of systemupdates from the Internet.

    List all software packages on /dev/cd0installp -l -d /dev/cd0 It is not necessary to explicitly

    mount /dev/cd0 . The installp commandwill do it automatically. None of theexamples using /dev/cd0 (including SMIT)in this section require the explicit mountingof the CD/DVD ROM.

    List the software in the default repository locationinstallp -ld /usr/sys/inst.imagesList all RPM packages on the system

    rpm -qaList all files in the installed gcc RPM

    rpm -ql gcc-4.2.0-3List all filesets that are applied, and can be

    committed or rejectedinstallp -s

    List packages on media in /dev/cd0gencopy -Ld /dev/cd0

    Copy contents of CD to local directorygencopy -d /dev/cd0 -t /proj/instsrc \

    -UX allCopy contents of CD to default local directory

    gencopy -d /dev/cd0 -UX allDownload AIX 5.3 TL10 updates to local

    repositorysuma -x -a Action=Download \

    -a RqType=TL -a RqName=5300-10 The updates will be placed in the default

    local repository in /usr/sys/inst.images .Install the mkinstallp tool

    installp -acgXYd /usr/sys/inst.images \bos.adt.insttools

    The options are:-a Apply

    -c Commit-g Install prerequsites-X Extend filesystems if necessary-Y Agree to licenses-d Specify a sourcebos.adt.insttools pagkage to install

    Backup the rootvgmksysb -eivX /mnt/bombay.mksysb The options are:

    -e Exclude files listedin /etc/exclude.rootvg

    Page 16 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    17/24

    List all installed filesets separated by filesystemtypelslpp -l

    List all installed filesets with combined filesysteminfolslpp -L Adding the -c option will make this output

    scriptable in that it will be colon delimited.

    See the next example.List just the filesets on a systemlslpp -Lc | cut -d : -f 2

    List all files in the bos.mp64 filesetlslpp -f bos.mp64

    List all files in the root part of bos.rte.shelllslpp -Or -f bos.rte.shell

    List what known fileset provides kshwhich_fileset ksh

    List the installed fileset thatprovides /usr/bin/kshlslpp -w /usr/bin/ksh *ksh* would have worked, but more

    results.

    -i Create an /image.data file-v List files as they are backed up-X Extend /tmp if necessary/mnt/bombay.mksysb The file to create

    As this command will back up all mountedfilesystems in rootvg it is necessary toaccount for the potential size of this file.

    The root user has a file size limit (fsize)and can be temporarily disabled withulimit -f unlimited

    Command reference: installp , inutoc , lslpp ,

    emgr , gencopy , suma , mksysb

    Users / Groups

    Page 17 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    18/24

    AIX users and groups have an administrativeattribute that determines who can makechanges to that user or group. Only the rootuser (or equivalent RBAC role) can modify auser or group that has the admin attribute set.Regular, non-admin accounts, may be modifiedby members of the security group. Non-admingroups can have group administrators (that are

    not part of the security group) that can modifythe group members. The following is a table that represents how the

    admin attribute of a user/group effects who canmodify that item:

    adminattribute =

    rootuser

    securitygroup

    users on thegroup admslist

    user true Yes No N/Afalse Yes Yes N/A

    group true Yes No Nofalse Yes Yes Yes

    RBAC (Role Based ACcounting) is a natural

    maturation from using simple SUID/SGIDbinaries to a more granular method of grantingprivileges to users to accomplish tasks. LegacyRBAC was introduced in AIX 4.2.1, and wasupgraded to Enhanced RBAC in AIX 6.1. Thisdocument refers to the Enhanced version of RBAC and only mentions Legacy RBAC incontrast where appropriate.

    Legacy RBAC was a simplified method to divideroot tasks into groups and give non-root usersability to perform those tasks. This was donewith traditional SUID/SGID applications thatthen checked to see if the user was assignedthe privilege before the task was attempted. Asa result, it required specialized binaries thatwere potentially open to exploit because theprocesses they spawned still had effective rootaccess. The benefit was the more granulardivision of responsibilities that RBAC promises.Unfortunately, Legacy RBAC was not sufficientto change many administrator's minds on theuse of root for all tasks administrative.

    Enhanced RBAC does not rely upon SUID/SGIDapplications but instead allows for granularpermissions based upon the users rolemembership and only the permissions requiredto complete the task. The kernel only allowsauthorizations to non-root users for veryspecific actions instead of relying on theapplication code to grant that access.

    A user is assigned a role that aligns with anadministrative task such as the ability to restart(or shutdown) the system. The role is agrouping method that defines all authorizationsthat are required to accomplish that type of task. Commands, files, and devices are addedto priv* files that define what authorizationsare required to perform that specific task or

    Relationship between RBAC files.

    Create an admin group called wfavorit with GID501mkgroup -a id=501 wfavorit

    List the attributes of the just-created groupwfavoritlsgroup wfavorit

    Create an admin user called wfavorit with UID501mkuser -a id=501 shell=/usr/bin/ksh \home=/home/wfavorit pgrp=wfavorit \wfavorit

    Set the password for user wfavorit (run asprivileged user)pwdadm wfavorit or passwd wfavorit

    Add wfavorit as member of the security groupchgrpmem -m + wfavorit security

    Make a group with wfavorit as the adminmkgroup adms=wfavorit favorite

    Make wfavorit an administrator of the proj groupchgrpmem -a + wfavorit proj

    List all users on the systemlsuser -a ALL

    Page 18 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    19/24

    access that file / device. When a command isrun, the required authorizations are checkedagainst the authorizations assigned to roles forthe user running the command. If the userlacks sufficient access then permission isdenied.

    The following table lists the key configurationfiles in the Enhanced RBAC system, thecommands used to access/modify those filesand what the files are for.user.roles chuser

    mkuserlsuser

    Provides a mappingbetween existing usersand existing roles - both of which are definedelsewhere.

    roles chrolemkrolelsrolermrole

    Defines roles as either agroup of authorizations orof sub-roles.

    authorizations mkauthchauthlsauthrmauth

    Defines user createdauthorizations. Systemauthorizations are definedelsewhere.

    privcmds setsecattrlssecattrrmsecattr

    Lists all authorizations thatare required for acommand to complete itstask.

    privfiles setsecattrlssecattrrmsecattr

    Lists all authorizations thatare required to read orwrite to a file.

    privdevs setsecattrlssecattrrmsecattr

    Lists all authorizations thatare required to read orwrite to a device.

    The user environmental variables are stored

    in /etc/environmentand /etc/security/environ . The variables setin /etc/environment are given to all users andprocesses while the settingsin /etc/security/environ are per-user.

    User limits are set for login processes fromthe /etc/security/limits file. The chusercommand can be used to modify this file.

    The default options for the mkuser commandare storedin /usr/lib/security/mkuser.default .

    The /etc/security/passwd file is the shadowpassword file.

    The last command returns login information forthe system (from the /var/adm/wtmp file.The /etc/security/lastlog file contains per-user information on each users login attempts.

    The -a switch lists specific attributes, butin this case it is empty and only the usernames are displayed. See other lsuserexamples in this section for other uses of the -a switch.

    List all admin users on the systemlsuser -a admin ALL | grep =true

    List attributes for user wfavorit in a stanza format

    lsuser -f wfavoritList login history for user wfavoritlast wfavorit

    List the fsize ulimit for user wfavoritlsuser -a fsize wfavorit

    Change the file size ulimit to unlimited forwfavoritchuser fsize=-1 wfavorit

    List all groups and their IDslsgroup -a id ALL

    List all members of the favorite groupchgrpmem favorite

    User / Group admin command reference:

    mkuser , chuser , rmuser , lsuser , pwdadm ,mkgroup , chgroup , rmgroup , lsgroup ,chgrpmem , usrck , grpck , pwdck

    RBAC command reference: setkst , chrole ,mkrole , lsrole , rmrole , mkauth , chauth , lsauth ,rmauth , ckauth , setsecattr , lssecattr , rmsecattr

    User command reference: users , w, who ,whoami , whodo , id, chsh , passwd , setgroups ,ulimit , setsenv , last , finger

    Other

    Boot Process

    The normal numbers represent what you see asthe step begins. The red numbers are errorcodes when that command / step fails. This is

    cfgcon configures console c31

    Page 19 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    20/24

    not a complete list of error codes. A morecomplete set can be found in DiagnosticInformation for Multiple Bus Systems .

    Power onHardware initializationRetrieve bootlist from NVRAMLocate BLV and load into memory 20EE000BKernel initializes and mounts RAM FSPhase 1 ( rc.boot 1 )

    RAM FS is resized Logging begins restbase copies ODM to RAM FS 548

    cfgmgr configures base devices inODM510

    bootinfo determines boot device 511, 554Phase 2 ( rc.boot 2 )

    ipl_varyon varies on rootvg 551, 552 ,554 ,556 fsck of / 517, 555 mount of / 517, 557 fsck & mount of /usr 517, 518 fsck & mount of /var 517, 518 copycore, umount /var 517 swapon /dev/hd6 517

    RAM FS version of ODM copiedto /etc/objrepos517

    RAM FS version of /dev copied todisk517

    mount /var 517, 518

    Actual boot log written to (from RAMFS version)517

    rc.boot 2 is finished 553

    Kernel changes root from RAM FS todisk553

    Phase 3 553

    Kernel invokes init from rootvg 553 init invokes rc.boot 3 553 fsck & mount of /tmp 517, 518 syncvg -v rootvg & 517 Load streams modules 517 Configure secondary dump device 517

    cfgmgr -p2 (Normal) or cfgmgr

    -p3 (Service)

    517, 521-529

    Continued

    (cfgcon exit codes. c33 is assumedhere)c32, c33, or

    c34

    System hang detection is started c33 Graphical desktop is (optionally) started savebase updates ODM copy on BLV 530 syncd & errdemon started System LED is turned off

    rm -f /etc/nologin Start several optional services log: "System initialization completed"

    Phase 3 complete, init continuesprocessing inittab

    The previous boot process listing is for a normaldisk boot. This will vary for network, tape, andCD boots. Read the contents of /sbin/rc.bootfor specifics on each boot device method andtype (normal or service).

    The boot order is stored in NVRAM. The settingsare set and retrieved using the bootlistcommand.

    The BLV (Boot Logical Volume) is /dev/hd5. It iscreated / updated with the bosboot command.

    bosboot updates the boot record at the start of the disk, copies the SOFTROSfrom /usr/lib/boot/aixmon.chrp , copies thebootexpand utility, copies the kernelfrom /unix , creates a copy of the RAM FS fromthe list of filesin /usr/lib/boot/chrp.disk.proto , andcreates a base ODM.

    Layout of a bootable disk with hd5 shown.

    The kernel loaded from hd5 (the BLV) is thekernel the system will run under for the entiretyof the boot (until the system is shutdown orrestarted). For this reason it is important to re-

    run bosboot every time that the kernel isupdated or some boot-time kernel options areset.

    This is an abbreviated list of boot codes. cfgmgr(alone) produces numerous display messagesand potential error codes, far more than ispractical to display here.

    Command reference: bosboot , bootlist

    Error Logging

    Page 20 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    21/24

    AIX has three error logging and reportingmethods; alog, errlog, and syslog. The alog isan extensible collection of logs, but primarily isused for boot and console logging. errlog isused primarily for system and hardwaremessages. syslog is the traditional loggingmethod.

    HMC managed systems will also have a log of

    serviceable events relating to all systems onthat HMC. Both errpt and alog keep binary circular logs.

    For this reason, neither requires the rotationprocess that is used for syslog logs.

    A curses based error log browser can be foundlocally on the errbr page .

    The AIX syslog.conf uses *.debug for all, not*.*

    The following alog examples use the boot log asan example. These examples are transferableto any of the other existing logs as well asthose created in addition to the AIX suppliedlogs.

    List all logs alog knows about

    alog -LDump the contents of the boot log to stdout

    alog -o -t bootSend the current date to the boot log

    date | alog -t bootIncrease the size of the boot log to twice the

    default.alog -C -t boot -s 8192 Note: This changes the definition in the

    ODM, the size will be applied the next timethat the log is re-created.

    Clear the boot logrm /var/adm/ras/bootlogecho "boot log cleared on `date`" \

    | alog -t bootFind the current alog file size setting for the boot

    logodmget -q attribute="boot_logsize" \

    SWservAt

    Write a message to the errlogerrlogger "This is not Solaris!"

    Display the entire contents of the errlogerrpt Add -a or -A for varying levels of

    verbosity.Clear all entries from the errlog

    errclear 0

    Clear all entries from the errlog up to 7 days agoerrclear 7

    List info on error ID FE2DEE00errpt -aDj FE2DEE00 The ID is from the IDENTIFIER column in

    errpt output.Put a "tail" on the error log

    errpt -cList all errors that happened today

    errpt -s `date +%m%d0000%y`List all errors on hdisk0

    errpt -N hdisk0To list details about the error log

    /usr/lib/errdemon -lTo change the size of the error log to 2 MB

    /usr/lib/errdemon -s 2097152syslog.conf line to send all messages to a log

    file*.debug /var/log/messages

    syslog.conf line to send all messages to errorlog*.debug errlog

    Command reference: alog , errpt , errlogger ,

    errdemon , errclear

    WPAR

    WPARs (Workload PARtitions) are an AIX 6.1feature that can be used to capture a processtree and lock it into its own environment. AnAIX system can host multiple WPARs that eachappear to be nearly identical to a regularsystem. All processes in the WPAR are subjectto the environment of that WPAR such asdevices, filesystems, configurations, andnetworking unique to that WPAR.

    There are two types of WPARs, system andapplication. The key differences are that asystem WPAR begins at the init process whilean application WPAR begins at the applicationprocess and the system WPAR has dedicated

    Create the rudra WPAR with default optionsmkwpar -n rudra This command will pull the IP configuration

    for ruda from DNS. Naturally, rudra mustbe defined in DNS for the globalenvironment to find.

    Start the rudra WPARstartwpar -v rudra

    Log into the console of rudraclogin rudra -l root

    Create indra WAPR with useful optionsmkwpar -A -n indra -r -s -v -A = Start automatically on system boot. -n name = Workload partition name.

    Page 21 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    22/24

    file systems while the application may not.System WPARs can be "sparse" or "whole root"but it is the application WPAR that is mostdifferent from the other containerimplementations.

    The hosting AIX system is called the "globalenvironment". The key differences in the globalenvironment is that it runs the kernel, owns thedevices, and can host WPARs. Significant efforthas been taken for the user environment of aWPAR to be indistinguishable from the globalenvironment. That said, the administratorneeds to be aware of what environment she isin to perform various tasks.

    Because of the limited and contextually relevantadministrative environment of a WPAR, somecommands behave differently than others whenrun in a WPAR or the global environment.Generally speaking, the more lower level thecommand, the more appropriate it is to run inthe global environment. One example of administration tasks most appropriate for theglobal environment is device managementcommands. While a (system) WPAR hasdevices, the devices in a WPAR are muchdifferent than those in the global environment.

    WPARs are started from /etc/inittab withthe /etc/rc.wpars script, using theconfiguration information in /etc/wpars/ .

    By default, the root filesystems of sytem WPARsare created in /wpars/ WPAR_name / . Thefilesystems are browsable by (properlypermissioned) users of the global environment.Users in a WPAR cannot see filesystems of other WPARs.

    By default the /usr , /opt , and /proc

    filesystems of a system WPAR are shared withthe global environment via a read-only"namefs" vfs type. ( /proc is mounted read-write in each of the non-global WPARs.) As aresult, software and updates cannot be appliedto these read-only WPAR views of thefilesystems from the WPAR. Filesystems thatare local to the WPAR (such as /home , / , /tmp ,and /var ) can be modified from within theWPAR. Examples in this section show thedefault read-only and alternate options forthese filesystems.

    Some options for system WPAR filesystemsinclude:

    Using a dedicated VG or external NFS mountfor WPAR filesystems. (Unless otherwisespecified, system WPAR filesystems arecreated from rootvg.)

    Using a single LV for all local filesystems. (Thedefault filesystem layout is similar totraditional AIX installs in that it will be brokeninto multiple LVs / filesystems.)

    Creating a dedicated (local copy) of the /usrand /opt file systems. (In the defaultfilesystem setup /home , / , /tmp , and /var are

    -r = Copy global network name resolutionconfiguration into the workload partition.

    -s = Start after creation. -v = Verbose mode.

    Create a WPAR on a dedicated VGmkwpar -n varuna -A -g varuna_vg \

    -r -s -v If a VG or other filesystem options are not

    supplied then the filesystems for a systemWPAR will be created from LVs on therootvg . This command uses a dedicatedVG called varuna_vg . The /usr and /optfilesystems will still be shared with theglobal WPAR and therefore will still comefrom rootvg but will not take anyadditional space. If the -l option was usedin the above command then a new /usrand /opt would have been created for thisWPAR using the specified VG.

    Create an additional fs on dedicated VGcrfs -v jfs2 -g varuna_vg \

    -m /wpars/varuna/data01 -u varuna \-a size=100M

    This command is run from the globalenvironment. The mount point is within thevaruna root filesystem ( /wpars/varuna ) sothat it can be seen by the varuna WPAR.The -u varuna option specifies this fs aspart of the varuna mount group so that itwill be mounted when varuna starts.

    Remove the varuna WPARrmwpar -s varuna -s stops it first, -p preserves the

    filesystems. (In this case we delete theunderlying filesystems.)

    Create a WPAR with mount optionsmkwpar -n varuna -r -s \-M directory=/ vfs=nfs \

    dev=/varuna_nfs host=shiva \-M directory=/var vfs=directory \-M directory=/home vfs=directory \-M directory=/tmp vfs=directory \-M directory=/usr vfs=directory \-M directory=/opt vfs=directory

    The mkwpar command in this example usesa remote NFS share to host the filesystemsfor this system WPAR. It also specifies thateach of the regular mount points willinstead be directories and not mounts. Theresulting WPAR will have only two mountpoints, one for the / filesystem and one forthe /proc filesystem. The NFS mount inthis example must be root mountable byboth the global environment and thesystem WPAR. An example of the actual(but temporary) NFS share is given in theNFS section above.

    List all WPARs on the systemlswpar

    Page 22 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    23/24

    unique to the WPAR while /usr and /opt areviews on the actual file systems in the globalenvironment.)

    Creating additional filesystems dedicated to theWPAR. (This can take the form of a NFS mountor a dedicated filesystem just for the WPAR.)

    A number of commands support a new -@ flagfor WPAR related output. The required

    parameters and output of the -@ flag varies bycommand, and what environment the commandis run in (WPAR or global).

    A system WPAR is started and stopped muchlike a separate OS with the startwpar andstopwpar commands. These act effectively asboot and shutdown operations. The shutdownwill be the most familiar, while the bootoperation is significantly different from bootinga system. Instead of bootstrapping the systemfrom a disk, the WPAR startup process involvesbringing online all the required filesystems,changing to that root filesystem / environment,and then picking up the boot process at init.

    (This is a simplistic treatment of the processdesigned to illustrate the difference from asystem boot of something like a LPAR in avirtualized environment.)

    Application WPARs are not started like a systemWPAR. It is more appropriate to describe themas being executed in a different context .Application WPARs can see the globalenvironment filesystems and devices, theyinherit everything not explicitly set by thewparexec command. The large majority of examples and discussion in this section refer tosystem WPARs.

    The Solaris implementation of containers offersa command called zonename that tells whatzone the user is in. It works like the hostnamecommand when run from a zone but returnsthe word "global" when run from the globalenvironment. AIX provides the uname -W to tellif you are in a WPAR or not. I have included thelogic (script) to create a wparname commandthat tells if you are in a WPAR as well as thehostname of the WPAR (like the zonenamecommand).

    #!/bin/sh

    if (( `uname -W > /dev/null 2>&1` ))thenecho "global"

    elsehostname

    fiSample source of wparname command.

    Default output will include Name, State,Type, Hostname, and Directory. Valid typesare S (System), A (Application) and C(Checkpointable).

    Determine if you are in global WPARuname -W This command will print 0 to stdout and

    return 0 if in a global environment, and

    give non-zero values if in a system WPAR.Another method is to look for the wio0device in lsdev output - wio0 only exists ina system WPAR.

    List WPARs with (basic) network configurationlswpar -N

    Change rudra WPAR to start on system bootchwpar -A rudra

    List all processes in the indra WPAR from globalps -ef@ indra

    List ports / connections for the globalenvironmentnetstat -naf inet -@ Global Run in global environmnet.

    Stop WPAR rudra from globalstopwpar -v rudra

    Start apache in an application WPARwparexec -n varuna \

    /usr/sbin/apachectl start & In this example varuna is defined in DNS.

    Because the -h flag is not used, thehostname will default to the WPAR name,and will pull IP configuration from DNS forthat host. Subnet mask, name resolution,and all other settings will be inherited fromthe appropriate interface in the Globalenvironment.

    Command reference: mkwpar , chwpar , lswpar ,

    rmwpar , startwpar , stopwpar , wparexec ,rebootwpar , syncwpar , syncroot

    About this QuickStart

    Page 23 of 24AIX QuickStart

    1/12/2012http://www.tablespace.net/quicksheet/aix-quickstart.html

  • 8/3/2019 Aix Quick Start

    24/24

    Created by: William Favorite ([email protected])Updates at: http://www.tablespace.net/quicksheet/Disclaimer: This document is a guide and it includes no express warranties to the suitability, relevance, or compatibility of its contents with any specific system. Research any and all commands that you inflict upon your command line.Distribution: Copies of this document are free to redistribute as long as credit to the author and tablespace.net is retainedin the printed and electronic versions.

    Page 24 of 24AIX QuickStart