AIX related several QAs

Boot Related QAs

To change the console to the default physical LFT display
# chcons /dev/lft0

How to run 64BIT application on 32 bit kernel
# Smitty -> System Environments ->Enable 64bit Application environment
or
# /etc/methods/cfg64

How to verify /display the list of bootable PVs ?
# ipl_varyon -i

How to start local daemons at system startup
AIX does neither use the BSD style rc.local file nor the System V style /etc/rc*.d startup files
directories. To add local daemons to the system startup sequence in a BSD rc.local style use the
following command to create an /etc/inittab entry:
# mkitab -i rcnfs "rclocal:2:wait:/etc/rc.local >/dev/console 2>&1"
# touch /etc/rc.local
# chmod 700 /etc/rc.local
Then put the command lines to start the daemons in /etc/rc.local

Device and resource related QAs

Add Path to available Data Path Devices
# /usr/sbin/addpaths

To disable the paths between scsi0 and the hdisk1 disk device
# chpath -l hdisk1 -p scsi0 -s disable

To clean up failed software installation
# installp -C

To compare two directory
# dircmp /dir1 /dir1

To configure vpath devices
# cfallvpath

Datapath set device example
# datapath set device 0 13 policy rrs
rr, where rr indicates round robin, rrs, where rrs indicates round robin sequential
lb, where lb indicates load balancing ( also known as optimized policy )
lbs, where lbs indicates load balancing sequential (AIX and Linux Only)
df, where df indicates the default policy, which is load balancing
fo, where fo indicates failover policy

To display the value of the ARG_MAX variable
# getconf ARG_MAX

To display the value of the NAME_MAX variable for the /usr directory
# getconf NAME_MAX /usr

To determine the disk size for disk hdisk0
# getconf DISK_SIZE /dev/hdisk0

To determine the real memory size
# getconf REAL_MEMORY
or
# lsattr –El mem0 –F "attribute value"
or
# lsattr -El mem0 | grep "goodsize"

To determine if the machine hardware is 32-bit or 64-bit
# getconf HARDWARE_BITMODE

To determine if the kernel is 32-bit or 64-bit
# getconf KERNEL_BITMODE

To get the information for hdisk0
# lscfg -vpl hdisk0

To display all the disks
# lsdev -Cc disks

To display all the attribute of hdisk0
# lsattr -El hdisk0

To change the tape block size to variable length
# chdev -l rmt0 -a block_size=0

To display the microcode level for all supported devices
# lsmcode -A

To display the system firmware level and service processor (if present), type:
# lsmcode -c

To display the system firmware level and service processor (if present) in raw mode
# lsmcode -r

To display the adapter microcode levels for a RAID adapter scraid0
# lsmcode -r -d scraid0

To display the microcode level for a tape drive rmt0
# lsmcode -r -d rmt0

To list bus attributes for the device ent0
# lsresource -l ent0

To list bus attributes for all devices associated with ent0
# lsresource -a -l ent0

To list parent devices in the Customized Devices of rs232 device
# lsparent -C -k rs232

To list possible types of parent devices
# lsparent -P -k rs232

To list all of the possible connection locations on the sa2 IBM 8-Port
EIA-232/RS-422A (PCI) Adapter that will accept an RS-232 device connection
# lsconn -p sa2 -k rs232
# lsconn -p vsa0
# lsconn -p vsa0

To enable dynamic tracking of fiber channel device
# chdev -l fscsi0 -a dyntrk=yes

Fast-T command
# fget_config -Av

To find the devices in pre defined subclass. Example
# lsdev -P -H
then run
# lsdev -Cc adapter -Fname -spciex -- pci expressbus adapters
# lsdev -Cc adapter -Fname -spci --pci adapters

Format & Certify DVDRAM media
# diag -c -d deviceName -T"format [-s{initialize|fmtcert}]"

Initialiaze will format media without certifying bad blocks
# fmtcrt will format and certify media

How to add a tty on RS232 Port SA0 (for Serial Console)
# mkdev -c tty -t tty -s rs232 -p sa0 -w 0 -a login=enable -a speed=9600

To check the integrety of tape
# tapechk 3

To copy from one streaming tape to a 9-track tape
# tcopy /dev/rmt0 /dev/rmt8

To Display all the VLAN Adapter
# lsdev -Cc adapter -t eth -s vlan

How to find the system id number of an IBM AIX server
# lsattr -El sys0 -a systemid
# uname -u
# lscfg -vp | grep -p "System VPD:"| grep -i Serial

How to list all supported disk or tape
# lsdev -Pc disk -F "type subclass description"
# lsdev -Pc tape -F "type subclass description"

How to modify Asynchronous I/O variables in AIX
To modify the minservers asynchronous I/O variable (MINIMUM number of servers) in IBM AIX
# chdev -l aio0 -a minservers='1'

To modify the maxservers asynchronous I/O variable (MAXIMUM number of servers per cpu) in IBM AIX 5L
# chdev -l aio0 -a maxservers='10'

To modify the maxservers asynchronous I/O variable (MAXIMUM number of servers) in IBM AIX v4.3
# chdev -l aio0 -a maxservers='80'

To modify the requests asynchronous I/O variable (Maximum number of REQUESTS) in IBM AIX
# chdev -l aio0 -a requests='4096'

How to move a tty to another port
# chdev -l tty0 -p sa1 -w 0

How to run diagonostic on all SCSI Devices withour user interaction including fcs
# diag -S 5 -c

How to list all FC Adapters
# lsparent -C -k iocb;lsparent -C -k qiocb;lsparent -C -k qliocb
or
# lsdev -Cc adapter|grep -i fcs

How to list all graphics adapter
# lsdisp

To display all devices
# getdev

To list devices which are of type "logical_volume"
# getdev type=logical_volume

To list devices which are not of type "logical_volume"
# getdev type!=logical_volume

To list devices which are of type "logical_volume" or whose device alias is "sys0"
# getdev type=logical_volume alias=sys0

To list devices which are of type "logical_volume" and whose device alias is "lv01"
# getdev -a type=logical_volume alias=lv01

To display devices for which the status attribute is defined
# getdev status:*

To display devices for which the desc attribute is not defined
# getdev desc!:*

To list the names of all of the resource classes, enter:
# lsactdef

To list the public resource action definitions for resource class IBM.AuditLog, enter:
# lsactdef IBM.AuditLog

To list all conditions and their monitoring status
# lscondition

To list general information about the condition "FileSystem space used" in long form
# lscondition "FileSystem space used"

To list the command that would create the condition "FileSystem space used"
# lscondition -C "FileSystem space used"

To list all conditions that have the string space in their names,
# lscondition space

To list the conditions that are in error
# lscondition -e

To list all conditions and their monitoring status in a clustered system
# lscondition -a

To display a summary of the effective rset attached to pid 28026
# lsrset -p 28026

To display the online resources in the effective rset attached to pid 28026, type:
# lsrset -o -p 28026

To display all the resources in the effective rset attached to pid 28026, type:
# lsrset -v -p 28026

To display online resources for all rsets in the system registry, type:
# lsrset -a -o

To display all resources for all rsets in the system registry with expanded user and group name
# lsrset -X -v -a

