Saturday, November 5, 2011

Links

http://howtounix.blogspot.com/
http://martin.ankerl.com/
http://aix4admins.blogspot.com/

Tuesday, October 11, 2011

AIX VIO Sever

1- https://www.ibm.com/developerworks/mydeveloperworks/blogs/AIXDownUnder/entry/vio_server_virtual_media_library?lang=en
2- https://www-304.ibm.com/support/docview.wss?uid=nas15dd15b31badfa4738625755b00811805
3- http://aix-administration.blogspot.com/2010/08/creating-virtual-cdrom-on-vio-step-by.html
4- https://www-304.ibm.com/support/docview.wss?uid=nas15dd15b31badfa4738625755b00811805
5-http://aix-administration.blogspot.com/2010/08/creating-virtual-cdrom-on-vio-step-by.html
9-http://www.torontoaix.com/vio-how-to-s/virtual-media-library
10-http://www.kristijan.org/2011/06/vio-virtual-media-library/
11-http://gibsonnet.net/aix/AIX_Migration_with_File-Backed_VIOS_Devices.htm

Wednesday, August 17, 2011

BASH Shortcuts

Navigating and Editing the Command Line
Ctrl-a Move to the start of the line.
Ctrl-e Move to the end of the line.
Ctrl-b Move back one character.
Alt-b Move back one word.
Ctrl-f Move forward one character.
Alt-f Move forward one word.
Alt-] x Where x is any character, moves the cursor forward to the next occurance of x.
Alt-Ctrl-] x Where x is any character, moves the cursor backwards to the previous occurance of x.
Ctrl-u Delete from the cursor to the beginning of the line.
Ctrl-k Delete from the cursor to the end of the line.
Ctrl-w Delete from the cursor to the start of the word.
Esc-Del Delete previous word (may not work, instead try Esc followed by Backspace)
Ctrl-y Pastes text from the clipboard.
Ctrl-l Clear the screen leaving the current line at the top of the screen.
Ctrl-x Ctrl-u Undo the last changes. Ctrl-_ does the same
Alt-r Undo all changes to the line.

_____CTRL Key Bound_____________
Ctrl + a - Jump to the start of the line
Ctrl + b - Move back a char
Ctrl + c - Terminate the command
Ctrl + d - Delete from under the cursor
Ctrl + e - Jump to the end of the line
Ctrl + f - Move forward a char
Ctrl + h - Delete backwards one character
Ctrl + k - Delete to EOL
Ctrl + l - Clear the screen
Ctrl + r - Search the history backwards
Ctrl + R - Search the history backwards with multi occurrence
Ctrl + u - Delete backward from cursor
Ctrl + xx - Move between EOL and current cursor position
Ctrl + x @ - Show possible hostname completions
Ctrl + z - Suspend/ Stop the command
____________ALT Key Bound___________
Alt + < - Move to the first line in the history
Alt + > - Move to the last line in the history
Alt + ? - Show current completion list
Alt + * - Insert all possible completions
Alt + / - Attempt to complete filename
Alt + . - Yank last argument to previous command
Alt + b - Move backward
Alt + c - Capitalize the word
Alt + d - Delete word
Alt + f - Move forward
Alt + l - Make word lowercase
Alt + n - Search the history forwards non-incremental
Alt + p - Search the history backwards non-incremental
Alt + r - Recall command
Alt + t - Move words around
Alt + u - Make word uppercase
Alt + back-space - Delete backward from cursor

----------------More Special Keybindings-------------------

Here "2T" means Press TAB twice

$ 2T - All available commands(common)
$ (string)2T - All available commands starting with (string)
$ /2T - Entire directory structure including Hidden one
$ 2T - Only Sub Dirs inside including Hidden one
$ *2T - Only Sub Dirs inside without Hidden one
$ ~2T - All Present Users on system from "/etc/passwd"
$ $2T - All Sys variables
$ @2T - Entries from "/etc/hosts"
$ =2T - Output like ls or dir

Friday, August 5, 2011

links

http://unstableme.blogspot.com/
http://www.okboot.org/

Configure ksh environment

Configure ksh environment
To display the current settings

set -o


To set HP/UX stylee...

set -o vi
set -o vi-esccomplete

Saturday, July 16, 2011

Links

1- http://blog.mc-thias.org/
2- http://www.sunsolarisadmin.com/
3- http://www.brandonhutchinson.com/
4- http://www.optix.org/~dxy/solaris/command/
5- http://www.grid5.net/blog/

Solaris Command Reference

Solaris Command Reference
HD info(vendor, RPM, capacity)

oasis:/home/tse/dxy[9:18pm] iostat -E

sd0 Soft Errors: 0 Hard Errors: 3 Transport Errors: 0
Vendor: SEAGATE Product: ST34371W SUN4.2G Revision: 7462 Serial No: 9742K71685
RPM: 7200 Heads: 16 Size: 4.29GB <4292075520 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 3 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0

sd1 Soft Errors: 0 Hard Errors: 3 Transport Errors: 0
Vendor: SEAGATE Product: ST32171W SUN2.1G Revision: 7462 Serial No: 9736T74649
RPM: 5400 Heads: 19 Size: 2.13GB <2127708160 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 3 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0

sd6 Soft Errors: 0 Hard Errors: 3 Transport Errors: 0
Vendor: TOSHIBA Product: XM5701TASUN12XCD Revision: 0997 Serial No: 04/09/97
RPM: 0 Heads: 0 Size: 18446744073.71GB <-8589934591 bytes>
Media Error: 0 Device Not Ready: 3 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0

Display the number of used and free i-nodes

impulse:/home/dxy[4:07pm] df -F ufs -o i
Filesystem iused ifree %iused Mounted on
/dev/dsk/c0t3d0s0 38555 403045 9% /
/dev/dsk/c0t1d0s0 160761 345607 32% /export/home
/dev/md/dsk/d20 149826 1905214 7% /usr/local
impulse:/home/dxy[4:07pm] /usr/ucb/df -i
Filesystem iused ifree %iused Mounted on
/dev/dsk/c0t3d0s0 38555 403045 9% /
/dev/dsk/c0t1d0s0 160761 345607 32% /export/home
/dev/md/dsk/d20 149826 1905214 7% /usr/local
impulse:/home/dxy[4:07pm]

Display processes with the highest CPU utilization

velocity:/home/dxy[4:54pm] ps -eo pid,pcpu,args | sort +1n

Display processes with the highest memory usage

velocity:/home/dxy[4:54pm] ps -eo pid,vsz,args | sort +1n

Printing disk geometry and partition info

oasis:/home/dxy[4:16pm] prtvtoc /dev/rdsk/c0t0d0s0
* /dev/rdsk/c0t0d0s0 partition map
*
* Dimensions:
* 512 bytes/sector
* 135 sectors/track
* 16 tracks/cylinder
* 2160 sectors/cylinder
* 3882 cylinders
* 3880 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 7855920 7855919 /usr/local
1 3 01 7855920 524880 8380799
2 5 00 0 8380800 8380799
oasis:/home/dxy[4:16pm]

Checking whether it's running in 32-bit mode or 64-bit mode
64-bit mode

% isalist -v
sparcv9+vis sparcv9 sparcv8plus+vis sparcv8plus sparcv8 sparcv8-fsmuld sparcv7 sparc
% isainfo -v
64-bit sparcv9 applications
32-bit sparc applications

32-bit mode

% isalist -v
sparcv8plus+vis sparcv8plus sparcv8 sparcv8-fsmuld sparcv7 sparc
% isainfo -v
32-bit sparc applications

Verifying a route to a specified network

# route -n get xxx.yyy.zzz.0
route to: xxx.yyy.zzz.0
destination: default
mask: default
gateway: xxx.yyy.aaa.254
interface: hme0
flags:
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
0 0 0 0 0 0 1500 0
#

print the version of OBP

% prtconf -V
OBP 3.3.2 1996/06/28 08:43

% /usr/platform/`uname -i`/sbin/prtdiag -v | grep OBP
OBP 3.11.1 1997/12/03 15:53 POST 3.11.4 1997/05/27 02:26
%

{2} ok .version
Release 3.23 Version 1 created 1999/07/16 12:08
OBP 3.23.1 1999/07/16 12:08
POST 2.0.2 1998/10/19 10:46
{2} ok

print the version of Open Windows

% showrev -w

OpenWindows version:
OpenWindows Version 3.6.1 25 January 1999

%

To determine which monitor resolution is available

% /usr/sbin/ffbconfig -res \?
Valid values for -res option are:
1024x768x60 [1]
1024x768x70 [1]
1024x768x75 [1] [2]
1024x768x77
1024x800x84
1152x900x66
1152x900x76
1280x800x76 [1] [2]
1280x1024x60 [1] [2]
1280x1024x67
1280x1024x76
1280x1024x85 [1] [2]
960x680x112s
960x680x108s
640x480x60 [1] [2]
640x480x60i [1]
768x575x50i [1]
1440x900x76 [1] [2]
1600x1000x66 [1] [2]
1600x1000x76 [1] [2]
1600x1280x76 [1] [2]
1920x1080x72 [1] [2]
1920x1080x76 [1] [2]
1920x1200x70 [1] [2]
1920x1200x75 [1] [2]
svga [1]
1152
1280
stereo
vga [1] [2]
ntsc [1]
pal [1]
none
Notes:
[1] monitor does not support this resolution.
[2] this version of FFB (FFB1) does not support this resolution.
%

system configuration
% sysdef
Display the device list (and drivers attached to devices)

% prtconf -D
System Configuration: Sun Microsystems sun4u
Memory size: 256 Megabytes
System Peripherals (Software Nodes):

SUNW,Ultra-1
packages
terminal-emulator
deblocker
obp-tftp
disk-label
ufs-file-system
chosen
openprom
client-services
options, instance #0 (driver name: options)
aliases
memory
virtual-memory
counter-timer
sbus, instance #0 (driver name: sbus)
SUNW,CS4231 (driver name: audiocs)
auxio
flashprom
SUNW,fdtwo, instance #0 (driver name: fd)
eeprom (driver name: eeprom)
zs, instance #0 (driver name: zs)
zs, instance #1 (driver name: zs)
sc
SUNW,pll
SUNW,fas, instance #0 (driver name: fas)
sd (driver name: sd)
st (driver name: st)
sd, instance #0 (driver name: sd)
sd, instance #1 (driver name: sd)
sd, instance #2 (driver name: sd)
sd, instance #3 (driver name: sd)
sd, instance #4 (driver name: sd)
sd, instance #5 (driver name: sd)
sd, instance #6 (driver name: sd)
sd, instance #7 (driver name: sd)
sd, instance #8 (driver name: sd)
sd, instance #9 (driver name: sd)
sd, instance #10 (driver name: sd)
sd, instance #11 (driver name: sd)
sd, instance #12 (driver name: sd)
sd, instance #13 (driver name: sd)
sd, instance #14 (driver name: sd)
SUNW,hme, instance #0 (driver name: hme)
SUNW,bpp (driver name: bpp)
SUNW,UltraSPARC
SUNW,ffb, instance #0 (driver name: ffb)
pseudo, instance #0 (driver name: pseudo)

processor type, speed

% psrinfo -v
Status of processor 0 as of: 06/16/99 12:38:51
Processor has been on-line since 02/07/99 01:47:11.
The sparcv9 processor operates at 200 MHz,
and has a sparcv9 floating point processor.

patch applied on the system
% showrev -p
exported file system on NFS server
% showmount -e NFS_SERVER
display current run level
% who -r
Find out a package which a file belongs to

% pkgchk -l -p /usr/lib/sendmail
Pathname: /usr/lib/sendmail
Type: regular file
Expected mode: 4555
Expected owner: root
Expected group: bin
Expected file size (bytes): 650720
Expected sum(1) of contents: 22626
Expected last modification: Apr 07 04:13:53 1999
Referenced by the following packages:
SUNWsndmu
Current status: installed

%

Examining gcc behavior
% gcc -v -x c /dev/null
Display the version of CDE

% /usr/ccs/bin/what /usr/dt/bin/dtmail
/usr/dt/bin/dtmail:
CDE Version 1.3.4
CDEVersion1.3.4

Display the version of BIND

% nslookup -class=chaos -q=txt version.bind ns0.optix.org
Server: impulse.optix.org
Address: 210.164.85.210
Aliases: 210.85.164.210.in-addr.arpa

VERSION.BIND text = "8.2.2-P5"
% dig @ns-tk021.ocn.ad.jp version.bind chaos txt
; <<>> DiG 8.2 <<>> @ns-tk021.ocn.ad.jp version.bind chaos txt
; (1 server found)
;; res options: init recurs defnam dnsrch
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUERY SECTION:
;; version.bind, type = TXT, class = CHAOS

;; ANSWER SECTION:
VERSION.BIND. 0S CHAOS TXT "4.9.7-REL"

;; Total query time: 81 msec
;; FROM: velocity to SERVER: ns-tk021.ocn.ad.jp 203.139.160.103
;; WHEN: Tue May 9 17:26:23 2000
;; MSG SIZE sent: 30 rcvd: 64

%

system configuration

% /usr/platform/`uname -i`/sbin/prtdiag
System Configuration: Sun Microsystems sun4u 8-slot Sun Enterprise 4000/5000
System clock frequency: 82 MHz
Memory size: 512Mb

========================= CPUs =========================

Run Ecache CPU CPU
Brd CPU Module MHz MB Impl. Mask
--- --- ------- ----- ------ ------ ----
0 0 0 248 2.0 US-II 1.1
0 1 1 248 2.0 US-II 1.1
2 4 0 248 2.0 US-II 1.1
2 5 1 248 2.0 US-II 1.1


========================= Memory =========================

Intrlv. Intrlv.
Brd Bank MB Status Condition Speed Factor With
--- ----- ---- ------- ---------- ----- ------- -------
0 0 256 Active OK 60ns 2-way A
2 0 256 Active OK 60ns 2-way A

========================= IO Cards =========================

Bus Freq
Brd Type MHz Slot Name Model
--- ---- ---- ---- -------------------------------- ----------------------
1 SBus 25 3 SUNW,hme
1 SBus 25 3 SUNW,fas/sd (block)
1 SBus 25 13 SUNW,soc/SUNW,pln 501-2069
5 SBus 25 3 SUNW,hme
5 SBus 25 3 SUNW,fas/sd (block)
5 SBus 25 13 SUNW,soc/SUNW,pln 501-2069

Detached Boards
===============
Slot State Type Info
---- --------- ------ -----------------------------------------
3 disabled disk Disk 0: Target: 10 Disk 1: Target: 11
7 disabled disk Disk 0: Target: 14 Disk 1: Target: 15

No failures found in System
===========================

No System Faults found
======================

%

Source : http://www.optix.org/~dxy/solaris/command/

Some Gathering Solaris system information Stuff

Gathering Solaris system information
A UNIX administrator may be asked to gather system information about his/her Solaris systems. Here are the commands used on a Solaris 7 system to gather various system information.

Processors
The psrinfo utility displays processor information. When run in verbose mode, it lists the speed of each processor and when the processor was last placed on-line (generally the time the system was started unless it was manually taken off-line).

