Monday, March 29, 2010

AIX QUICK SHEET

Filesystems

/dev/hd1 /home
/dev/hd2 /usr
/dev/hd3 /tmp
/dev/hd4 / root
/dev/hd5 BLV (Boot Logical Volume)
/dev/hd6 Paging space
/dev/hd8 JFS2 log
/dev/hd9var /var
/dev/hd10opt /opt
/dev/hd11admin /admin New in 6.1
livedump /var/adm/ras/livedump New in 6.1 TL3
/proc procfs pseudo filesystem
Remove mount point entry and the LV for /mymount
rmfs /mymount (Add -r to remove mount point)

Grow the /var lesystem by 1 Gig
chfs -a size=+1G /var

Grow the /var lesystem to 1 Gig
chfs -a size=1G /var

Find the file usage on a fi lesystem
du -smx /

List filesystems in a grep-able format
lsfs

Get extended information about the /home filesystem
lsfs -q /home

Create a log device on datavg VG
mklv -t jfs2log -y datalog1 datavg 1

Format the log device just created
logform /dev/datalog1

Kernel Tuning

- no is used in the following examples. vmo, no, nfso, ioo, raso, and schedo all use similar syntax. lvmo uses di fferent syntax.

Reset all networking tunable to the default values
no -D (Changed values will be listed)

List all networking tunable
no -a

Set a tunable temporarily (until reboot)
no -o use isno=1

Set a tunable at next reboot
no -r -o use isno=1

Set current value of tunable as well as reboot
no -p -o use isno=1

List all settings, defaults, min, max, and next boot values
no -L

List all sys0 tunables
lsattr -El sys0

Get information on the minperm% vmo tunable
vmo -h minperm%

Change the maximum number of user processes to 2048
chdev -l sys0 -a maxuproc=2048

Check to see if SMT is enabled
smtctl

Directory containing tunables settings
/etc/tunables/

ODM
Query CuDv for a specific item
odmget -q name=hdisk0 CuDv

Query CuDv using the \like" syntax
odmget -q "name like hdisk?" CuDv

Query CuDv using a complex query
odmget -q "name like hdisk? and parent like vscsi?" CuDv

Devices
List all devices on a system
lsdev

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

List all customized (existing) device classes (-P for complete list)
lsdev -C -r class

Remove hdisk5
rmdev -dl hdisk5

Get device address of hdisk1
getconf DISK DEVNAME hdisk1 (or) bootinfo -o hdisk1

Get the size (in MB) of hdisk1
getconf DISK SIZE /dev/hdisk1 (or) bootinfo -s hdisk1

List all disks belonging to scsi0
lsdev -Cc disk -p scsi0

Find the slot of a PCI Ethernet adapter
lsslot -c pci -l ent0

Find the (virtual) location of an Ethernet adapter
lscfg -l ent1

Find the location codes of all devices in the system
lscfg

List all MPIO paths for hdisk0
lspath -l hdisk0

Find the WWN of the fcs0 HBA adapter
lscfg -vl fcs0 | grep Network

Temporarily change console output to /console.out
swcons /console.out -> (Use swcons to change back.)

Get statistics and extended information on fcs0
fcstat fcs0

Tasks
Change port type of HBA (This may vary by HBA vendor)
rmdev -d -l fcnet0
rmdev -d -l fscsi0
chdev -l fcs0 -a link type=pt2pt
cfgmgr

Mirroring rootvg to hdisk1
extendvg rootvg hdisk1
mirrorvg rootvg
bosboot -ad hdisk0
bosboot -ad hdisk1
bootlist -m normal hdisk0 hdisk1

Mount a CD/DVD ROM to /mnt

mount -rv cdrfs /dev/cd0 /mnt -> (for a CD)
mount -v udfs -o ro /dev/cd0 /mnt -> (for a DVD)
-> Note the two di erent types of read-only flags. Either is Ok.

Create a VG, LV, and FS, mirror, and create mirrored LV

mkvg -s 256 -y datavg hdisk1 (PP size is 1/4 Gig)
mklv -t jfs2log -y dataloglv datavg 1
logform /dev/dataloglv
mklv -t jfs2 -y data01lv datavg 8 -> (2 Gig LV)
crfs -v jfs2 -d data01lv -m /data01 -A yes
extendvg datavg hdisk2
mklvcopy dataloglv 2 -> (Note use of mirrorvg in next example)
mklvcopy data01lv 2
syncvg -v datavg
lsvg -l datavg will now list 2 PPs for every LP
mklv -c 2 -t jfs2 -y data02lv datavg 8 -> (2 Gig LV)
crfs -v jfs2 -d data02lv -m /data02 -A yes
mount -a

Move a VG from hdisk1 to hdisk2

extendvg datavg hdisk2
mirrorvg datavg hdisk2
-> Wait for mirrors to synchronize
unmirrorvg datavg hdisk1
reducevg datavg hdisk1

Find the free space on PV hdisk1
lspv hdisk1 ! (Look for \FREE PPs")

Additional Information
http://publib.boulder.ibm.com/infocenter/systems/scope/aix
http://www.redbooks.ibm.com/portals/unix
Display error codes can be found in the \Diagnostic Information for Multiple Bus Systems" manual

About this QuickSheet
Created by: William Favorite (wfavorite@tablespace.net)
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 specfi c system. Research any and all commands that you inflict upon your command line.
Distribution: The PDF version is free to redistribute as long as credit to the author and tablespace.net is retained in the printed and viewable versions. LATEX source not distributed at this time.