To display all resources for all rsets in the system registry, type:
# lsrset -v -a

To display attributes and their values for all attributes that have one or more properties
# lsrsrc -p 0x0a

To list the names of all of the resource classes
# lsrsrc

To list both the persistent and dynamic attributes for the resource class IBM.Condition
# lsrsrc -c -A b -p 0 IBM.Condition

To turn on error checking capabilities of all system components
# errctrl errcheckon

To find a physical location of a disk example
# lsdev -Cc disk -l hdisk0 -F "name location"
or
# lscfg -vpl hdisk0

To display optical Jukebox device
# lsdev -Cc rwoptical

How to change the console to tty0 if tty0 not available

# smitty devices
add a tty
tty rs232 Asynchronous terminal
sa0
in next screen select port to 0, baud rate to 9600 and Enable Login to enable
and hit enter

IBM 3594 tape testing commands example using mtlib
# mtlib -l /dev/lmcp0 -D -E
# mtlib -l /dev/lmcp0 -qV -V YZA456
# mtlib -l /dev/lmcp0 -f /dev/rmt4 -m -V YZA456
# mtlib -l /dev/lmcp0 -qM
# mtlib -l /dev/lmcp0 -f /dev/rmt4 -d -V YZA456
# mtlib -l /dev/lmcp0 -qM
#mtlib -l /dev/lmcp0 -x 342280 -m -V A00020
#tar -cvf /dev/rmt1 /etc (note: rmt1 maps to serial number 342280

checked with the "lscfg -l rmt1 -v" command)

#mtlib -l /dev/lmcp0 -x 342280 -d -V A00020
# mtlib -l /dev/lmcp0 -f /dev/rmt1 -m -V A00020

User & Security related QAs

To add someone to existing group
(Example: add sid and sharah to the finance group, which currently only has
john as a member)
# chgroup users=sam,carol,frank finance

Change an users failed login count
# chsec -f /etc/security/lastlog -a "unsuccessful_login_count=0" -s 'sid'

Change password history size in aix
# chuser histsize=0 username

To change the authorizations of the role ManageUserBasic to PasswdAdmin
# chrole authorizations=PasswdAdmin ManageUserBasic

To enable user sid to access this system remotely
# chuser rlogin=true sid

To change the expiration date for the davis sid account to 8 a.m., 6 May, 2015
# chuser expires=0601082015 sid

To add sid to the groups finance and accounting
# chuser groups=finance,accounting sid

To disable remote login for user sid, created to use LDAP
# chuser -R LDAP rlogin=false sid

To display list of all valid user id
# dispuid

To display all the security roles defined
#lsrole -c ALL

To display all system identifications for the current user, enter:
# id

To display all group ID numbers for the current user
# id -G

To display all group names for the current user
# id -Gn

To display the real group name for the current user
# id -gnr

To display the login UID after logging in as root and running the su command to user
# id -lu

To display the primary group name of the user who actually logged in
# id -lgn

To display the primary group ID of the user who actually logged in, type:
# id -lg

To disable displaying user name during login
# chsec -f /etc/security/login.cfg -s default -a usernameecho=false

How to specify the usernameecho attribute for a specific port lft0
(graphics console device)
# chsec -f /etc/security/login.cfg -s /dev/lft0 -a usernameecho=false

To set a password for user root
# pwdadm root

To query the password status for user root
# pwdadm -q root

To change the user sid to be a member of the system group
# usermod -g system sid

To change the shell to /usr/bin/ksh for sid
# chsh sid /usr/bin/ksh

To remove jones as an administrator of the f612 group
# chgrpmem -a - jones f612

To add members davis and edwards to group f612,
# chgrpmem -m + davis,edwards f612

To remove jones as an administrator of the f612 group
# chgrpmem -a - jones f612

To add members davis and edwards to group f612,
# chgrpmem -m + davis,edwards f612

To list members and administrators of group staff
# chgrpmem staff

To list members of the LDAP I&A loadable module group monsters
# chgrpmem -R LDAP monsters

How to changes a user's gecos information
# chfn username

How to disable TCB
# odmget -q attribute=TCB_STATE PdAt | sed 's/tcb_enabled/tcb_disabled/' \
| odmchange -o PdAt -q attribute=TCB_STATE

How to enable TCB back
# odmget -q attribute=TCB_STATE PdAt | sed 's/tcb_disabled/tcb_enabled/' \
| odmchange -o PdAt -q attribute=TCB_STATE

How to display all attribute of a user sid
# lsuser -f sid

How to display all groups and member of a machine
# lsgroup ALL

How to unlock a user
# chuser account_locked=false user_name
or
# chsec -f /etc/security/user -a account_locked=false -s user_name

How to lock a user
# chuser account_locked=true user_name
or
# chsec -f /etc/security/user -a account_locked=true -s user_name

How to set IBM AIX for full core dumps to unlimited
# ulimit -c unlimited

To set IBM AIX for files to unlimited
# ulimit -f unlimited

To view your ulimit settings
# ulimit –a

To change the default ulimit setting
# chsec -f /etc/security/limits -s default -a fsize=-1

To list all conditions with their linked responses
# lscondresp

To list information about the condition "FileSystem space used"
# lscondresp "FileSystem space used"

To list information about the condition "FileSystem space used" for responses that are active
# lscondresp -a "FileSystem space used"

To list all of the responses, run this command
# lsresponse

To see which resources are locked
# lsresponse -U

To list general information about the response "Critical notifications"
# lsresponse "Critical notifications"

To list the command that would create the response "Critical notifications" along with one of
its actions
# lsresponse -C "Critical notifications"

To list all responses that have the string E-mail in their names
# lsresponse "E-mail"

To list the number of unsuccessful login attempts by the root user since the last successful login of
the root user
# lssec -f /etc/security/lastlog -s root -a unsuccessful_login_count

To list the times that logins are allowed on the /dev/tty2 port
# lssec -f /etc/security/login.cfg -s /dev/tty2 -a logintimes

To list the default setting for the tpath attribute and the ttys attribute in colon forma,
# lssec -c -f /etc/security/user -s default -a tpath -a ttys

How t suppress g login messages
# touch .hushlogin

How to turn on process accounting
# Either by adding the following line to the /etc/rc file or by deleting the comment symbol (#)
in front of the line # /usr/bin/su - adm -c /usr/sbin/acct/startup

How to change a users attribute like pasword length
# chsec -f /etc/security/user -s sid -a minlen=8
or
# chuser minlen=8 sid

To disable all non root user login in AIX
Create /etc/nologin. When a non-root user attempts to login, the system blocks the login and displays
the contents of the /etc/nologin file.

To enable user login,
Delete the /etc/nologin file.

Performance Related QAs

AIX IPTRACE Example
# startsrc -s iptrace -a /tmp/nettrace
or
# startsrc -s iptrace -a "-a -p 2049 /tmp/iptrace.server.bin"
# stopsrc -s iptrace
# ipreport /tmp/nettrace

How to capture TCPIP packet information in IBM AIX
# iptrace -a -d host_destination -b /tmp/ip.out

iptrace will run in the background and results will be in /tmp/ip.out

To see the results of the trace
# ipreport /tmp/ip.out more