/usr/sbin/psrinfo -v
Status of processor 1 as of: 12/12/02 09:25:50
Processor has been on-line since 11/17/02 21:10:09.
The sparcv9 processor operates at 400 MHz,
and has a sparcv9 floating point processor.
Status of processor 3 as of: 12/12/02 09:25:50
Processor has been on-line since 11/17/02 21:10:11.
The sparcv9 processor operates at 400 MHz,
and has a sparcv9 floating point processor.

The psradm utility can enable or disable a specific processor.

To disable a processor:
/usr/sbin/psradm -f processor_id

To enable a processor:
/usr/sbin/psradm -n processor_id

The psrinfo utility will display the processor_id when run in either standard or verbose mode.

RAM
The prtconf utility will display the system configuration, including the amount of physical memory.

To display the amount of RAM:

/usr/sbin/prtconf | grep Memory
Memory size: 3072 Megabytes


Disk space
Although there are several ways you could gather this information, the following command lists the amount of kilobytes in use versus total kilobytes available in local file systems stored on physical disks. The command does not include disk space usage from the /proc virtual file system, the floppy disk, or swap space.

df -lk | egrep -v "Filesystem|/proc|/dev/fd|swap" | awk '{ total_kbytes += $2 } { used_kbytes += $3 } END { printf "%d of %d kilobytes in use.\n", used_kbytes, total_kbytes }'
19221758 of 135949755 kilobytes in use.

You may want to convert the output to megabytes or gigabytes and display the statistics as a percentage of utilization.

The above command will list file system usage. If you are interested in listing physical disks (some of which may not be allocated to a file system), use the format command as the root user, or the iostat -En command as a non-privileged user.


Processor and kernel bits
If you are running Solaris 2.6 or earlier, you are running a 32-bit kernel.

Determine bits of processor:
isainfo -bv

Determine bits of Solaris kernel:
isainfo -kv

Source : http://www.brandonhutchinson.com/

Saturday, July 9, 2011

Links

1- http://blog.thilelli.net/
2- http://unixsadm.blogspot.com/
3- http://unixarticles.blogspot.com/
4- http://administratosphere.wordpress.com/
5- http://www.ilkda.com/sendmail/
6- http://unixuptime.com/
7- http://thegreyblog.blogspot.com/
8- http://unixfoo.blogspot.com/
9- http://www.boran.com/
10-http://www.rootunix.org/
11-http://www.review-ninja.com/

Friday, July 8, 2011

Link

http://www.leonardoborda.com/

Link

Link

http://jeffersonbriones.blogspot.com/

Saturday, July 2, 2011

link

http://sureshaix.blogspot.com

Tuesday, June 7, 2011

Chrooting AIX

http://1-linux.blogspot.com/2008/04/openssh-with-aix-chroot.html

http://www.snoozingdragon.com/information-technology/tips-and-tricks/set-up-rssh-with-chroot-jail-on-aix-53-3.html

http://ulf.zeitform.de/en/documents/sshchroot.html

Saturday, May 28, 2011

TSM Offsite Volumes Operations

Link -1 http://publib.boulder.ibm.com/tividd/td/SMAS4N/GC35-0315-01/en_US/HTML/a454g205.htm

Saturday, May 21, 2011

Links

1- http://passionforunix.blogspot.com
2- http://www.ilive4unix.net/

Xterm Short-Cuts

Ctrl-c Interupt, break
Ctrl-z Suspending process
Ctrl-s Puases program output
Ctrl-q Unpause program output
Ctrl-d Exit, quit, or logout (may signal EOF)
Ctrl-j Line feed
Ctrl-u Erases whole line
Ctrl-h Backspace
Ctrl-\ Quit
Ctrl-? Same as DEL key
Ctrl-left mouse Main options
Ctrl-right mouse VT fonts
Ctrl-middle mouse VT options

Thursday, May 19, 2011

Back up HMC critical data to FTP server command line

Back up HMC critical data to FTP server command line

hscroot@hmcsrvr:~> bkconsdata -r ftp -h hostname -u user --passwd pass -d /home/user/

Saturday, May 14, 2011

AIX HACMP Startup Procedure

Purpose:

This document describes steps to start and stop IBM HACMP cluster.

Startup Procedure:

Phase1: Powering on the servers and bringing up AIX.

Caution: Do NOT power on both the servers simultaneously.

BEGINNING of phase1:

1) Power on all peripherals.If any of the peripherals is already on, leave it as it is.

2) Power ON node1 server.

3) Wait till the Common Desktop Environment (CDE) screen is displayed in the monitor display of this server.

4) Power ON node2 server.

5) Wait till the Common Desktop Environment (CDE) screen is displayed in the monitor display of this server.

END of phase1


Phase2: Bringing up cluster (HACMP):

Caution: Do not login now through CDE. Through out this procedure use only command line login.

BEGINNING of phase2:

1)login as : root

2) Checks to see that the cluster is not running:
a)
# lssrc -g cluster

Subsystem Group PID Status


b)
# netstat -i


c)
# lsvg -o

rootvg


3) Check to see if network is working:
a)
# ping node2_boot
# ping node2_stdby
# ping node2_prv



4) Start HACMP:
# smitty clstart

Start Cluster Services

Type or select values in entry fields.
Press Enter AFTER making all desired changes.

[Entry Fields]
* Start now, on system restart or both now

BROADCAST message at startup? true
Startup Cluster Lock Services? true
Startup Cluster Information Daemon? true


[[ Left Hand Top Corner - "Running". Wait till "O.K" is displayed ]]
Esc+0 to exit to prompt.




To see the progress of cluster startup:

# tail -f /tmp/hacmp.out



When no more update takes place, the cluster is fully up on this system.

5) Check if cluster is up and normal:
a)
# lssrc -g cluster

Subsystem Group PID Status
clstrmgrES cluster 12762 active
clsmuxpdES cluster 14672 active
clinfoES cluster 15570 active



b)
# netstat -i


c)
# lsvg -o



othervg
rootvg



END of phase2:
Cluster is ready.

Links

1- http://aixibm.wordpress.com

How to determine the number of cores in a Power CPU?

1- http://unix.ittoolbox.com/groups/technical-functional/ibm-aix-l/how-to-determine-the-number-of-cores-in-a-cpu-3231386

TSM Disaster Recovery

TSM Disaster Recovery

http://www.urz.uni-heidelberg.de/ADSM/ibmdoc.tsm51/win/html/guide/anrwg241.htm
http://webdocs.caspur.it/ibm_doc/tsm/5.1.5/doc/win/html/qstart/anrwqs33.htm
http://www.urz.uni-heidelberg.de/ADSM/ibmdoc.tsm51/win/html/guide/anrwg241.htm
http://www.urz.uni-heidelberg.de/ADSM/ibmdoc.tsm51/win/html/guide/anrwg244.htm#HDRDRSCRIPT
http://www.urz.uni-heidelberg.de/ADSM/ibmdoc.tsm51/mvs/html/qstart/anrmqs15.htm
http://ezaix.blogspot.com/2008/01/complete-tsm-disaster-recovery.html

Thursday, May 12, 2011

links

1- http://4bcad.com/doc/
2- http://lazysystemadmin.blogspot.com/
3- http://momo66.wordpress.com

AIX focused korean website

http://aixservice.net/documents/

Tuesday, May 10, 2011

Determine DS8000 Series model

The DS8300 Model 9A2/9B2 provides a split between the resources.
Each storage image uses the machine type/model number/serial number of the
DS8300 Model 9A2/9B2 base frame. The frame serial number ends with a 0. The
last character of the serial number is replaced by a number in the range one to
eight that uniquely identifies the DS8000 image. This character is a 1 or a 2,

Saturday, May 7, 2011

Powering On/Off the DS8000 Series

Powering a storage unit on and off (real-time only)

Complete this task to power on or power off a storage unit, bringing it online or taking it offline, respectively.
Procedure

In the navigation, select Real-time manager > Manage hardware > Storage units. On the Storage units — Main Page, select the storage unit that you want to power on or off.
In the Select Action drop-down list, select Power Control The Control mode page is displayed.
To enable the power on and off button for the following steps, set the Current power control mode to Remote and set the Set remote power control mode to Remote management console manual.
Click Apply and then click on the Power on/off option in the left navigation pane. The Power on/off page is displayed.
The button label depends on the current state of the storage unit. If the storage unit is currently off, this button has a label of “Power on”. If the storage unit is currently on, this button has a label of “Power off”. If you open this page while the storage unit is in the process of powering on or powering off, this button is disabled.
To change the state, press the power button. A confirmation message is displayed that asks you if you want to proceed. If you choose to continue, the power button is disabled and displays the label that is the opposite state of the box until the storage unit is completely powered on or off. A progress bar is displayed by the button to indicate that the process is working.
Once the process is complete, click OK to close the page.
-------------------------------------------------------------------------------------
Storage Unit Power Control — Power on/off (real-time only)

Use this page to power on a storage unit, bringing it online, and to power off a storage unit, taking it offline.
Menu path
Real-time manager > Manage hardware > Storage units > Select a storage unit > Select Action: Power Control
Fields

Power on or off button
Enabled if the local or remote switch is set to Remote and the Remote power control mode is set to Manual power control. The default depends on the current state of the storage unit. If the storage unit is currently off, this button is labeled with “Power on”. If the storage unit is currently on, this button is labeled with “Power off”. If you open this page while the storage unit is in the process of powering on or powering off, this button is disabled.

Unlocking an administrative password DS8000

Unlocking an administrative password

There might be times when administrative users forget the password that they use to access the DS Storage Manager. Beyond the set number of allowable attempts with the wrong password, the account is locked. If the administrative account is locked, the administrator must use the security recovery utility tool to reset the password to the default (administrative). You cannot unlock an administrative password using the DS Command-Line Interface. The administrative user is forced to establish a new password. Using the chuser command, you can specify a password that expires after the initial use, and then create a new password. See DS CLI documentation for more information.
About this task
Notes:

1. This security recovery utility tool only unlocks the administrative account on the DS Storage Manager on which the tool is run.
2. This task only explains how to use the security recovery utility tool to unlock the administrative account. The topic "Unlocking a user account" describes how to unlock a non-administrative user account.
3. The security recovery utility tool is a script that is installed in a file directory. You run the script from the directory.

1. Press the Enter key. The script runs and the administrative account is unlocked. The password is reset to the default (admin).
2. Open the Web-based System Manager tool and enter the IP address of the HMC that you want to unlock the password for. Press Enter.
3. Enter the HMC (hardware management console) password.
4. Navigate to the Service Applications folder and select Service Focal Point.
5. Select Service Utilities from the Tasks list, and then highlight the storage facility.
6. Navigate to Selected > Get HMCs, and then highlight the HMC.
7. Navigate to Selected > Start/Stop ESSNI, and then select Reset under the Security Recovery Options.
8. Click Apply.

Unlocking an administrative password

There might be times when administrative users forget the password that they use to access the DS Storage Manager. Beyond the set number of allowable attempts with the wrong password, the account is locked. If the administrative account is locked, the administrator must use the security recovery utility tool to reset the password to the default (administrative). You cannot unlock an administrative password using the DS Command-Line Interface. The administrative user is forced to establish a new password. Using the chuser command, you can specify a password that expires after the initial use, and then create a new password. See DS CLI documentation for more information.
About this task
Notes:

1. This security recovery utility tool only unlocks the administrative account on the DS Storage Manager on which the tool is run.
2. This task only explains how to use the security recovery utility tool to unlock the administrative account. The topic "Unlocking a user account" describes how to unlock a non-administrative user account.
3. The security recovery utility tool is a script that is installed in a file directory. You run the script from the directory.

1. Press the Enter key. The script runs and the administrative account is unlocked. The password is reset to the default (admin).
2. Open the Web-based System Manager tool and enter the IP address of the HMC that you want to unlock the password for. Press Enter.
3. Enter the HMC (hardware management console) password.
4. Navigate to the Service Applications folder and select Service Focal Point.
5. Select Service Utilities from the Tasks list, and then highlight the storage facility.
6. Navigate to Selected > Get HMCs, and then highlight the HMC.
7. Navigate to Selected > Start/Stop ESSNI, and then select Reset under the Security Recovery Options.
8. Click Apply.

Friday, May 6, 2011

DS8000 Series information Center links

1- http://publib.boulder.ibm.com/infocenter/dsichelp/ds8000ic/index.jsp?topic=

2- http://www.ibm.com/developerworks/aix/library/au-disk_storage/index.html

Several Tutorials

1- http://www.arcudi.org/index.php?option=com_content&task=section&id=6&Itemid=88

Thursday, May 5, 2011

Complete TSM Disaster Recovery

Link : http://ezaix.blogspot.com/2008/01/complete-tsm-disaster-recovery.html
Complete TSM Disaster Recovery
These are my notes from the Mercedes Benz DR Test .
To restore the TSM we must have at least the DB backup and storage pool backups. These are two most essential things, rest all can be recreated. It helps if you have the volume history and device configuration file as well, although most of the time if TSM is being restored on a different server you will end up recreating the device config. If you have DR plan that would be the best.

Now to begin with, the original environment was TSM as a partition on p595 with a 3584 partitioned Library with 5 drives. The restoration environment was a similar partition on p570, 3584 with 10 drives. The test was done at vendor location who provided hardware with partitions and vanilla AIX installation.


Make sure you have CDROM drivers installed or at least have CDROM properly configured on one of the partitions from where you can NFS mount it to TSM partition. We ended up spending half hour in searching and installing drivers from AIX OS CDs by FTPing the bff files from a PC to TSM partition.
Install TSM software. Match the version and fix level of source server. Do not forget to run lppchk and comment out the automatic start script in /etc/inittab before you reboot the server.
Check the size of DB and log files from DR plan and create them with dsmfmt.
Initialize the logs and db files with dsmserv format. This would put in the entries for these files in dsmserv.dsk file in TSM installation directory.
Set your ulimits to unlimited, export LANG=en_US and run dsmserv. It will start TSM server and would give you TSM prompt. Here set the server name, then create device configurations in following order:
define library
define path for library
define drive
define path for drives
define devclass
Make sure the device names used while defining path to drives have the same serial number as the serial number of physical drive in the element used in defining the drive. The AIX device numbers (rmt0, rmt1 etc.) are not necessarily in order. Use lscfg -vl and lsattr -El for this. To speed up the restoration, just define one drive and start, rest can be done once TSM is restored and clients have started restoring their files. We do not need disk storage pool as no client is going to backup their data here and all restores will happen from tapes only.
Halt the TSM server. Restore the original dsmserv.opt from DR plan or any other location and run backup devconfig. This will write the newly created devconfig to files specified in dsmserv.opt. Copy this devconfig, we will need it again and it gets overwritten when we restore DB.
Copy the original volume history file to the place pointed by dsmserv.opt.
Put in the tapes in library.

