Practical Guide to AIX

http://aix4admins.blogspot.de/2011/05/server-computer-that-makes-its-file.html(external link)

Kompatibilität zu anderen OS Systemen

On some AIX 6.1 instances, you can not mount NFS shares from a LINUX server. The root of the error lies in how AIX handles its NFS ports. You can configure AIX to use the standard NFS ports so that it can successfull connect to LINUX NFS service.
Run below comand to setup AIX NFS options to use the proper ports for Linux NFS mounts to activate portcheck:
nfso -p -o nfs_use_reserved_ports=1

To deactivate portcheck:
nfso -p -o nfs_use_reserved_ports=0

f this setting does not survive a reboot, you can manually edit /etc/tunables/nextboot file as follows:
nfso:         nfs_use_reserved_ports = 1

and run:
tuncheck -f /etc/tunables/nextboot

Then NFS share could mount normally. Below example show how to mount the share temporar:
mount nfsserver:/exported/share /mnt

Mounting ISO images in AIX 6 and 7

loopmount -i [ISOFILE] -o "-V cdrfs -o ro" -m [MOUNTPOINT]

How do I find OS version

oslevel -r

I prefer the command, because his shows if you are missing fileset fixes for the level you are
instfix -i|grep ML


find/display your MAC

As the root user type:
"netstat -ia"

From the displayed information, find the Ethernet adapter (the name changes based on the Ethernet card installed)
Locate the number below Address. This is your MAC address
Name  Mtu   Network     Address            Ipkts Ierrs    Opkts Oerrs  Coll
en0   1500  link#2      0.11.25.a6.8d.0   3430437     0  1564706     4     0

define static routes

using chdev to list/add/change/remove routing
list routing information
lsattr -El inet0 -a route

odmget -q "attribute=route" CuAt

netstat -nr

add default route
route add 0

chdev -l inet0 -a route="net,,0,"

add route from network with gateway and netmask to network
chdev -l inet0 -a route="net,-hopcount,0,-netmask,255,255,255,0,,,,,-static,,"

delete default route
route delete default

delete route that is listed above by lsattr or odmget
chdev -l inet0 -a delroute="STRING from above"

After updating the routing, you need to use mkdev to refresh it.
mkdev -l inet0

AIX QuickSheet


command description
lsdev List all devices on a system
lsdev -Cc disk List all disk devices on a system (See next item for a list of classes)