Don't foregt to kill iptrace when you're done:
# ps -ef grep iptrace grep -v grep awk '{system("kill " $2)}'

Some other cool options of iptrace:

-d : specify destination IP address -s : specify origin IP address

-b : show 2-way traffic (as in "-s xxx -b" or "-d xxx -b")

-a : no ARP requests (less pollution in the trace)

To see all packets going in and out of server, unixserv, without ARP requests:
# iptrace -a -d unixserv -b /tmp/ip.out

To list the current and reboot value, range, unit, type, and dependencies of all tunables
parameters that are managed by the ioo command
# ioo -L

To display help on j2_nPagesPerWriteBehindCluster
# ioo -h j2_nPagesPerWriteBehindCluster

To set maxrandwrt to 4 after the next reboot
# ioo -r -o maxrandwrt=4

To permanently reset all ioo tunable parameters to default
# ioo -p -D

To list the reboot value of all ioo parameters
# ioo -r -a

To list (spreadsheet format) the current and reboot value, range, unit, type and dependencies of all
tunables parameters managed by the ioo command
# ioo -x

To display the value for the pv_pbuf_count, type the following:
# lvmo -v rootvg -o pv_pbuf_count

To set the pv_pbuf_count value to 2048, type the following:
# lvmo -v rootvg -o pv_pbuf_count=2048

To generate pbuf and blocked I/O statistics, type the following:
# lvmo -a

To run the ls command and write information concerning events in set 5 from hardware counters
# hpmcount -s 5 ls

To run the ls command and write information concerning events in sets 5, 2, and 9 from hardware counters
using the counter multiplexing mode
# hpmcount -s 5,2,9 ls

To show valid values for shm_1tb_shared tunable parameter
# vmo -F -L shm_1tb_shared

Few VMO syntaxed to set various memory options
# vmo -p -o maxfree=128
# vmo -p -o minperm%=5
# vmo -p -o maxclient%=10
# vmo -p -o maxperm%=10
# vmo -p -o maxfree=632
# vmo -p -o minfree=600
# ioo -p -o maxpgahead=32

Display Maximum number of processes a user can have:
# lsattr -El sys0 -a maxuproc
(maxuproc 128 Maximum number of PROCESSES allowed per user True)

To change it to 256 from 128
# chdev -l sys0 -a maxuprc=256
sys0 changed

To display the new value
# lsattr -El sys0 -a maxuproc
( maxuproc 256 Maximum number of PROCESSES allowed per user True)

To change it to 256 from 128
# chdev -l sys0 -a maxuprc=256
sys0 changed

To display the new value
# lsattr -El sys0 -a maxuproc
( maxuproc 256 Maximum number of PROCESSES allowed per user True)

To change Maximum Socket Buffer size to 131072
# no -o sb_max=131072

To change maximum nfs socket size
# nfso -o nfs_socketsize=130972


LVM/Filesystems/Files Related QAs

To change the interphysical volume allocation policy of logical volume testlv to minimum
# chlv-e m testlv

To change the permission of logical volume testlv to read-only
# chlv -p r testlv

To change the type to paging and the maximum number of physical volumes to 10 for logical
volume testlv
# chlv -t paging -u 10 lv03

To convert a JFS2 file system to a version which can support NFS4 ACLs
# chfs -a ea=v2 /test