While using the 3584 library, TSM puts in the location of volumes as a line in device config file, I don't remember seeing this in 3590s, may be because that was an intelligent library. Get the location of DB backup tape from 3584 web interface and write a single line in device config with the location of DB backup volume. (Spent another half hour figuring this out). The line would look like this: /* LIBRARYINVENTORY SCSI 3584_LIB 000002 1605 101*/
Where first column indicates its library inventory, second column states the type of library it is, third column library name, fourth column volume name/serial no, fifth column is the element address and the sixth and last column is logical library number.
Run dsmserv restore db with todate option. TSM checks the volhist file for latest DB backup and then checks device config for its location. The volume is mounted, DB restored and the log files are formatted again. The progress of log format and DB restore is mixed together in console so you have to look hard to monitor the DB restoration progress.
Once the DB is restored, the TSM dismounts the volume and halts. The device config is now overwritten with original TSM's device config, so copy it and overwrite it with the one we created for this environment.
Start TSM by issuing dsmserv. Once you get the prompt, checkin the volumes with search=yes and status=private.
Mark all primary storage pool volumes' access as destroyed.
Update all copy storage pool volumes' access as readonly.
Disable all admin schedules for backup storage pool, expiration or reclamation.
Halt the server.
Start the server normally. You should be good to restore the data from TSM now.

TSM cheat sheet

TSM cheat sheet

The syntax for TSM commands is a verb followed by an object, which is then usually followed by flags and conditions (both required and optional). The commands do not have to be typed out completely; if you type the capitalized portions of the commands listed below, that is sufficient to run the command. For example, the
Query STGpool
command can be typed as
q stg

[from a system prompt] dsmadmc
This opens the administrative command line interface to the TSM server. It can be run from any computer that has the administrative client loaded and has a configuration file (dsm.opt or dsm.sys) that contains pointers to a TSM server. On UNIX computers, the TSM client installation process paths the directory that contains dsmadmc; on Windows computers, you must cd to the proper directory (default: c:\program files\tivoli\tsm\baclient) before running this command. In order to view a ‘live’ window of the TSM activity log, use dsmadmc with this flag:
dsmadmc -console
Note that the directory that dsmadmc resides in is pathed for UNIX boxes, but it is not for Windows machines.

[from a web browser session] http://:1580
This opens the web-based administrative interface to the TSM server. It can be run from any computer that has a sufficiently recent version of a web browser. 1580 is the default TCP port used by TSM for web communication; it can be configured to any desired, non-reserved TCP port in the TSM server’s configuration file:
dsmserv.opt


Help
When you prefix 'help' to the beginning of any command, TSM will display the help file for that command. The help file contains an explanation of the command, its syntax, examples of the command, and related commands.


Help
When you type 'help' followed by a message ID found at the beginning of each activity log entry, you get an explanation of what the message ID refers, and other related information.


Query STGpool
This command will show a detailed list of all storage pools in the following format:

Storage Pool Name Device Class Name Est. capacity Pct Util Pct Migr High Mig Low Mig Next Pool
AOFFSITE2 IBM3590 1,220,636.0 0.5
ARCHPOOL2 IBM3590 1,220,636.0 0.5 1.0 85 70
ARDISK2 DISK 808.0 98.9 6.3 35 0 ARCHPOOL2
BUPOOL1 DISK 69,530.0 9.2 9.2 40 0 TAPEPOOL1
BUPOOL2 DISK 108,385.0 1.3 1.3 40 0 TAPEPOOL2
BUPOOL3 DISK 85,890.0 2.7 0.0 40 0 TAPEPOOL3
OFFSITE1 IBM3590 4,326,864.0 12.4


Query EVent
This command will list information concerning the results of scheduled events for both clients and administration. The syntax of the command for examining client backups for the current 24-hour time slice is

Query EVent * *

For examining the outcome of scheduled client events for other days is

Query EVent * * BEGINDate=MM/DD/YYYY

The output of the command appears in the following format:

Scheduled Start Actual Start Schedule Name Node Name Status
07/19/2001 00:00:00 07/19/2001 00:25:44 AM000 LAWSONP1 Completed
07/19/2001 00:00:00 07/19/2001 00:03:07 AM000 DOMINO1 Completed
07/19/2001 00:00:00 07/19/2001 00:47:31 AM000 LAWSOND1 Failed
07/19/2001 00:00:00 07/19/2001 00:11:45 AM000 BINC_MSN Completed
07/19/2001 00:00:00 07/19/2001 00:05:17 AM000 BINCDOM_BDC Missed
07/19/2001 00:00:00 07/19/2001 00:12:10 AM000 MSNLS8B Completed

Similarly, the command to show the success or failure of scheduled administrative events is

Query EVent * type=admin

'Missed' events never commenced. 'Failed' events began, but for some reason had a non-zero status returned at completion. 'Future' events have yet to occur in the time slice requested.


Query DB
This command will show the current state of the TSM internal database. The output shows:

Available Assigned Maximum Maximum Page Total Used Pct Max.
Space Capacity Extension Reduction Size Usable Pages Util Pct
(MB) (MB) (MB) (MB) (bytes) Pages Util
28,616 26,572 2,044 8,296 4,096 6,802,432 4,171,891 61.3 61.8


Query PRocess
This command will show currently running processes, such inventory expiration, library audits, data migration, etc.


Query SEssion
This command will show all currently connected clients. The output looks like this:

Sess Comm. Sess Wait Bytes Bytes Sess Platform Client Name
Number Method State Time Sent Recvd Type
48,449 Tcp/Ip Run 0 S 262.3 K 735 Admin WinNT ADMIN
48,535 Tcp/Ip MediaW 59 S 1.3 G 2.0 K Node Linux86 SWISSWEB


Query ACTlog
This command will show a listing of the TSM activity log. The default command will show the previous hour's worth of log entries. The syntax for specific blocks of time is

Query ACTlog BEGINDate=mm/dd/yyyy BEGINtime=hh:mm ENDDate=mm/dd/yyyy ENDTime=hh:mm


Query DRive
This command will show the existence and state of all tape drives defined within TSM. The output looks like this:

Library Name Drive Name Device Type Device On Line
IBM3494 DRIVE1 3590 /dev/rmt1 Yes
IBM3494 DRIVE2 3590 /dev/rmt2 Yes
IBM3494 DRIVE3 3590 /dev/rmt3 Yes
IBM3494 DRIVE4 3590 /dev/rmt4 Yes
IBM3494 DRIVE5 3590 /dev/rmt5 Yes
IBM3494 DRIVE6 3590 /dev/rmt6 Yes
MANUAL4MM IBM1 4MM /dev/mt7 Yes


Query LIBRary
This command will show the existence and state of all tape libraries defined within TSM. The output looks like this:

Library Name: IBM3494
Library Type: 349X
Device: /dev/alcatraz
Private Category: 300
Scratch Category: 301
External Manager:
Shared: No

Library Name: MANUAL4MM
Library Type: MANUAL
Device:
Private Category:
Scratch Category:
External Manager:
Shared: No


Query LIBVolume
This command will list the tape volumes currently contained in all tape libraries and recognized by TSM as either scratch or private tapes. The output looks like this:

Library Name Volume Name Status Owner Last Use Home Element
IBM3494 016001 Scratch
IBM3494 016002 Scratch
IBM3494 016003 Scratch
IBM3494 016004 Private Data
IBM3494 016005 Scratch
IBM3494 016006 Scratch
IBM3494 016007 Private Data
IBM3494 016008 Private Data
IBM3494 016009 Private Data
IBM3494 016011 Private Data
IBM3494 016013 Private DbBackup
IBM3494 016015 Private DbBackup


Query SYStem
This command will echo all server settings. This command generates quite a bit of information about the settings and configuration of the TSM server.


Query NODe
This command will echo back the names and other information concerning the clients that have been registered with the TSM server.


EXPIre Inventory
This command will purge the TSM database of all entries that have been deleted due to retention rule enforcement or manual deletion. This should be run on a daily basis, preferably scheduled as an administrative event.


BAckup DB
This command will backup the internal TSM database to the designated device class (tape, file, etc.). This command should be run on a daily basis, preferably scheduled as an administrative event.


Many of the Query commands have counterparts to define new entities or update existing ones. To define most new entities, substitute

DEFine

for Query. To update existing entities, substitute

UPDate

for Query. For instance, to update an existing storage pool, the command syntax is

UPDate STGpool ...

Use the Help prefix to obtain complete information about such commands, or refer to the TSM Administrator's Reference.

Many of the Query commands allow for an optional flag Format=Detailed. This gives more detailed information in the query results.

Sunday, May 1, 2011

Links

1- http://solarisinterview.blogspot.com/
2- http://sysadmincollection.blogspot.com/

links

1- http://aix-theinandouts.blogspot.com/

Link

1- http://anandbanajiger.blogspot.com/
2- http://singautara.blogsome.com/

Link

1- http://www.fsck.it/html/geek/unix/intro.html

Links

1- http://unixworld2010.wordpress.com/
2- http://www.pimpworks.org/
3- http://unixarticles.com/
4- http://doc-tcpip.org/index.html

Links

1- http://aixblogs.blogspot.com/
2- http://www.ahinc.com/
3- http://www.system.adm.br/

Sys Admin magz

1- https://students.cs.unipi.gr/pub/docs/sysadmin-1992-1998/

AIX Link

1- http://thinkaix.blogspot.com/

Sys Admin Pocket Survival Guide

1- http://users.cis.fiu.edu/~tho01/psg/psg.html

AIX sheet

1- http://www.pimpworks.org/ibm/aix.txt
TITLE : AIX Command Crib Sheet
OS LEVEL : AIX
DATE : 11/02/2001
VERSION : 2.0

>> Latest version can be found at http://mort.level5.net/johnr/index.html <<

----------------------------------------------------------------------------
MISCELLENEOUS
----------------------------------------------------------------------------

http://www.rs6000.ibm.com/cgi-bin/ds_form Web based man pages

compress -c file.txt > file.Z Create a compressed file.

uuencode (infile) (extract-file-name) > (output file)
Converts a binary file to an ASCII file for transfer by modem or email

uudecode (encoded file)
Extracts a binary file from encoded file and calls it the extract-file-name

examples :-

uuencode maymap maymap > maymap.enc
uudecode maymap.enc

od -c /tmp Displays contents of the /tmp directory file
ls -i Lists files with their inode numbers
echo * Lists files, can be used if ls is corrupt/missing

chtz (timezone eg GMT0BST) Changes the timezone in /etc/environment file
chlang (language eg En_GB) Changes the language in /etc/environment file

ar -v -t (archive file) List contents of an archive
ar -v -x (archive file) Extracts the archive
ar -v -t /usr/lib/libC-r.a Lists contents of the libC_r.a library

find /source -print | cpio -pdm /target
Copying directories using cpio, creates /target/source directory.

dump -nTv (binary executable) Displays the contents of an executable file

dump -c Displays string information
dump -o Displays object file headers
dump -l Displays line numbers
dump -s Displays the text section

snap -ao /dev/rmt0 Create a snapshot onto tape
snap -ad (directory) Create a snapshot into a named directory other
than the default (/tmp/ibmsupt)

/usr/dt/bin/dtconfig -d Disables desktop logins
/usr/dt/bin/dtconfig -e Enables desktop logins
/var/dt/Xpid PID of the dtlogin process

--------------------------------------------------------------------------------
LICENSES / SOFTWARE INSTALLATION
--------------------------------------------------------------------------------


lslicense Displays number of current user licenses
chlicense -u (number) Changes the number of user licenses
( ftp,rexec and rsh (without -i flag) do not need an AIX user license to be
able to access the system. )


oslevel Returns operating system level

4 . 3 . 3 . 0 <--------- Preventive Maintenance Level
| | |
| | +----------------Modification
| +--------------------Release
+------------------------Version

oslevel -l 4.3.3.0 Displays all filesets that are "downlevel"

whence (program) Returns full path of program
whereis (program) Returms full path of program

what (program) Displays identifying info from the executable
like version number, when compiled.

lslpp -L all list all installed software
lslpp -L (program set name) Check if software installed
lslpp -f Lists filesets vs packages
lslpp -ha Lists installation history of filesets
lslpp -w /usr/bin/swapon Lists the fileset that the file belongs to

lppchk -c Checks file checksums against SWVPD
lppchk -l Checks symbolic links against SWVPD

instfix -ik (fix number eg IX66617) Checks id fix is installed
instfix -ik 4330-02_AIX_ML
instfix -i | grep ML Displays all ML's installed

instfix -k IX38794 -d /dev/cd0 Installs a fix from cdrom

/usr/sbin/install_assist Smitty Installation Assistant

/usr/sys/inst.images/sys.bundles Software bundle files

alt_disk_install -c hdisk1 Clones a running rootvg onto hdisk1
alt_disk_install -w Wakes up alt vg
alt_disk_install -s Sends alt vg to sleep !
alt_disk_install -x Removes alt vg from disk

/usr/lpp/bosinst/blvset -d /dev/hdisk0 -p 4.2
Resets the pad string in the BLV to the correct AIX version. Needed if the
migration option is missing when installing.

installp -ad (device) (fileset) (level) Install apply and commit fileset
installp -pad (device) (fileset) (level) Preview install
installp -u (fileset) Remove fileset
installp -ld (device) List all software on device

example:-

installp -pad /dev/rmt0 X11.base 4.3.3.0

installp -C Cleans up after a premature cancel or interrupted installation.

--------------------------------------------------------------------------------
TERMINALS / DISPLAYS
--------------------------------------------------------------------------------

/usr/share/lib/terminfo Directory with all support terminal info files.

tty Displays what the tty/pty number of the terminal is.

termdef reports the termtype setup in smit for the tty port
that termdef is run on.

chdev -l (device eg tty1) -a term=vt100 Sets tty to a vt100 terminal type

penable tty0 adds getty line into /etc/inittab for tty0 and starts getty
pdisable tty0 disables the getty line and disables getty

penable / pdisable -a option is for all

stty erase ^? Set backspace key for vt100 terminals
stty erase ^H Set backspace key for wyse50 terminals

lscons Displays the console device
chcons -a login=enable (device eg /dev/tty1) Changes the console device

lsdisp Display adapter device information
chdisp Change default display used by LFT subsystem


Create ttys on ports 0 to 7 on adapter sa2 :-

for i in 0 1 2 3 4 5 6 7
do
mkdev -c tty1 -t tty -s rs232 -p sa2 -w$i -a login=enable -a term=vt100
done

portmir -t /dev/tty0 Mirror current terminal onto /dev/tty0
portmir -o Turns off port mirroring


--------------------------------------------------------------------------------
NETWORK
--------------------------------------------------------------------------------

host (ip or hostname) Resolves a hostname / ip address

hostname Displays hostname
hostname (hostname) Sets the hostname until next reboot

lsdev -Cc if Lists all available/defined network interfaces

chdev -l (device name) -a hostname=(hostname) Changes hostname permanently
chdev -l inet0 -a hostname=thomas

ifconfig (device name) Displays network card settings
ifconfig (device name) up Turns on network card
chdev -l (device name) -a state=up Turns on network card
ifconfig (device name) down Turns off network card
ifconfig (device name) detach Removes the network card from the
network interface list
ifconfig en0 inet 194.35.52.1 netmask 255.255.255.0 up

ifconfig lo0 alias 195.60.60.1 Create alias ip address for loopback

route (add/delete) (-net/-host) (destination) (gateway)
Adds or deletes routes to other networks or hosts, does not update
the ODM database and will be lost at reboot.
route add -net 194.60.89.0 194.60.90.4