List all customized (existing) device classes (-P for complete list)
lsdev -C -r class
Remove hdisk5
rmdev -dl hdisk5
BLV (Boot Logical Volume) Get device address of hdisk1
getconf DISK DEVNAME hdisk1 ⇐or⇒ bootinfo -o hdisk1
Paging space
Get the size (in MB) of hdisk1
JFS2 log
getconf DISK SIZE /dev/hdisk1 ⇐or⇒ bootinfo -s hdisk1
List all disks belonging to scsi0
lsdev -Cc disk -p scsi0
hd11admin /admin
New in 6.1
Find the slot of a PCI Ethernet adapter
New in 6.1 TL3
lsslot -c pci -l ent0
procfs pseudo filesystem
Find the (virtual) location of an Ethernet adapter
lscfg -l ent1
Remove mount point entry and the LV for /mymount
Find the location codes of all devices in the system
rmfs /mymount (Add -r to remove mount point)
Grow the /var filesystem by 1 Gig
List all MPIO paths for hdisk0
chfs -a size=+1G /var
lspath -l hdisk0
Grow the /var filesystem to 1 Gig
Find the WWN of the fcs0 HBA adapter
chfs -a size=1G /var
lscfg -vl fcs0 | grep Network
Find the file usage on a filesystem
Temporarily change console output to /console.out
du -smx /
swcons /console.out → (Use swcons to change back.)
List filesystems in a grep-able format
Get statistics and extended information on fcs0
fcstat fcs0
Get extended information about the /home filesystem
lsfs -q /home
Create a log device on datavg VG
Change port type of HBA (This may vary by HBA vendor)
mklv -t jfs2log -y datalog1 datavg 1
rmdev -d -l fcnet0
Format the log device just created
rmdev -d -l fscsi0
logform /dev/datalog1
chdev -l fcs0 -a link type=pt2pt
Kernel Tuning
Mirroring rootvg to hdisk1
• no is used in the following examples. vmo, no, nfso, ioo, raso, and
extendvg rootvg hdisk1
schedo all use similar syntax. lvmo uses different syntax.
mirrorvg rootvg
Reset all networking tunables to the default values
bosboot -ad hdisk0
no -D (Changed values will be listed)
bosboot -ad hdisk1
List all networking tunables
bootlist -m normal hdisk0 hdisk1
no -a
Mount a CD/DVD ROM to /mnt
Set a tunable temporarily (until reboot)
mount -rv cdrfs /dev/cd0 /mnt → (for a CD)
no -o use isno=1
mount -v udfs -o ro /dev/cd0 /mnt → (for a DVD)
Set a tunable at next reboot
→ Note the two different types of read-only flags. Either is Ok.
no -r -o use isno=1
Create a VG, LV, and FS, mirror, and create mirrored LV
Set current value of tunable as well as reboot
mkvg -s 256 -y datavg hdisk1 (PP size is 1/4 Gig)
no -p -o use isno=1
mklv -t jfs2log -y dataloglv datavg 1
List all settings, defaults, min, max, and next boot values
logform /dev/dataloglv
no -L
mklv -t jfs2 -y data01lv datavg 8 → (2 Gig LV)
List all sys0 tunables
crfs -v jfs2 -d data01lv -m /data01 -A yes
lsattr -El sys0
extendvg datavg hdisk2
Get information on the minperm% vmo tunable
mklvcopy dataloglv 2 → (Note use of mirrorvg in next example)
vmo -h minperm%
mklvcopy data01lv 2
Change the maximum number of user processes to 2048
syncvg -v datavg
chdev -l sys0 -a maxuproc=2048
lsvg -l datavg will now list 2 PPs for every LP
Check to see if SMT is enabled
mklv -c 2 -t jfs2 -y data02lv datavg 8 → (2 Gig LV)
crfs -v jfs2 -d data02lv -m /data02 -A yes
Directory containing tunables settings
mount -a
Move a VG from hdisk1 to hdisk2
extendvg datavg hdisk2
mirrorvg datavg hdisk2
Query CuDv for a specific item
→ Wait for mirrors to synchronize
odmget -q name=hdisk0 CuDv
unmirrorvg datavg hdisk1
Query CuDv using the “like” syntax
reducevg datavg hdisk1
odmget -q "name like hdisk?" CuDv
Find the free space on PV hdisk1
Query CuDv using a complex query
lspv hdisk1 → (Look for “FREE PPs”)
odmget -q "name like hdisk? and parent like vscsi?" CuDv
• The entX is the physical device. It is associated with physical layer
settings such as link speed, and duplex. enX and etX determine the
frame type run on entX . IP addresses are configured on enX (Standard
Ethernet) or etX (802.3). Typically only enX is used.
• The examples here assume that the default TCP/IP configuration
(rc.net) method is used. If the alternate method of using rc.bsdnet
is used then some of these examples may not apply.
Determine if rc.bsdnet is used over rc.net
lsattr -El inet0 -a bootup option
TCP/IP related daemon startup script
To view the route table
netstat -r
To view the route table from the ODM DB
lsattr -EHl inet0 -a route
Temporarily add a default route
route add default
Temporarily add an address to an interface
ifconfig en0 netmask
Temporarily add an alias to an interface
ifconfig en0 netmask alias
To permanently add an IP address to the en1 interface
chdev -l en1 -a netaddr= -a netmask=0xffffff00
Permanently add an alias to an interface
chdev -l en0 -a alias4=,
Remove a permanently added alias from an interface
chdev -l en0 -a delalias4=,
List ODM (next boot) IP configuration for interface
lsattr -El en0
Permanently set the hostname
chdev -l inet0 -a hostname=bombay
List networking devices
lsdev -Cc tcpip
List Network Interfaces
lsdev -Cc if
List attributes of inet0
lsattr -Ehl inet0
List (physical layer) attributes of ent0
lsattr -El ent0
List (networking layer) attributes of en0
lsattr -El en0
Set (desired) speed is found through the entX device
lsattr -El ent0 -a media speed
Find actual (negotiated) speed, duplex, and link
entstat -d ent0
→ The interface must be up (ifconfig en0 up) for stats to be valid
Set the ent0 link to Gig full duplex
chdev -l ent0 -a media speed=1000 Full Duplex -P
→ Auto Negotiation is another option
Turn off Interface Specific Network Options
no -p -o use isno=0
Get (long) statistics for the ent0 device (remove -d for shorter results)
entstat -d ent0 ⇐or⇒ netstat -v ent0
→ The results of entstat vary by device type. Virtual, physical, and
IVE (LHEA) devices all produce different results.
List all open, and in use TCP and UDP ports
netstat -anf inet
List all LISTENing TCP ports
netstat -na | grep LISTEN
Remove all TCP/IP configuration from a host
Flush the netcd DNS cache
netcdctrl -t dns -e hosts -f
• Hostname lookup order is determined using /etc/irs.conf,
/etc/netsvc.conf and then $NSORDER. irs.conf and $NSORDER
are typically not used.
• IP packets can be captured using iptrace / ipreport or tcpdump