To copy the contents of logical volume fslv03 to a new logical volume
(The new logical volume will be created and placed in the same volume group as fslv03 and
will be named by the system.
# cplv fslv03

To copy the contents of logical volume fslv03 to a new logical volume in volume group vg02
(the new logical volume will be created, named, and added to volume group vg02)
# cplv -v vg02 fslv03

To copy the contents of logical volume lv02 to a smaller, existing logical volume, lvtest,
without requiring user confirmation.
# cplv -e lvtest -f lv02

To display the placement of file blocks of a file
# fileplace -v /usr/bin/ls
# fileplace -p /usr/bin/ls

To display the information in the i-node corresponding to the /usr/bin/ksh file
# istat /usr/bin/ksh

Extendvg problem lvm call returned

First Check
# lsvg -p rootvg

And now run
# lsdev -Cl hdisk1
# lqueryvg -Atp hdisk1

Match the output for hdisk1 then run
# redefinevg -d hdisk1 rootvg
# synclvodm -Pv rootvg
# syncvg -l rootvg
# extendvg rootvg hdisk0

Find a file used by a process
# fuser filename ( full path)

Find and remove syntax example of removing all htm files
# find /utility -name "*.htm*" -exec rm {} \;

To generate a core file named "core.1095" for the process with process ID 1095
# gencore 1095 core.1095
(The creates the core file without terminating the process)

To get all the charactiractics of a disk in a vg
# lqueryvg -Atp hdisk2

Example to check two filesystems
# dfsck -p /dev/testlv1 - -p /dev/testlv2
or simply
# dfsck /dev/testlv1 /dev/testlv2

To create a FIFO special file with permissions prw-r--r--
# mkfifo -m 644 /tmp/myfifo

To create a FIFO special file using the - (minus sign) operand to set permissions of prw-r-----,
# mkfifo -m g-w,o-rw /tmp/fifo2

How to list the filesystems in a volume group in IBM AIX
# lsvgfs volume_group_name

To join the original volume group, testvg, with the snapshot volume group snapvg
# joinvg testvg

To list the path names of all files in a given file system or logical volume
# ff -I /dev/hd3
or
# ff -I /tmp

To list files that have been modified in last 2 days on /dev/hd2
# ff -m -2 -u /dev/hd2

To list files that have not been used for last 30 days
# ff -a +30 /dev/hd2

To find out the paths corresponding to i-node numbers 451,76
# ff -l -i 451,76 /dev/hd2

Lists the vital product data
# /usr/sbin/lsvpd

To create a JFS logging device on a newly created volume group, first create a logical volume of type jfslog
# mklv -t jfslog -y jfslog1 newvg 1
(This command creates a jfslog logical volume named jfslog1 in the volume group newvg.
The size of the logical volume is 1 logical partition.)

To format the jfslog1 logical volume once it has been created
# logform /dev/jfslog1
(The jfslog1 logical volume is now ready to be used as a JFS log device.)

To format the inline log for an existing file system called /j2 which is on the file system device /dev/fslv00
# logform /dev/fslv00
(This formats the inline log for file system /j2, but does not touch the data in the file system)

To display information about logical volume lv03
# lslv lv03

To display the logical volume allocation map for hdisk2
# lslv -p hdisk2

To display information about logical volumelv03 by physical volume
# lslv -l lv03

To display information about physical volume hdisk3 gathered from the descriptor area on hdisk2
# lslv -n hdisk2 -p hdisk3 lv02

To display information about a specific logical volume, using the identifier:
# lslv 00000256a81634bc.2

To check the LVCB (Logical Volume Control Blockdata)
# getlvcb -AT hd2

To enable the statistics collection for volume group datavg (all the LVs in datavg are enabled)
# lvmstat -v datavg -e

To display the history of all the partitions of logical volume hd2
# lvmstat -l hd2

To display the history of top five logical volumes of volume group uservg
# lvmstat -v uservg -c 5

To display a continuous report at two second intervals for the logical volume ramlv
# lvmstat -l ramlv 2

To display six reports at two second intervals for the volume group rootvg
# lvmstat -v rootvg 2 6

To reset the counters for statistics for all the logical volumes in the volume group uservg
# lvmstat -v uservg -C

To disable statistics collection for datalv
# lvmstat -l datalv –d

To scan logical volume lv33, report the status of each partition, and have every block of each partition read to
determine whether it is capable of performing I/O operations
# mirscan -l lv33

To scan logical volume lv33, report the status of each partition, and have only the first two blocks of each partition
read to determine whether it is capable of performing I/O operations
# mirscan -l lv33 -q 2

To scan logical volume lv33, report the status of each partition, sync any stale partitions found, and migrate any
partitions that are not capable of performing I/O operations,
# mirscan -l lv33 –a

To scan every allocated logical partition on hdisk4 and report the status of each partition
# mirscan -p hdisk4

To find every allocated partition in the volume group that resides on hdisk4, and scan and report the status of
all partitions that do not reside on hdisk4 but are mirror copies of a partition that resides on hdisk4
(This would be useful to run before removing hdisk4 from the system)
# mirscan -r hdisk4

To scan volume group vg05, report the status of each allocated partition, and have the first, middle, and last 512 bytes
of each partition read to determine whether that partition is capable of performing I/O operations
# mirscan -v vg05 -q 0

To split off a copy of a mirrored file system and mount it read-only for use as an online backup
# chfs -a splitcopy=/backup -a copy=2 /testfs

How to unlock a rootvg
# putlvodm -K `getlvodm -v rootvg`

To remove a mirror copy from a LV AIX example
# /usr/sbin/rmlvcopy fslv01 1 hdisk4 hdisk5

Example of creating a filesystem in aix adding from a new disk
# mkvg -y testvg hdisk1
#lsvg testvg and note down LP size to calculate teh size of the file system you need
# mklv -y testlv -x 1024 -t jfs2 testvg 500 hdisk1 (500 is 500 LP )
# crfs -v jfs2 -A yes -d testlv m /custimg

Create aJFS2 filesystems on VG testvg with size 10MB mount point /fs1 with adding entry in /etc/filesystems example.
# crfs -v jfs2 -g testvg -a size=10M -m /fs1 -A yes

To enable snapshot support, split off the original volume group (origVG) to another disk or set of disks,
using the following command:
# splitvg origVG

Reactivate the split-off disk and merge it into the original volume group using the following command

# joinvg origVG

Backup/Restore Related QAs

To create a snapshot for the /home/sid file system and perform a backup
on the snapshot by name
# backsnap -m /tmp/snapshot/sid -s size=64M -i -f/dev/rmt0 /home/sid

To remotely create a backup archive by name
# find pathname -print | backup -ivqf- | rsh remotehost "dd of=/dev/rmt0 bs=blocksize conv=sync"

To remotely create a backup archive by inode, first unmount your file system then use the backup
command.
# umount /myfs backup -0 -uf- /myfs | rsh remotehost \ "dd of=/dev/rmt0 bs=blocksize conv=sync"

To create and copy an archive to the remote tape device
# find pathname -print | cpio -ovcB | rsh remotehost \ "dd ibs=5120 obs=blocksize of=/dev/rmt0"

Create a tar Archive To remotely create a tar archive
# tar -cvdf- pathname | rsh remotehost \ "dd of=/dev/rmt0 bs=blocksize conv=sync"

Create a Remote Dump To remotely create a remote dump of the /myfs file system,
# rdump -u -0 -f remotehost:/dev/rmt0 /myfs

To create remote tar backup from server2 using rsh
# tar cBf - /test | rsh server1 "dd ibs=512 obs=512 of=/dev/rmt0"

How to determine Tape block size
# dd if=/dev/rmtXX bs=128k count=1 | wc -c
or
# tcopy /dev/rmtXX

Few Troubleshooting

To clone the running 5300-00 rootvg to hdisk3, then apply updates from /updates to bring the
cloned rootvg to a 5300-01 level. The bootlist would then be set to boot from hdisk3 at the next reboot.
# alt_disk_copy -d hdisk3 -F 5300-01_AIX_ML -l /updates
# bootlist -m normal hdisk3 hdisk0 ( to set new bootlist)
# bootlist -m normal -o (to verify above command)

To clone the running rootvg to hdisk3 and hdisk4, and execute update_all on all updates from /updates
# alt_disk_copy -d "hdisk3 hdisk4" -b update_all -l /updates
# bootlist -m normal hdisk3 hdisk0 ( to set new boot list)

To clone the running rootvg to hdisk1 and stop after phase 1
# alt_disk_copy -d hdisk1 -P1

To execute phases 2 and 3 on an existing alternate rootvg and reboot the system on successful completion
# alt_disk_copy -d hdisk1 -P23 –r

How to Disable false AIX Err Reports
run errpt and note down the IDENTIFIER
errupdate <Enter>
=C8375BE4: <Enter> <-- IDENTIFIER
Report=False <Enter>
<CTRL+D>
<CTRL+D>

For "installp An error occurred during bosboot verification processing"
First run bootlist command and find the boot device
# bootlist -om normal

hdisk0 blv=hd5 pathid=0

Make sure that major/minor no is same for rhdisk0 ipldevice

# ls -l /dev/rhdisk0 /dev/ipldevice

crw------- 2 root system 20, 0 Apr 07 2004 /dev/ipldevice

crw------- 2 root system 20, 0 Apr 07 2004 /dev/rhdisk0

if not then

# rm /dev/ipldevice
# ln -s /dev/rhdisk0 /dev/ipldevice

To resync a logival volume in AIX
# lresynclv fslv01 -l lvid ( from lslv fslv01 cmmand)

or run this script ( replace fslv01 with the proper lvnames)

# lslv fslv01 |grep -i "LV IDEN"|awk -F" '{print $2}'|awk '{print $1}'|while read T
do
lresynclv fslv01 -l $T
done

or
#syncvg -l fslv01

Example :

# lslv hd6

LOGICAL VOLUME: hd6 VOLUME GROUP: rootvg

LV IDENTIFIER: 00c8411e00004c000000011731887e00.2 PERMISSION: read/write

VG STATE: active/complete LV STATE: opened/stale

TYPE: paging WRITE VERIFY: off

MAX LPs: 512 PP SIZE: 128 megabyte(s)

COPIES: 2 SCHED POLICY: parallel

LPs: 2 PPs: 4

STALE PPs: 2 BB POLICY: non-relocatable

INTER-POLICY: minimum RELOCATABLE: yes

INTRA-POLICY: middle UPPER BOUND: 32

MOUNT POINT: N/A LABEL: None

MIRROR WRITE CONSISTENCY: off

EACH LP COPY ON A SEPARATE PV ?: yes

Serialize IO ?: NO

# lresynclv -l 00c8411e00004c000000011731887e00.2

How to rebuild ODM database ( Don't ever try it in any production system or any system you have any data).
One of the most dangerous AIX command. But useful if used properly. Use at your own risk. Check the man pages
and call Help Desk instead of trying this command. System might not come back after using this command if
proper pre-caution not taken. Can be tried when all other methods fails to bring the System back in proper
stage after ODM corrupted.
# drvreset

vpaths not created for all hdisks of an AIX host or missing vpaths for some hdisks.
In some cases a customer may notice that some hdisks are not associated with any vpaths.
Or a customer may not see the expected number of vpaths for the number of hdisks that they
have on their AIX host.

In either case the problem could be caused by the fact that the hdisks with no vpath association are
listed in a file called /etc/vpexclude. If this file exists a customer can remove the file and run
cfgmgr and the hdisks will now be associated with vpaths.

The only way that the vpexclude file can be created is if a customer runs a querysn command on the AIX host or
if the customer manually edits the /etc/vpexclude file to include the hdisks.

How to add errolog to syslog entry
Step1. Create a file /tmp/syslog.add with the follwoing lines

errnotify:
en_name = "syslog1"
en_persistenceflg = 1
en_method = "logger Msg from Error Log: `errpt -l $1 | grep -v
'ERROR_ID TIMESTAMP'`"

Step2. Run this command
# odmadd /tmp/syslog.add

Step3. Check the status of the odm with odmget
# odmget -q"en_name='syslog1'" errnotify

Step 4. Chech if all is working with errlogger command
# errorlogger system test-syslog

How to fix a pv from missing state to active.
# lsvg -p rootvg
and hdisk0 showing as missing.
Make sure disk is available using lsdev -Cc disk command, then try with
# chpv -a n hdisk0
# chpv -a y hdisk0
# chpv -v a hdisk0

then run
# syncvg rootvg

LED 553 - Corrupted /etc/inittab file
1. Access the rootvg with all file systems mounted by following the procedure
described in 4.4.2, "Accessing a system that will not boot" on page 105.
2. Check for free space in /, /var, and /tmp by using the df command.
3. Check the /etc/inittab file and correct the inittab problems if there is one empty
inittab file, missing inittab file, or wrong entry in inittab file.
4. Check problems with:
/etc/environment file
/bin/sh
/bin/bsh
/etc/fsck
/etc/profile
/.profile
5. Shut down the system and reboot.

CD/DVD Automount

To run the CD Auto Mount Daemon run
# startsrc -s cdromd

To load a CD
# cdutil -l

To Suspend management of the device by cdromd.
# cdutil -s

Resume management of the device by cdromd.
# cdutil -r

To eject a CDROM
# cdeject

To check whether a CDDRIVE is managed by cdromd daemon
# cdcheck -a

To check whether any medis presend in the drive
# cdcheck -e

To mount a cd
# cdmount

To unmount a cd
# cdumount

To enable cd automount daemon to inittab file to start automatically
# mkitab "cdromd:2:boot:/usr/bin/startsrc -s cdromd >/dev/console 2>&1" >/dev/null 2>&1

How to mount an ISO CD/DVD ?
# mount -V cdrfs -o ro /dev/cd0 /cdrom

Software/Package QAs

AIX updating all packages
# /usr/lib/instl/sm_inst installp_cmd -a -d '.' -f '_update_all' -c -N -g -X -Y

To add open source applications to your AIX system
# geninstall -d/dev/cd0 R:cdrecord R:mtools

To create a software bundle from an existing directory
# gencopy -X -b "-qv" -d /export/lpp_source/gpfs -t /export/lpp_source/GPFS -f File 2>&1

To fix AIX ML/TL level to correct level
First run this command to see which filesets are not completely installed
# instfix -i|grep -i ml

Now run this command to find out which file set is causing issue. This example

# instfix -ciqk 6100-06_AIX_ML|grep ":-:"

Now install those specific sets to see proper level

How to display all installed rpm packages
# rpm -qa

To install a specific software, for example openssh server package
First list to see the exact package name
# installp -L -d /utility|grep -i openssh

list will be like this

openssh.base:openssh.base.server:4.3.0.5300::I:C:::::N:Open Secure Shell Server::::0::

Now run this command to install it
# installp -aX -d/utility/openssh.base openssh.base.server

Install a software with automaticallly selecting all prerequisites and specific version

First check the list of softwares you want to install
# installp -L -d .|grep -i nim.master

Now install the software with all pre-requisites
# installp -g -d . bos.sysmgt.nim.master 5.3.7.0

To list the installation state for the most recent level of installed filesets for all of
the bos.rte filesets
# lslpp -l "bos.rte.*"

To list the installation state for the base level and updates for the fileset bos.rte.filesystem
# lslpp -La bos.rte.filesystem

To list the installation history information of all the filesets in the bos.net software package
# lslpp -ha 'bos.net.*'

To list the names of all the files of the bos.rte.lvm fileset
# lslpp -f bos.rte.lvm

To list the fileset that owns installp
# lslpp -w /usr/sbin/installp

To list the fileset that owns all file names that contain installp
# lslpp -w "*installp*"

To display all files in the inventory database
# lslpp -w

To display the installation state for the RPM cdrecord
# lslpp -L cdrecord

To display the installation state for all the filesets contained in the Server bundle located at
/usr/sys/inst.data/sys_bundles/Server.bnd
# lslpp -L -b Server
or
# lslpp -L -b /usr/sys/inst.data/sys_bundles/Server.bnd

Which fileset contains a particular binary for ls
# lslpp -w /usr/bin/ls

To show which filesets need to be installed or corrected
# lppchk -v

To list all the softwares under /utility directory
# installp -L -d /utility

To list all the softwares in a cdrom
# installp -L -d /dev/cd0

Install all software from CD
# /usr/sbin/installp -aX -d/dev/cd0 * all

Install Atape software from utility directory
# /usr/sbin/installp -aX -d/utility Atape* ALL

Network/NFS Related

To change a mount to read-only
# chnfsmnt -f /usr/man -d /usr/man -h hostname -t ro

To change default route permanently, example.
# chdev -l inet0 -a route=net,default,192.168.0.225

To add an entry in the /etc/hosts file with a series of host names,
# hostent -a 192.100.201.7 -h "alpha bravo charlie"

In above example, the IP address 192.100.201.7 is specified as the address of the host that
has a primary host name of alpha with synonyms of bravo and charlie.

To show an entry in the /etc/hosts file matching a host name
# hostent -s alpha

To change the IP address of an server to a new IP address in /etc/hosts file
# hostent -c 192.100.201.7 -i 192.100.201.8

In example 3, the old IP address is 192.100.201.7 and the new address is 192.100.201.8.

To list all of the directories currently exported with NFS in the colon format
# lsnfsexp -c

To list all of the NFS mounted file systems in the colon format
# lsnfsmnt -c

To list all of the NFS mounted file systems in the list format
# lsnfsmnt -l

To add the adapter ent0 as the backup adapter in the EtherChannel called ent7
# /usr/lib/methods/ethchan_config -a -b ent7 ent0

To change the address to ping attribute of an EtherChannel called ent7 to 10.10.10.10
# /usr/lib/methods/ethchan_config -c ent7 netaddr 10.10.10.10

To force a failover of an EtherChannel called ent7 from the currently active channel to the idle channel
# /usr/lib/methods/ethchan_config -f ent7

To export a directory with read-only permission
# mknfsexp -d /usr -t ro

To export a directory with read-mostly permission and a secure protocol to specific hosts
# mknfsexp -d /home/guest -t rm -h bighost,littlehost -s

To export a directory with read-write permission to a specific netgroup and specific hosts and to make the export
effective on the next system restart
# mknfsexp -d /usr -t rw -c host1,host3,grp3 -I

To export a directory with read-only permission to an exports file other than /etc/exports
# mknfsexp -d /usr -t ro -f /etc/exports.other

To export a directory to allow access only to clients using NFS version 4 protocol
# mknfsexp -d /common/documents -v 4

To export a directory, allowing access to client1 and client2 for clients using krb5 access
# mknfsexp -d /common/documents -S krb5 -r client1,client2

To export the /common/documents directory with full scattering for the hosts named s1 and s2 specified as referrals
# mknfsexp -d /common/documents -v 4 -G /common/documents@s1:/common/documents@s2 -o full

To export the /common/documents directory with partial scattering at hosts named s1, s2 and s3, specified as replicas
# mknfsexp -d /common/documents -v 4 -g \
/common/documents@s1:/common/documents@s2:/common/documents@s3 -o partial

To export the /common/documents directory with the export name /exports1/cool/mike
# mknfsexp -d /common/documents -e /exports1/cool/mike -S sys -v 4

How to configure secondery network Interface
# chdev -l en1 -a netaddr=10.10.10.1 -a netmask 255.255.255.224 -a state=up

How to setup network permanently from a command line
# mktcpip -h god.abc.xyz.com -a 30.3.1.10 -i en0 \
-n 30.3.0.1 -m 255.255.0.0 -g 30.3.0.7 -d xyz.abc.com\
-s
(n=name server, m=netmask, g=gateway, d=domain, -s=start now, -a=ip address
i=interface, h=hostname)

How to test a network throughput test

ftp targethost
username/passwd...
bin
hash
put "|dd if=/dev/zero bs=32k count=100000" /dev/null

To print the resource information on the system "mercury" for an nfs type filesystem
# dfshares -F nfs mercury

To save current Network Tuning Parameter for next boot
# /usr/sbin/tunsave -a -F nextboot -t no

How to setup umask for ftp
# The ftp command does not use the user's umask setting. Use the ftp site umask x subcommand to change the
ftp umask. Ex. site umask 022

How to configure BSD style Network configuration in AIX
# smit configtcp fast path and then select BSD Style rc Configuration. Or configure the /etc/rc.bsdnet file using a
standard text editor. ( Two commands mkdev -t inet & chdev -l inet0 -a bootup_option=yes )

To restart inetd in AIX
# refresh -s inetd

To make AIX replying to broadcast ping run this command
# no -o bcastping=1

Remove network alias from ODM
# chdev -l en0 -a delalias4=172.21.64.170 255.255.252.0

Remove temporary network alias
# ifconfig en0 172.21.64.170 netmask 255.255.252.0 delete

To change the number of nfsd daemons on a server to 10, both immediately and at each subsequent system boot
# chnfs -n 10

To change the number of biod daemons on a client to 8 temporarily, with no permanent change
(that is, the change happens now but is lost at the next system boot)
# chnfs -N -b 8

To change both the number of biod daemons and the number of nfsd daemons on a system to 9, with the change
delayed until the next system boot
# chnfs -I -b 9 -n 9

To check nfs statistics
# nfsstat -c

Allows response to ICMP echo packets to the broadcast address. Disabling this prevents Smurf attacks.
# /usr/sbin/no -o bcastping=0

Specifies whether or not SYN (synchronizes the sequence number) attacks are being avoided.
# /usr/sbin/no -o clean_partial_conns=1

Specifies whether to allow a directed broadcast to a gateway. Setting to 0 helps prevent
directed packets from reaching a remote network.
# /usr/sbin/no -o directed_broadcast=0

Specifies whether the system responds to an ICMP address mask request. Disabling this prevents
access through source routing attacks.
# /usr/sbin/no -o icmpaddressmask=0

Specifies whether the kernel should forward packets. Disabling this prevents redirected packets
from reaching remote network.
# /usr/sbin/no -o ipforwarding=0

Disabling this prevents access through source routing attacks.
# /usr/sbin/no -o tcp_pmtu_discover=0

Printer related QAs

To convert text files to PostScript® format for printing (-d printer name)
(provided enscript installed)
# opt/freeware/bin/enscript -d9050DN /etc/hosts

To create a network printer named myprinter on remote host god and remote queue ibm1372
# /usr/lib/lpd/pio/etc/piomisc_ext mkpq_remote_ext -q myprinter -h god -r ibm1372 -t att -C FALSE

MKSYSB related QAs

To create mksysb dvd
# mkdvd -d /dev/cd0 -V rootvg -p

To create a mksysb dvd using existing mksysb file
# mkdvd -d /dev/cd0 -m /path_to_mksysb_file -V rootvg

To get a listing of the files/directories from a mksysb DVD
# listvgbackup -f /dev/cd0

To restore a file/files from your mksysb DVD into the current working working directory
# restorevgfiles -f /dev/cd0 ./home/sid

To restore all the files from a specific directory of mksysb iso dvd to a new directory /mydir
# restorevgfiles -f /dev/cd0 -d /mydir ./home/sid

To restore /home/sid directory from UDF mksysb DVD
# mkdir /mksysbdvd
# mount -V udfs -o rw /dev/cd0 /mksysbdvd
# cp -R /mksysbdvd/home/sid /home

if the above command not working then this can be tried
# restore -xqvdf /dvdbackup/usr/sys/inst.images/mksysb_image ./home/sid

To create a mksysb tape
# mksysb -p -vi /dev/rmt0

(never forget the -p to disable software compression otherwise your mksysb tape may never be
recoverable. Even if you are able to run the other commands to read the tape you may get a
packing error during recovery )

To verify the mksysb tape
# listvgbackup -Vf /dev/rmt0

How to copy a mksysb image from DVD for nim installation
mount a mksysb DVD
# mount -v udfs -o rw /dev/cd0 /cdrom
# cd /cdrom/usr/sys/inst.images
# mkdir /images/client_name
# cp mksysb* /images/client_name
# cat mksysb_image2>>mksysb.image

Now you can define this mksysb image to NIM Server

How to preview a mksysb image
# lsmksysb -l -f /tmp/mybackup

How to view the files and file sizes in a user-volume group backup
# lssavevg -f /vg_backup/nimvg -l

How to view the filesets installed in a system backup
# lsmksysb -L -f generic_sysb

To display colon separated lpp information about a mksysb backup tape located on /dev/rmt0
# lsmksysb -Lc -f /dev/rmt0

To display the volume group backup log to stdout
# lssavevg –B

To list the contents of the system backup located on device /dev/cd1, which is a user volume
group that is not rootvg
# listvgbackup -f /dev/cd1 -s

To restore /etc/filesystems from the system backup located on device /dev/cd1
# listvgbackup -f /dev/cd1 -r ./etc/filesystems

To restore all files in the /myfs/test directory of the non-rootvg backup, which is located on device /dev/cd1,
and write the restored files to /data/myfiles
# listvgbackup -f /dev/cd1 -r -s -d /data/myfiles ./myfs/test

To list volume group and general backup data about a backup located at /tmp/mybackup
#listvgbackup -l -f /tmp/mybackup

To verify the readability of each header on a volume group backup tape in /dev/rmt0
# lsmksysb -V -f /dev/rmt0

HMC/Lpar related QAs

To reboot HMC from command line
# hmcshutdown -r -t 0

How to reboot a lpar from hmc command line
# chsysstate -r lpar -m MACHINE_NAME -o shutdown --immed \
--restart --id LPARID (or -n LPARNAME)

To get the default LPAR statistics
# lparstat 1 1

To get default LPAR statistics with summary statistics on Hypervisor
# lparstat –h 1 1

To get the information about the partition
# lparstat -i

To get detailed Hypervisor statistics
# lparstat –H 1 1

Example of running a command on VIO server from HMC
# viosvrcmd -m <server> -p <partition> -c "lsmap -all"

List all systems managed by this HMC:
# lssyscfg -r sys
# lssyscfg -r sys -F name

Display all the lpars and their state in system god
# lssyscfg -m god -r lpar -F name,lpar_id,state

To display all the lpars in the managed system
# lssyscfg -r sys -F name:type_model:serial_num
Ex. lssyscfg -r lpar -m 9119-595*02999E
(model Serial )
( to get machine/serial information run the lssyscfg -r sys )

List the managed system god:
( get the systems name from lssyscfg -r sys command)
# lssyscfg -r sys -m god

List all partition profiles defined for partition zeus
# lssyscfg -r prof -m god --filter "lpar_names=zeus"

To remove a lpar
# rmsyscfg -r lpar --id 2

To list all the pci slots in a managed system
# lshwres -m god -r io --rsubtype slot -F description,drc_name

To list all the pci slots in a managed system and sort them
# lshwres -m god -r io --rsubtype slot -F description,drc_name|sort

To display all ethernet ports
# lshwres -r io --rsubtype slotchildren -m god|grep -i "ethernet"

To display ethernet slots on power7 servers
# lshwres -r io --rsubtype slot -m god|grep -i "pci-to-pci"

How to activate a lpar
Run this to check the status
# lssyscfg -m god -r lpar -F name,lpar_id,state
Then select the lpar-id you want to activate
now run
# chsysstate -m god -r lpar --id 2 -o on -b norm -f Normal

To shutdown
# chsysstate -m god -r lpar --id 2 -o shutdown --immed

Here is an example, from the man page. For more information see '''man mksyscfg'''
# mksyscfg -r lpar -m MACHINE -i name=LPARNAME, profile_name=normal, lpar_env=aixlinux, \
shared_proc_pool_util_auth=1, min_mem=512, desired_mem=2048, max_mem=4096, proc_mode=shared, \
min_proc_units=0.2, desired_proc_units=0.5, max_proc_units=2.0, min_procs=1, \
desired_procs=2, max_procs=2, sharing_mode=uncap, uncap_weight=128, \
boot_mode=norm, conn_monitoring=1, shared_proc_pool_util_auth=1

If you want to create more LPARS at once you can use a configuration file and provide it as input for mksyscfg.
Here is an example for 3 LPARs, each definition starting at new line:

name=LPAR1,profile_name=normal,lpar_env=aixlinux,all_resources=0,\
min_mem=1024,desired_mem=9216,max_mem=9216,proc_mode=shared,\
min_proc_units=0.3,desired_proc_units=1.0,max_proc_units=3.0,min_procs=1,\
desired_procs=3,max_procs=3,sharing_mode=uncap,uncap_weight=128,\
lpar_io_pool_ids=none,max_virtual_slots=10,\
"virtual_scsi_adapters=6/client/4/vio1a/11/1,7/client/9/vio2a/11/1",\
"virtual_eth_adapters=4/0/3//0/1,5/0/4//0/1",boot_mode=norm,\
conn_monitoring=1,auto_start=0,power_ctrl_lpar_ids=none,\
work_group_id=none,shared_proc_pool_util_auth=1

name=LPAR2,profile_name=normal,lpar_env=aixlinux,all_resources=0,\
min_mem=1024,desired_mem=9216,max_mem=9216,proc_mode=shared,\
min_proc_units=0.3,desired_proc_units=1.0,max_proc_units=3.0,min_procs=1,\
desired_procs=3,max_procs=3,sharing_mode=uncap,uncap_weight=128,\
lpar_io_pool_ids=none,max_virtual_slots=10,\
"virtual_scsi_adapters=6/client/4/vio1a/12/1,7/client/9/vio2a/12/1",\
"virtual_eth_adapters=4/0/3//0/1,5/0/4//0/1",boot_mode=norm,\
conn_monitoring=1,auto_start=0,power_ctrl_lpar_ids=none,\
work_group_id=none,shared_proc_pool_util_auth=1

name=LPAR3,profile_name=normal,lpar_env=aixlinux,all_resources=0,\
min_mem=1024,desired_mem=15360,max_mem=15360,proc_mode=shared,\
min_proc_units=0.4,desired_proc_units=1.0,max_proc_units=4.0,min_procs=1,\
desired_procs=4,max_procs=4,sharing_mode=uncap,uncap_weight=128,\
lpar_io_pool_ids=none,max_virtual_slots=10,\
"virtual_scsi_adapters=6/client/4/vio1a/13/1,7/client/9/vio2a/13/1",\
"virtual_eth_adapters=4/0/3//0/1,5/0/4//0/1",boot_mode=norm,\
conn_monitoring=1,auto_start=0,power_ctrl_lpar_ids=none,\
work_group_id=none,shared_proc_pool_util_auth=1

Copy this file to HMC and run:
# mksyscfg -r lpar -m SERVERNAME -f /tmp/profiles.txt

If you already have LPARs created you can use this command to get their configuration which can be reused as template
# lssyscfg -r prof -m SERVERNAME --filter "lpar_ids=X, profile_names=normal"

To close a Console terminal from HMC
# rmvterm -m p550ahmc --id 1

VFS related

To create a new vfs entry called newvfs
# crvfs "newvfs:4:none:/etc/helpers/newvfshelper"

To change the FileSystemHelper for the vfs entry named newvfs
(The missing parameters are left unchanged)
# chvfs "newvfs:::/etc/helper/testhelper"

To list the vfs entry named newvfs
# lsvfs newvfs

To list all vfs types, enter:
# lsvfs –a

To remove the newvfs entry
# rmvfs newvfs

Other AIX QAs

In this example, the action named "E-mail root" cannot be the only action.
To delete "E-mail root" from the response named "E-mail root anytime", run this command:
# chresponse -p -n "E-mail root" "E-mail root anytime"

In this example, the action named "E-mail root" will be used Monday through Friday from 8 AM to 6 PM,
will use the command /usr/sbin/rsct/bin/notifyevent root, will save standard output in the audit log,
and will expect return code 5 from the action. To add "E-mail root" to the response named "E-mail root anytime"
# chresponse -a -n "E-mail root" -d 2-6 -t 0800-1800 -s "/usr/sbin/rsct/bin/notifyevent root" -o \
-r 5 "E-mail root anytime"

To rename the response "E-mail root anytime" to "E-mail root and admin anytime"
# chresponse -c "E-mail root and admin anytime" "E-mail root anytime"

These examples apply to management domains:

To delete the action named "E-mail root" from the response named "E-mail root anytime" that is defined
on the management server, run this command on the management server:
# chresponse -p -n "E-mail root" "E-mail root anytime"

In this example, the action named "E-mail root" will be used Monday through Friday from 8 AM to 6 PM,
will use the command /usr/sbin/rsct/bin/notifyevent root, will save standard output in the audit log,
and will expect return code 5 from the action. To add "E-mail root" to the response "E-mail root anytime"
that is defined on the management server, run this command on the management server:
# chresponse -a -n "E-mail root" -d 2-6 -t 0800-1800 -s "/usr/sbin/rsct/bin/notifyevent root" -o -r 5 \
"E-mail root anytime"

To delete the action named "E-mail root" from the response named "E-mail root anytime" that is defined
on the managed node nodeB, run this command on the management server:
# chresponse -p -n "E-mail root" "E-mail root anytime":nodeB

These examples apply to peer domains:

In this example, the action named "E-mail root" will be used Monday through Friday from 8 AM to 6 PM,
will use the command /usr/sbin/rsct/bin/notifyevent root, will save standard output in the audit log,
and will expect return code 5 from the action. To add "E-mail root" to the response "E-mail root anytime"
that is defined on node nodeA in the domain, run this command on any node in the domain:
# chresponse -a -n "E-mail root" -d 2-6 -t 0800-1800 -s "/usr/sbin/rsct/bin/notifyevent root" -o -r 5 \
"E-mail root anytime":nodeA

To delete the action named "E-mail root" from the response named "E-mail root anytime" that is defined
on node nodeA in the domain, run this command on any node in the domain:
# chresponse -p -n "E-mail root" "E-mail root anytime":nodeA

How do I get a dump of the header of the loader section and the symbol entries in symbolic representation?
# dump -Htv

How do I determine the amount of paging space allocated and in use?
# lsps -a

snap command example
# snap -gfkDNd /visualsc/dump/ibmsupt
# snap -cd /visualsc/dump/ibmsupt

Sendmail Version error fix

Warning: .cf file is out of date: sendmail AIX5.3/8.13.4 supports version 10, .cf file is version 9

Solution : vi /etc/mail/sendmail.cf and change V9 to V10

sddpcm commnds example
# manage_disk_drivers -l
# pcmpath query device
# sddpcm_get_config -Av
# pcmpath query devstats
# pcmpath query adaptstats
# lspcmcfg
# sddpcm_get_config -A
# lspcmcfg hdisk4
# mkpath -l hdiskX -p fscsi1
# mkpath -l hdiskX -p sas0
# chdev -l hdisk4 -a hcheck_mode=enabled
# chdev -l hdisk4 -a algorithm=round_robin

To check the device configuration status, enter:
# lspath -l hdiskX -H -F "name path_id parent connection status"
Ex .
# lspath -l hdisk4 -H -F "name path_id parent connection status"
# pcmpath query device 4
# pcmpath query adapter

To dynamically remove all paths under a parent fibre-channel adapter from a supported storage MPIO
# devicermpath -dl hdiskX -p fscsiY

To remove a failed disk using odmdelete command

If you have been working with a PVID value rather than with an hdisk name, ensure that the PVID is removed from the
ODM with the following command. The 32-digit value supplied consists of the PVID plus 16 zeros. For example
# odmdelete -q value=0073659c2c6d26f10000000000000000 -o CuAt ( add 16 zeros)

To get the PVID run
#lsvg -p vgname

Then run
# rmlvcopy <LVname> 1 0073659c2c6d26f1 (16 Digit PVID)

ODMDELETE COMMAND TO DELETE NIM OBJECTS

Suppose you want to delete the entry with TRYME mksysb and lsnim shows the name as mksysb.TRYME and you are unable to delete it normal way.

MAKE SURE YOU BACKUP NIM DATABSE BEFORE THIS. READ THE LAST LINE TOO
# odmget nim_attr >/tmp/nim_attr.out
# vi /tmp/nim_attr.out and look for TRYME entry
Note down the id no for Ex. id=1161733976
# odmdelete -o nim_attr -q id=1161733976
Now Delete it from nim_objects
# odmget nim_objects >/tmp/nim_objects.out
vi that file and note down the id for TRYME
# odmdelete -o nim_object -q id=1162344443
now from websm screen or smitty nim add the routing information to NIM MASTER object
resources -> master ->properties ->nim interface. ( Add the interface again)

odmdelete example
# odmdelete -o CuDv -q name=hdisk1

odmdelete command to delete network example

DEVICE=et2

odmdelete -q "name = $DEVICE" -o CuAt

odmdelete -q "parent = $DEVICE" -o CuDv

odmdelete -q "name = $DEVICE" -o CuDv

odmdelete -q "name = $DEVICE" -o CuDep

odmdelete -q "dependency = $DEVICE" -o CuDep

odmdelete -q "value1 = $DEVICE" -o CuDvDr

odmdelete -q "value3 = $DEVICE" -o CuDvDr

or

odmdelete -q name=en0 -o CuAt

odmdelete -q name=inet0 -o CuAt

To see all the ODM attributes
# odmget CuAt

To see all the devices ODM
# odmget CuDv

How to mirror a terminal
# portmir -t pts/0

To stop mirroring terminal
# portmir -o

How to change a lv to system dump device
# chlv -t sysdump lg_sysdump1

Identifying the current run level of aix at the command line
# cat /etc/.init.state

To find what the default run level is on your aix system
# lsitab init
init:2:initdefault:

Find out the Status of VGDA
# lqueryvg -g `getlvodm -v newtestvg` -At -p hdisk14

To determine the status of system battery
# diag -B -c

To change the default dump device, type the following command
# sysdumpdev -P -p /dev/new_dump_device

To move a directory, type the following:
# mvdir book manual

To find the path to aix system's error log file
# /usr/lib/errdemon -l

To change the maximum size of the error log file
# /usr/lib/errdemon -s LogSize

To change the size of the error log device driver's internal buffer
# /usr/lib/errdemon -B BufferSize

To list all events for which logging is currently disabled
# errpt -t -F Log=0

To list all events for which reporting is currently disabled
# errpt -t -F Report=0

To erase the Data from Disks example
# diag -d hdisk1 -T format

Few VIO Examples

How to create etherchanel in VIO Server

Step -1. Clean old definitions

# rmtcpip -all

remove the shared interface if any

Ex.

# rmdev -dev ent3 ( if ent3 is shared ethernet)

Create the aggregate

# mkvdev -lnagg ent0 ent1 ( this will create etherchannel device using ent0 & ent1. ent2 is a vio adapter)

ent3 available

or you may run

# mkvdev -lnagg ent3 ent0 ent1 , this will create etherchannel device ent3 using ent0 & ent1)

ent3 will be created as etherchannel device

create the shared device with etherchannel device)
# mkvdev -sea ent3 -vadapter ent2 -default ent2 -defaultid 1

ent4 available

en4

et4

Now set up the interface with ip address

# mktcpip -hostname vioa -inetaddr 172.24.145.81 -interface en4 -start -netmask 255.255.255.0 -gateway 172.24.145.1
# lstcpip (to display network)