chdev -l inet0 -a "net,-hopcount,1,-netmask,255.255.255.0,207.156.168.0,10.0.15.254"
(destination) ( gateway )
Adds route and adds entry into ODM, route survives a reboot,

route -rn Display route table
odmget -q "attribute=route" CuAt Displays routes in the ODM.

lsattr -EHl inet0 Displays routes set in ODM and hostname
odmget -q "name=inet0" CuAt Displays routes set in ODM and hostname

refresh -s inetd Refresh inetd after changes to inetd.conf
kill -1 (inetd PID) Refresh inetd after changes to inted.conf

netstat -i Displays interface statistics
entstat -d (ethernet adapter eg en0) Displays ethernet statistics

arp -a Displays ip to mac address table from arp cache

no -a Displays network options use -o to set individual options or
-d to set individual options to default.
no -o option=value (this value is reset at reboot)
no -o "ipforwarding=1"

traceroute (name or ipaddress) Displays all the hops from source to
destination supplied.

ping -R (hostname or ipaddress) Same as traceroute except repeats.
spray (hostname or ipaddress) Send a stream of packets to a host

stopsrc -g tcpip Stops all running TCP/IP daemons
/etc/tcp.clean Stops all running TCP/IP daemons and removes all
lock files
/etc/rc.tcpip Start all TCP/IP daemons.
Do not use startsrc -g tcpip as this will start all
TCP/IP daemons including routed & gated
--------------------------------------------------------------------------------
N.F.S.
--------------------------------------------------------------------------------

exportfs Lists all exported filesystems

exportfs -a Exports all fs's in /etc/exports file

exportfs -u (filesystem) Un-exports a filesystem

mknfs Configures and starts NFS services

rmnfs Stops and un-configures NFS services

mknfsexp -d /directory Creates an NFS export directory

mknfsmnt Creates an NFS mount directory

mount hostname:/filesystem /mount-point Mount an NFS filesystem

nfso -a Display NFS Options
nfso -o option=value Set an NFS Option
nfso -o nfs_use_reserved_port=1

--------------------------------------------------------------------------------
BACKUPS
--------------------------------------------------------------------------------

MKSYSB
------

mkszfile -f Creates /image.data file (4.x onwards)
mkszfile -X Creates /fs.size file (3.x)

mksysb -i (device of file) Creates a mksysb image

mksysb does not save any raw data and will not backup a filesystem that
is not mounted.

SAVEVG
------

savevg -if (device or file) (vg) Creates a savevg image

restvg -q -f (device or file) Restore from a savevg image
Ensure that the restvg command is run from /

mkvgdata (vg) Creates new vgname.data file

CPIO ARCHIVE
------------

find (filesystem) -print | cpio -ocv > (filename or device)

eg find ./usr/ -print | cpio -ocv > /dev/rmt0

CPIO RESTORE
------------

cpio -ict < (filename or device) | more Lists archive
cpio -icdv < (filename or device)
cpio -icdv < (filename or device) ("files or directories to restore")

eg cpio -icdv < /dev/rmt0 "tcpip/*" Restore directory and contents
cpio -icdv < /dev/rmt0 "*resolve.conf" Restore a named file

TAR ARCHIVE
-----------

tar -cvf (filename or device) ("files or directories to archive")

eg tar -cvf /dev/rmt0 "/usr/*"

TAR RESTORE
-----------

tar -tvf (filename or device) Lists archive

tar -xvf (filename or device) Restore all
tar -xvf (filename or device) ("files or directories to restore")
use -p option for restoring with orginal permissions

eg tar -xvf /dev/rmt0 "tcpip" Restore directory and contents
tar -xvf /dev/rmt0 "tcpip/resolve.conf" Restore a named file

AIX ARCHIVE
-----------

find (filesystem) -print | backup -iqvf (filename or device)
Backup by filename.

eg find /usr/ -print | backup -iqvf /dev/rmt0

backup -(backup level 0 to 9) -f (filename or device) ("filesystem")
Backup by inode.

eg backup -0 -f /dev/rmt0 "/usr" -u option updates /etc/dumpdates file

AIX RESTORE
-----------

restore -qTvf (filename or device) Lists archive

restore -qvxf (filename or device) Restores all
restore -qvxf (filename or device) ("files or directories to restore")
(use -d for restore directories)

restore -qvxf /dev/rmt0.1 "./etc/passwd" Restore /etc/passwd file

restore -s4 -qTvf /dev/rmt0.1 Lists contents of a mksysb tape


BACKUPS ACROSS A NETWORK
------------------------

To run the backup on a local machine (cpio) and backup on the remote
machine's (remhost) tape drive (/dev/rmt0)

find /data -print | cpio -ocv | dd obs=32k | rsh remhost \
"dd ibs=32k obs=64k of=/dev/rmt0"

To restore/read the backup (cpio) on the remote machine

dd ibs=64k if=/dev/rmt0 | cpio -icvt

To restore/read the backup (cpio) on the local machine from the remote
machine's (remhost) tape drive (/dev/rmt0)

rsh remhost "dd ibs=64k obs=32k if=/dev/rmt0" | dd ibs=32k \
| cpio -icvt

To run the backup (cpio) on a remote machine (remhost) and backup to
the local machines tape drive (/dev/rmt0)

rsh remhost "find /data -print | cpio -ocv | dd ibs=32k" \
| dd ibs=32k obs=64k of=/dev/rmt0

tar cBf - . | rsh remhost "dd ibs=512 obs=512 of=/dev/rmt0"
Same as above but using tar instead of cpio.

--------------------------------------------------------------------------------
Copying diskettes and tape
--------------------------------------------------------------------------------

COPYING DISKETTES
-----------------

dd if=/dev/fd0 of=(filename) bs=36b
dd if=(filename) of=/dev/fd0 bs=36b conv=sync or flcopy


COPYING TAPES
-------------

dd if=/dev/rmt0 of=(filename)
dd if=(filename) of=/dev/rmt0 or tcopy

--------------------------------------------------------------------------------
VI Commands
--------------------------------------------------------------------------------

:g/xxx/s//yyy/ global change where xxx is to be changed by yyy

sed 's(ctrl v ctrl m)g//g' old.filename > new.filename
Strips out ^M characters from ascii files that have been transferred as binary.
To enter crontrol characters type ctrl v then ctrl ? where ? is whatever
ctrl character you need.

--------------------------------------------------------------------------------
DEVICES
--------------------------------------------------------------------------------

lscfg lists all installed devices
lscfg -v lists all installed devices in detail
lscfg -vl (device name) lists device details

bootinfo -b reports last device the system booted from
bootinfo -k reports keyswitch position
1=secure, 2=service, 3=normal

bootinfo -r reports amount of memory (/ by 1024)
bootinfo -s (disk device) reports size of disk drive
bootinfo -T reports type of machine
ie rspc,rs6ksmp,rspc or chrp

lsattr -El sys0 -a realmem reports amount of useable memory

mknod (device) c (major no) (minor no) Creates a /dev/ device file.
mknod /dev/null1 c 2 3

lsdev -C lists all customised devices ie installed
lsdev -P lists all pre-defined devices ie supported
lsdev -(C or P) -c (class) -t (type) -s (subtype)

chdev -l (device) -a (attribute)=(new value) Change a device attribute
chdev -l sys0 -a maxuproc=80

lsattr -EH -l (device) -D Lists the defaults in the pre-defined db
lsattr -EH -l sys0 -a modelname

rmdev -l (device) Change device state from available to defined
rmdev -l (device) -d Delete the device
rmdev -l (device) -SR S stops device, R unconfigures child devices

lsresource -l (device) Displays bus resource attributes of a device.

cfgmgr Configures devices
cfgmgr -i /dev/cd0 Configure devices and install drivers from /dev/cd0
if required
cfgmgr -S Run in serial, used with a larger number of disks
cfgmgr -l scsi0 Configure devices on adapter scsi0 only

diag Run hardware diagnostic menu
smitty diag Run hardware diagnostic menu
( 7020-40P and 7248-43P machines cannot run diagnostics, use diagnostics
in the SMS menus instead )

diag -d (device) Run diagnostics against a device.

lsslot Displays all hot swap slots
lsslot -c pci Lists all pci hot swap slots
lsslot -c pci -a Lists all available pci hot swap slots

drslot Reconfgiures PCI hot-plug slots
drslot -i -c pci -s U0.1-P1-I3 Display a slot, flashes the LED next to
the slot so that it can be identified.

Power Management (PCI machines)
-------------------------------

pmctrl -a Displays the Power Management state

rmdev -l pmc0 Unconfigure Power Management
mkdev -l pmc0 Configure Power Management

--------------------------------------------------------------------------------
TAPE DRIVES
--------------------------------------------------------------------------------

rmt0.x where x = A + B + C

A = density 0 = high 4 = low
B = retension 0 = no 2 = yes
C = rewind 0 = yes 1 = no

tctl -f (tape device) fsf (No) Skips forward (No) tape markers
tctl -f (tape device) bsf (No) Skips back (No) tape markers
tctl -f (tape device) rewind Rewind the tape
tctl -f (tape device) offline Eject the tape
tctl -f (tape device) status Show status of tape drive

chdev -l rmt0 -a block_size=512 changes block size to 512 bytes
(4mm = 1024, 8mm = variable but
1024 recommended)
dd if=/dev/rmt0 bs=128k count=1 | wc -c
Displays the block size of an unknow tape. Set block size to 0 first.

bootinfo -e answer of 1 = machine can boot from a tape drive
answer of 0 = machine CANNOT boot from tape drive

diag -c -d (tape device) Hardware reset a tape drive.
diag -c -d rmt0

tapechk (No of files) Checks Number of files on tape.

< /dev/rmt0 Rewinds the tape !!!


--------------------------------------------------------------------------------
PRINTERS / PRINT QUEUES
--------------------------------------------------------------------------------

splp (device) Displays/changes printer driver settings
splp /dev/lp0

export $LPDEST="pqname" Set default printer queue for login session

lsvirprt Lists/changes virtual printer attributes.

lsallq Displays all queues

rmvirprt -q queuename -d queuedevice Removes a virtual printer

qpri -#(job No) -a(new priority) Change a queue job priority.

qhld -#(job No) Put a hold on hold
qhld -r #(job No) Release a held job

qchk -A Status of jobs in queues
lpstat
lpstat -p(queue) Status of jobs in a named queue

qcan -x (job No) Cancel a job from a queue
cancel (job No)

enq -U -P(queue) Enable a queue
enable (queue)

enq -D -P(queue) Disable a queue
disable (queue)

qmov -m(new queue) -#(job No) Move a job to another queue

startsrc -s qdaemon Start qdaemon sub-system
lssrc -s qdaemon List status of qdaemon sub-system
stop -s qdaemon Stop qdaemon sub-system


--------------------------------------------------------------------------------
FILE SYSTEMS
--------------------------------------------------------------------------------

