AIX Basicks
AIX Basicks
Kernel
/unix is a symbolic link to the booted kernel. To find out what kernel mode is
running, enter ls -l /unix and see what file /unix it links to. The following are
the three possible outputs from the ls -l /unix command and their corresponding
kernels:
During the installation process, one of the kernels, appropriate for the AIX
version and the hardware in operation, is enabled by default. Use the method from
the previous question and assume that the 32-bit kernel is enabled. Also assume
that you want to boot it up in the 64-bit kernel mode. This can be done by running
the following commands in sequence:
lslv -m hd5
Note:
In AIX V5.2, the 32-bit kernel is installed by default. In AIX V5.3, the 64-bit
kernel is installed on 64-bit hardware and the 32-bit kernel is installed on 32-bit
hardware by default.
Hardware
AIX 5L Version 5.3 supports all 32- bit and 64-bit Common Hardware Reference
Platform (CHRP)-based IBM Power� hardware. Only 64-bit CHRP systems are supported
with AIX 6.1 and AIX V7.1.
Run the prtconf command. If it is a CHRP machine, the string chrp appears on the
Model Architecture line.
To list the current values of the attributes for the tape device, rmt0, type:
lsattr -l rmt0 -E
To list the default values of the attributes for the tape device, rmt0, type:
lsattr -l rmt0 -D
To list the possible values of the login attribute for the TTY device, tty0, type:
lsattr -E -l sys0
How many processors does my system have?
lspv
How do I list information about a specific physical volume?
To find details about hdisk1, for example, run the following command:
lspv hdisk1
How do I get a detailed configuration of my system?
lscfg
The following options provide specific information:
Option
Description
-p
Displays the vital product data (VPD) found in the customized VPD object class.
For example, to display details about the tape drive, rmt0, type:
How do I find out the chip type, system name, node name, model number, and so
forth?
Command
Description
uname -p
Displays the chip type of the system. For example, IBM PowerPC�.
uname -r
uname -s
uname -n
uname -a
uname -M
uname -m
name -u
AIX
To determine the highest technology level reached for the current version of AIX on
the system, type:
oslevel -r
lslpp -h bos.rte
To list the installation state for the most-recent level of installed file sets for
all of the bos.rte file sets, type:
lslpp -l "bos.rte.*"
To list which software is below AIX Version 5.3 technology level 1, type:
oslevel -r -l 5300-01
To list which software is at a level later than AIX Version 5.3 technology level 1,
type:
oslevel -r -g 5300-01
To determine the highest service pack reached for the current technology level on
the system, type:
oslevel -s
To list the known service packs on a system, type:
oslevel -sq
The levels returned can be used with the [ -s -l ] or [ -s -g ] flags, and will be
similar to the following:
oslevel -s -l 6100-00-01-0748
To list which software is at a level later than AIX Version 6.1 technology level 0,
service pack 1, type:
oslevel -s -g 6100-00-01-0748
How do I create a file system?
The following command will create, within volume group testvg, a journaled file
system (JFS) of 10 MB with mounting point /fs1:
To make a JFS on the rootvg volume group with nondefault fragment size and
nondefault NBPI, enter:
To increase the /usr file system size by 1000000 512-byte blocks, type:
To split off a copy of a mirrored file system and mount it read-only for use as an
online backup, enter:
chfs -a splitcopy=/backup -a copy=2 /testfs
This mounts a read-only copy of /testfs at /backup.
Note:
In AIX V5.3, the size of a JFS2 file system can be shrunk, as well.
The following command will mount file system /dev/fslv02 on the /test directory:
mount {-a|all}
How do I display mounted file systems?
Type the following command to display information about all currently mounted file
systems:
mount
To mount a remote directory, enter the following command:
To mount a file or directory from the /etc/file systems file with a specific type,
enter the following command:
mount -t remote
This command sequence mounts all files or directories in the /etc/file systems file
that have a stanza containing the type=remote attribute.
To remount the mounted read-only JFS2 file system to a read-write file system,
enter the following command:
umount /test
To unmount all mounts from the Node A remote node, enter:
umount -n nodeA
How do I remove a file system?
rmfs /test
This removes the /test file system, its entry in the /etc/filesystems file, and the
underlying logical volume.
The defragfs command can be used to improve or report the status of contiguous
space within a file system. For example, to defragment the file system /home, use
the following command:
defragfs /home
To generate a report on the /data1 file system that indicates its current status as
well as its status after being defragmented, enter:
defragfs -r /data1
To generate a report on the fragmentation in the /data1 file system, enter:
defragfs -s /data1
Which file set contains a particular binary?
lslpp -w /usr/bin/vmstat
To display all files in the inventory database, type:
lslpp -w
To list the file set that owns all file names containing installp, type:
lslpp -w "*installp*"
Or, to show which file set contains /usr/bin/svmon, type:
which_fileset svmon
How do I display information about the installed file sets on my system?
lslpp -l
To list the installation state for the most recent level of installed file sets for
all of the bos.rte file sets, type:
lslpp -l "bos.rte.*"
To list the installation state for the base level and updates for the
bos.rte.filesystem file set, type:
lslpp -f bos.rte.lvm
To list the file set that owns all file names containing installp, type:
lslpp -w "*installp*"
How do I determine if all file sets of technology level are installed on my system?
instfix -i | grep TL
How do I determine if a fix is installed on my system?
To inform the user on whether fixes IX38794 and IX48523 are installed, type:
To install APAR IY73748 from /dev/cd0, for example, enter the command:
How do I verify if file sets have required prerequisites and are completely
installed?
lppchk -v
How do I get a dump of the header of the loader section and the symbol entries in
symbolic representation?
dump -Htv
To dump the object file headers, enter:
dump -o a.out
To dump line number information for the a.out file, enter:
dump -l a.out
To dump the contents of the a.out object file text section, enter:
dump -s a.out
To dump symbol table information for the a.out object file, enter:
dump -t a.out
Note:
Firmware-assisted dump is now the default dump type in AIX V7.1, when the hardware
platform supports firmware-assisted dump. The traditional dump remains the default
dump type for AIX V6.1, even when the hardware platform supports firmware-assisted
dump.
# oslevel -s
6100-00-03-0808
# sysdumpdev -l
primary /dev/lg_dumplv
secondary /dev/sysdumpnull
copy directory /var/adm/ras
forced copy flag TRUE
always allow dump FALSE
dump compression ON
type of dump traditional
# oslevel -s
7100-00-00-0000
# sysdumpdev -l
primary /dev/lg_dumplv
secondary /dev/sysdumpnull
copy directory /var/adm/ras
forced copy flag TRUE
always allow dump FALSE
dump compression ON
type of dump fw-assisted
full memory dump disallow
To set the full memory dump option, type:
# sysdumpdev -f require
# sysdumpdev -l
primary /dev/lg_dumplv
secondary /dev/sysdumpnull
copy directory /var/adm/ras
forced copy flag TRUE
always allow dump FALSE
dump compression ON
type of dump fw-assisted
full memory dump require
The full memory system dump mode is now allowed. To change to the traditional dump
on AIX V7.1, type:
# sysdumpdev -t traditional
# sysdumpdev -l
primary /dev/lg_dumplv
secondary /dev/sysdumpnull
copy directory /var/adm/ras
forced copy flag TRUE
always allow dump FALSE
dump compression ON
type of dump traditional
To reinstate firmware-assisted dump, type:
# sysdumpdev -t fw-assisted
Note:
lsps -a
How do I increase a paging space?
You can use the chps -s command to dynamically increase the size of a paging space.
For example, if you want to increase the size of hd6 with three logical partitions,
you issue the following command:
chps -s 3 hd6
To change the size of the myvg paging space, enter:
chps -s 4 myvg
This adds four logical partitions to the myvg paging space.
You can use the chps-d command to dynamically reduce the size of a paging space.
For example, if you want to decrease the size of hd6 with four logical partitions,
you issue the following command:
chps -d 4 hd6
How would I know if my system is capable of using simultaneous multithreading
(SMT)?
If you run the smtctl command without any options, it tells you if it is enabled or
not.
Note:
AIX V5.3 32-bit kernel only supports SMT 2. For SMT 4 exploitation, you would need
to run AIX V5.3 in a versioned workload partition (WPAR) on top of AIX V7.1
(described in the Workload partitions section). The 32-bit kernel was removed in
AIX V6.1.
Option
Description
-m off
-m on
-w boot
Makes the SMT mode change effective on next and subsequent reboots if you run the
bosboot command before the next system reboot
-w now
Makes the SMT mode change immediately but will not persist across reboot
If neither the -w boot option nor the -w now option is specified, then the mode
change is made immediately. It persists across subsequent reboots if you run the
bosboot command before the next system reboot.
To disable simultaneous multithreading for the current boot cycle and for all
subsequent boots, enter:
smtctl -m off
The system displays a message similar to the following:
smtctl: SMT is now disabled. It will persist across reboots if you run the bosboot
command before the next reboot.
lparstat �h 1 1
To get the information about the partition, enter the following command:
lparstat -i
To get detailed hypervisor statistics, enter the following command:
lparstat �H 1 1
To get statistics about the shared memory pool and the I/O memory entitlement of
the partition, enter the following command:
lparstat �m
Note:
AIX V7.1 includes enhanced support for solid-state drive (SSD) in the AIX Logical
Volume Manager (LVM). The commands lsvg, mkvg, chvg, extendvg, and replacepv
described in the following sections support creation, extension, and maintenance of
volume groups consisting of SSDs.
Run the lsvg command on the volume group and look at the value for MAX PVs. The
value is 32 for normal, 128 for big, and 1024 for scalable volume group.
Use the following command, where s partition_size sets the number of megabytes (MB)
in each physical partition where the partition_size is expressed in units of MB
from 1 through 1024. (It is 1 through 131072 for AIX V5.3.) The partition_size
variable must be equal to a power of 2 (for example: 1, 2, 4, 8). The default value
for standard and big volume groups is the lowest value to remain within the
limitation of 1016 physical partitions per physical volume. The default value for
scalable volume groups is the lowest value to accommodate 2040 physical partitions
per physical volume.
To create a volume group that can accommodate a maximum of 1024 physical volumes
and 2048 logical volumes, type:
You use the following command to change the characteristics of a volume group:
chvg
To cause volume group vg03 to be automatically activated during system startup,
type:
chvg -a y vg03
In AIX 7.1, you can also use the System Management Interface Tool (SMIT) smit chvg
fast path to run this command.
To increase the size of the logical volume represented by the lv05 directory by
three logical partitions, for example, type:
extendlv lv05 3
How do I display all logical volumes that are part of a volume group (for example,
rootvg)?
You can display all logical volumes that are part of rootvg by typing the following
command:
lsvg -l rootvg
To display the names of all active volume groups, enter the following command:
lsvg -o
To display the names of all volume groups within the system, enter the following
command:
lsvg
To display information about volume group vg02, enter the following command:
lsvg vg02
The characteristics and status of both the logical and physical partitions of
volume group vg02 are displayed.
Run the following command to display information about the logical volume lv1:
lslv lv1
To display the logical volume allocation map for hdisk2, enter:
lslv -p hdisk2
An allocation map for hdisk2 is displayed, showing the state of each partition.
Because no LogicalVolume parameter was included, the map does not contain logical
partition numbers specific to any logical volume.
To display information about the lv03 logical volume by physical volume, enter:
lslv -l lv03
The characteristics and status of lv03 are displayed, with the output arranged by
physical volume.
How do I remove a logical volume from a volume group?
You can remove the logical volume lv7 by running the following command:
rmlv lv7
The rmlv command removes only the logical volume, but does not remove other
entities, such as file systems or paging spaces that were using the logical volume.
To add physical partitions to the logical partitions in the lv01 logical volume, so
that a total of three copies exist for each logical partition, enter:
mklvcopy lv01 3
The logical partitions in the logical volume represented by the lv01 directory have
three copies.
You can use the rmlvcopy command to remove copies of logical partitions of a
logical volume. To reduce the number of copies of each logical partition belonging
to the testlv logical volume, enter:
rmlvcopy testlv 2
Each logical partition in the logical volume now has at most two physical
partitions.
lsvg
To show all the characteristics of rootvg, type:
lsvg rootvg
To show disks used by rootvg, type:
lsvg -p rootvg
How to add a disk to a volume group?
How do I find out the maximum supported logical track group (LTG) size of my hard
disk?
You can use the lquerypv command with the -M flag. The output gives the LTG size in
KB. For instance, the LTG size for hdisk0 in the following example is 256 KB.
/usr/sbin/lquerypv -M hdisk0
256
You can also run the lspv command on the hard disk and look at the value for MAX
REQUEST.
syncvg -v testvg
To synchronize the copies on volume groups vg04 and vg05, enter:
The command migratepv moves allocated physical partitions from one physical volume
to one or more other physical volumes.
The reducevg command removes physical volumes from a volume group. When all the
physical volumes are removed from the volume group, the volume group is deleted.
You can run the alt_disk_copy command to copy the current rootvg to an alternate
disk. The following example shows how to clone the rootvg to hdisk1.
alt_disk_copy -d hdisk1
Network
The no command sets or displays current or next boot values for network tuning
parameters.
no -o thewall
To change the default socket buffer sizes on your system, type:
no -r -o tcp_sendspace=32768
no -r -o udp_recvspace=32768
To use a system as an Internet work router over the Internet Protocol networks,
type:
no -o ipforwarding=1
To list the current and reboot value, range, unit, type and dependencies of all
tunable parameters that are managed by the no command, type:
no -L
How do I get the IP address of my machine?
ifconfig -a
host Fully_Qualified_Host_Name
For example, type the following command to get the IP address of the machine
cyclop.austin.ibm.com:
host cyclop.austin.ibm.com
How do I identify the network interfaces on my server?
Either of the following two commands will display the network interfaces:
lsdev -Cc if
ifconfig -a
To get information about one specific network interface, for example, tr0, run the
command:
ifconfig tr0
How do I activate a network interface?
ifconfig tr0 up
How do I deactivate a network interface?
For example, to deactivate the network interface tr0, run the command:
netstat -r -f inet
To display interface information for an Internet interface, type:
netstat -i -f inet
To display statistics for each protocol, type:
netstat -s -f inet
How do I record packets received or transmitted?
To record packets coming in and going out to any host on every interface, enter:
iptrace /tmp/nettrace
The trace information is placed in the /tmp/nettrace file.
To record packets received on an interface en0 from a remote host airmail over the
Telnet port, enter:
--------------------------------------------------------------------------------
Back to top
Workload partitions
With AIX 7.1, the support of kernel extension load and VIOS disks and their
management within a WPAR has been added, allowing a rootvg WPAR that supports VIOS
disks. A new product named AIX 5.2 Workload Partitions for AIX 7 to support an AIX
5.2 environment in a versioned workload partition has been introduced in AIX 7.1.
The enhancement introduced with the reliability, availability, and serviceability
(RAS) error-logging mechanism has been propagated to WPARs with AIX 7.1. This RAS
error-logging feature first became available in AIX 7.1 and was included in AIX 6.1
TL 06.
mkwpar -f /tmp/wpar1.spec
How do I create a new specification file for an existing workload partition wpar1?
startwpar temp
How do I stop a workload partition?
stopwpar temp
How do I view the characteristics of workload partitions?
lswpar
To run the /usr/bin/ps command as user root in a workload partition named howdy,
type:
rmwpar temp
To stop and remove the workload partition called temp preserving data on its file
system, type:
rmwpar -p -s temp
--------------------------------------------------------------------------------
Back to top
The iostat command described below has been enhanced in AIX 6.1 TL6 and AIX 7.1 to
capture useful data to help analyze I/O issues and identify and correct the problem
quicker. A new flag, -b, is available for the iostat command to display block I/O
device utilization statistics.
vmstat
To display five summaries at 2-second intervals, type:
vmstat 2 5
To display a summary of the statistics since boot including statistics for logical
disks scdisk13 and scdisk14, enter the following command:
vmstat -t
To display all the VMM statistics available, enter the following command:
vmstat -vs
To display a summary of the statistics for all of the workload partitions after
boot, type:
vmstat -@ ALL
To display all of the virtual memory statistics available for all of the workload
partitions, type:
To display a single set of statistics for all TTY, CPU, and disks since boot, type:
iostat
To display a continuous disk report at 2-second intervals for the disk with the
logical name disk1, type:
iostat -d disk1 2
To display six reports at 2-second intervals for the disk with the logical name
disk1, type:
iostat disk1 2 6
To display six reports at 2-second intervals for all disks, type:
iostat -d 2 6
To display six reports at two second intervals for three disks named disk1, disk2,
disk3, enter the following command:
iostat -s
To print the adapter throughput reports at 5-second intervals, enter the following
command:
iostat -a 5
To print 10 system and adapter throughput reports at 20-second intervals, with only
the TTY and CPU report (no disk reports), enter the following command:
iostat -sat 20 10
To print the system and adapter throughput reports with the disk utilization
reports of hdisk0 and hdisk7 every 30 seconds, enter the following command:
iostat -T 60
To display only file system statistics for all workload partitions, type:
iostat -F -@ ALL
To display system throughput of all workload partitions along with the system,
type:
iostat -s -@ ALL
How do I display local and remote system statistics?
topas
To go directly to the process display, enter:
topas -P
To go directly to the logical partition display, enter:
topas -L
To go directly to the disk metric display, enter:
topas -D
To go directly to the file system display, enter:
topas -F
To go directly to WPAR monitoring mode abc, enter the following command:
topas -@ abc
To go directly to the topas WPAR mode, enter the following command:
topas -@
How do I report system unit activity?
sar
To report current TTY activity for each 2 seconds for the next 40 seconds, enter
the following command:
sar -y -r 2 20
To report the processor use statistics in a WPAR from the global environment, enter
the following command:
sar -@ wparname
To report all of the processor activities from inside a WPAR, enter the following
command:
sar -P ALL 1 1
To report processor activity for the first two processors, enter:
sar -u -P 0,1
This produces output similar to the following:
--------------------------------------------------------------------------------
Back to top
Conclusion
Admittedly, a list such as this can be helpful in quickly answering some of your
own questions. However, it does not cover everything that you might need. You can
extend the usefulness of such a list by adding other commands that answer
additional questions not addressed here.
--------------------------------------------------------------------------------
Back to top
Resources
Learn
�AIX Information Center: This website provides the latest documentation on AIX.
�Introduction to Workload Partition Management in IBM AIX Version 6.1: This
Redbooks presents WPARs, a set of completely new software-based system
virtualization features introduced in IBM AIX Version 6.1.
�The AIX and UNIX developerWorks zone provides a wealth of information relating to
all aspects of AIX systems administration and expanding your UNIX skills.
�developerWorks technical events and webcasts: Stay current with developerWorks
technical events and webcasts.
�AIX Wiki: Visit this collaborative environment for technical information related
to AIX.
�Podcasts: Tune in and catch up with IBM technical experts.
�AIX 5L Differences Guide Version 5.3 Edition
�AIX 5L Differences Guide Version 5.3 Addendum
�IBM AIX Version 6.1 Differences Guide
�IBM AIX Version 7.1 Differences Guide
�Browse the technology bookstore for books on these and other technical topics.
�IBM AIX 7.1 Information Center
�IBM AIX 6.1 Information Center
�IBM AIX 5.3 Information Center
�Writing AIX kernel extensions