FAQ AIX
Contents
- What is the command to analyze a dump with AIX 5L?
- How can I display all actually loaded kernel extensions?
- Can I run a 64bit kernel on my system?
- How can I activate the 64bit Kernel? Is it even already running??
- Is it possible to install AIX 5.2 or AIX 5.3 on my box?
- How do I create users with long login names (more than 8 characters) under AIX 5.3?
- Is it possible to increase the maximum number of PPs beyond 1016?
- How can I list the version of an HMC?
- How can I list the firmware level of a p5 system?
- How can I create a snap suitable for IBM support?
- What are the correct settings for daylight saving time in Central Europe?
- How can I figure out if a fibrechannel card is linked to a switch port?
- How can I create a backup ethernet adapter?
- How can I create a dummy disk to reserve an hdisk number?
- How can I figure out the managing HMC (and CSM server) of my LPAR?
- How can I directly read out the VGDA of a PV (hdisk)?
- How can I unlock a SAN disk?
- How can I do a preview of an ML/TL upgrade?
- How can I archive a directory with backup?
- How can I see the allocated resources of an LPAR w/o checking on the HMC?
- How can I see statistics about all LPARs sharing the same resources?
- How to set a static route?
- How can I force nfs mounts to use reserved ports?
- How to exclude a directory from being backed up by the mksysb command?
- How can I identify a generic SCSI disk for replacement?
- How can I extract a compressed tar archive under AIX?
- How can I change the the name of a tape device?
- Can I identify deleted files still opened by a process?
- How to view the current SMT mode settings and processor information
1. What is the command to analyze a dump with AIX 5L?
Since AIX 5.1 the proper command to analyze a dump is kdb. For AIX 4.3.3 and earlier you
use crash instead. The usage is almost identical.
2. How can I display all actually loaded kernel extensions?
You use the command genkex to see all modules and extensions loaded into the kernel. If you are only interested in real extensions, you can use a line like this:
# genkex | grep 'ext$'
3. Can I run a 64bit kernel on my system?
You can use the bootinfo command:
# bootinfo -y 32
If it comes back with 32 this machine can not run the 64bit kernel. Does it
come back with 64 it can run both, 32bit and 64bit kernel.
4. How can I activate the 64bit Kernel? Is it even already running??
Since AIX 5.2 the classic kernel /unix is only a link to the real kernel file in /usr/lib/boot. You can follow this link to see which kernel the system is supposed to use. In the below example this link points to /usr/lib/boot/unix_64 what means that your system is set up for a 64bit kernel. However, does this link point to either /usr/lib/boot/unix_up or /usr/lib/boot/unix_mp your system is set up to run the 32bit kernel.
Example:
# ls -l /unix lrwxrwxrwx 1 root system 21 21 Jul 2004 /unix -> /usr/lib/boot/unix_64
Use bootinfo to figure out which kernel the system actually runs:
# bootinfo -K 64
If your system still runs the 32bit kernel and you want to change to 64bit the above link and another link unix in /usr/lib/boot have to be set accordingly:
# cd / # rm -f unix # ln -s /usr/lib/boot/unix_64 unix # cd /usr/lib/boot/ # rm -f unix # ln -s unix_64 unix
After the new links have been set you have to rewrite all BLVs:
# bosboot -a bosboot: Boot image is 19008 512 byte blocks.
After the next reboot your system will run the 64bit kernel.
5. Is it possible to install AIX 5.2 or AIX 5.3 on my box?
Since AIX version 5.2 IBM does not support the whole range of power processor based RS/6000 models anymore. You can issue the command " bootinfo -p " to figure out if your system can be installed with AIX 5.2 or 5.3. Does the command come back with " chrp " your system can run AIX 5.2 or 5.3. Does the command respond " rs6k " or " rspc " however, you cannot install any version of AIX higher 5.1.
# bootinfo -p chrp
Please note that a firmware upgrade might be needed in order to boot from the AIX 5.2 CD!
AIX 6.1 does not support all chrp models!. Particulary 32bit systems are not supported anymore.
6. How do I create users with long login names (more than 8 characters) under AIX 5.3?
Since AIX version 5.3 one can create users with login names longer than 8 characters. In order to create such a login name you first have to enable longer login names. This can be done with:
# chdev -l sys0 -a max_logname=13
The above example allows login names with up to 12 characters.
7. Is it possible to increase the maximum number of PPs beyond 1016?
If you want to integrate a new and larger disk into an existing Volume Group you might run into problems with the the maximum number of PPs of one Physical Volume. The reason is, that when creating a new Volume Group the PP size is often set to the smallest value possible. The number of PPs/PV of a standard Volume Group is limited to 1016. What to do?
You can use chvg -t to increase the number of PPs with a factor of 2,4,16, or 32:
# chvg -t 2 rootvg
With the above command you increase the maximum number of PPs per PV in the rootvg to 2032. But be aware, that you decrease the number of PVs (hdisks) per
VG with the same factor. In this example the rootvg cannot contain more then 16 PVs.
8. How can I list the version of an HMC?
On the HMC commandline you can use lshmc to check the HMC version:
hscroot@hmc:~> lshmc -V "version= Version: 5 Release: 1.0 HMC Build level 20051110.1 MH00464: InfoCenter Update for V5R1.0 (10-27-2005) MH00493: Fixes for leap second handling, DST time and openssl (11-29-2005) MH00507: Maintenance Package for V5R1.0 (12-03-2005) "
You could also use WebSM/wsm to get this information:
- On the left open "Licensed Internal Code Maintenance"
- click on "HMC Code Update"
- In the "Status" area you find the same information you saw with lshmc -V.
If you want to learn more about the HMC commandline interface, you might want to have a look at the HMC Commandline Howto.
9. How can I list the firmware level of a p5 system?
Login to any of the LPARs of your p5 system and issue the command lsmcode:
DISPLAY MICROCODE LEVEL 802811 IBM,9117-570 The current permanent system firmware image is SF235_185 The current temporary system firmware image is SF235_185 The system is currently booted from the temporary firmware image.
10. How can I create a snap suitable for IBM support?
The general command to collect information for the IBM support is snap. First you should remove any old snap files. The easiest way to remove any old snap files is snap -r. To avoid problems when creating the new snap, you should also manually remove the whole subdirectory /tmp/ibmsupt:
# rm -rf /tmp/ibmsupt
# snap -gfiLGc
Checking space requirement for general information........................done.
.
.
.
Creating compressed pax file...
Starting pax/compress process... Please wait... done.
-rw------- 1 0 0 8621905 Mar 2 10:40 snap.pax.Z
You find the compressed snap file under /tmp/ibmsupt/snap.pax.Z. This file should be sent to IBM.
11. What are the correct settings for daylight saving time in Central Europe?
The timezone is set by the TZ environment variable. To set the timezone globally you have to change the TZ variable in /etc/environment. For the central eurpean countries (Brussels time) this variable should be set as follows:
TZ=CET-1CST,M3.5.0/2:00,M10.5/3:00
All services that read the timezone have to be restarted (e.g. cron). A reboot -of course- will restart everything.
Please note that AIX's default time settings for Central Europe are not correct!
12. How can I figure out if a fibrechannel card is linked to a switch port?
Check the status of the FC SCSI I/O Controller Protocol Device:
The below example shows the status of the FC SCSI I/O Controller Protocol Device of the first fibre channel adapter if the system is not connected to the switch (cable is present, but switch port not configured) - attach: none, no SCSI ID:
# lsattr -El fscsi0 attach none How this adapter is CONNECTED False dyntrk no Dynamic Tracking of FC Devices True fc_err_recov delayed_fail FC Fabric Event Error RECOVERY Policy True scsi_id Adapter SCSI ID False sw_fc_class 3 FC Class for Fabric True
... and this is how it looks, if the card is connected to the switch:
# lsattr -El fscsi1 attach switch How this adapter is CONNECTED False dyntrk no Dynamic Tracking of FC Devices True fc_err_recov delayed_fail FC Fabric Event Error RECOVERY Policy True scsi_id 0x610100 Adapter SCSI ID False sw_fc_class 3 FC Class for Fabric True
... and this is how it looks if there is no cable to a switch at all:
# lsattr -El fscsi1 attach al How this adapter is CONNECTED False dyntrk no Dynamic Tracking of FC Devices True fc_err_recov delayed_fail FC Fabric Event Error RECOVERY Policy True scsi_id 0x610100 Adapter SCSI ID False sw_fc_class 3 FC Class for Fabric True
al means Arbitrary Loop. You get this if there is no cable plugged into the fibre channel card. But you also get this
if the system is directly attached to a storage box (e.g. FAStT). In the latter case there is nothing wrong if you see attach: al
13. How can I create a backup ethernet adapter?
You have to create an etherchannel device. First you have to unconfigure the current ethernet
settings on the physical ethernet adapter (en0 in the below example). You also need to
make sure that there is a second physical ethernet adapter available (en1 in the below example).
If these requirements are met you create the etherchannel with the commands below:
# ifconfig en0 detach
# chdev -P -l en0 -a state=down
# mkdev -c adapter -s pseudo -t ibm_ech -a adapter_names=ent0 \
-a backup_adapter=ent1 -a netaddr=192.168.100.1 \
-a num_retries=3 -a retry_time=3
# mkdev -c if -s EN -t en -a netaddr=192.168.100.33 \
-a netmask=255.255.255.0 -w en2 -a state=up -a arp=on
# mkdev -l inet0
The IP address of the first mkdev call belongs to a host (e.g. the gateway) that can be pinged.
The system uses this to figure out if the primary network adapter is still alive. The second mkdev
however, defines the IP address you want to set to your new etherchannel logical device (i.e. the communication IP address of the box).
The system uses the next free number for the etherchannel device (in our example en2).
14. How can I create a dummy disk to reserve an hdisk number?
Below you find a situation where the next LUN that is mapped to your system would get an hdisk number 0 (hdisk0):
# lsdev -Cc disk hdisk1 Available 06-08-00-4,0 16 Bit LVD SCSI Disk Drive hdisk2 Available 06-08-00-5,0 16 Bit LVD SCSI Disk Drive
To avoid this you could reserve hdisk0 for a dummy disk, e.g.:
# mkdev -l hdisk0 -c disk -t osdisk -s scsi -p scsi0 -w 0,10 -d hdisk0 defined
Now we see hdisk0 as defined:
# lsdev -Cc disk hdisk0 Defined 06-08-00-0,10 Other SCSI Disk Drive hdisk1 Available 06-08-00-4,0 16 Bit LVD SCSI Disk Drive hdisk2 Available 06-08-00-5,0 16 Bit LVD SCSI Disk Drive
... and the next LUN would be mapped to hdisk3.
15. How can I figure out the managing HMC (and CSM server) of my LPAR?
To find the managing servers of your LPAR you can use the domain status information - the
ctrmc subsystem must be active in order to do so. You can check with:
# lssrc -s ctrmc Subsystem Group PID Status ctrmc rsct 1151036 active
Is the subsystem indeed active you get the IP address of your HMC with:
# /usr/sbin/rsct/bin/rmcdomainstatus -s ctrmc Management Domain Status: Management Control Points O A 0xccdfc3e608ad7624 0001 192.168.100.10
Is your LPAR also connected to a CSM server you would see two Control Points:
# /usr/sbin/rsct/bin/rmcdomainstatus -s ctrmc Management Domain Status: Management Control Points I A 0x58016857defc1b87 0001 192.168.100.11 I A 0xccdfc3e608ad7624 0002 192.168.100.10
For newer versions of rsct you could also use lsrsrc to get this information:
# lsrsrc -l "IBM.ManagementServer"
Resource Persistent Attributes for IBM.ManagementServer
resource 1:
Name = "192.168.100.10"
Hostname = "192.168.100.10"
ManagerType = "HMC"
LocalHostname = "192.168.100.23"
ClusterTM = "9078-160"
ClusterSNum = ""
ActivePeerDomain = ""
NodeNameList = {"mylpar22-ext"}
resource 2:
Name = "192.168.100.11"
Hostname = "192.168.100.11"
ManagerType = "CSM"
LocalHostname = "mylpar22"
ClusterTM = "9078-160"
ClusterSNum = "10BF571"
ActivePeerDomain = ""
NodeNameList = {"mylpar22-ext"}
16. How can I directly read out the VGDA of a PV (hdisk)?
Information about VGx, LVx, filesystems, etc. are stored in the ODM. But these information are also written to the VGDA of the disks itself. You can read the information directly from the disk's VGDA with a command like this:
# lqueryvg -Atp hdisk100
You can use
# redefinevg -d hdisk100 myvg
to synchronize the ODM with the information of the VGDA. You can also synchronize the VGDA with the information stored in the ODM:
# synclvodm myvg
17. How can I unlock a SAN disk?
Finally I got my LUN mapped to my system, but when I try to create my Volume Group with mkvg -f vpath100
all I get is an I/O error. What can I do?
Probably there is still a SAN lock on the disk. Try to unlock it with:
# lquerypv -ch /dev/vpath100
and retry to create your Volume Group.
18. How can I do a preview of an ML/TL upgrade?
If I want to upgrade an AIX system to a new ML or TL I like to check it first by doing an PREVIEW only. But the result of this action is not very helpful, because I always see that only one fileset will be updated, all the rest is rejected because of dependency failures. However when I start the real update all the other filesets will be upgraded aswell, although the PREVIEW said different.
You have to upgrade the installer separately first (APPLY only). This can be done with a command like this:
# cd /path/to/TL # installp -agX -d. bos.rte.install
Restart the upgrade procedure:
# smitty update_all
Now you can do a PREVIEW only installation and you see which filesets actually would be upgraded. If you decide to not upgrade the system after the preview you can easily role back the installer to the old version with:
# smitty reject
19. How can I archive a directory with backup?
tar on AIX has severe limitations. If I want to archive an directory without these limitations I think about the backup command. But what would be the syntax?
Assuming you want to backup /usr/local the tar command would be something like this:
# tar cvpf /tmp/archive.tar ./usr/local/
You could use the following backup command instead:
# find ./usr/local/ | backup -iqvpf /tmp/archive.bff
To restore the backup you can use the restore command:
# restore -xqvf /tmp/archive.bff
(the corresponding tar command would be tar xvpf /tmp/archive.tar)
20. How can I see the allocated resources of an LPAR w/o checking on the HMC?
Run this command on your LPAR:
$ lparstat -i Node Name : barney Partition Name : mylpar2 Partition Number : 2 Type : Shared-SMT Mode : Uncapped Entitled Capacity : 0.60 Partition Group-ID : 32796 Shared Pool ID : 0 Online Virtual CPUs : 6 Maximum Virtual CPUs : 10 Minimum Virtual CPUs : 1 Online Memory : 3072 MB Maximum Memory : 16384 MB Minimum Memory : 1024 MB Variable Capacity Weight : 80 Minimum Capacity : 0.10 Maximum Capacity : 10.00 Capacity Increment : 0.01 Maximum Physical CPUs in system : 16 Active Physical CPUs in system : 8 Active CPUs in Pool : 8 Unallocated Capacity : 0.00 Physical CPU Percentage : 10.00% Unallocated Weight : 0
21. How can I see statistics about all LPARs sharing the same resources?
There is a special option in topas that allows you to see CPU and Memory usage of the whole CEC:
# topas -C
The output is something like this:
Topas CEC Monitor Interval: 10 Wed Aug 13 17:08:13 2008 Partitions Memory (GB) Processors Shr: 12 Mon:83.0 InUse:20.6 Shr:3.8 PSz: 8 Don: 0.0 Shr_PhysB 0.14 Ded: 0 Avl: - Ded: 0 APP: 7.9 Stl: 0.0 Ded_PhysB 0.00 Host OS M Mem InU Lp Us Sy Wa Id PhysB Vcsw Ent %EntC PhI -------------------------------------shared------------------------------------- vioserver1 A53 U 5.0 1.4 6 3 6 0 90 0.03 177 0.30 10.3 2 vioserver2 A53 U 5.0 1.2 6 3 6 0 90 0.03 257 0.30 10.1 2 mylpar0 A53 U 5.0 3.1 6 2 4 0 92 0.02 195 0.30 7.6 0 mylpar1 A53 U 5.0 2.8 6 0 2 0 96 0.01 363 0.30 4.0 0 mylpar2 A53 U 10 1.5 12 0 0 0 99 0.01 367 0.60 1.2 1 mylpar3 A53 U 18 2.7 8 0 0 0 98 0.01 288 0.40 1.7 0 mylpar4 A53 U 6.0 1.3 2 0 3 0 96 0.01 190 0.10 5.1 0 mylpar5 A53 U 3.0 1.5 12 0 0 0 99 0.01 286 0.60 0.8 0 mylpar6 A53 U 10 1.5 12 0 0 0 99 0.00 231 0.60 0.8 0 mylpar7 A53 U 6.0 1.2 2 0 2 0 97 0.00 176 0.10 4.1 2 mylpar8 A53 U 6.0 1.3 2 0 1 0 97 0.00 135 0.10 3.2 0 mylpar9 A53 U 4.0 1.1 2 0 1 0 97 0.00 132 0.10 3.1 0 Host OS M Mem InU Lp Us Sy Wa Id PhysB Vcsw %istl %bstl Host OS M Mem InU Lp Us Sy Wa Id PhysB Vcsw %istl %bstl------------ ------------------------------------dedicated-----------------------------------
22. How to set a static route?
Of course you can use the route command to set a static route. But this way you don't get it back
after reboot.
To make a route persistent you need to change inet0. First check which routes are already set:
# lsattr -El inet0 -a route route net,-hopcount,0,,0,192.168.1.1 Route True route net,-hopcount,255.255.255.128,,,,,192.168.3.155,192.168.2.1 Route True
These routes would be set with:
# chdev -l inet0 -a route=net,-hopcount,0,,0,192.168.1.1 # chdev -l inet0 -a route=net,-hopcount,255.255.255.128,,,,,192.168.3.155,192.168.2.1
To remove these specific static routes:
# chdev -l inet0 -a delroute=net,-hopcount,0,,0,192.168.1.1 # chdev -l inet0 -a delroute=net,-hopcount,255.255.255.128,,,,,192.168.3.128,192.168.2.1
In this route string 255.255.255.128 is the netmask, 192.168.3.128 the destination net,
and 192.168.2.1 the gateway.
For hostroutes the keyword net has to be replaced with host.
23. How can I force nfs mounts to use reserved ports?
Some UNIX variants such as OpenBSD or Solaris require clients to use reserved ports (below 1024) to mount nfs shares. But AIX uses non-reserved by default when trying to mount an nfs share. However, with the following command you can change the default:
# nfso -o nfs_use_reserved_ports=1
The above command will lose effect after reboot. To make it permanent you use the '-p' switch on AIX 5L and 6:
# nfso -p -o nfs_use_reserved_ports=1
This setting is also respected by the autofs subsystem. But be aware that this setting has to be made before a remote filesystem is actually mounted!
24. How to exclude a directory from being backed up by the mksysb command?
To exclude a directory /var/testdir from being backed up by mksysb add the following line
to the file /etc/exclude.rootvg:
^./var/testdir/
and start mksysb with the '-e' flag:
# mksysb -e -i -X /dir/to/image
25. How can I identify a generic SCSI disk for replacement?
To identify a SCSI disk (attached to a hot swap enclosure) with AIX you can use diag to let it blinking:
# diag
Then select
> Task Selection (Diagnostics, Advanced Diagnostics, Service Aids, etc.)
> Hot Plug Task
> SCSI and SCSI RAID Hot Plug Manager
> Identify a Device Attached to a SCSI Hot Swap Enclosure Device
You see the following screen providing you with a list of hdisks. Select the one you need to identify:
IDENTIFY DEVICE ATTACHED TO SCSI HOT SWAP ENCLOSURE DEVICE
The following is a list of devices attached to SCSI Hot Swap Enclosure devices.
Selecting a slot will set the LED indicator to Identify.
Make selection, use Enter to continue.
U0.1-
ses2 P1-I1/Z1-Af
slot 1 P1-I1/Z1-A8 hdisk2
slot 2 P1-I1/Z1-A9 hdisk3
slot 3 P1-I1/Z1-Aa hdisk4
slot 4 P1-I1/Z1-Ab hdisk5
slot 5 P1-I1/Z1-Ac hdisk6
slot 6 P1-I1/Z1-Ad hdisk7
slot 7 P1-I1/Z1-Ae hdisk8
U0.1-
ses3 P1-I5/Z1-Af
slot 1 P1-I5/Z1-A0 hdisk9
slot 2 P1-I5/Z1-A1 hdisk10
slot 3 P1-I5/Z1-A2 hdisk11
slot 4 P1-I5/Z1-A3 hdisk12
slot 5 P1-I5/Z1-A4 hdisk13
slot 6 P1-I5/Z1-A5 hdisk14
slot 7 +------------------------------------------------------+
| |
| The LED should be in the Identify state for the |
| selected device. |
| |
| Use 'Enter' to put the device LED in the |
| Normal state and return to the previous menu. |
| |
| F3=Cancel F10=Exit Enter |
+------------------------------------------------------+
F1=Help F10=Exit
If you already removed the hdisk with the rmdev command you would still see the slot in the
above screen but no device name.
26. How can I extract a compressed tar archive under AIX?
First of all: You need gzip/bzip2 to be installed on your AIX box. However gnutar is not required - you could use the AIX tar as shown below:
# gzip -d -c archiv.tgz | tar xvf -
If you only want to have a deeper look into the archive, type:
# gzip -d -c archiv.tgz | tar tvf -
It's a bzip2 compressed archive - then type
# bzip2 -d -c archiv.tgz | tar xvf -
27. How can I change the the name of a tape device?
You can rename a tape device (i.e. rmtX or smcX) easily with chdev. For example, if you want to rename rmt0 to rmt201 just type:
# chdev -l rmt0 -a new_name=rmt201 rmt0 changed
Please note: It only works with tapes! This is because IBM defined a special attribute new_name in the ODM
only for tape drives and media changers.
28. Can I identify deleted files still opened by a process?
Just run fuser -V -d on the filesystem you want to check for deleted but still opened files. This is an example for /tmp:
# fuser -V -d /tmp /tmp: inode=7 size=56 fd=2 512238
The PID points to the process which still has an open file descriptor to the deleted file:
# ps uxwww -p 512238 USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND root 512238 0.0 0.0 1728 1352 - A Mar 20 3:29 /usr/sbin/rsct/bin/ctcasd
29. How to view the current SMT mode settings and processor information
You can use smtctl to get the information. Below is an example:
# smtctl This system is SMT capable. SMT is currently enabled. SMT boot mode is not set. SMT threads are bound to the same virtual processor. proc0 has 2 SMT threads. Bind processor 0 is bound with proc0 Bind processor 1 is bound with proc0 proc2 has 2 SMT threads. Bind processor 2 is bound with proc2 Bind processor 3 is bound with proc2
unixwerk