Physical Volumes (PV's)
-----------------------

lspv Lists all physical volumes (hard disks)
lspv (pv) Lists the physical volume details
lspv -l (pv) Lists the logical volumes on the physical volume
lspv -p (pv) Lists the physical partition usage for that PV
lspv -M (pv) Lists the PP allocation table for that PV.

If the PV state is "missing" but the disk is okay, use "varyonvg vg" to change
the state of the PV to "active".

chdev -l (pv) -a pv=yes Makes a new hdisk a pysical volume.

chpv -v r (pv) Removes a disk from the system.
chpv -v a (pv) Adds the removed disk back into the system.
chpv -a y (pv) Changes pv allocatable state to YES
chpv -a n (pv) Changes pv allocatable state to NO

migratepv (old pv) (new pv) Moves all LV's from one PV to another PV, both
PV's must be in the same volume group.

Migratepv cannot migrate striped logical volumes, use cplv and rmlv.

replacepv (old pv) (new pv) (4.3.3 onwards)


Volume Groups (VG's)
--------------------

lsvg Lists all volume groups
lsvg (vg) Lists the volume group details
lsvg -l (vg) Lists all logical volumes in the volume group
lsvg -p (vg) Lists all physical volumes in the volume group
lsvg -o Lists all varied on volume groups

varyonvg (vg) Vary On a volume group
varyonvg -f (vg) Forces the varyon process
varyonvg -s (vg) Vary on a VG in maintenance mode. LV commands can be
used on VG, but LV,s cannot be opened for I/O.
varyoffvg (vg) Vary Off a volume group

synclvodm (vg) Tries to resync VGDA, LV control blocks and ODM.
synclvodm -v (vg) Rebuilds the LVCB.
(the vg needs to be varied on before running synclvodm)


mkvg -y(vg) -s(PP size) (pv) Create a volume group
mkvg -y datavg -s 4 hdisk1

reducevg (vg) (pv) Removes a volume group
reducevg -d (vg) (pv) Removes a volume group and delete all LV's on the PV
reducevg (vg) (PVID) Removes the PVID disk reference from the VGDA when a
disk has vanished without the reducevg (vg) (pv)
command being run first.
reducevg -df (vg) (pv) Deletes all LV's from the VG and removes the VG
from the disk. If the last disk in the VG then
the VG is deleted.

extendvg (vg) (new pv) Adds another PV into a VG.

exportvg (vg) Exports the volume group, removes the VG entries and
removes all FS entries from /etc/filesystems but
leaves the mount points.

Note : Cannot export a VG if it has active paging space, turn off paging,
reboot before exporting VG. Exporting removes entries from filesystems
file but does not remove the mount points.

chvg -a y (vg) Auto Vary On a volume group at system start.
chvg -u (vg) Unlocks a locked volume group.

lqueryvg -Atp (pv) Details volume group info for the hard disk.

importvg -y (vg name) (pv) Import a volume group from a disk.
importvg (pv) Same as above but VG will be called vg00 etc.

4.3 onwards, importvg will automatically varyon the VG.

chvg -Q (y/n) (vg name) Turns on/off Quorum checking on a VG.

reorgvg (vg) (lv) Reorganised a fragmented LV, must state an LV at the
command line else the first LV in the VG is picked.
Does not reorg the PP's of striped LV's.



Logical Volumes (LV's)
----------------------

lslv (lv) Lists the logical volume details
lslv -l (lv) Lists the physical volume which the LV is on
lsattr -EHl (lv) Displays more logical volume details

mklv (vg) (No of PP's) (pv Name optional) Create a logical volume
mklv -y (lv) (PP's) (pv name optional) Creates a named logical volume
( use -t jfs2 when creating an LV for a JFS2 filesystem )


chlv -n (new lv) (old lv) Rename a logical volume
chlv -x (number) (lv) Change max no of PP's
chlv -s n (lv) Turns of strickness on the LV
extendlv (lv) (extra No of PP's) Increase the size of an LV
rmlv (lv) Remove a logical volume

cplv -v (vg to copy to) -y (new lv) (lv) Copy an LV to a new LV

If copying a filesystem LV, umount the filesystem before copying, otherwise you
will have to fsck the the new LV before the filesystem can be mounted.
If copying a striped LV to an LV that is already created, and the stripe
size is different ( or not even striped ), then these new parameters are
maintained when the data is copied to the new LV.

cplv -e (new lv) (old lv) Copy to an existing LV
( new lv must have type as copy use chlv -t copy (new lv) to change )

mklv/extendlv -a = PP alocation policy
-am = middle -ac = center -ae = edge
-aie = inner edge -aim = inner middle

migratepv -l (lv) (old pv) (new pv)
Move a logical volume between physical volumes. Both physical volumes
must be in the same volume group !

mklv -y (lv) -t jfslog (vg) (No of PP's) (pv Name optional)
Creates a JFSlog logical volume.

logform (/dev/lv) Initialises an LV for use as an JFSlog

getlvcb -AT (lv) Displays Logical Volume Control Block information

File Systems (FS's)
-------------------

lsfs Lists all filesystems
lsfs -q (fs) Lists the file system details
lsjfs Displays data about all filesystems in CSV style format

mount Lists all the mounted filesystems
mount (fs or lv) Mounts a named filesystem
mount -a Mounts all filesystems
mount all

mount -r -v cdrfs /dev/cd0 /cdrom mounts cd0 drive over /cdrom

crfs -v jfs -d(lv) -m(mount point) -A yes
Will create a file system on the whole of the logical volume, adds entry into
/etc/filesystems and will create mount point directory if it does not exist.
( use -v jfs2 for JFS2 filesystems )

crfs -v jfs -g(vg) -m(mount point) -a size=(size of fs) -A yes
Will create a logical volume on the volume group and create the file system on
the logical volume. All at the size stated. Will add entry into
/etc/filesystems and will create the mount point directory if it does not exist.

Use attribute "-a log=/dev/log01" to specify a jfslog devices
Use attrubute "-a bf=true" for a large file enabled filesystem

chfs -A yes (fs) Change file system to Auto mount in
/etc/filesystems
chfs -a size=(new fs size)(fs) Change file system size
chfs -m (new-mount-point) (fs) Change the file system mount point.

rmfs (fs) Removes the file system and will also remove the
LV if there are no onther file systems on it.

defrag -q (fs) Reports the fragment status of the file system.
defragfs -r (fs) Runs in report only defrag mode (no action).
defragfs (fs) Defragments a file system.

fsck (fs) Verify a file system, the file system must be unmounted!
fsck (-y or -n) (fs) Pre-answer questions either yes or no !
fsck -p (fs) Will restore primary superblock from backup copy if the
superblock is corrupt.
( or dd count=1 bs=4k skip=31 seek=1 if=/dev/lv00 of=/dev/lv00 )

Mirroring
---------

mklv -y (lv) -c(copies 2 or 3) (vg) (No of PP's) (PV Name optional)
Creates a mirrored named logical volume.

mklvcopy -s n (lv) (copies 2 or 3) (pv)
Creates a copy of a logical volume onto another physical volume. The physical
volume MUST be in the same volume group as the orginal logical volume !

rmlvcopy (lv) (copies 1 or 2) Removes logical volume copies.
rmlvcopy (lv) (copies 1 or 2) (pv) From this pv only!

syncvg -p (pv) Synchronize logical partion copies
syncvg -l (lv)
syncvg -v (vg)

mirrorvg (vg) (pv)
Mirrors the all the logical volumes in a volume group onto a new physical
volume. New physical volume must already be part of the volume group.

chfs -a splitcopy=/backup -a copy=2 /data1
Splits off a copy of a 3 way mirror and mount read only for use as an
offline backup.

--------------------------------------------------------------------------------
BOOT LOGICAL VOLUME (BLV) / PROCESSORS / KERNEL
--------------------------------------------------------------------------------

Mirroring does not work with the BLV as it is not a true logical volume,
bosboot must be run against the other disk after mirroring the rootvg.

bootlist -m (normal or service) -o displays bootlist
bootlist -m (normal or service) (list of devices) change bootlist

bootinfo -b Identifies the bootable disk
bootinfo -t Specifies type of boot

bosboot -a -d (/dev/pv) Creates a complete boot image on a physical volume.

mkboot -c -d (/dev/pv) Zero's out the boot records on the physical volume.

savebase -d (/dev/pv) Saves customised ODM info onto the boot device.

lslv -m hd5 Find out which disk the BLV is on.

bootinfo -y Displays which kernel can be used, 32 or 64 bit

genkex Reports all loaded kernel extensions.

lsdev -Cc processor Lists all processors
lsattr -EHl proc0 Displays attributes of processor 0. AIX 5.1L will
display processor clock frequency.

--------------------------------------------------------------------------------
SYSTEM DUMP
--------------------------------------------------------------------------------

1, AIX 4.2.1 and greater supports system dump to paging space.
2, AIX 4.3.3 and greater supports system dump to mirrored paging space.
3, Primary dump device must be in the rootvg
4, Secondary dump device can be outside rootvg unless it is a paging device.

sysdumpdev -l Lists current dump destination.
sysdumpdev -e Estimates dumpsize of the current system in bytes.
sysdumpdev -L Displays information about the previous dump.

sysdumpstart -p Starts a dump and writes to the primary dump device.
sysdumpstart -s Starts a dump and writes to the secondary dump device.

(MCA machine can also dump if key is in service position and the reset
button is pressed)

sysdumpdev -p (dump device) -P Sets the default dump device, permanently

Analyse dump file :-
echo "stat\n status\n t -m" | crash /var/adm/ras/vmcore.0

snap -gfkD -o /dev/rmt0 Copy dump to tape to send to IBM support, uses tar.

--------------------------------------------------------------------------------
PAGING SPACE (PS's)
--------------------------------------------------------------------------------

lsps -a Lists out all paging space
lsps -s Displays total paging and total useage
lsps (ps)

swappon /dev/ps Activates a paging device eg /dev/paging00
swappoff /dev/ps Deactivates a paging device ( AIX 5.x only )

mkps -s(No of PP's) -n -a (vg)
mkps -s(No of PP's) -n -a (vg) (pv)
-n = don't activate/swapon now -a = activate/swapon at reboot

mklv -b n -t paging -y hd6 (vg) (No of PP's) (pv)
Creates paging space using the mklv command.

chps -a n (ps) Turns off paging space.
chps -s(No of PP's) (ps) Increases paging space.
chps -d(No of PP's) (ps) Decreases paging space ( AIX 5.x only )

chlv -n (new name) (old name) Change paging space name

rmps (ps) Remove paging space. PS must have been turned off
and then the system rebooted before it can be removed.

Note : Need to change the swapon entry in /sbin/rc.boot script if you are
changing the default paging space from /dev/hd6. You also need to
do a "bosboot -a -d /dev/hdiskx" before the reboot.

/etc/swapspaces File that lists all paging space devices that are
activated/swapon during reboot.

--------------------------------------------------------------------------------
SCHEDULING
--------------------------------------------------------------------------------

crontab -l List out crontab entrys
crontab -e Edit crontab entrys
crontab -l > (filename) Output crontab entrys to a file
crontab (filename) Enter a crontab from a file
crontab -r Removes all crontab entrys
crontab -v Displays crontab submission time.

/var/adm/cron/cron.allow File containing users allowed crontab use.
/var/adm/cron/cron.deny File containing users denied crontab use.
/var/adm/cron/crontab Directory containing users crontab entries.
/var/adm/cron/log Cron log file.

at (now + 2 minutes, 13:05, etc) {return} Schedule a job using at
Command or schell script {return}
{CTRL D}

echo "shutdown -Fr" | at now + 1 minute

at -l
atq Lists out jobs scheduled to run via at command

at -r (at job No)
atrm (at job No) Removes an at job scheduled to run.

/var/adm/cron/at.allow File containing users allowed at use.
/var/adm/cron/at.deny File containing users denied at use.
/var/adm/cron/atjobs Directory containing users at entries.

--------------------------------------------------------------------------------
SECURITY
--------------------------------------------------------------------------------

nulladm /var/adm/wtmp To recreate/clear down the wtmp file.

groups Lists out the groups that the user is a member of
setgroups Shows user and process groups

chmod abcd (filename) Changes files/directory permissions

Where a is (4 SUID) + (2 SGID) + (1 SVTX)
b is (4 read) + (2 write) + (1 execute) permissions for owner
c is (4 read) + (2 write) + (1 execute) permissions for group
d is (4 read) + (2 write) + (1 execute) permissions for others


-rwxrwxrwx -rwxrwxrwx -rwxrwxrwx
||| ||| |||
- - -
| | |
Owner Group Others

-rwSrwxrwx = SUID -rwxrwSrwx = SGID drwxrwxrwt = SVTX


chown (new owner) (filename) Changes file/directory owners
chgrp (new group) (filename) Changes file/directory groups

chown (new owner).(new group) (filename) Do both !!!

umask Displays umask settings
umask abc Changes users umask settings

where ( 7 - a = new file read permissions)
( 7 - b = new file write permissions)
( 7 - c = new file execute permissions)

eg umask 022 = new file permissions of 755 = read write and execute for owner
read ----- and execute for group
read ----- and execute for other

mrgpwd > file.txt Creates a standard password file in file.txt

passwd Change current user password

pwdadm (username) Change a users password

pwdck -t ALL Verifies the correctness of local authentication

lsgroup ALL Lists all groups on the system
mkgroup (new group) Creates a group
chgroup (attribute) (group) Change a group attribute
rmgroup (group) Removes a group

--------------------------------------------------------------------------------
USERS / ENVIRONMENT
--------------------------------------------------------------------------------

passwd -f Change current users gecos (user description)
passwd -s Change current users shell

chfn (username) Changes users gecos
chsh (username) (shell) Changes users shell

env Displays values of environment variables
printenv

id Displays current user's uid and gid details
id (user) Displays user uid and gid details

whoami Displays current user details
who am i (or who -m)

who Displays details of all users currently logged in.
w
who -b Displays system reboot time

uptime Displays number of users logged in, time since last
reboot, and the machine load averages.

lsuser ALL Lists all users details
lsuser (username) Lists details for user
lsuser -a(attribute) (username or ALL) Lists user attributes
lsuser -a home ALL

mkuser -a(attributes) (newuser) Add a new user

chuser (attributes) (user) Change a user
chuser login=false (user) Lock a user account

rmuser -p (user) Removes a user and all entries in security files

usrck -t ALL Checks all the user entires are okay.

fuser -u (logical volume) Displays processes using the files in that LV
fuser -k /dev/lv02 Will send a kill signal to all processes using
/dev/lv02

lsattr -D -l sys0 -a maxuproc Displays max number of processes per user
chdev -l sys0 -a maxuproc=(number) Changes max number of processes per user

chlang (language) Changes the language settings for system or user.
En_GB = PC850 code pages
en_GB = ISO8859 code pages (Great Britain)
C = posix

su - (user) Switch to new user and change to the new users environment.
su (user) Switch to new user, current environment is propated to the
new shell.

--------------------------------------------------------------------------------
REMOTE USERS
--------------------------------------------------------------------------------

ruser -a -f (user) Adds entry into /etc/ftpusers file
ruser -a -p (host) Adds entry into /etc/host.lpd file
ruser -a -r (host) Adds entry into /etc/hosts.equiv file

ruser -d -f (user) Deletes entry in /etc/ftpusers file
ruser -d -p (host) Deletes entry in /etc/host.lpd file
ruser -d -r (host) Deletes entry in /etc/hosts.equiv file

ruser -s -F Shows all entries in /etc/ftpusers file
ruser -s -P Shows all entries in /etc/host.lpd file
ruser -s -R Shows all entries in /etc/hosts.equiv file

ruser -X -F Deletes all entries in /etc/ftpusers file
ruser -X -P Deletes all entries in /etc/host.lpd file
ruser -X -R Deletes all entries in /etc/hosts.equiv file

--------------------------------------------------------------------------------
INITTAB
--------------------------------------------------------------------------------

telinit S Switches to single user mode.
telinit 2 Switches to multi user mode.
telinit q Re-examines /etc/inittab

lsitab -a Lists all entries in inittab
lsitab (ident eg tty1) Lists the tty1 entry in inittab

mkitab ("details") Creates a new inittab entry
chitab ("details") Ammends an existing inittab entry

rmitab (ident eg tty1) Removes an inittab entry.

chitab "tty1:2:respawn:/usr/bin/getty /dev/tty1"

--------------------------------------------------------------------------------
ODM
--------------------------------------------------------------------------------

odmget -q "name=lp1" CuDv |more Gets lp1 info from pre-defined database.

odmget -q "name-lp1" CuAt |more Gets lp1 info from customised database.

odmdelete -o CuAt -q "name=lp1" Deletes lp1 info from customised db.

odmget -q "name=lp1" CuAt > lp1.CuAt Export ODM info to text file.
odmadd lp1.CuAt Import ODM info from text file.

odmshow CuAt Displays fields and record structures of CuAt

odmchange
odmdrop

--------------------------------------------------------------------------------
ERROR LOGGING / LOGS
--------------------------------------------------------------------------------

/usr/lib/errdemon -l Displays errorlog attributes.
/usr/lib/errdemon Starts error logging.
/usr/lib/errstop Stops error logging.

errpt Displays summary errorlog report.
errpt -a Displays detailed errorlog report.
errpt -j (identifier) Displays singe errorlog report.

Note : errorlog classes are H=Hardware S=Software O=Information V=Undetermined

errclear (days) Deletes all error classes in the errorlog.
errclear -d (class) (days) Deletes all error class entries in errlog.

Note : The errclear command will delete all entries older than the numbers of
days specified in the days paramenter. To delete ALL entries used 0.

errlogger "message up to 230 chrs"
Enters an operator notifaction message into the errorlog.

alog -L Lists all logs define in the alog db

alog -o -t (type) Display contents of log (type)
alog -o -t boot

cat /tmp/boot.log | alot -q -t (type) Copies contects of a file to a log

--------------------------------------------------------------------------------
PERFORMANCE MONITORING / TUNING
--------------------------------------------------------------------------------

vmstat (drive) (interval) (count) Reports virtual memory statistics.
vmstat hdisk0 5 20

vmstat -s Diplays number of paging events since system start.
vmstat -f Diplays number of forks since system start.
vmstat -i Diplays number of interupts by device since system start.

iostat (drive) (interval) (count) Reports i/o and cpu statistics.
iostat hdisk0 5 20

iostat -d (drive) (interval) (count) Limits report to drive statistics.
iostat -t (interval) (count) Limits report to tty statistics.

sar -u -P ALL 10 10 Displays %usr %sys %wio %idle for all processors

/usr/samples/kernel/vmtune Displays "Virtual Memory Manager" settings

--------------------------------------------------------------------------------
DOS DISKETTES
--------------------------------------------------------------------------------

dosdir Reads directory listing of a diskette
dosdir (directory) Reads directory listing of a named directory

dosread -D/dev/fd0 C41.TXT c41.txt Gets C41.TXT from diskette drive fd0

dosread -D/dev/fd0 DIRECTORY/C41.TXT c41.txt
(-D option can be dropped if using fd0)

doswrite -D/dev/fd0 (unixfile) (dosfile) Writes a file to diskette

dosdel (dosfile) Deletes a dos file on diskette

dosformat Formats the diskette

--------------------------------------------------------------------------------
SENDMAIL
--------------------------------------------------------------------------------

sendmail -bi Creates new aliase db from /etc/aliase file.
newaliases

sendmail -bp Displays the contents of the mail queue
mailq

sendmail -q Processe the sendmail queue NOW

sendmail -bt -d0.4 < /dev/null
Prints out sendmail version, compile defines and system information

refresh -s sendmail Restart sendmail, will re-read /etc/sendmail.cf
kill -l (sendmail PID)

stopsrc -s sendmail Stops the sendmail daemon
startsrc -s sendmail "-bd -q30" Starts the sendmail daemon

Sys Admin Pocket Survival Guide - AIX

URL - http://users.cis.fiu.edu/~tho01/psg/aix.html
HOW-TO
AIX Admin 101

PMR - Problem Management Record.
PTF - Program Temporary Fix eg Unnnnnn
APAR - Authorized Program Analysis Report, specific release of PTF. eg IYnnnnn, IXnnnnn
ML - Maintenance Level, grouping of APAR. eg 5300-04 is ML 4
SP - Service Pack (starting aix 5.3 ML 3) eg 5300-03-01 is SP 1 on ML3
TL -

Fileset - group of files, eg bos.adt.libm
VRMF - Version, Release, Modification/Maintenance level, and Fix.
eg 5.2.0.60


smit
A lot of the sys admin task in AIX can be done thru smit (or smitty for TUI version). It can accept a parameter to get to a specific menu section right away.

Here are some example:

smit mktcpip # configure network parameters
smit chfs # change file system, eg grow/extend it.
smit lsprt # list printers (don't list all, may need to go thru long menu)
smit installp # Add new software
smit update # add patches
smit update_all # automatic add patches to existing sw, no complain if patch is not relevant


smitty fastpath:

Action Prefix Device Abbreviation
------ ------ ------ ------------
(add) mk (printer) prt
(change) ch (tty) tty
(list) ls (pty) pty
(remove) rm (disk) dsk
(cdrom) cdr
(diskette) dskt
(tape) tpe
(adapter) adp
lang

Keystrokes:
F3 or ESC, 3 Cancel, go back
F4 or ESC, 4 Provide list of items to choose from
F6 or ESC, 6 Show command that smit will actually run
F10 or ESC, 10 Exit smitty


Linux Affinity
AIX is affectionally known as It Ain't uniX. With version 5L that added Linux Affinity, it maybe called Ain't It linuX?
The linux toolkit does add lot of open source utilities for AIX, it even provides an rpm package manager to manipulate these open source tools. However, it is stuck in the past, circa 2002, and so many of the newer Linux updates are not available. For example, there is no rpmbuild but use the old rpm --recompile. There is no automatic patch to update the source codes from Source RPM. These deficiencies makes development in AIX extremely painful.

AIX Idiosyncrasies
If a file is held open by the OS with a running program, it will not allowed to be overwritten (think Windows). For example, /lib/security/NSS_LDAP and /usr/lib/netsvc/dynload/nss_ldap.so are modules loaded by the authentication subsystem, and these files are locked and cannot be upgraded.

Initial System Setup

smitty assist # init os setup assistant to config basic system param.


/usr/sbin/install_assist # what get launched automatically after init install reboot



FS Layout
AIX uses a pretty good volume manager out of the box. Every FS can be expanded on the fly, so no special work is really needed on initial setup. If you use /home as NFS mounted home dir, you may wish to update /etc/filesystems so that the the local disk is mounted as /localhoome or something.

Bundle Install
AIX that comes with the machine often don't have all the desired software packages installed. It maybe good to add some bundles before releasing the machine for general use.

eg: Add the Application Development bundle ::
/usr/lib/instl/sm_inst installp_cmd -a -Q -d '/nfshome/sa/aix53/cd1' -b 'App-Dev' -f 'all' '-c' '-N' '-g' '-X' '-G'

Other bundles that can be installed are:

1. AllDevicesKernels
2. Alt_Disk_Install
3. App-Dev
4. CC_EVAL.Graphics
5. CDE
6. GNOME
7. Graphics
8. KDE
9. Kerberos_5 (Expansion Pack)
10. Media-Defined
11. Mozilla (AIX Toolbox for Linux Applications, Mozilla CD)
12. PerfTools
13. Server

Note that not everything is in the first CD. Time for IBM to get with DVD media, no? :)


See also Config Files

Firmware/BIOS
When upgrading an older machine to new version of AIX, be sure to check the AIX release notes to ensure the machine in question is still supported, and whether any firmware update maybe needed.

RS/6000 / pSeries machine firmware is typically updated when AIX is still running. Many older machines does not support firmware update in SMS. Old hardware or firmware have tendency to crap out in a boot process giving error 20EE000B (unable to find boot device), even when boot from the CD for the initial install works fine. The saving grace is that one can boot and reinstall the old OS should machine become unbootable.

# show firmware version, sample output included
# the last 6 digit of the firmware is a date code YYMMDD
lscfg -vp | grep -p Platform

Platform Firmware:
ROM Level.(alterable).......3R040323
Version.....................RS6K
System Info Specific.(YL)...U0.1-P1/Y1
Physical Location: U0.1-P1/Y1


# copy new firmware from CDROM into a new dir /tmp/fwupdate
# inside the microcode dir in the CDROM are subdir for each machine type
# refer to the doc inside this dir for full details on firware upgrade.
cp /mnt/cdrom/microcode/... /tmp/fwupdate

# run checksum on the firmware image.
sum vvYYMMDD.img

# perform the update, it will reboot the machine automatically when done
cd /usr/lpp/diagnostics/bin
./update_flash -f /tmp/fwupdate/3R041029.img


Boot Time Troubleshooting

RC scripts executed at startup:

/etc/rc.d/rcN.d/
same as solaris, Snn--- script, but there is nothing in here from basic OS.
normal run level is 2. Placed S74autofs and S89sshd in rc2.d .
/etc/rc.d/rc script is the one that source all the rcN.d,
but this script doesn't seems to exist by default,
had to be copied from another 4.3.3 machine and then it was fine.
For some unknown reason, init script for AIX 5.3 doesn't seems to run
correctly!! (eg, opensshd script will create log, but fail to start)



AIX default system config is to have a few named rc scripts,
they are all started by init as per /etc/inittab:
/etc/rc.tcpip # tcp config, but could not start sshd from here at boot, so placed in rc2.d/S89sshd.
/etc/rc.nfs # includes NIS, rcp
/etc/rc.emcpower # emc added their own startup script here, which is called form /etc/inittab.


Single User/Maintenance Mode
For servers with Service Processor:

1. Power off machine
Navigate the Service Processor menu (avail only when machine is off, from serial console):
2. go to (2) system power control menu
3. go to (7) Boot Mode Menu (some system list it as AIX/Linux mode config)
4. go to (2) Service Mode boot from Saved List (to enable Maintenance Mode, diff than SMS mode).
Power on machine.
Kernel will boot, then ask which options to boot to, choose single user mode (maintenance mode has less capability).


To install new OS to system, change system to get into System Management Service (SMS) mode. Then choose to boot from cdrom (first CD for OS install).

A note about the old desktop machines (eg 43P-140 604e-332 PowerPC 760):

1. When machine first boot, it will display various number on the various terminal.
eg. 0 for ASCII console (dumb terminal), 1 on first graphics video, 2 on second graphics video.
Press the number corresponding to the video that you wish to use.
This setting is "memorized" by the system, prompt again only when a there is hardware config change.
2. To get into the graphical System Management Service (SMS) mode, press F1 as soon as the double beep "dirip-dirip" chirps happens (and the keyboard icons is displayed).
You better be quick, do it before the long chime of the speaker test happens (the fifth/last icon in startup: speaker icon).
If using ASCII console, F-keys are simulated via ESC+Number keys. The graphical icons won't appear, but the equivalent text will be displayed progressively across the screen:

memory keyboard network scsi speaker


3. Pressing F8 will go to the open firmware OK prompt. There are only a few commands accepted:

devalias
printenv
setenv
boot [DEVICE]


boot disk will do a normal boot from hard drive. This is the default action if open firmware is not explicitly invoked.
boot cd will boot from the cdrom and run the installer program, whereby it will prompt for install config info.
There is also option to get into maintenance mode (?? It is NOT boot -s !!)
More info about open firmware: IEEE 1275.
4. SMS has entry to define boot device scan sequence, which is based on SCSI (lowest ID first). However, actual boot is according to Open Firmware boot command, so which device is booted depends on what the alias for disk is defined as. In summary, ignore the SCSI id boot sequence in SMS.
5. Some system require pressing F5 instead of F1 to get into SMS mode. If you are lucky, some will display what key to press to get into what mode right before the hardware scan progress, eg:

1 = SMS Menu 5 = Default Boot List
6 = Stored Boot List 8 = Open Firmware Prompt


6. IBM RS/6000 hardware is pretty finiky and OS support may not be available for some machines. AIX 5.2 will no support any machines with ISA bus. Some 43P have such bus and thus can only run AIX 5.1 as latest OS. Other 43P that don't have ISA bus can run the newer AIX. If you wish to install Linux, expect even more finickyness, as there are lot of small modifications between motherboards of different serial numbers. Linux may run on one 43P, but not another that looks the same. ie: don't install Linux on these putters!

Random Daily Sys Admin Tasks

See if system has ASync IO feature installed:

lslpp -l | grep -i asyn # list bos.rte.aio package installation
lppchk -c # check to ensure all fileset are installed correctly
lsdev -C -t aio # list whether async io is avail as device
smitty chgaio # smit interface to activate aio, reboot req.


---

smitty chtz # change timezone info
# /etc/environments TZ=PST8PDT
date -u # display internal system clock (in CUT/GMT).
# reboot was recomended, but all future login will see
# corect TZ. cron and stuff may not update till reboot.


---

AIX WebSM, default port is 9090 (/etc/services)
To disable, use /usr/websm/bin/wsmserver -disable; -enable will re-enable it.

HTTP server, started in /etc/inittab !
So it will respawn if it is just killed, edit inittab to free up port 80!

EMC navisphere agent also started in inittab, I guess it is the AIX way.
it calls /etc/rc.agent

----

ibm option number for universal (oem) cabinet rack mount rail part. OEM means 3rd party cabinet. IBM cabinet rails are fixed length!
p5 9113-550 :: 7162 IBM/OEM RACK-MOUNT DR.RAIL KIT 1 168.00

p5 510 :: 7166 IBM/OEM RACK-MOUNT DR.RAIL KIT 1 150.00

Storage
Disk/Volume Management/Filesystem
AIX has probably the most admin-friendly Logical Volume Manager and Filesystem of all the major Unices out there. It use a single LVM for every FS. Every FS is extendable online without the need to unmount. It does have lot of commands that are needed to manipulate the system though. But if you just need to get more space on a given FS/partition, just use smit chfs.

TLA name eg sample cmd
--- ------------- ------------------------ --------------
PP physical part
LP logical part

PV physical vol hdisk0 hdisk1 lspv
VG volume group rootvg appvg lsvg mkvg extendvg
LV logical vol /dev/hd0 /dev/hd9var lslv mklv
FS filesystem / /var lsfs mount

hdiskN are physical hard drives (or RAID device?)
/dev/hdN are FS level mountable device, these are created by the LVM.
/dev/hdN are subcomponents of VG such as rootvg.


smit vg # display and set logical volume group info

lsdev -Cc adapter # list many adapters, include fc, scsi, ide, pci, LPAR virtual, usb, graphics
lsdev -Cc disk # list hard disks. eg hdisk0 hdisk1
rmdev -dl hdisk2 # remove a named disk from config, often needed when san disk has been
# changed on the storage server side. after rm, rescan the bus.

lsvg # list all VG present in system
lsvg rootvg # VG space usage and free, PP size, etc
lsvg -l rootvg # list LP content of rootvg
lsvg -p rootvg # list PP used and free for a VG
# when LV/FS need to be extended.

extendvg -f rootvg hdisk8 # allocate physical hd to VG rootvg
smitty vg # smitty for Vol Grp, allow remove vg

mklv -y'appvol00' appvg 1 # create logical volume (after volume group defined via mkvg)
# if -y is not given, a generic volume name will be assigned.
# This step isn't strictly needed, mkfs will create generic vol as needed.
mkvg -f -y'appvg' hdisk2 hdisk3 # create a VG appvg from 2 physical hd
mkvg # original Vol Grp (Max 32 PV, 255 LV)
mkvg -B # Big Volume Group (Max 128 PV, 512 LV, 4.3.1+)
mkvg -S # Scalable Vol Group (Max 1024 PV, 256 LV, 5.2+)

smit fs # best to use smit to create a fs, many parameters.
# it typically call cffs -v jfs2

reorgvg # reorganize PP w/in vol grp

lsfs # list fs on machine, kinda like mount,
# diff output, only list fs in /etc/filesystems.

chfs -a size=+1 /dev/hd2 # grow a file system, size mult of 512 bytes, but
# always rounded up to integer number of PP
# 8 mb, 64 mb, etc (see lsvg rootvg pp size)
# to add 256mb, use size=+524288
# 256 * 1024*1024 / 512 = 524288 blocks
# ie, use size val of [ X MB * 2048 (constant) ]
chfs -a size=+1 /tmp # /dev/hd2 can be substituted by the fs mount pt.
smitty chfs # will see SIZE for more accurate resizing.
# count is # of 512 bytes block,
# value is absolute num only.
# Can also strink fs while mounted (at least tested in 5.3)

lslv hd1 # info of LV hd1 (find from mount
# what fs it belongs to).

cplv # copy LV
chlv # change LV,
# cplv + chlv = move Log Vol b/w Vol Grp.

lspv # list PVID (physical volume id) and vg on disk
lspv -l hdisk0 # list what fs are on a given disk
# good to check to ensure fs does not span more
# than one disk unecessarily, to reduce disk
# crash damage.

migratepv -l LVname oldPV newPV # move a fs w/in same vol grp, but diff hd. eg
migratepv -l paging00 hdisk1 hdisk2 # migrate pagin, can take a while!




varyonvg VGname # vary on a vol grp, needed before VG is accessible,
# typically automatica with most commands now
varyoffvg VGname # vary off, ie, make vol grp offline.

exportvg VGname # disociate /etc/filesystems etc from the computer,
# making the VG available for mount by another computer
importvg -y VGname hdiskN # reimport the VG. Remember the vary cmd.

lqueryvg -p hdisk0 -v # Determine the VG ID# on hdisk0
lqueryvg -p hdisk0 -L # Show all the LV ID#/names in the VG on hdisk0
lqueryvg -p hdisk0 -P # Show all the PV ID# that reside in the VG on hdisk0

getlvodm -u rootvg # Determine if ODM and VGDA data are correct (in sync)




chvg -u rootvg # unlick rootvg (maybe locked during crash, ODM problems)
getlvodm/putlvodm # disk ODM repair related.

smitty mklvcopy # smitty fastPath for making mirrors
# work on each logical volume, eg hd1
# Lot of menu options then, but don't like it much,
# not obvious how to make 2 disk mirror identically.
# maybe one don't have to, as it will be mapped blocks anyway
# not like solaris that match cylinder allocation, but solaris maybe more resilient
# aix wants to find where to place vol (center of disk, etc).
# Maybe multiple copies of a logical vol inside same volume group (and potnetially
# same disk!
# aix book p 210

mirrorvg rootvg # mirror whole volume group, simple one command does it.
# aix book p 202

istat /opt # show inode status

ipl_varyon -i # Determine which disk(PV) is the boot drive



Other ref: Advanced Horizons AIX File Info

swap / paging

/etc/swpaspaces # config file
swapon -a # activate all swap spaces
swapon /dev/paging00 # activate additional device
swapoff /dev/paging00 # deactivate

chps -s16 hd6 # change attrib of paging space
# add 16 PP to existing paging space in /dev/hd6
# PP size determined by lslv hd6", eg 256, 512 MB
chps -d8 hd6 # remove 8 PP to existing paging space in LV hd6
mkps -s16 rootvg -a -n # add new paging space worth 16 PP to
# vg called rootvg,
# -a = activate at once,
# -n = active on reboot.
mkps -s32 datavg hdisk1 # add new paging space on diff vg, specifying
# which disk to put it on.
rmps paginig00 # remove the whole paging space from sys
lsps -a # list paging space stat
shrinkps # 5L, shrink paging space (script)
# not sure why need this??

svmon # view current vm usage. Need perfagent.tools

Connectivity (Network)
Serial/Console Port
DB9 connector wiring is slightly different than Sun. Use a real null modem cable. "Psseudo" cable from sun DB9-RJ45 adaptors and ribbon cable don't work. One will see text and be able to type text, but it won't accept the login, even when password is right. can't loging!! Terminal is VT100, none of the flow control stuff, but that probably don't matter. Also, for running system, when NULL modem is connected to serial, it should automatically display new text and prompt for login. ribbon cable probably don't work at all here.
P4 and older machines use standard 9600 for serial port. But new POWER5 machines, they changed serial port to use 19200!! All other settings are same as before.
Dumb Terminal
The tip command exist on AIX, but it is slightly different than Solaris.

# aix tip host spec, typically placed in /etc/remote-file
# with a /etc/remote file defining its location
# alternatively, env var REMOTE can define location of this remote-file
#
# aix tip escape sequence is same as solaris.
# ~? produces full list.
# ~^D terminate the connection.
#
# tty0 is the system console, like Solaris Serial A, not usually usable as dumb terminal emulator
# tty1 is the serial port labeled T2, the equi of serial B in Solaris.
#
# IBM AIX serial connection is slightly diff than Sun, req NULL modem cable.
# This emulated TIP does not fully act as dumb terminal :(
# Depending on the state of the machine, and whether tip session is established first,
# or the cable is connected first, text may or may not be visible :(
# So, tip in aix can probably only work as dumb terminal for sun and hp machines,
# and the most reliable console is still a dumb terminal.
#
# eg usage, runnable as normal user:
# export REMOTE=$HOME/etc/remote-file
# tip dumb19200
# tip -9600 serial1
#
#
dumb9600|direct connect at 9600 bps,br#9600:dv=/dev/tty1
dumb19200|direct connect at 19200 bps,br#19200:dv=/dev/tty1
serial0|dumbterminal:dv=/dev/tty0
serial1|tty1|dumbterminal:dv=/dev/tty1
tty|dumbterminal:br#19200:dv=/dev/tty
#
# The serial ports ttyp0...ttyp9,ttypa...ttypf do not usually exist
#
ttyp0|dumbterminal:br#19200:dv=/dev/ttyp0
ttyp1|dumbterminal:br#19200:dv=/dev/ttyp1
ttyp2|dumbterminal:br#19200:dv=/dev/ttyp2
ttyp3|dumbterminal:br#19200:dv=/dev/ttyp3
ttyp9|dumbterminal:br#19200:dv=/dev/ttyp9
ttypa|dumbterminal:br#19200:dv=/dev/ttypa
ttypb|dumbterminal:br#19200:dv=/dev/ttypb
ttypc|dumbterminal:br#19200:dv=/dev/ttypc
ttypf|dumbterminal:br#19200:dv=/dev/ttypf


cu Connect Unix.
Opening a serial line may need some file config, cli below get error :(
I guess need to get minicom/telix or some other similar program from the Linux world.

cu -s9600 -l/dev/ttyp1
-s speed
-l device line
cu commands:
~%b send a break
~%! give shell
~. end session, logout user.

NIC

ifconfig
netstat -i

lsdev | grep -i ether # see Ethernet devices and drirver.
# entX = h/w card.
# enX = ethernet (DIX II framing) for IP
# etX = ethernet (IEEE 802.3) for SNA, don't bother :)

lsattr -R -l ent0 -a media_speed # show capabilities of ent0
lsattr -EH -l ent0 -a media_speed # show current settings
lsattr -D -l ent0 # show all def val for Eth dev.

chdev -P -l ent0 -a media_speed=100_Full_Duplex # change to forced full 100
chdev -P -l ent0 -a media_speed=Auto_Negotiation # change to auto negotiate for speed duplex
# effective after reboot !!!


smitty mktcpip # configure/change ip of interface, default route, netmask
# permanently set ip option for interface
# smitty just run mktcpip cmd:
/usr/sbin/mktcpip
-h'HOSTNAME'
-a'HOST.IP'
-m'HOST.IP.NETMASK'
-i'NIC' # eg en0, "standard network interface"
-n'DNS.SERVER.IP' # may want to add more to /etc/resolv.conf
-d'DNS.DOMAIN.NAME' # eg titaniumleg.com
-g'DEF.GATEWAY.IP'
-A'no' # Start now? no or yes # just omit it.
eg:
mktcpip -h'aix01' -a'10.215.11.101' -m'255.255.255.0' -i'en0' -n'10.215.2.1' -d'titaniumleg.com' -g'10.215.11.1'


Network Services

lssrc -a # list all services and their status
startsrc # start network service
stopsrc # stop network service
-g # group
-s # subsystem, g or s is largely how AIX define the service.
-a #
-D # Debug

startsrc -g nis # start NIS service group
startsrc -s rcp.mountd # rpc/mount service
startsrc -s xntpd # start ntp daemon
# init script starts it from /etc/rc.tcpip

startsrc -s sendmail -a -bd # start mail server to allow inbound mail.
# essentially, do sendmail -bd, makes it a
# daemon listening on port 25 for mail services.

startsrc -s iptrace -a "/tmp/iptrc.bin" # start ip tracing facility,
# -a = stor in file (binary).
stopsrc -s iptrace # stop tracing after problem is reproduced.


DNS

/etc/resolv.conf # main config file, like other Unix.

accept up to 3 name servers
change server after TimeOut (def of 5 sec), retry (def = 3),
so 5+10+20+40=75 sec.
eg:
domain hybridauto.com
nameserver 10.210.2.11
nameserver 10.210.2.12
nameserver 165.87.201.244
search hybridauto.com
search titaniumleg.com
search titaniumlegcorp.com

namerslv -s # run cmd to see settings are understood by system.

DNS resolution depends on file /etc/netsvc.conf
hosts=local,nis,bind
and env var NSORDER=local,bind
AIX 4.3 accepts bind4 and bind8

NIS

chypdom -B titaniumleg.com # set the NIS domain for the machine
# it proabably edit /etc/rc.nfs to run cmd domainname
domainname # show the NIS domain
smitty yp # general YP NIS config
smitty mkclient # configure machine as NIS client
rmyp -c # remove yp client config
lssrc -s ypbind # display active vs inoperative NIS
stopsrc -s ypbind # nis client process
startsrc -s ypbind
# /etc/rc.nfs is where the ypbind is set to use specific server (if not broadbcast)

startsrc -g nis # start nis server daemon
stopsrc -g nis


CD
AIX does not have a /etc/nsswitch.conf, instead use /etc/netsvc.conf
and /etc/irs.conf (Information Retrieval System, bind 8 code base, used in FreeBSD also).

Also, changes to irs.conf doesn't seems to be effective till next reboot.
At least that seems to be the case with automount entry,
restarting autofs a/o secldapclntd didn't refresh it.

May want to try these commands in /usr/sbin
flush-secldapclntd
restart-secldapclntd
stop-secldapclntd
start-secldapclntd
ls-secldapclntd


eg of irs.conf




Okay, here a real sample of /etc/irs.conf from an AIX 5.3 machine:

hosts dns continue
hosts nss_ldap continue
hosts nis continue
hosts local
services nss_ldap continue
services nis continue
services local
networks dns continue
networks nss_ldap continue
networks nis continue
networks local
netgroup nss_ldap continue
netgroup nis continue
netgroup local
protocols nss_ldap continue
protocols nis continue
protocols local
###
### http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.doc/cmds/aixcmds1/autom
ount.htm
###
automount nis_ldap
##automount nis
##automount files
##automount nis_ldap nis files





eg of /etc/netsvc.conf

# bind Uses BIND/DNS services for resolving names
# local Searches the local /etc/hosts file for resolving names
# nis Uses NIS services for resolving names. NIS must be running if you specify this option
# nis+ Uses NIS plus services for resolving names. NIS plus must be running if you specify this option
# ldap Uses LDAP services for resolving names
# ldap_nis Uses LDAP NIS services for resolving names
# bind4 Uses BIND/DNS services for resolving only IPv4 addresses
# bind6 Uses BIND/DNS services for resolving only IPv6 addresses
# local4 Searches the local /etc/hosts file for resolving only IPv4 addresses
# local6 Searches the local /etc/hosts file for resolving only IPv6 addresses
# nis4 Uses NIS services for resolving only IPv4 addresses
# nis6 Uses NIS services for resolving only IPv6 addresses
# nis+4 Uses NIS plus services for resolving only IPv4 addresses
# nis+6 Uses NIS plus services for resolving only IPv6 addresses
# ldap4 Uses LDAP services for resolving only IPv4 addresses
# ldap6 Uses LDAP services for resolving only IPv6 addresses
# ldap_nis4 Uses NIS LDAP services for resolving only IPv4 addresses

hosts = nis_ldap, nis, bind, local


NFS

nfso -a # show all nfs options and current value
nfso -o varname[=val] # display/set nfs option.
nfso -o nfs_use_reserved_ports=1
# AIX default does not use port <1024, which result in auth error.
# http://www.faqs.org/faqs/aix-faq/part3/
# only needed for /net with certain solaris version?


Manual NFS mount can be added to /etc/filesystems ::

/nethome:
dev = "/vol/vol1/users"
vfs = nfs
nodename = netapp
mount = true
options = rw,fg,soft,intr,nosuid
account = false

/Import:
dev = "/vol/vol1/depot"
vfs = nfs
nodename = netapp
mount = false
options = ro,fg,hard,intr,nosuid
account = false


mount -o vers=2,proto=tcp,wsize=8192,rsize=8192,llock,soft,intr netapp:/vol/vol1/users /nethome
mount -o vers=2,proto=tcp,wsize=8192,rsize=32768,llock,soft,intr desktop:/mnt/cdrom /mnt/rcdrom
mount -o ro -v cdrfs /dev/cd0 /cdrom



startsrc -g autofs # start autofs service group.
stopsrc -g autofs # stop autofs service group.
# autofs group has only 1 subsystem, so -s or -g is same
startsrc -s automountd # start automount service, more reliable than -g autofs !!

automount is started in the /etc/rc.nfs script.
An alternative is to use the Sun style script (aix supports them, but nothing added
by default), eg in /etc/rc.d/rc2.d/S74autofs, have something like:


/usr/sbin/automount -M /home /-

# monitor /home (for user),
# /- will give the /net/HOST access like sol (and other direct mount)
# aix 5.1 no longer support the -M param

aix 5.1L ML 3, automount started in /etc/rc.nfs as:

/usr/sbin/automount -f /etc/auto_master -D ARCH=SC_AIX


# auto_master had only "+auto_master"
# remember that /home may be a mounted fs, so may wan to use /nethome.
# /net will work okay without -M /- .
# automount will call the automountd process, massage the mount points, and exit.
# do NOT start automountd on the CLI manually, it will not interface with mount correctly.

/etc/exports # export files, similar to HP-UX, Linux
eg content of the file:
/usr -ro,root=admin-desktop"

exportfs -a # export everything
exportfs -v # display active exports
exportfs -i /tmp # manually /tmp w/o entry in exportfs

startrc -g nfs # start mountd, etc

lsauthent # list authenticaltion methods
mknfs -B # start nfs service now and at boot?




Printing
Use smit to add printer, prints to windows print server easily (provided the windows print server has Unix printing services setup):

smitty, Print Spooling, (AIX Print Spooling, choose it if it pops up),
Add a Print Queueus, type is remot, std processing :
Name of Queue to add --> Use printer name maching remote queue name (ie win prt name)
Hostname of remote server --> Windows print server name
Name of queue on remote server --> Windows printer name.
Type of print spooler on remote server --> System V

CLI:
/usr/lib/lpd/pio/etc/piomisc_ext mkpq_remote_ext -q 'QueueName' -h 'Hostname' -r 'RemoteQueueName' -t 'att' -C 'FALSE' -d 'description'


To see what printers are installed, use:

/usr/bin/lsallq # brief listing of printer name only
/usr/lib/lpd/pio/etc/piolsvp -p # listing with queue server and description
/bin/lpstat # query windows print server on printer status, but names are truncated


Sys Config
General SA Commands

oslevel -rq # list all known and recommended ML
oslevel -r # which ML (maint level) machine is at.
oslevel -l 4.3.3.0 # list fileset missing to bring machine to specified level.
oslevel -l 5200-02 -r # aix 5L is weired wrt oslevel -l
oslevel -s # service pack, in addition to ML, not avail on all sys.
# ( -s is new flag starting ca 2006, aix 5.3 ML 3? not in base 5.3)

uname -a # ver info, also with val of -m at the end
uname -m # some sort of machine code, includes serial number of the machine:
# 000F2C9A4C00 embeds serial 00F2C9A4 (jc)
# 000750AC4C00 embeds serial 10-750AC (vs -u opt)
uname -u # serial number (of management frame).
# IBM,0110750AC embeds serial 10-750ac (targa, 4.3 )
uname -L # first number = the LPAR partition number
# OS is running inside of.

errpt # generate ERRor rePorT. This is more detailed than syslog.
errpt -a # all entries, detailed view. Default is brief listing only.
errpt -A # Abreviated detailed view.
-D # Collapse duplicate entries.


watch cmd -o logfile # similar to truss cmd, but can't watch existing pid
truss # exist for 5.x, in /bin

topas # top/monitor clone
vmstat
sar
istat
slibclean
svmon



----
NIM Network Install Manager
- Network installation of aix, equiv of solaris jumpstart
- r-cmd to control remote machine


Config Files

/etc/passwd
/etc/security/passwd # similar to shadow file
/etc/security/login # dictate shells that are valid shell for various process.
# if user shell not listed here, ftp will fail.
/etc/ftpaccess # set ftp access priviledges, allow/deny access, etc.
/etc/nologin # tmp disable login, presence of file set this behaviour
/etc/filesystems # instead of /etc/fstab



# /etc/syslog.conf

# can start syslog simply as: /usr/sbin/syslogd
# kill -HUP reload config file, adding note to error level (it whines).
#
# ensure the two columns are separated by TAB, not spaces
# or syslogd will fail to log silently!!
# AIX 5.x works okay with spaces now.

# IBM don't seems to have any standard, there are no default settings.

# *.info /var/adm/syslog_info.log
*.notice /var/adm/syslog_notice.log rotate size 100k files 4
# *.warning /var/adm/syslog_warning.log
# *.err /var/adm/syslog_err.log
*.crit /var/adm/syslog_crit.log

# create files as follows:
# touch /var/adm/syslog_info.log /var/adm/syslog_crit.log
# touch /var/adm/syslog_notice.log
# touch /var/adm/syslog_warning.log /var/adm/syslog_err.log
# really just need crit and notice
# warning and notice are same, both just marginally smaller than info.







# /etc/filesystems

/:
dev = /dev/hd4
vol = "root"
mount = automatic
check = false
free = true
vfs = jfs2
log = /dev/hd8
type = bootfs

/home-old:
dev = /dev/hd1
vol = "/home"
mount = true
check = true
free = false
vfs = jfs2
log = /dev/hd8

/usr:
dev = /dev/hd2
vfs = jfs2
log = /dev/hd8
mount = automatic
check = false
type = bootfs
vol = /usr
free = false

/var:
dev = /dev/hd9var
vfs = jfs2
log = /dev/hd8
mount = automatic
check = false
type = bootfs
vol = /var
free = false

/tmp:
dev = /dev/hd3
vfs = jfs2
log = /dev/hd8
mount = automatic
check = false
vol = /tmp
free = false

/proc:
dev = /proc
vol = "/proc"
mount = true
check = false
free = false
vfs = procfs

/opt:
dev = /dev/hd10opt
vol = "/opt"
mount = true
check = true
free = false
vfs = jfs2
log = /dev/hd8

/lhome:
dev = /dev/vol1
vfs = jfs2
log = /dev/loglv00
mount = true
options = rw
account = false

/home_na:
dev = "/vol/vol1/users"
vfs = nfs
nodename = na_data
mount = true
options = rw,fg,hard,intr,nosuid
account = false

/mnt/import:
dev = "/vol/vol1/depot"
vfs = nfs
nodename = na_data
mount = true
options = rw,fg,hard,intr,nosuid
account = false

/mnt/cdrom:
dev = "/dev/cd0"
vfs = cdrfs
mount = false
check = false
options = ro
vol = "/mnt/cdrom"
free = false



Hardware commands
lspci
lsattr

Hot swap PCI cards, or hot remove. Essentailly, issue command to identify, then power off a given pci slot, then reactivate it again.
smit, devices, pci hot plug manager

shutdown -F # shutdown right away, no delay time
-r # reboot
-m # maintenance mode
shutdown -r +5 "msg to users" # +5 = 5 minutes later.

lsattr # list attributes
-D # display def val
-R # display range of legal values
-E # display Effective vall (current settings)
-l name # specify dev logical name
-a attr # specify attribute of NAME logical dev

lsattr -El sys0 # show lot of hardware info, include mem
lsattr -El sys0 -a realmem # get specifically the memory attribute, in KB.

lsdev -Cc processor # see number of processor on machine (may not be numbered in sequence)
lsattr -El proc0 # find processor speed

pmcycles -m # list total number of CPU. installed in /bin by bos.pmapi.
# AIX 5.2 and above, CD #1.


A note about IBM processors.
POWER4 and POWER5 processor are typically packed in a processor card as a Dual Chip Module (DCM). The processor card has a single physical "CPU" in the traditional sense of touchable chip, but internally it has two cores and is marketed as a 2-way processor.
The CPU listed by the output of pmcycles -m is similar to the Intel Hyperthreadig tech whereby a processor can run more than one thread at a time, it is not a physicall processor per se, but available to the programmer.
Thus, a fully populated 4-way processor P5-550 would have 2 DCM processor card (two 2-way processor cards), lsdev -Cc processor will show 4 processors, and pmcycles -m will show 8 CPU.
REF: IBM redbook-p5-550.pdf



lscfg # list config
# ses are internal scsi disks
# scsi includes int and ext disks
# procX are CPUs
# fca = Fiber Channel HBA
lscfg -vp # lot more detailed info, eg: use to search for fca
lscfg | grep disk # see number and size of HD


lsslot -c pci -a # list pci slot info

lsdev # list devices



cfgmgr # rescan bus and install driver for new devices
# eg when new device made available over SAN
-S # scan serially (instead of parallel)
-v # verbose, print more status info
# Note that emc come with its wrapper script to do the work.

bootinfo -y # 32 v 64-bit enabled
# NOTE: bootinfo is runnable by root only.
-K # current kernel mode
# show kernel native bits,
# NOTE: 32-bit can run 64 bit app anyway.
-r # real memory in system in KB
-s hdisk0 # disk size in MB
bootinfo -b # last boot dev
bootinfo -m # machine model code
-p # hw platform (type of bus, etc)
-r # show real memory in sys, in Kb

----

LPAR sysmtem
From HMC (hardware manager console), cmds in /opt/hsc/bin

query_cecs # list all online managed sys
get_cec_state -m # find curret state of sys

get_op_panel -m # get operator panel lcd code

get_cec_mtms -m # frame type and serial number, buggy.



Package/Software Management

lslpp -h bos.rte # show fileset history (from package mgnt?)
lslpp -L bos.rte # snapshot of main levele and statet of fileset
lslpp -f bos.rte # see what files are installed by a given fileset.
lslpp -l bos.net.nfs.client # show fileset revision level
lppchk -v # chk see if any lpp product are broken, obsolete, missing

lslpp -l | grep vacpp # show all fileset info about the ibm compiler

installp flags
a apply update (def action)
c commit
g recursively install prereq
X eXpand (local) FS is more space is needed.
d file specify the location of the media file ( . for current dir).
p preview only, nothing will actually be done.

eg:

installp -qa -d . -X all # apply updates
installp -rB -X all # reject updates
installp -c -g -X all # commit updates
smitty install_commit # same as above.
installp -qac -N all -d . # install w/ commit on, no backup, no simple roll back.
installp -u [filesetname] # uninstall comitted lpp product

installp -iq -d /dev/cd0 all # display supplemental info abouut ML patch in cd
installp -qA -d /dev/cd0 all # display APAR info


IBM Software iFOR licensing commands

i4cfg -list # list license services status

i4blt # license management for visual age. no param = help
-r 6 # print report type 6. see help for more types.
-lp # list licenses
-lp -i # list licenses with extra info, such as time stamp
-s # prod license status
-a # add/enroll a produt

-d # delete license
-v # opt vendor info (for some custom lic, used by VA C++
-p # opt product info
-U # update license
-T # specify number of user, cn license only

eg
14blt -a -f /usr/vac/c44aix_cn.lic -T 10 -R "registration_comment_avoid_space"
# enroll a license. -T 10 inidcates number of licenses.

i4blt -U -v "'IBM Software Solutions Toronto'" -p "'VisualAge C++ Professional' 6.0.n" -T 100
# Update license to allow 100 users. Only for _cn license type.
# Be very careful about quotes! Name with spaces need additional
# single quotes around them!!! Awful syntax and very cryptic error messge!!

i4blt -d -n server_name -v "'vendor name with space'" -p "'product name' product_version" -t timestamp
i4blt -d -v "'IBM Software Solutions Toronto'" -p "'VisualAge C++ Professional' 6.0.n" -t 1022291809
i4blt -d -v "'IBM Software Solutions Toronto'" -p "'C for AIX' 6.0.n" -t 1022291952
# delete a license.
# -t is timestapm retrieved from output of i4blt -lp -i


License files are located in
/usr/vac/*.lic
/usr/vacpp/*.lic

The files type are:
C C++ license file names
cforaix_cn vacpp_cn = concurrent nodelock LUM license
_c _c = concurrent network
_n _n = simple nodelock

The First line of file is actually command for license enrollment.


Visual Age compiler license file installation requires the package bos.adt.libm For 5.1L, it is in CD 4/6. However, its install need to kick started from CD 1, by requesting the install of all all componets of bos.adt, which is not installed by default.

Applying ML

http://techsupport.services.ibm.com/server/mlfixes/43/
http://techsupport.services.ibm.com/server/mlfixes/43/11/00to11.html

get aix ML (Maintenance Level patch) and instructions on installing it.


inutoc ./usr/sys/inst.images/
installp -acgXd ./usr/sys/inst.images bos.rte.install
smit update_all #

cd /home_sc/sa/share/aix43.ml/433.noLevel_to_11
inutoc . # this creates the .toc file
installp -acgXd . bos.rte.install # install the basic os patch ?
smit update_all # add the other patches
oslevel -r # + reboot

If getting APAR fixes with a series of .bff files, use
(touch .toc, chmod 777 .toc)
inutoc .
and then smitty update_all on the dir to install all the patches.

java 1.4 download, they came in .tar.gz format.
strangely, it seems that I have to use tar xf from aix to correctly extract the archive.
it become a backup/restore file which "smitty installp" as "Install Software"
with path to the file as dir location will work.
May actually need to specify the full name of the installp image filename in the path.
tar off from solaris doesn't seems to work!!



Software Patches
aka Program Temporary Fix

instfix -i # show applied APAR fix
instfix -i | grep AIX_ML # fix done by ML patch
instfix -i -k IY78933 # see if a given IY APAR fix had been applied.
instfix -ivq | grep xlC.aix5.*rte | sort -u # list installed xlC runtime environment


/usr/lib/instl/sm_inst instfix_cmd -d '/lhome/root/vacpp7_rte8' -f 'IY78993' -c -N -X
# install the specific IY78933 from the RunTimeEnv v8 for "xlC v7"
# this can be done over NFS dir, provided .toc is created correctly
# and stored on this NFS source.
# The downloaded PTF file vacpp.70.aix.nov2005.ptf.tar.Z need to be extracted
# which produce a series of .bff files in backup/restore format.

/usr/lib/instl/sm_inst installp_cmd -a -Q -c -N -g -X -G \
-d '/nfshome/sa/share/aixX.smit/aix_vacpp_rte7_nov2005/extract' -f _all_latest
# install the whole RunTimeEnv v8 for "xlC v7"

/usr/lib/instl/sm_inst installp_cmd -a -c -N -g -X \
-d '/nfshome/sa/share/aixX.smit/aix_vacpp_rte7_nov2005/extract' -f _update_all
# apply relevant updates from RunTimeEnv v8 for "xlC v7"
# it will not display failure msg when optional debugger
# components are not installed.




Example: Installing and Patching IBM Visual Age c++

copy cdrom image
run smit

use dir of
cdrom/usr/sys/inst.images
eg /nethome/sa/software/VisualAge_5.0.2_cd/usr/sys/inst.images
/nethome/sa/software/VisualAge_5.0.2_cd/usr/sys/mvCD

NOTE: use inst.images first, then mvCD.

mvCD may have complain of wrong path, but it generally list more stuff and install more programs, even when some may fail.
mvCD may be listing all software in the whole CD set, not just a given CD.
mvCD would fail if content is network path and no CD media change is possible.
actually, aix5l book suggest use of inst.images dir (build .toc before install if obtaining as tar is normal procedure.)


use F7 or ESC,7 to toggle selection.
can use keyword "all" to select all subpackages.
but note that it will not currectly detect os level and then cause fialure notices.


Applying patches :

/nethome/sa/software/VisualAge_patch_to_5.0.2.7

it is like installing normal software, but the tar didn't have a .toc file.
thru smit, there was an entry to list software in media, run it so that it created a .toc file.
After that, install the patch as software (via smit update_all), which generate commands like:

geninstall -I "a -cgNqwX -J" -Z -d /nethome/sa/software/VisualAge_patch_March2003_runtimePTF -f File 2>&1

File:
xlC.adt.include 6.0.0.0
xlC.aix50.rte 6.0.0.0
xlC.aix50.rte 6.0.0.5
xlC.msg.en_US.rte 6.0.0.0
xlC.rte 6.0.0.0

geninstall -I "a -cgNqwX -J" -Z -d /nethome/sa/software/VisualAge_patch_March2003PTF -f File 2>&1


Adding international LOCALE

smitty lang (System Environments,Manage Language Environment),
go to "Add Additional Language Environments"
Then there are two possibilities:
- CULTURAL convention to install
This add support for desired lang (already supported language can be
found from "locale -a")
- LANGUAGE translation to install
This add system error message for many different software packages
installed on the machine. Not typically needed for dev/test of intl lang
support.


Instead of putting CD into machine CD-ROM drive, one can specify network shared CD-ROM
such as /net/tin-sun/cdrom, but it will NOT prompt to change CD,
and any language locale pack selected not avail on network path will simply not be queue for
install, so not even error message. If the CD has nothing about the related
language, it will display error. Most International language locale start
with CD #5.

----

Can use Remove Lang Env to see list of installed lang translation locale.
Sometime adding a language locale complain missing file set pre-req. do:
cd directy to the dir with the bos.loc.com file, and install it manually.
smitty installp on any of the CD doesn't show option to add this fileset!

cd /share/aix5.2/disk1/usr/sys/inst.images
installp -acgXd . bos.loc.com

lslpp -l | grep bos.loc.com
bos.loc.com.CN 5.2.0.30 COMMITTED Common Locale Support -
bos.loc.com.utf 5.2.0.50 COMMITTED Common Locale Support - UTF-8
[...]

May also need to put in CD #1 and use smitty installp, and add the necessary
bos.iconv set appropriate to the desired language.

---

other locale/intl related cmd:
chlang es_ES # change to use spanish from spain... update .profile, effective after re-login.
# but I don't see the effects...

chkbd
lsfont
lskbd


Ref: Understanding Locale from AIX online ref.
Loose ends
AIX dev env does not use LD_LIBRARY_PATH, but instead use LIBPATH

Places to get freeware for aix.
http://silcon.silcon.com/~baspence/AIXtip/freeware.htm
http://aixpdslib.seas.ucla.edu/ [recommended by esj]

monitor # top like tool for real time monitor
# t = top processes

# a = toggle view mode
# ? = help

portmon

Reference
# rootvg.net AIX portal, lot of sutff!
#
# IBM Online documentation at http://publib.boulder.ibm.com/infocenter/pseries/
# Service Guide for RS/6000 F80 (Ch 4 and 5 have 4 digits LED error code for boot time hardware/firmware problem). http://publib16.boulder.ibm.com/pseries/en_US/infocenter/base/hardware_docs/pdf/380568.pdf
# RS/6000 Diagnostic LEDs (BITS code, 3 digits used in older, small machines). BIST Error Code
#
# AIX Toolbox for Linux
# Download specific IBM fileset Specify OS version and "specific fixes", and it will bring a search page that allows retrieval of a specific version of a given fileset. eg bos.net.nfs.client 5.3.0.50.
#
#
AIX CD Catalog
AIX does not have a "install everything" option. So, one often has to dig thru CDs to find the right package to add a desired feature. This file list what is in some of the CD. The vary by releases, so pretty long list. But easier to search here than keep on swapping CDs :)
[Doc URL: http://www.cs.fiu.edu/~tho01/psg/aix.html]