AIX QuickSheet Annex


Description:

Annex (noun)
- an addition to a structure.
- something added to a document, a supplement to a document.

This is a (random) list of items that would not fit on the AIX QuickSheet but may still be of value.


Contents


Storage

List dac and dar mappings of a DS4000 storage array
fget_config -Av

Catalog a tape
tcopy /dev/rmt0

User Management

Add a new user called "wfavorit" to the system
mkuser home=/home/wfavorit shell=/usr/bin/ksh wfavorit

Change default shell of user wfavorit to ksh
chuser shell=/usr/bin/ksh wfavorit
(The shell must be listed in /etc/security/login.cfg)

Check all user accounts for errors in config files. Report, but do NOT fix the errors.
usrck -n ALL

List all attributes of user wfavorit (in human readable / grep-able manner)
lsuser -f wfavorit

List just the default shell for user wfavorit
lsuser -a shell wfavorit

The shadow file on AIX
/etc/security/passwd

The default settings file for the mkuser command. One stanza exists for each type of user.
/usr/lib/security/mkuser.default

CD / DVD ROM

Mount a DVD ROM on /mnt (CDROM = cdrfs)
mount -v udfs -o ro /dev/cd0 /mnt

Remove a CD ROM (from OS) prior to a DLPAR operation
lscfg (To show parent device of cd0)
lsdev -p pci3 (Walk back through device tree to verify)
lsdev -p ide0 (Continue walking back to cd0)
rmdev -dl pci3 -R (Remove all devices from ODM)

List all software packages on the CD in /dev/cd0
installp -Ld /dev/cd0

LVM

Clear all LVM info from header of hdisk2
dd if=/dev/zero of=/dev/hdisk2 bs=1024 count=512
(This clears the first 512K of the disk of any previous LVM info that may prevent its use in a new VG)

Grow the default paging space by 8 LPs (actual size depends upon PP size for rootvg)
chps -s 8 hd6

Display info from the LVCB for hd2
lslv hd2

Display info from the LVCB on the disk hdisk0 for hd2
lslv -n hdisk0 hd2

Get raw info from hd2 LVCB
getlvcb -TA hd2

File System

Find the name of the file in the / (root) file system that is on inode 17
ncheck -i 17 /

List all PIDs and (users) who have open files on the /usr mount point
fuser -uxc /dev/hd2

Same command as previous but specifies filesystem mount point (not device)
fuser -uxc /usr

Software / Package Management

Find the ML/TL and Service Pack level of the system
oslevel -s

List all ML/TLs on the system (another method)
instfix -i | grep AIX_ML

List all software packages on the CD in /dev/cd0
installp -Ld /dev/cd0

Install a package from CD ROM
installp -ac -g -X -Y -d /dev/cd0 sysmgt.websm.rte
The options are as follows:
   -ac -- Apply and Commit
   -g -- Install prerequisites
   -X -- Extend filesystems if necessary
   -Y -- Agree to license agreements
   -d /dev/cd0 -- Device to read from
   sysmgt.websm.rte -- Package to install

List all files in the bos.64bit package
lslpp -f bos.64bit

Networking

Determine if network interface is up (has link) or not
entstat -d ent1 | grep Link

/etc/rc.net is (the default method) used to configure interfaces. This file is typically not run by a user but is called by cfgmgr during the boot process. /etc/rc.tcpip is used to start UDP/TCP related daemons. It can be run by users but is run by the system upon startup. Run /etc/tcp.clean to disable all daemons that /etc/rc.tcpip starts.

Command to modify / list /etc/resolv.conf entries
namerslv

Add a nameserver entry into the resolv.conf file for 10.0.1.1
namerslv -a -i 10.0.1.1

List just the nameserver entries in the resolv.conf file
namerslv -sI

HMC Commands

List systems connected to this HMC (HMC Command)
lssyscfg -r sys -F name

List LPARs on managed system (HMC Command)
lssyscfg -r lpar -m Server_9117-MMA-SNXXXXXXX -F name

List all LPARs on all managed systems (HMC Command)
for SYS in `lssyscfg -r sys -F name`
do
   echo "=== ${SYS} ==="
   lssyscfg -r lpar -m ${SYS} -F "lpar_id:name"
done


Connect to system from previous command (HMC Command)
mkvterm -m Server-9117-MMA-SNXXXXXXX --id 2
- or -
mkvterm -m Server-9117-MMA-SNXXXXXXX -p myappsrv
(Note that -m is the managed server, --id is the ID of the LPAR, and -p is the name of the LPAR)

Disconnect the console of previous command (HMC Command)
rmvterm -m Server-9117-MMA-SNXXXXXXX --id 2

NFS

List all exported file systems
exportfs -av

Temporarily export the /proj directory, allowing root access by server1
exportfs -i -o rw root=server1 /proj

Export all entries in /etc/exports
exportfs -a

Enable NFS daemons now, and on next start
mknfs

Disable NFS daemons now, and on next start
rmnfs

Start NFS daemons now, but do not persist after reboot
mknfs -N

Create a NFS entry in /etc/exports for /proj directory
mknfsexp -d /proj -t rw -a 501 -r paris -B
The options are as follows:
   -d /proj -- Export the /proj direcotry
   -t rw -- Access is read write
   -a 501 -- Unknown users are mapped to 501(wfavorit)
   -r paris -- Host named paris can have root access
   -B -- Insert entry into /etc/exports and activate immediately

There are three options for the mknfs* commands
   -B -- Make the change now, and after next reboot
   -I -- Make the change effective after next reboot
   -N -- Make the change now, but will not survive reboot
(The -B flag tends to be the default. -I leads you to think of Immediate and -N as Next boot. Using standard AIX logic, reverse these thoughts, and you will have the proper use of the N and I flags.)

System Information

Find the current runlevel (cleaner results)
cat /etc/.init.state

Find the current runlevel (Unix standard method)
who -r

List all the available alog sources on the system
alog -L

Display the contents of the alog boot log (a pipe to more is recommended)
alog -t boot -o

Display information about the boot log (file:size:verbosity)
alog -t boot -L

List all error log entries from today (not last 24 hours)
errpt -s `date +%m%d0000%y`

List all error log entries from last 24 hours (Note: This is not a recommended command as it will break on the first day of the month. It is placed here to contrast with the previous command.)
errpt -s `date +%m`$(( `date +%d` - 1 ))`date +%H%M%y`