Aix Commands
Aix Commands
2010
OS LEVEL AIX: 4.3.3 + 5.1 + 5.2 + 5.3 + 6.1
##############
# useful links
##############
http://www.rootvg.net
http://publib.boulder.ibm.com/cgi-bin/ds_form
http://publib16.boulder.ibm.com/pseries/en_US/infocenter/base/errorsearch.htm
http://www.aixtips.com/AIXtip/
http://www.rootunix.org/AIX/
http://www.rootvg.net/ledlist.htm
http://www.ibm.com/developerworks/aix/
http://www.ibm.com/developerworks/forums/forum.jspa?forumID=747
http://www.perzl.org/aix/
###############
# AIX 6 Support
###############
AIX V6.1 exclusively supports 64-bit Common Hardware Reference Platform
(CHRP) machines with selected processors:
PowerPC 970
POWER4
POWER5
POWER6
To see if you have a supported machine, log into the machine as the root user,
and run the following command:
1. prtconf | grep "Processor Type"
AIX V6.1 does not support the following processor architectures:
RS64
POWER3
604
#######################
# commandline or smitty
#######################
Wer sich nicht sicher ist, unter
intern:
http://uriel/austausch/betrieb/os/aix/doc/all_fast_path.txt
extern:
http://www.hdkutz.de/os/aix/all_fast_path.txt
sind alle smitty-menues (Menue smitty Befehl) aufgelistet.
Beispiel:
<snip>
Processes process
<snip>
Aufruf smitty process
Durch den smitty werden Kommandos teilweise automatisch vervollstaendigt, so das
ein Fehler kaum mehr moeglich ist. Parameter werden angegeben.
#############################
# determine Maintenance Level
#############################
instfix -i | grep AIX_ML
oslevel will report the base OS level - i.e. we are at 4.3.3.04 and
oslevel returns 4.3.3.0.
instfix -ik 4330-04_AIX_ML *checks* that all filesets are installed
for ML 04 on AIX 4.3.3 and returns a success / failure message
and instfix -ic | pg will list the fields keyword name, fileset name,
required level, installed level, status, and short abstract for each
fileset installed - the status field allows you to identify which
filesets are downlevel by showing a < in this field. See the man pages
for this command ...
However, to my knowledge there is no command that reports both oslevel and
ML level in one.
This will show you all the filesets missing for that Maintenance Level:
instfix -ivk 4330-08_AIX_ML | grep : | grep not
Nachschauen welche APARs im Verzeichnis enthalten sind:
instfix -Td .
To install all fixes on the disk, enter:
# instfix -T -d . | instfix -d . -f-
Once installed, you can determine if all fileset updates for the
4330-07 level are installed using the following command. The
'oslevel' command will still indicate AIX 4.3.3.0.
instfix -ik 4330-08_AIX_ML
If the output indicates that not all filesets are found, you
can determine which filesets are not updated using the command:
instfix -qick 4330-08_AIX_ML | grep ":-:"
To check for filesets BELOW a given maintenance level:
instfix -qick 4330-08_AIX_ML | grep ":-:"
To check for filesets ABOVE a certain maintenance level:
instfix -qick 4330-08_AIX_ML | grep ":+:"
To check for filesets AT a certain maintenance level:
instfix -qick 4330-08_AIX_ML | grep ":=:"
To check for filesets AT a certain maintenance level:
instfix -qick 5200-02_AIX_ML|grep ":-:"
To check for filesets AT a certain maintenance level:
instfix -qick 5200-03_AIX_ML|grep ":-:"
To check for filesets AT a certain maintenance level:
instfix -qick 5300-10_AIX_ML|grep ":-:"
##############################
# view fix installed on system
##############################
instfix -ik IX78215 -v
root@cws [~]# instfix -ik IX78215 -v
IX78215 Abstract: trace allocates too much memory
Fileset bos.sysmgt.trace:4.3.1.1 is applied on the system.
All filesets for IX78215 were found.
############################
# view filesets in directory
############################
# instfix -T -d .
IY14691 WRONG 2 DECLARATION OF SVC_REGISTER IN RPC/SVC.H
IY30887 SDK 1.3.1 32-bit PTF 1
IY31033 SDK 1.3.1 32-bit PTF 0 : ca131w-20020404
IY31312 CANNOT 2 COMPILE RPC WRAPPERS IN 64BIT ON AIX 5
IY31879 SYS/SHM.H 2 HEADER SHOULD NOT DEFINE _ALL_SOURCE
IY32007 STR() 2 OF OSTRSTREAM FREEZES
IY32852 JULY 2 2002 C++ RUNTIME PTF
IY33524 IY33524 SYMBOLS 18 SYMBOLS EXPORTED FROM OLD RTE NOT EXPORTED EXP. FROM
...
#################
# efix management
#################
# wenn man nicht weiss wie der label eines efixes ist
- entpacken mit gnu-tar
- ecfile anschauen
# list all
emgr -l
ID STATE LABEL INSTALL TIME ABSTRACT
=== ===== ========== ================== ======================================
1 S IY64691ML4 12/15/04 14:23:08 chvg -B causes corruption
2 S aio 12/15/04 14:23:30 Efix for AIO hang problem.
3 S 52IS63366 12/20/04 13:52:36 efix for dlsym problem on 52I
# list detail of fix
emgr -L 84597
# install
emgr -e IYxxx
# show locks
emgr -P
# uninstall
emgr -r -L LABELNAME
######
# suma
######
# download TL
suma -x -a DLTarget=/export/fixes/530TL07 -a Action=Download -a RqType=TL -a RqN
ame=5300-07
# download specific fixes
suma -x -w -a Action=Preview -a RqType=APAR -a RqName=IY70298
Task ID 1 created.
The download list contains one or more fixes known to cause a regression:
U809929
# download fixes
suma -x -w -a Action=Download 1
The download list contains one or more fixes known to cause a regression:
U809929
Extending the /usr filesystem by 1196427 blocks.
Filesystem size changed to 10223616
Download SUCCEEDED: /usr/sys/inst.images/installp/ppc/Java131.ext.commapi.1.3.1.
2.bff
Download SUCCEEDED: /usr/sys/inst.images/installp/ppc/ICU4C.rte.5.3.0.60.bff
Download SUCCEEDED: /usr/sys/inst.images/installp/ppc/Java131.adt.includes.1.3.1
.5.bff
# unschedule task
suma -u 1
# delete task
suma -d 1
#########
# oslevel
#########
# oslevel -r -q
Known Recommended Maintenance Levels
------------------------------------
4330-08
4330-07
4330-06
4330-05
4330-04
4330-03
4330-02
4330-01
4320-02
####################
# ML52_02 downloaden
####################
http://techsupport.services.ibm.com/server/aix.fdc?toggle=DNLDLATEST
##########################
# compare_report nur > 5.1
##########################
https://techsupport.services.ibm.com/server/aix.techTips?refNo=0274
get LatestFixData51
# /usr/sbin/compare_report -s -r /tmp/LatestFixData51 -l
# ls -l /tmp/lower*
-rw-r--r-- 1 root system 0 Feb 20 17:28 /tmp/lowerthanlatest1.r
pt
-rw-r--r-- 1 root system 0 Feb 20 17:28 /tmp/lowerthanmaint.rpt
ab 5.2
smitty compare_report
####################
# compare 2 machines
####################
# lslpp -qLc >/tmp/lslpp_machine1.out
copy this to the machine you want to compare
# lslpp -qLc >/tmp/lslpp_machine2.out
/usr/sbin/compare_report -b /tmp/lslpp_machine1.out -o /tmp/lslpp_machine2.out -
l -h -m -n
If all reports (-l, -h, -m, and -n) are requested for this type of
comparison, the following reports will be generated respectively:
o baselower.rpt (generated with -l)
o basehigher.rpt (generated with -h)
o baseonly.rpt (generated with -m)
o otheronly.rpt (generated with -n)
####################################
# update script fuer ml oder patches
####################################
AIX 5
regatta1:/> file /usr/sbin/install_all_updates
/usr/sbin/install_all_updates: shell script - ksh (Korn shell)
regatta1:/> install_all_updates -?
Usage: install_all_updates: Updates installed software to latest levels.
install_all_updates -d <device> [-picrnsxvNSYVD]
-p = Preview only.
-i = Update install utilities only.
-r = Also update rpms if possible.
-s = Skip recommended maintenance verification.
-N = Skip updating install utilities first.
-D = Script debug output.
Installp specific option flags:
-c = Commit updates.
-n = Do not automaticly install requisites.
-x = Do not expand automaticly.
-v = Verify installation.
-S = Suppress multi-volume processing.
-V = Verbose output.
# check
install_all_updates -pYcd.
# do
install_all_updates -Ycd.
#############################
# update rpm packages toolbox
#############################
updtvpkg
####################################
# restore particular file from mksysb
#####################################
AIX 3
tctl -f /dev/rmt0 fsf 3 < moves tape forward from the mksysb files>
tar -xvf /dev/rmt0 /etc/passwd < extracts the file >
AIX 4
tctl -f /dev/rmt0 rewind
restore -s4 -xqvf /dev/rmt0.1 ./var/spool/cron/crontabs/root
Tapeinhalt mksysb anschauen
# restore -s4 -Tvqf /dev/rmt0.1 | tee filename
oder
# restore -s4 -Tvqf /dev/rmt0 > file
what command will eject tape from tapedrive ?
tctl -f /dev/rmt0 rewoffl
mt -t device_file offl (will actually eject for a 4mm drive, will only take off
line for a DLT)
Determining a tape format
It happens some time that you have an unlabeled backup tape which you don't
know using which command this tape been created. This is a very easy way
rather than attempting to read the tape directly with various backup
command. Read a small portion of the tape using the "dd" command, then using
the "file" command to attempt to determine the format of the archive.
For example :
# dd if=/dev/rmt0 of=/tmp/tape.data count=4
4 + 0 records in.
4 + 0 records out.
# file /tmp/tape.data
/tmp/tape.data: tar archive
#######################################
# doing remote mksysb without tapedrive
#######################################
The mksysb script (which is also the savevg script BTW) needs to talk
to a tape device. But you can edit a copy
of the script, or just butcher it, to achieve what you want. If you
want a bootable tape, you will have to emulate the
script exactly - that is, create the four files needed and get them to
the tape somehow.
The first three files go on the tape with bs=512, the fourth, the
backup itself, with bs=1024.
Techniques like
rsh remote "chdev -l rmt0 -a block_size=512"
dd if=file1 bs=512 conv=sync | rsh remote "dd of=/dev/rmt0.1 bs=512 conv=sync"
(repeat for file 2 and file 3; note 0.1 for norewind tape device) rsh
remote "chdev -l rmt0 -a block_size=1024"
The above command often rewind the tape, so to avoid overwriting the
first three files, skip past them after
setting bs=1024.
rsh remote "mt -f /dev/rmt0 rewind&&mt -f /dev/rmt0.1 fsf 3"
Examine mksysb to see exactly how backup is fed - I don't have access
just now, so I've put ... . Make f the last
option on backup, follow with space and - to direct backup output to
stdout, then pipe to rsh: find ... | backup
-{other options from mksysb}f - | rsh remote "dd of=/dev/rmt0.1 bs=1024 conv=sy
nc"
########################
# doing mksysb over pipe
########################
1. mknod /tmp/.mksysb.pipe p
2. dd if=/tmp/.mksysb.pipe | ssh servername dd of=/mksysb/filename & mksysb -e /
tmp/.mksysb.pipe
############################
# exclude files from mksysb
############################
In the /etc/exclude.rootvg file, insert the names of the filesystems that
you do not want backed up. Example:
b508 spaldst /home/spaldst
>cd /etc
b508 spaldst /etc
>ls -l exclude.rootvg
-rw-r--r-- 1 root system 54 Sep 13 07:36 exclude.rootvg
b508 spaldst /etc
>cat exclude.rootvg
/mkcd/mksysb_image
/mkcd/cd_fs
/mkcd/cd_images
/cdrom
http://www-03.ibm.com/support/techdocs/atsmastr.nsf/84279f6ed9ffde6f86256ccf0065
3ad3/b75a2f3717807e9d86256fcd004ec329?OpenDocument
http://www.dvddemystified.com/dvdfaq.html#4.3
Maxell DVD-RAM 4.7GB single sided,
rewriteable media
Part number 636070
Script to write mksysb to DVD
<snip>
echo '************************************************************'
echo 'backup the rootVG volume group to DVD-RAM(daily copy)'
now=`date`
echo mksysb backup to DVD-RAM started on $now
/usr/sbin/mkcd -U -d /dev/cd0 -P -V rootvg
now=`date`
echo mksysb nightly onsite backup to DVD-RAM completed on $now
echo '************************************************************'
<snip>
###############################
# copy mksysb from tape to disk
###############################
tctl -f /dev/rmt0 rewind
tctl -f /dev/rmt0.1 fsf 3
dd if=/dev/rmt0.1 of=/mksysb/clone.image bs=<tpebs>
##############
# listvgbackup
##############
# listvgbackup -l -f /mksys/maschine/mksys-maschine-050317
VOLUME GROUP: rootvg
BACKUP DATE/TIME: Thu Mar 17 23:30:03 NFT 2005
UNAME INFO: AIX maschine 3 4 0045C95A4C00
BACKUP OSLEVEL: 4.3.3.75
MAINTENANCE LEVEL:
BACKUP SIZE (MB):
SHRINK SIZE (MB):
VG DATA ONLY: no
# listvgbackup -l -f /mksys/maschine/mksys-maschine-041130
VOLUME GROUP: rootvg
BACKUP DATE/TIME: Tue Nov 30 17:05:32 MEZ 2004
UNAME INFO: AIX maschine 2 5 0055CCFA4C00
BACKUP OSLEVEL: 5.2.0.40
MAINTENANCE LEVEL: 5200-03
BACKUP SIZE (MB): 29952
SHRINK SIZE (MB): 16886
VG DATA ONLY: no
rootvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
hd5 boot 1 1 1 closed/syncd N/A
hd6 paging 9 9 1 open/syncd N/A
hd8 jfs2log 1 1 1 open/syncd N/A
hd4 jfs2 1 1 1 open/syncd /
hd2 jfs2 88 88 1 open/syncd /usr
hd9var jfs2 33 33 1 open/syncd /var
hd3 jfs2 32 32 1 open/syncd /tmp
hd1 jfs2 1 1 1 open/syncd /home
hd10opt jfs2 1 1 1 open/syncd /opt
app01LV jfs2 32 64 2 open/syncd /usr/app/oracle
paging00 paging 7 7 1 open/syncd N/A
local01LV jfs2 10 10 1 open/syncd /usr/local
audit01LV jfs2 2 2 1 open/syncd /audit
hd7 dump 119 119 1 open/syncd N/A
hd77 dump 119 119 1 open/syncd N/A
app02LV jfs2 80 160 2 open/syncd /usr/app/oracle/pr
oduct/8.1.7
app03LV jfs2 144 288 2 open/syncd /usr/app/oracle/pr
oduct/9.2.0
#####################
# doing remote backup
#####################
Backup to a remote tape drive
# rdump -fsystemwithdrive:/dev/rmt0 /data_to_backup
OR
# tar -cvBf - . | rsh hostname dd of=/dev/rmt0 ibs=20
OR
TO BACKUP
# find ./home/username -print | backup -iqvf- | rsh remote_hostname dd ibs=1024
obs=1024 of=/dev/rmt1
# find ./ -print | backup -iqvf- | ssh idefix dd ibs=1024 obs=1024 of=/dev/rmt0
TO RESTORE
cd "the appropriate directory for file that begin ./home/username" rsh remote_ho
stname "dd if=/dev/rmt1 bs=1024" | restore -xqvf -
# ssh remote copy to another machine with backup/restore
# find ./ -print | backup -iqvf- | ssh idefix "cd to_be_restore && restore -xqvf
-"
#######################
# backing up raw-device
#######################
Backing Up Raw Devices
Use the dd command to back up raw devices. You should not overwrite the first
4KB block of a raw device, as the AIX Logical Volume Manager uses it. It is
faster to back up with a block size of larger than 4KB. A good block size to use
when backing up to tape is 256KB. The following is a sample script that can be
used to back up/restore a raw device to tape:
1. To back up the raw device to tape:
dd if=/dev/<raw_device> of=/dev/rmt0.1 bs=256k
2. To restore the raw device from tape:
dd if=/dev/rmt0.1 of=/dev/<raw_device> count=63 seek=1 skip=1 bs=4k
mt -f /dev/rmt0.1 bsf 1
dd if=/dev/rmt0.1 of=/dev/<raw_device> seek=1 skip=1 bs=256k
##########################
# mksysb from disk to tape
##########################
You could create a bootable tape with the mksysb image etc. on it, by using the
commands:
1. bosboot -ad /dev/rmtx.1
2. mkinsttape /dev/rmtx.1
3. Use the tctl command to insert an EOF mark
4. Use dd to transfer the rootvg files from the disk file to tape.
or in detail:
http://www.rs6000.ibm.com/doc_link/en_US/a_doc_lib/aixins/aixinsgd/creating_boot
able_tapes.htm#ksxNj2a6ttay
############
# restore vg
############
VG-Infos wurden vorher mit Script
austausch/betrieb/os/aix/scripte/vg_recovery
gesichert.
Die Dateien liegen dann unter /usr/local/vgdata/<VGNAME>
Diese Infos koennen dann ueber
restvg -q -f /usr/local/vgdata/vg01
zurueckgeholt werden.
Da /usr/local in einem mksysb enthalten ist werden somit saemtliche Infos bezueg
lich der anderen VG's mit aufgenommen.
<snip>
Creating information file for volume group ipasvgp05..
Creating list of files to back up
Backing up 10 filesBacking up to /usr/local/vgdata/ipasvgp05
Cluster 51200 bytes (100 blocks).
Volume 1 on /usr/local/vgdata/ipasvgp05
a c 265 ./ata/vgdata.files38786
a 265 ./tmp/vgdata/vgdata.files
a 3758 ./tmp/vgdata/ipasvgp05/filesystems
a 0 .
a 4786 ./tmp/vgdata/ipasvgp05/ipasvgp05.data
a 18 ./tmp/vgdata/ipasvgp05/logipasvgp05.map
a 2700 ./tmp/vgdata/ipasvgp05/lvipasinfopool.map
a 36 ./tmp/vgdata/ipasvgp05/testlv01.map
a 36 ./tmp/vgdata/ipasvgp05/testlv02.map
a 36 ./tmp/vgdata/ipasvgp05/testlv03.map
total size: 11900
Done at Tue Oct 8 10:52:41 MSZ 2002; 100 blocks on 1 volume(s)
0512-038 savevg: Backup Completed Successfully.
To restore the volume group image saved in /usr/local/vgdata/ipasvgp05 file onto
the disks specified in the vgname.data file contained within the backup image,
enter: restvg -f/usr/local/vgdata/ipasvgp05
Creating
information file for volume group ipasvgp04.
C
reating list ofk up
Backing up 8 filesBacking up to /usr/local/vgdata/ipasvgp04
Cluster 51200 bytes (100 blocks).
Volume 1 on /usr/local/vgdata/ipasvgp04
a 191 ./tmp/vgdata/vgdata.files39186
a 191 ./tmp/vgdata/vgdata.files
a / 3758 ./tmp/vgdasvgp04/filesystems
a 0 .
a 2936 ./tmp/vgdata/ipasvgp04/ipasvgp04.data
a 18 ./tmp/vgdata/ipasvgp04/logipasvgp04.map
a 90 ./tmp/vgdata/ipasvgp04/lvsironp01.map
a 90 ./tmp/vgdata/ipasvgp04/lvsironp11.map
total size: 7274
Done at Tue Oct 8 10:52:56 MSZ 2002; 100 blocks on 1 volume(s)
0512-038 savevg: Backup Completed Successfully.
To restore the volume group image saved in /usr/local/vgdata/ipasvgp04 file onto
the disks specified in the vgname.data file contained within the backup image,
enter: restvg -f/usr/local/vgdata/ipasvgp04
Creating information file for volume group ipasvgp03..
Creating
list of files to back up
Backing up 9 filesBacking up to /usr/local/vgdata/ipasvgp02
Cluster 51200 bytes (100 blocks).
Volume 1 on /usr/local/vgdata/ipasvgp02
a 226 ./tmp/vgdata/vgdata.files38848
a 226 ./tmp/vgdata/vgdata.files
a 3758 ./tmp/vgdata/ipasvgp02/filesystems
a 0 .
a 4743 ./tmp/vgdata/ipasvgp02/ipasvgp02.data
a 17 ./tmp/vgdata/ipasvgp02/logipasvgp02.map
a 5967 ./tmp/vgdata/ipasvgp02/lvipasp01.map
a 3332 ./tmp/vgdata/ipasvgp02/lvipasp02.map
a 1394 ./tmp/vgdata/ipasvgp02/lvipasp03.map
total size: 19663
Done at Tue Oct 8 10:54:30 MSZ 2002; 100 blocks on 1 volume(s)
0512-038 savevg: Backup C5ompleted Succes.
To restore the volume group image saved in /usr/local/vgdata/ipasvgp02 file onto
the disks specified in the vgname.data file contained within the backup image,
enter: restvg -f/usr/local/vgdata/ipasvgp02
Creating information file for volume group ipasvgp01.
Creating list of files to back up ..
Backing up 8 filesBacking up to /usr/local/vgdata/ipasvgp01
Cluster 51200 bytes (100 blocks).
Volume 1 on /usr/local/vgdata/ipasvgp01
a 190 ./tmp/vgdata/vgdata.files34022
a 190 ./tmp/vgdata/vgdata.files
a 3758 ./tmp/vgdata/ipasvgp01/filesystems
a 0 .
a 2905 ./tmp/vgdata/ipasvgp01/ipasvgp01.data
a 17 ./tmp/vgdata/ipasvgp01/logipasvgp01.map
a 833 ./tmp/vgdata/ipasvgp01/lvoraclep01.map
a 102 ./tmp/vgdata/ipasvgp01/lvuc4p01.map
total size: 7995
Done at Tue Oct 8 10:55:09 MSZ 2002; 100 blocks on 1 volume(s)
0512-038 savevg: Backup Completed Successfully.
To restore the volume group image saved in /usr/local/vgdata/ipasvgp01 file onto
the disks specified in the vgname.data file contained within the backup image,
enter: restvg -f/usr/local/vgdata/ipasvgp01
xipasp01#pwd
/usr/local/vgdata
xipasp01#ll
total 520
-rw-r--r-- 1 root system 51200 Oct 08 10:55 ipasvgp01
-rw-r--r-- 1 root system 51200 Oct 08 10:54 ipasvgp02
-rw-r--r-- 1 root system 51200 Oct 08 10:53 ipasvgp03
-rw-r--r-- 1 root system 51200 Oct 08 10:52 ipasvgp04
-rw-r--r-- 1 root system 51200 Oct 08 10:52 ipasvgp05
<snip>
######################
# remote copy with tar
######################
cd basedir ; tar cvf - dirtocopy | (ssh -q user@floyd "cd basedir ; tar xfBF -")
cd basedir ; tar cvf - dirtocopy | (ssh -q user@floyd "cd basedir ; tar xvf -")
#####################
# local copy with tar
#####################
tar -cf - . | (cd destdir; tar vpxf -)
########################
# copy with ssh and cpio
########################
find basedir -depth -print | cpio -oc | \
ssh2 -q remote@floyd "cd basedir && cpio -icmlMudv"
# l --> create links
# m --> modifikation-time files bleibt erhalten
# M --> modifikation-time dirs bleibt erhalten
# d --> create dirs
# u --> An older filer replaces newer
# v --> verbose
bash-2.03$ find . -depth -print |cpio -oc | /usr/local/bin/ssh -q root@verleihni
x-filer.intern.rzag.net "cd /var/log/twelogbackup && cpio -icmlMudv"
##########################
# tar without inbound gzip
##########################
gzip -dc xyz.tar.gz | tar xvf -
################
# tar with xargs
################
ls | /usr/bin/xargs /opt/freeware/bin/tar -czvf /oracle/E03/tmp/logarch.tar.gz
#########
# ramdisk
#########
mkramdisk 40000
ls -l /dev | grep ram
mkfs -V jfs /dev/ramdiskx
mkdir /ramdiskx
mount -V jfs -o nointegrity /dev/ramdiskx /ramdiskx
where x is the logical RAM disk number. To remove a RAM disk, use the rmramdisk
command. RAM disks are also removed when the machine is rebooted.
#######################
# mksysb auf filesystem
#######################
aixinstall0:/# /usr/bin/mksysb '-e' '-i' /mksysb/aixinstall2.20010516.obj
-e --> exclude.rootvg Inhalte werden nicht mitgesichert
################
# mksysb auf dvd
################
/usr/sbin/mkcd -L -d '/dev/cd0' -M '/mksbcd/backup_image' -C '/mksbcd/cd_fs' -I
'/mksbcd/cd_images' -V 'rootvg'
#############################
# mkcd nur bootimage erzeugen
#############################
# cd /var/adm/ras
# ls ./bosinst.data ./images.data | backup -ivqf /tmp/520ML04.img
# mkcd -m /tmp/520ML04.img -S -V app01VG
Initializing mkcd log: /var/adm/ras/mkcd.log...
Verifying command parameters...
Creating temporary file system: /mkcd/cd_fs...
Populating the CD or DVD file system...
0512-323 mkcd: The following files are required for the
creation of the CD or DVD image and are not available on the source system:
/usr/lib/drivers/pci/qfcdd devices.pci.77101223.rte
/usr/lib/drivers/pci/qfcddpin devices.pci.77101223.rte
/usr/lib/drivers/qfscsidd devices.pci.77101223.rte
/usr/lib/drivers/qfscsiddpin devices.pci.77101223.rte
/usr/lib/drivers/usb/usbfd devices.usbif.080400.rte
/usr/lib/drivers/usb/usbcd devices.usbif.08025002.rte
/usr/lib/drivers/usb/usbcdpin devices.usbif.08025002.rte
/usr/lib/methods/cfgcdrom_usb devices.usbif.08025002.rte
/usr/lib/methods/cfgfd_usb devices.usbif.080400.rte
/usr/lib/methods/cfgqfc devices.pci.77101223.rte
/usr/lib/methods/cfgqfscsi devices.pci.77101223.rte
The files can be installed from the listed filesets.
0512-321 mkcd: Error populating the CD or DVD file system
using the /usr/lpp/bosinst/cdfs.optional.list proto file.
#######################
# restore informationen
#######################
It is 'backup' format. You can list with 'restore' like :
restore -Tqvf /dev/rmtxx
##################
# test mksysb-tape
##################
AIX V4:
The mksysb tape has 4 images on it:
------------------------------------------------------------
boot image | install image | empty TOC | system backup image
------------------------------------------------------------
To test the first 3 images, use the following commands. All this
does is checks for tape media errors. If you want to be absolutely
sure, boot the tape.
# The first 3 images are always written in 512 byte blocks
#
chdev -l rmt0 -a block_size=512
dd if=/dev/rmt0.1 of=/dev/null
dd if=/dev/rmt0.1 of=/dev/null
dd if=/dev/rmt0.1 of=/dev/null
To test the 4th image, use the commands:
# The system backup image is written at whatever block size the
# tape device was set to when the mksysb was made. You might
# assume 512 and skip the commands up through 'chdev' and the
# optional 'ibs' parameter to dd in the subsequent section. If
# you do and the block size is not 512, you'll get an I/O error.
#
tctl rewind
restore -xqvf /dev/rmt0.1 -s2 ./tapeblksz
chdev -l rmt0 -a block_size=$(awk '{ print $1 }' tapeblksz)
dd if=/dev/rmt0 [ibs=$(awk '{ print $1 }' tapeblksz)] |
restore -Tqf- >/dev/null
#########
# tar
#########
AIX-tar
/usr/bin/tar -L tar.include -cvf /backup/backup.tar
gnu-tar
/usr/local/bin/tar -czvf /dev/rmt0 --files-from ./files.2000
wobei files.2000 die Namen der zu sichernden Dateien enthaelt
standard-tar
find /data -name "200012*" -print > /tmp/tar.include
tar -czvf /backup/backup.tgz -I /tmp/tar.include
gtar -czvf /backup/backup.tgz -T /tmp/tar.include
###############################################
# translation from characterset to characterset
###############################################
iconv -f ISO8859-2 -t IBM-852 original > translated
##############################
# determine big fs oder normal
##############################
Try lsfs -q file-system-name.
For example, lsfs -q /home
Name Nodename Mount Pt VFS Size Options
Auto
Accounting
/dev/hd1 -- /home jfs 409600 -- yes no
(lv size: 409600, fs size: 409600, frag size: 4096, nbpi: 4096, compress:
no,
bf: false, ag: 4)
The attribute "bf" seems to indicate whether large file is enabled or not.
"ag" is related to allocation group.
#########################
# vi command completition
#########################
AFAIR it must be \ (antislash) to do filename completion in vi mode.
I like much vi editor for all its capabilities (buffers...), but I
personnaly find that the emacs mode is much more user friendly for line
editing in ksh. One of its greatest interest is almost undocumented : you
may have aliases to use the arrow keys for line editing. Try these five
lines in your .kshrc (or whatever filename your ENV variable contains) :
set -o emacs
alias __A=^P # cursor up
alias __B=^N # cursor down
alias __C=^F # cursor right
alias __D=^B # cursor left
The first __ (double _) replaces the ^[ sent by the vt100 mode function keys
in 7bits mode. The followings are CONTROL-letter characters (one char only)
that you insert in vi with CTRL-V+CTRL-letter.
After that log again and you may use the arrow keys to navigate in the
commands history and through the lines. You may never wanna come back to vi
mode...
########################
# ksh command completion
########################
ksh can do this too:
esc + \ --> completes the command
esc + = --> gives a list of options with full path
###############
# topas auf aix
###############
topas im Paket perfagent
topas -P # aehnlich top
topas -C # Cross Partion - ueber alle Partions
topas -L # Partion view
topas -W # Workloadmanger
#################
# monitor auf aix
#################
monitor -Toplog -log /var/adm/monitor_colon05.log
####################
# manuell cd mounten
####################
crfs -v cdrfs -p ro -d'cd0' -m'/cdrom'
#####################
# default TERM setzen
#####################
In the /etc/profile I added TERM_DEFAULT=vt200.
##########################
# reject maintenance level
##########################
when you install the maintenance level, use smitty update_all
for the COMMIT software updates? line, select no
This will APPLY the updates (make a backup of the old level)
If for some reason the new stuff doesnt work, you can revert back to
the old level using: smitty reject
###########################
# install maintenance level
###########################
smitty update_all
Einzelne Fixes installieren
smitty update_by_fix
Fixe auflisten
smitty install_list_problems
##################
# login verhindern
##################
touch /etc/nologin
#########################
# failed logins ermitteln
#########################
/usr/sbin/acct/fwtmp < /etc/security/failedlogin | more
oder
who /etc/security/failedlogin
sudo bash -c "/usr/sbin/acct/fwtmp < /etc/security/failedlogin"
##################
# wtmp verkleinern
##################
# /usr/lib/acct/fwtmp < /var/adm/wtmp > /tmp/wtmp.tmp
# tail -1000 /tmp/wtmp.tmp > /tmp/wtmp.tmp1
# /usr/lib/acct/fwtmp -ci < /tmp/wtmp.tmp1 >/var/adm/wtmp
# wtmp lesen
# /usr/sbin/acct/fwtmp </var/adm/wtmp
#########################
# loginretries limitieren
#########################
I've been given two solutions - Add "loginretries = 3" to one of the
following files:
/etc/security/mkuser.default
/etc/security/user
My understanding of these files:
1. mkuser.default - will supply default values to the mkuser command
whether run from the command line or through smit but the smit mkuser
screen will still show [0] for the "Number of FAILED LOGINS before user
account is locked" field.
2. user - will supply a default value for ALL users, unless it is
specifically overridden in that user's stanza. Surprisingly, smit looks at
this file. The "Number of FAILED..." field shows a change made in this
file. (Guess I should have tested this :-)
####################################
# check unsuccesful logins with mail
####################################
lsuser -a unsuccessful_login_count ALL|grep unsuccessful_login_count=[1-9] >/tmp
/bla
&& mail -s login_failure [email protected] </tmp/bla
###############################
# user zur laufzeit ueberwachen
###############################
tail -f /home/username_to_watch/.sh_history
/usr/sbin/portmir -t pts/(#_username_to_watch)
pts kann per who -Hu erfahren werden
##########
# check su
##########
cat /var/adm/sulog|grep " - "|more
root@cws [~]# cat /var/adm/sulog|grep " - "|m
SU 10/09 14:42 - pts/4 michaeln-root
SU 02/19 12:42 - pts/10 nrajab-nrajab
SU 02/19 15:14 - pts/13 up-root
SU 07/29 08:31 - pts/1 kutz-root
SU 07/30 08:36 - pts/1 kutz-root
SU 12/02 15:52 - pts/13 user05-root
SU 12/02 15:53 - pts/13 user05-root
SU 12/03 10:10 - pts/20 user08-root
SU 12/04 09:54 - pts/11 user06-root
SU 12/05 10:15 - pts/21 user03-root
SU 12/05 16:05 - pts/17 user08-root
SU 12/06 11:45 - pts/19 user03-root
###########
# chuser id
###########
chuser id=neue_id user
find / -user alte_id -exec chown name {} \;
###############
# chuser ulimit
###############
USER=
/usr/bin/chuser fsize=-1 $USER
/usr/bin/chuser core=0 $USER
/usr/bin/chuser stack=-1 $USER
/usr/bin/chuser data=-1 $USER
##############################
# root pw ermitteln per telnet
##############################
iptrace -a -e -p 23 /tmp/iptrace.log
warten bis per telnet login erfolgt ist
dann
kill -15 `ps -ef|grep iptrace|awk '{print $2}'`
ipreport -ns /tmp/iptrace.log |more
#######################
# copy PVID duplication
#######################
You can change the PVID when the VG is exported using "chdev -l hdiskX -a pv=cle
ar; chdev -l hdiskX -a pv=yes", but there is no way to change the VGID on the di
sk.
Changing it in the ODM database will just make it out of sync with the disk.
If I were you, I'd start over. Create a new VG and use cplv to copy all of the l
ogical volumes to the new VG, then edit the /etc/filesystems file to create moun
t
points for the filesystems using the new LV names that will be assigned.
If you have no need to keep both VGs around, you might do just as well making a
backup of the data, replacing the disks, remaking the VG and filesystems, then
restoring the data. If you need help with that, check out either Storix, savevg
(AIX command) or Sysback.
####################################
# hdisk tausch anschliessend problem
####################################
root@KAH82:/>extendvg rootvg hdisk1
0516-008 extendvg: LVM system call returned an unknown
error code (-271).
0516-792 extendvg: Unable to extend volume group.
root@KAH82:/>extendvg -f rootvg hdisk1
0516-008 extendvg: LVM system call returned an unknown
error code (-271).
0516-792 extendvg: Unable to extend volume group.
Loesung:
odmget -q "name = 'rootvg' and attribute = 'pv' " CuAt
CuAt:
name = "rootvg"
attribute = "pv"
value = "00573ada8010ae5b0000000000000000"
type = "R"
generic = ""
rep = "sl"
nls_index = 0
CuAt:
name = "rootvg"
attribute = "pv"
value = "00573ada760235200000000000000000"
type = "R"
generic = ""
rep = "sl"
nls_index = 0
AIX ist der Meinung - da gibt es 2 Disks!
kutz@KAH82 /home/kutz> sudo redefinevg -d hdisk0 rootvg
Password:
kutz@KAH82 /home/kutz> sudo synclvodm -Pv rootvg
synclvodm: Physical volume data updated.
synclvodm: Logical volume hd5 updated.
synclvodm: Logical volume hd6 updated.
synclvodm: Logical volume hd8 updated.
synclvodm: Logical volume hd4 updated.
synclvodm: Logical volume hd2 updated.
synclvodm: Logical volume hd9var updated.
synclvodm: Logical volume hd3 updated.
synclvodm: Logical volume hd1 updated.
synclvodm: Logical volume lv01 updated.
kutz@KAH82 /home/kutz> odmget -q "name = 'rootvg' and attribute = 'pv' " CuAt
CuAt:
name = "rootvg"
attribute = "pv"
value = "00573ada8010ae5b0000000000000000"
type = "R"
generic = ""
rep = "sl"
nls_index = 0
Anschliessend gehen extendvg und mirrorvg durch!
######
# cpio
######
To copy a directory and all of its subdirectories, enter:
mkdir /home/jim/newdir
find . -print | cpio -pdl /home/jim/newdir
or
find . | backup -iqvf - | (cd /<dir where the files are to be thrown>;restore -i
qvf -)
#################
# filesystem copy
#################
find . -xdev -print | backup -iqf - | (cd new_directory; restore -xf -)
################################
# reexport nfs /cdrom filesystem
################################
/usr/sbin/chnfsexp -d '/cdrom' -t 'ro' '-B'
###############
# rm nfs-export
###############
/usr/sbin/rmnfsexp -d '/export/fixes' '-B'
######################
# increase nfs daemons
######################
stopsrc -s nfsd
chnfs -n <count> for nfsd
chnfs -b <count> for biod
This will make the change instantly and for each subsequent re-boot
startsrc -s nfsd
######################
# nfs export directory
######################
aixinstall0:/# /usr/sbin/mknfsexp -d '/export/conf' -t 'rw' -c 'aixinstall1,aixi
nstall2,aixinstall3,aixinstall4,aixinstall5' -r 'aixinstall1,aixinstall2,aixinst
all3,aixinstall4,aixinstall5' '-B'
/export/conf root=aixinstall1:aixinstall2:aixinstall3:aixinstall4:aixinstall5,ac
cess=aixinstall1:aixinstall2:aixinstall3:aixinstall4:aixinstall5
Exported /export/conf
change
kurzschlus:/#chnfsexp -d '/export/nim/scripts/aixinstall1.script' -c 'aixinstall
1' -r 'aixinstall1' -B
/export/nim/scripts/aixinstall1.script ro,root=aixinstall1,access=aixinstall1
exportfs: 1831-187 re-exported /export/nim/scripts/aixinstall1.script
#############################
# mount nfs from linux to aix
#############################
Have you got "nfs_use_reserved_ports" set to 1 on AIX (use "nfso -a")?
If not set it with "nfso -o nfs_use_reserved_ports=1". If this does the
trick, add it to e.g. /etc/rc.tcpip to make it permanant.
Linux by default requires any NFS mount to use a so called reserved port
below 1024 and AIX 4.3 does by default use ports above 1024. You can use
the nfso command to restrict AIX to the reserved port range as follows:
nfso -o nfs_use_reserved_ports=1
This comes from some AIX FAQ somewhere.
check name resolution !!!
# nfso -a
portcheck= 0
udpchecksum= 1
nfs_socketsize= 60000
nfs_tcp_socketsize= 60000
nfs_setattr_error= 0
nfs_gather_threshold= 4096
nfs_repeat_messages= 0
nfs_udp_duplicate_cache_size= 0
nfs_tcp_duplicate_cache_size= 0
nfs_server_base_priority= 0
nfs_dynamic_retrans= 1
nfs_iopace_pages= 0
nfs_max_connections= 0
nfs_max_threads= 8
nfs_use_reserved_ports= 0
nfs_device_specific_bufs= 1
nfs_server_clread= 1
nfs_rfc1323= 0
nfs_max_write_size= 0
nfs_max_read_size= 0
nfs_allow_all_signals= 0
nfs_v2_pdts= 1
nfs_v3_pdts= 1
nfs_v2_vm_bufs= 1000
nfs_v3_vm_bufs= 1000
####################################
# umount dir from crashed nfs-server
####################################
umount -f DirectoryToBeUnmounted
################
# mount diskette
################
mount -r -V jfs /dev/fd0 /your_mount_point
#########################
# remove exported nfs-dir
#########################
/usr/sbin/rmnfsexp -d '/spdata/sys1/install/aix433' '-B'
##############################
# restore vg saved with savevg
##############################
I have the backup of mksysb and save VG. I'd would to scratch
install my system. I can successfully install the rootvg, but how can I restore
VG.
'lspv' to make sure which PVs you want to restore your
vg to.
then, 'restvg -qf /dev/rmt0 -s hdiskN'
if your new PVs are exactly the same as the old one,
you don't need the '-s'
######
# find
######
Finden von Dateien in einem bestimmten Zeitraum.
Here's an example. Replace 12, 14 and 20 with 2, 3, 4 and 5.
$ date
Thu Dec 28 19:30:38 MST 2000
$ find src/ -name '*.c' -type f \( -mtime 12 -o -mtime 14 -o -mtime 20 \) -ls
911362 4 Frw-rw-r-- 1 veblen 1000 3505 Dec 17 01:42 src/read/read.
c
913410 1 Frw-rw-r-- 1 veblen 1000 683 Dec 8 20:59 src/read/_arch
ive/read.c
911366 4 Frw-r--r-- 1 veblen 1000 3775 Dec 17 02:49 src/read/fsh.c
2083 2 Frw-r--r-- 1 veblen 1000 1396 Dec 14 21:54 src/tcase_recv.
c
2086 2 Frw-r--r-- 1 veblen 1000 1363 Dec 14 21:54 src/tcase_send.
c
2085 1 Frw-r--r-- 1 veblen 1000 965 Dec 14 19:31 src/sigaction.c
Finden von Dateien
die im letzten Jahr veraendert wurden (gestartet am 28.02.2001)
und
bilde Summe der Bytes ueber awk
btr034:/backup/logs/web #>find . -type f \( -mtime 59 -o -mtime 424 \) -ls|awk
'{ s += $7 } END {print "sum is",s, "average is", s/NR }'
sum is 948425019 average is 3.37518e+06
Q: I want to find all files in the / filesystem. But not the files in /prod/anot
herfilesystem and /var etc. /prod is a directory, not a fs. /var is a fs too.
A: find / -xdev
Q: I want to list all files in one dir, but not the files in subdirs.
A: find /dir -type f
#######################
# fiberchannel settings
#######################
# show settings of an attribute
# lsattr -El fcs0
bus_intr_lvl 323 Bus interrupt level Fals
e
bus_io_addr 0xdf800 Bus I/O address Fals
e
bus_mem_addr 0xe8081000 Bus memory address Fals
e
init_link al INIT Link flags True
intr_priority 3 Interrupt priority Fals
e
lg_term_dma 0x800000 Long term DMA True
max_xfer_size 0x200000 Maximum Transfer Size True
num_cmd_elems 200 Maximum number of COMMANDS to queue to the adapter True
pref_alpa 0x1 Preferred AL_PA True
sw_fc_class 2 FC Class for Fabric True
# lsattr -El fcs0 -R -a max_xfer_size
0x100000
0x200000
0x400000
0x800000
0x1000000
# change direct (vol must be offline)
# chdev -l fcs0 -a max_xfer_size=0x200000
# nur odm change
# chdev -l fcs0 -P -a max_xfer_size=0x100000 (default)
# chdev -l fcs0 -P -a max_xfer_size=0x200000 # 2GB
# chdev -l fcs0 -P -a max_xfer_size=0x400000 # 4GB
# chdev -l fcs0 -P -a max_xfer_size=0x800000 # 8GB
# chdev -l fcs0 -P -a max_xfer_size=0x1000000 # 10GB
# chdev -l fcs0 -P -a lg_term_dma=0x800000 (0x800000)
# lsattr -El fcs0 -R -a num_cmd_elems
20...2048 (+1)
DS4k Clariion
# chdev -l fcs0 -P -a num_cmd_elems=400 #(default 200)
DS8k
# chdev -l fcs0 -P -a num_cmd_elems=1024 #(default 200)
# lsattr -El fscsi0
attach switch How this adapter is CONNECTED False
dyntrk no Dynamic Tracking of FC Devices True
fc_err_recov fast_fail FC Fabric Event Error RECOVERY Policy True
scsi_id 0x10900 Adapter SCSI ID False
sw_fc_class 3 FC Class for Fabric True
# chdev -l fscsi0 -P -a fc_err_recov=fast_fail (default delayed_fail)
# lsattr -El fcnet0
enable_farp yes Use Fiber Channel Address Resolution Protocol True
num_q_bufs 75 Maximum Number of HOST buffers to queue to adapter True
sw_fc_class 3 FC Class for Fabric True
################################
# disk settings for fiberchannel
################################
# lsattr -El vpath0
active_hdisk hdisk4/75235512325/fscsi2 Active hdisk Fal
se
active_hdisk hdisk2/75235512325/fscsi0 Active hdisk Fal
se
active_hdisk hdisk3/75235512325/fscsi0 Active hdisk Fal
se
active_hdisk hdisk5/75235512325/fscsi2 Active hdisk Fal
se
policy df Scheduling Policy Tru
e
pvid 00025eb562b8fd8d0000000000000000 Physical volume identifier Fal
se
qdepth_enable yes Queue Depth Control Tru
e
serial_number 75235512325 LUN serial number Fal
se
unique_id 210C37523551232507210790003IBMfcp Device Unique Identification Fal
se
#############################
# network statistics loeschen
#############################
# netstat -Zi
#######################
# flags bei netstat -nr
#######################
U
Up.
H
The route is to a host rather than to a network.
G
The route is to a gateway.
D
The route was created dynamically by a redirect.
M
The route has been modified by a redirect.
L
The link-level address is present in the route entry.
c
Access to this route creates a cloned route. This field only applies
to AIX Version 4.2.1 or later.
W
The route is a cloned route. This field only applies to AIX Version
4.2.1 or later.
(1) Protocol specific routing flag #1.
(2) Protocol specific routing flag #2.
(3) Protocol specific routing flag #3.
(b) The route represents a broadcast address.
(e) Has a binding cache entry.
(l) The route represents a local address.
(m) The route represents a multicast address.
(P) Pinned route.
(R) Host or net unreachable.
(S) Manually added.
(u) Route usable.
################################
# netstat routing table ausgeben
################################
# netstat -C
Routing tables
Destination Gateway Flags Refs Use If Cost Config_Cost
Route Tree for Protocol Family 2 (Internet):
10.50.5/24 aix_52_test U 10 709388 en0 0 0
aix_52_test loopback UGHS 2 7 lo0 0 0
127/8 loopback U 8 286 lo0 0 0
Route Tree for Protocol Family 24 (Internet v6):
::1 ::1 UH 0 0 lo0 0 0
####################################
# netmask einstellungen herausfinden
####################################
lsattr -El en0 -a netmask -F value
root@cws [~]# lsattr -El en0 -a netmask -F value
255.255.255.0
#####################
# interface erstellen
#####################
smitty mkinet1en
oder
NETADDR=10.50.11.22
NETMASK=255.255.255.0
BROAD=10.50.11.255
chdev -l en2 -a netaddr='10.50.11.22' -a netmask='255.255.255.0' -a broadcast='1
0.50.11.255'
oder
mkdev -c if -s EN -t en -a netaddr='10.50.11.22' -a netmask='255.255.255.0' -w '
en2' -a state='up' -a arp='on' -a broadcast='10.50.11.255'
################################
#alias definieren fuer Interface
################################
ifconfig en0 alias <IP-Adress> <subnetmask> <broadcast>
Check ifconfig en0 or netstat -i after addition/removal to make sure that it has
been created/removed.
chdev -l en1 -a alias4=172.28.64.129,255.255.255.0
#####################################
# check welche aliases sind definiert
#####################################
for i in `ifconfig -a|grep -w inet | grep -v 127.0.0.1|awk '{print $2}'`
do
host $i
done
###############
#alias loeschen
###############
ifconfig en0 delete 20.9.167.45 - this is to remove the alias
chdev -l en1 -a delalias4=172.28.64.129,255.255.255.0
#############################
# interface andere ip-adresse
#############################
ifconfig en0 down
chdev -l en0 -a netaddr='10.0.0.1'
ifconfig en0 up
oder
chdev -l en0 -a state=down
chdev -l en0 -a state=detach
chdev -l en0 -a netaddr='10.0.0.1'
chdev -l en0 -a state=up
oder ohne aenderung am interface aber mit aenderung in der ODM
chdev -l en0 -P -a netaddr='10.0.0.1'
#############################################
# interface andere geschwindigkeit einstellen
#############################################
ifconfig en? down detach
chdev -l en? -a media_speed=100_Full_Duplex
10_Half_Duplex
10_Full_Duplex
100_Half_Duplex
100_Full_Duplex
Auto_Negotiation
ifconfig en? up
REBOOT REQUIRED? NO
OR
Take the adapter down and detach it:
ifconfig en0 detach
chdev -a media_speed=100_Full_Duplex ent0
@ This point you can ifconfig it up, but you will have to put in all the informa
tion ( IP,SM ) for it come up right.
ifconfig en0 <IP Address or hostname if in host file> netmask < if not base on s
egment > up
I prefer to do a smitty chinet, select en0, and make sure the information is
correct to bring it up.
#################
# vipa interfaces
#################
virtuelle interfaces welches ueber mehrere andere netzbeine gelegt wird.
Beispiel:
en0=192.168.1.x
en1=192.168.2.x
vi0=192.168.3.x
http://www16.boulder.ibm.com/pseries/en_US/aixbman/commadmn/tcp_vipa.htm
mkdev -c if -s VI -t vi -a netaddr='172.31.109.101' -a netmask='255.255.255.0' -
w 'vi0' -a state='up'
# mit zuweisung interfaces
mkdev -c if -s VI -t vi -a netaddr='172.31.109.101' -a netmask='255.255.255.0' -
w 'vi0' -a state='up' -a interface_names='en0,en2'
lsdev -HCc if -F 'name class subclass type status description'
##################
# config interface
##################
INTERFACE=en0
INTERFACE=en1
IP=
BC=
# gigabit
chdev -l $INTERFACE -a netaddr=$IP
chdev -l $INTERFACE -a netmask=255.255.255.0
chdev -l $INTERFACE -a broadcast=$BC
chdev -l $INTERFACE -a tcp_nodelay=1
chdev -l $INTERFACE -a tcp_recvspace=655350
chdev -l $INTERFACE -a tcp_sendspace=655350
chdev -l $INTERFACE -a state=up
#######################
# restore static routes
#######################
If you lose any routes ( static ) they can be restored by doing a:
mkdev -l inet0
###################################################################
# routen die beim anlegen des interfaces automatisch erzeugt werden
###################################################################
route add -net 10.42.1/24 10.42.1.10
route add 10.42.1.10 loopback
######################################
# routingtable flushen und neu anlegen
######################################
route -f
mkdev -l inet0
########################
# defaultroute eintragen
########################
/usr/sbin/chdev -l inet0 -a route=net,-hopcount,1,-netmask,255.255.255.0,0,172.3
1.64.1
/usr/sbin/chdev -l inet0 -a route=net,-hopcount,1,-netmask,255.255.255.0,0,10.42
.1.1
#######################
# defaultroute loeschen
#######################
/etc/route -n -f; odmdelete -o CuAt -q "name=inet0 and attribute=route";savebase
#####################
# netzroute eintragen
#####################
chdev -l inet0 -a route=net,-hopcount,1,-netmask,255.255.255.0,172.31.16.0,172.3
1.64.1
###################################
# route von einer maschine kopieren
###################################
lsattr -El inet0 | grep route | awk '{ print $2 }' > /tmp/routes
move /tmp/routes to the target system and run this command :
for RR in $(cat /tmp/routes)
do
chdev -l inet0 -a route=$RR
done
#####################
# hostroute erstellen
#####################
chdev -l inet0 -a route=<TYPE>,-hopcount,<HOPCOUNT>,,<SOURCE>,<GATEWAY>
Beispiel:
Einrichten einer Hostroute von 164.61.197.27 uerb Default-Gateway der MGI
chdev -l inet0 -a route=host,-hopcount,1,,164.61.197.27,193.168.131.20
chdev -l inet0 -a route=host,-hopcount,1,,172.26.241.12,172.31.64.1
####################
# hostroute loeschen
####################
chdev -l inet0 -a delroute=host,,172.26.129.23,172.28.64.19
Beispiel:
# chdev -l inet0 -a delroute=host,,172.26.129.23,172.28.64.19
inet0 changed
################
# route loeschen
################
chdev -l inet0 -a delroute=net,-netmask,255.255.255.0,172.26.129.23,172.28.64.19
chdev -l inet0 -a delroute=net,-netmask,255.255.0.0,172.26.0.0,172.31.64.18
#####################
# route informationen
#####################
odmget -q attribute=route CuAt
And if you change it in the odm, you have to do a bosboot.
So just change it with chinet/smit.
##########################
# mac-adresse herausfinden
##########################
entstat <interface>|grep Hardware Address
Hardware Address: 00:06:29:c3:49:07
oder
entstat ent0|grep "Hardware Address"|tr -d ":"
oder
entstat -d ent1|grep ardw|awk '{print $3}'|sed '1,$s/://g'
####################
# display open ports
####################
netstat -af inet
###############################################
# display tcp sockets in Listen and udp in wait
###############################################
lsof -i | egrep "COMMAND|LISTEN|UDP"
lsof -i @<destination hostname or ip address>
lsof -i :<port number>
################################
# eintraege in inittab erstellen
################################
Shutdown commands can be put into /etc/rc.shutdown. For startup I do the
following to tell AIX about an /etc/rc.local script:
/etc/rc.shutdown MUST be executable!
mkitab -i rcnfs "rclocal:2:wait:/etc/rc.local >/dev/console 2>&1"
#################
# shutdown script
#################
/etc/rc.shutdown is the place to put things for shutdown:
! su - dba <<-EOF
! export ORACLE_HOME=$orahome
! export ORACLE_SID=$sid
! export PATH=$ORACLE_HOME/bin:$PATH
! svrmgrl <<End_of_svrmgrl
! connect internal
! shutdown immediate
! End_of_svrmgrl
! EOF
##########################
# ed einfuegen einer zeile
##########################
ed - kutest <<END
3i
Text der eingefuegt werden soll
.
w
q
END
######
# chfn
######
change gecos for user
######
# chsh
######
change users shell
############
# block user
############
/etc/security/user
/etc/ftpuser -> die user die kein ftp duerfen
/etc/ruser -> die user die kein rsh duerfen
###################################
# schauen ob dump geschrieben wurde
###################################
# sysdumpdev -L
0453-039
Device name: /dev/lv00
Major device number: 10
Minor device number: 9
Size: 29359616 bytes
Date/Time: Sat Oct 28 10:34:37 DFT 2000
Dump status: -2
dump device too small
Einstellungen dump
# sysdumpdev -l
primary /dev/lv00
secondary /dev/sysdumpnull
copy directory /var/adm/ras
forced copy flag TRUE
always allow dump TRUE
dump compression OFF
dump-device aendern
sysdumpdev -P -p /dev/hd5
primary /dev/hd5
secondary /dev/sysdumpnull
copy directory /var/adm/ras
forced copy flag TRUE
always allow dump FALSE
size of dump-device
root@cws [~]#sysdumpdev -e
0453-041 Estimated dump size in bytes: 36700160
#####################################
# dump im laufenden Betrieb forcieren
#####################################
sysdumpstart
oder
echo "hans-dieter kutz" >/dev/kmem
#######################
# dump-device erstellen
#######################
erstelllen mit
mklv -t sysdump -y <name_of_raw_lv> <name_of_VG> <size_of_LP> <hdiskx>
setzen mit
sysdumpdev -P -p /dev/hd7
Check it if this command run and did change:
sysdumpdev -l
# sysdumpdev auf /dev/sysdumpnull stellen
sysdumpdev -P -p /dev/sysdumpnull
sysdumpdev -P -s /dev/sysdumpnull
# zurueckstellen auf hd-devices
sysdumpdev -P -p /dev/hd7
sysdumpdev -P -s /dev/hd77
###########################
# paging-device verkleinern
###########################
- make new ps
mkps -a -n -s 30 rootvg hdisk0
- change actual ps
chps -a n hd6
- Change the paging space entry in the /sbin/rc.boot file from:
swapon /dev/hd6
to
swapon /dev/paging00 (created bei mkps command)
- list actual dump-settings
sysdumpdev -l
- change ps to new ps
sysdumpdev -P -p /dev/paging00
- bosboot erstellen
bosboot -d /dev/hdisk0 -a
- reboot
shutdown -Fr
- alten pagingspace loeschen
rmps hd6
- neuen ps erstellen
mklv -t paging -y hd6 rootvg 30
- dump settings umstellen
sysdumpdev -P -p /dev/hd6
- Change the paging space entry in the /sbin/rc.boot file from:
swapon /dev/paging00
to
swapon /dev/hd6 (created bei mklv command)
- bosboot
bosboot -d /dev/hdisk0 -a
- activate hd6 as ps
chps -a y hd6
- deactivate paging00
chps -a n paging00
- reboot
shutdown -Fr
- temp ps paging00 loeschen
rmps paging00
##############
# dump analyse
##############
"Problem Solving and Troubleshooting in AIX5L" RedBook (SG24-5496-01)
Section 4.7 has some kdb basics.
################################################
# Moving the hd6 Paging Space within the Same VG
################################################
migratepv [ -i ] [ -l LogicalVolume ] SourcePhysicalVolume DestinationPhysicalVo
lume
migratepv -l hd6 hdisk0 hdisk1
###########
# migratelp
###########
1. To move the first logical partitions of logical volume lv00 to hdisk1, type:
migratelp lv00/1 hdisk1
2. To move second mirror copy of the third logical partitions of logical volume
hd2 to hdisk5, type:
migratelp hd2/3/2 hdisk5
3. To move third mirror copy of the 25th logical partitions of logical volume te
stlv to 100th partition of hdisk7, type:
migratelp testlv/25/3 hdisk7/100
###################################
# number of licensed user ermitteln
###################################
# lslicense
Maximum number of fixed licenses is 30.
Floating licensing is disabled.
############################
# einstellungen der maschine
############################
# lsattr -El sys0
keylock normal State of system keylock at boot time Fal
se
maxbuf 20 Maximum number of pages in block I/O BUFFER CACHE Tru
e
maxmbuf 0 Maximum Kbytes of real memory allowed for MBUFS Tru
e
maxuproc 256 Maximum number of PROCESSES allowed per user Tru
e
autorestart false Automatically REBOOT system after a crash Tru
e
iostat false Continuously maintain DISK I/O history Tru
e
realmem 262144 Amount of usable physical memory in Kbytes Fal
se
conslogin enable System Console Login Fal
se
fwversion IBM,L99071 Firmware version and revision levels Fal
se
maxpout 0 HIGH water mark for pending write I/Os per file Tru
e
minpout 0 LOW water mark for pending write I/Os per file Tru
e
fullcore false Enable full CORE dump Tru
e
pre430core false Use pre-430 style CORE dump Tru
e
rtasversion 1 Open Firmware RTAS version Fal
se
modelname IBM,9076-WCN Machine name Fal
se
systemid IBM,010078023 Hardware system identifier Fal
se
boottype disk N/A Fal
se
SW_dist_intr false Enable SW distribution of interrupts Tru
e
cpuguard disable CPU Guard Tru
e
#######################
# einstellungen adapter
#######################
# lsattr -El en1
mtu 1500 Maximum IP Packet Size for This Device True
remmtu 576 Maximum IP Packet Size for REMOTE Networks True
netaddr 192.168.10.239 Internet Address True
state up Current Interface Status True
arp on Address Resolution Protocol (ARP) True
netmask 255.255.255.0 Subnet Mask True
security none Security Level True
authority Authorized Users True
broadcast 192.168.10.255 Broadcast Address True
netaddr6 N/A True
alias6 N/A True
prefixlen N/A True
alias4 N/A True
rfc1323 N/A True
tcp_nodelay N/A True
tcp_sendspace N/A True
tcp_recvspace N/A True
tcp_mssdflt N/A True
# lsattr -El ent1
busio 0x7fffc00 Bus I/O address False
busintr 6 Bus interrupt level False
intr_priority 3 Interrupt priority False
tx_que_size 8192 TRANSMIT queue size True
rx_que_size 256 RECEIVE queue size True
rxbuf_pool_size 384 RECEIVE buffer pool size True
media_speed Auto_Negotiation Media Speed True
use_alt_addr no Enable ALTERNATE ETHERNET address True
alt_addr 0x000000000000 ALTERNATE ETHERNET address True
ip_gap 96 Inter-Packet Gap True
################
# mtu veraendern
################
chdev -l en1 -a mtu=new-value
#####################
# adapter unconfigure
m####################
# rmdev -l atm0
atm0 Defined
# rmdev -d -l atm0
atm0 deleted
###########################
# adapter aus odm entfernen
###########################
# rmdev -d -l atm0
atm0 deleted
####################
# adapter aktivieren
####################
# mkdev -l 'ssa0'
ssa0 Available
#############################
# timeout setzen bei sessions
#############################
You should check if environment variable TMOUT is set either in .profile or /etc
/environment.
TMOUT=3600
readonly TMOUT
export TMOUT
####################################
# bootfaehige cd unter aix erstellen
####################################
smitty mkcdgeneric
oder
1. To generate a bootable system backup to the CD-R device named /dev/cd1,
enter:
mkcd -d /dev/cd1
2. To generate a non-bootable volume group backup of the volume group myvg to
/dev/cd1, enter:
mkcd -d /dev/cd1 -v myvg
Note: All savevg backup images are non-bootable.
3. To generate a generic system backup with the previously created mksysb and
with /mydata/mksysb and /dev/cd0 as the package source location, and to
write to /dev/cd1, enter:
mkcd -d /dev/cd1 -G -m /mydata/mksysb -p /dev/cd0
mkcd -d /dev/cd1 -G -m /mksysb/mksysbname.obj -p /export/lpp_source/aix433/ai
x433_minimage
Optional List for Devices to be installed:
/usr/lpp/bosinst/cdfs.optional.list
Note: The functionality required to create Rock Ridge format CD images and
to write the CD image to the CD-R device is not part of the mkcd command.
You must supply additional code to mkcd to do these tasks. The code will be
called via shell scripts and then linked to /usr/sbin/mkrr_fs (for creating
the Rock Ridge format image) and /usr/sbin/burn_cd (for writing to the CD-R
device). Both links are called from the mkcd command.
Some sample shell scripts are included for different vendor-specific
routines. You can find these scripts in /usr/samples/oem_cdwriters.
#######
# sdiff
#######
vergleicht 2 Dateien gegenueber
sdiff lslpp_machine1.out lslpp_machine2.out|grep -v "\|" # ohne gleiche inhalte
sdiff lslpp_machine1.out lslpp_machine2.out|grep "|" # nur gleiche inhalte
sdiff lslpp_machine1.out lslpp_machine2.out|grep ">" # filtert nur rechts
sdiff lslpp_machine1.out lslpp_machine2.out|grep "<" # filtert nur links
# erzeugen
lslpp -qL >/tmp/lslpp_machine1.out
lslpp -qL >/tmp/lslpp_machine2.out
###############################
# herausfinden file --> fileset
###############################
elod@root# lslpp -w /usr/sbin/mkcd
File Fileset Type
-----------------------------------------------------------
/usr/sbin/mkcd bos.sysmgt.sysbr File
###########################
# alle files eines filesets
###########################
lslpp -f packagename
#############################
# when was software installed
#############################
lslpp -h
############################
# when was machine installed
############################
lslpp -h bos.rte
Fileset Level Action Status Date Time
----------------------------------------------------------------------------
Path: /usr/lib/objrepos
bos.rte
5.2.0.0 COMMIT COMPLETE 04/22/05 11:18:18
5.2.0.40 COMMIT COMPLETE 12/06/04 16:23:45
5.2.0.50 COMMIT COMPLETE 04/22/05 15:11:49
Path: /etc/objrepos
bos.rte
5.2.0.0 COMMIT COMPLETE 04/22/05 11:18:18
################
# check filesets
################
lppchk -v
lppchk -m3 -v --> liefert mehr infos
#########################
# check prereq of fileset
#########################
lslpp -p bos.net.tcp.client
#################################
# check when system was installed
#################################
lslpp -h bos.rte
#############################################
# alle packages mit superseede level anzeigen
#############################################
lslpp -L '-a' all
###########
# bffcreate
###########
/usr/lib/instl/sm_inst bffcreate_cmd -d 'QUELLE' -f'all' -t'ZIEL' '-X'
Example:
/usr/lib/instl/sm_inst bffcreate_cmd -d '/export/nim/customize/zusaetzliche_pack
ages/5.2.0.0' -f'all' -t'/export/nim/customize/zusaetzliche_packages/5.2.0.0/bff
' '-X'
oder per gencopy
gencopy -b "-qvX" -d . -t /tmp/inst.images -f File 2>&1
wobei File Inhalt:
all
oder nur 1 Medium auf Platte kopieren:
gencopy -b "-qvSX" -d /dev/cd0 -t /export/nim/lpp_source/520all_res -f File 2>&
1
File:
all
########################
# check for locale codes
########################
locale -a"
will show you all the locales you have installed
$ /tmp> /usr/lib/nls/lsmle -c
ISO8859-1 C (POSIX) [C]
...
ISO8859-15 German (Austria) [de_AT.8859-15]
UTF-8 German (Austria) [DE_AT]
ISO8859-1 German (Switzerland) [de_CH]
ISO8859-15 German (Switzerland) [de_CH.8859-15]
UTF-8 German (Switzerland) [DE_CH]
IBM-1252 German [de_DE.IBM-1252]
ISO8859-1 German [de_DE]
ISO8859-15 German [de_DE.8859-15]
UTF-8 German [DE_DE]
ISO8859-15 German (Luxembourg) [de_LU.8859-15]
UTF-8 German (Luxembourg) [DE_LU]
...
###########################
# socksserver auf aix 4.3.3
###########################
export SOCKS5C_CONF=/etc/socks5c.conf
and create your self a suitable socks5c.conf file, of course :-)
I think they call this CIDR format, or some such. Anyway, it lists the
network(s) to exclude, and the last line points at your socks server
machine
i.e.
207.146.170.0/24 NONE
0.0.0.0/0 mysocksserver.com
My friend offered me the binaries for rtelnet, rftp, rwho and other
utilities, and I had to export
SOCKS_SERVER=mysocksserver.com
Then I could use these utilities to go outside the firewall.
# firewall port blocking
http://coombs.anu.edu.au/~avalon/
You can generate a rule using genflt, I dumped the smitty output:
/usr/sbin/genfilt -v 4 -a 'D' -s 'all' -m 'all' -g 'y' -c 'tcp' -o 'eq' -p '1234
' -O 'any' -P '0' -r 'B' -w 'O' -l 'N' -t '0'
Once you have your filters defined you then need to start the tcp filters up, us
e
smitty ips4_start_stop
####################################
# einstellungen zum passwort checken
####################################
Mit dem Kommando pwdadm username kann man das Passwort aendern!
# pwdadm -q kutz
kutz:
lastupdate = 902242010
##########################
# letzte login eines users
##########################
# set - $(lsuser -a time_last_login kutz); echo ${2##time_last_login=}
1008012807
###################################
# aenderungen an resolv.conf machen
###################################
namerslv -C "Domaenen Such-Liste"
namerslv -E # umbenennen
namerslv -e # Ruecknahme umbenennen
namerslv -a -i {IP-Adresse} -D {Domain} -S {Search List} # Nameserver eintragen
namerslv -a -i 172.31.64.227
namerslv -a -i 172.31.64.228 -S "search.domain1.de searchpath.domain2.de"
Timeouts DNS-Server
<snip>
I think you are on the right track by changing the variable RES_TIMEOUT to a
lower value, but you should also try and change RES_RETRY variable which
overrides the default value for the retry, which is 4. This value is the
number of times the resolver tries to query the name servers before giving
up.
Hence for default values of RES_TIMEOUT=5 sec
and RES_RETRY=4 sec and for each retry
the inital RES_TIMEOUT is multiplied by 2
RES_TIMEOUT=5
RES_RETRY=4
=> 5 + 10 + 20 + 40 = 75 seconds
RES_TIMEOUT=2
RES_RETRY=4
=> 2 + 4 + 8 + 16 = 30 seconds
RES_TIMEOUT=5
RES_RETRY=2
=> 5 + 10 = 15 seconds
RES_TIMEOUT=3
RES_RETRY=2
=> 3 + 6 = 9 seconds
So, change also the RES_RETRY value. Afterwards it should work.
<snip>
#########################
# status ethernet-adapter
#########################
entstat -d ent0
##################
# check linkstatus
##################
netstat -v |grep RJ45
##################
# check collisions
##################
root@cws [/tmp]#netstat -I en0
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
en0 1500 link#2 2.60.8c.2f.c3.ec 3403525 0 3655451 0 0
en0 1500 192.168.0 cws 3403525 0 3655451 0 0
#############################
# batch jobs ueber printqueue
#############################
A backend is just an ordinary program or shell script. Here an example
of a shell queue. It will execute the submitted scripts sequentially.
----- /etc/qconfig ----
bsh:
discipline = fcfs
device = bshdev
bshdev:
backend = /usr/bin/ksh
-------------------------
To run a shell procedure called myproc using this batch queue, enter:
$ qprt -Pbsh myproc
#############################################
# removing all but 3 characters from a string
#############################################
Using Bourne shell, how can I take a string of variable length and remove all bu
t the last 3 characters.
Try this (in Korn):
len1=${#X} # Length of X
((len2=len1-3)) # minus 3
typeset -L$len2 CPL # Fixing length of $CPL to len2 left truncated
CPL=$X
Beware: -L$len2 WITHOUT space....
#########
# iptrace
#########
iptrace -i en1 -s some.address.com -b /tmp/ftp.out
iptrace: 0827-877 setsockopt -: There is not enough buffer space for the
requested socket operation.
Solution:
no -o sb_max=1310720
###################
# lvcb ueberpruefen
###################
getlvcb -AT <lvname>
######################
# console ueberpruefen
######################
# lscons
/dev/lft0
To change the system console to a file called console.out in the /tmp directory,
enter:
chcons /tmp/console.out
To change the system console to a terminal with the tty3 logical name, enter:
chcons /dev/tty3
To change the console to the default physical LFT display, enter:
chcons /dev/lft0
#########################
# enable login on console
#########################
chcons -a login=enable
############################################
# How do I increase the number of ptys > 64?
############################################
From: [email protected] (Mickey Coggins)
SMIT only allows 64. Try this:
odmget -q"attribute=num and uniquetype=pty/pty/pty" PdAt |
sed "s/0-64/0-512/" |
odmchange -q"attribute=num and uniquetype=pty/pty/pty" -o PdAt
chdev -l pty0 -anum=256 -P
reboot
#############################################
# I lost the root password, what should I do?
#############################################
From: [email protected] (Donald E. Ramm)
Boot from boot diskettes, bootable tape, or bootable CD.
At the Installation/Maint menu select item 4, "Start a limited function
maintenance shell.
At the subsequent "#" prompt enter the command:
getrootfs hdiskN
(where "N" is replaced by the number of a disk on your system
that is in rootvg.)
That will run for about a minute or so and you get a # prompt back. At this
point you are logged in as root in single user mode.
Change to /etc/security and edit the passwd file. Delete the three lines
under root: password, update time (or whatever it's called), and
flags. Save the file.
Then at the prompt, give root a new password.
Shutdown/reboot in normal mode. Log in with new password.
#######################################
# accessing a system that will not boot
#######################################
http://www.rs6000.ibm.com/doc_link/en_US/a_doc_lib/aixins/aixinsgd/system_will_n
ot_boot.htm#PJkRg222skil
#################################
# How do I recover deleted files?
#################################
Preferably from a backup. If you don't have a backup, at least one
company, Compunix, claims to have a product that will recover deleted
files. More information is available at <http://www.compunix.com/>.
From: [email protected]
[Editor's note: this one appears to be for the really desperate ones,
but it might be helpful if you really need it the most.]
RECOVERING REMOVED FILES AND DIRECTORIES IN A FILESYSTEM
If a file is Deleted from the system, the filesytem blocks composing
that file still exist, but are no longer allocated. As long as no new
files are created or existing files extended within the same filesystem,
the blocks will remain untouched. It is possible to reallocate the
blocks to the previous file using the "fsdb" command (filesystem debugger).
MAKE A BACKUP OF THE ENTIRE FILESYSTEM BEFORE PERFORMING THESE STEPS!!!
ELSE ( BANG !!!!! ).
It is possible to send a mail for have some informations ...
[email protected]
Steps to recover a deleted file
-------------------------------
1) "ls -id {dir}"
(where dir is directory where file resided)
Record INODE number for next step.
2) Unmount the filesystem.
3) "fsdb /{Mountpoint}" or "fsdb /dev/{LVname}"
(where Mountpoint is the filesystem mount point, and LVname is
the logical volume name of the filesystem)
4) "{INODE}i"
(where INODE is the inode number recorded in step 1)
This will display the inode information for the directory. The
field a0 contains the block number of the directory.
The following steps assume only field a0 is used. If a value
appears in a1, etc, it may be necessary to repeat steps #5 and
#6 for each block until the file to be recovered is found.
5) "a0b"
(moves to block pointed to by field "a0" of this inode)
6) "p128c"
(prints 128 bytes of directory in character format)
Look for missing filename. If not seen, repeat this step until
filename is found. Record address where filename begins. Also
record address where PRIOR filename begins. If filename does
not appear, return to step #5, and selecting a1b, a2b, etc.
Note that the address of the first field is shown to the far left.
Increment the address by one for each position to the right,
counting in octal.
7) "a0b"
(moves to block pointed to by field "a0" of this inode)
If the filename was found in block 1, use a1b instead, etc.
8) "p128e"
(prints first 128 bytes in decimal word format)
Find the address of the file to recover (as recorded in step 6)
in the far left column. If address is not shown, repeat until found.
9) Record the address of the file which appeared immediately PRIOR to
the file you want to recover.
10) Find the ADDRESS of the record LENGTH field for the file in step
#9 assuming the following format:
{ADDRESS}: x x x x x x x x x x ...
| | | | |-------- filename ------|
inode # --+----+ | |
| +-- filename length
record LENGTH --+
Note that the inode number may begin at any position on the line.
Note also that each number represents two bytes, so the address
of the LENGTH field will be `{ADDRESS} + (#hops * 2) + 1'
11) Starting with the first word of the inode number, count in OCTAL
until you reach the inode number of the file to be restored,
assuming each word is 2 bytes.
12) "0{ADDRESS}B={BYTES}"
(where ADDRESS is the address of the record LENGTH field found
in step #10, and BYTES is the number of bytes [octal] counted
in step #11)
13) If the value found in the LENGTH field in step #10 is greater than
255, also type the following:
"0{ADDRESS-1}B=0"
(where ADDRESS-1 is one less than the ADDRESS recorded in step #10)
This is necessary to clear out the first byte of the word.
14) "q"
(quit fsdb)
15) "fsck {Mountpoint}" or "fsck /dev/{LVname}"
This command will return errors for each recovered file asking if
you wish to REMOVE the file. Answer "n" to all questions.
For each file that is listed, record the associated INODE number.
16) "fsdb /{Mountpoint}" or "fsdb /dev/{LVname}"
17) {BLOCK}i.ln=1
(where BLOCK is the block number recoded in step #15)
This will change the link count for the inode associated with
the recovered file. Repeat this step for each file listed in
step #15.
18) "q"
(quit fsdb)
19) "fsck {Mountpoint}" or "fsck /dev/{LVname}"
The REMOVE prompts should no longer appear. Answer "y" to
all questions pertaining to fixing the block map, inode map,
and/or superblock.
20) If the desired directory or file returns, send money to the author
of this document.
#############################################
#How do I control how hostnames are resolved?
#############################################
From: <[email protected]> Frank Kraemer
Information from AIX 4.1.2 Infoexplorer:
The default order can be overwritten by creating the configuration file,
/etc/netsvc.conf and specifying the desired order. Both the default and
/etc/netsvc.conf can be overwritten with the environment variable,
NSORDER. If either the /etc/netsvc.conf file or environment variable,
NSORDER are defined, then at least one value must be specified along with
the option.
examples:
echo hosts = local,nis,bind >/etc/netsvc.conf
NSORDER=local,bind; export NSORDER
[Editor's notice: As of AIX 4.3 you also have bind4 & bind8 (for IPv4 & IPv6)]
###################
# changing hostname
###################
NAME=
chdev -l inet0 -a hostname=$NAME
/usr/sbin/hostid '$NAME'
hostname $NAME
uname -S $NAME
#################################################################
# How to get your keyboard back after unplugging it from the 6000
#################################################################
From: Mickey Coggins and Anne Serre and L. Mark Larsen
When you unplug your keyboard from a running system, and plug it back
in, the key mapping is wrong. For example, keys like Caps Lock and Ctrl
don't work as designed.
Solution: Type at the command line
/usr/lpp/diagnostics/da/dkbd
Your screen goes black, you hear a few beeps, and your keyboard is reset.
It works with any environment, Xwindows, hft, NLS...
For Models 220, 230 and M20, use the following commands:
/usr/lpp/diagnostics/da/dkbd
/usr/lpp/diagnostics/da/dkbdsal (for the 220)
After running the keyboard diagnostics to reset keyboard mappings, the
repeat rate is also reset to some slow value (11, according to the man
page). If the user is in X, you need to open an hft window. Do this
with "xopen /bin/csh". Once you have an hft window, run "chhwkbd -r30".
[Editor's note: By unplugging & plugging a keyboard/mouse on a live
system you may/will damage/zap/fry/destroy the motherboard]
###################################################
# How can I get the mouse back after unplugging it?
###################################################
/usr/lpp/diagnostics/da/dmousea
[Editor's note: By unplugging & plugging a keyboard/mouse on a live
system you may/will damage/zap/fry/destroy the motherboard]
###############
# Some acronyms
###############
APAR - Authorized Program Analysis Report
Created internaly by a systems programmer to solve a code bug.
BOS - Base Operating System
DCR - design change request
Someone asked to change something.
LPP - Licensed Program Product
ODM - Object Data Manager
Don't touch until you grok it.
PRPQ - programming request for price quotation
Essentialy, a program that is not available off-the-shelf.
(e.g. HACMP started as a PRPQ, you could not order HACMP, but
you could ask IBM for a highly-available solution)
PTF - Program Temporary Fix
SMIT - System Management Interface Tool
SMITTY - SMIT, tty interface, no bells, no whistles. "alias smit=smitty"
######################################
# Maximum File/Filesystem Sizes in AIX
######################################
23-Jan-04
AIX 4.3 AIX 5.1 AIX 5.2
JFS JFS JFS JFS2 JFS JFS2
AIX Kernel 32/64 32/64 32 Bit 64 Bit 32/64 32 Bit 64 Bit
Maximum Supported
File Size 64 GB 64 GB 1 TB 1 TB 64 GB 1 TB 16 TB
Filesystem Size 1 TB 1 TB 1 TB 1 TB 1 TB 1 TB 16 TB
#######################################
# Make and Back Up a Snapshot of a JFS2
#######################################
Beginning with AIX 5.2, you can make a snapshot of a mounted JFS2 that establish
es a consistent block-level image of the file system at a point in time. The sna
pshot image remains stable even as the file system that was used to create the s
napshot, called the snappedFS, continues to change. The snapshot retains the sam
e security permissions as the snappedFS had when the snapshot was made.
In the following scenario, you create a snapshot and back up the snapshot to rem
ovable media without unmounting or quiescing the file system, all with one comma
nd: backsnap. You can also use the snapshot for other purposes, such as accessin
g the files or directories as they existed when the snapshot was taken. You can
do the various snapshot procedures using Web-based System Manager, SMIT, or the
backsnap and snapshot commands.
To create a snapshot of the /home/abc/test file system and back it up (by name)
to the tape device /dev/rmt0, use the following command:
/usr/sbin/backsnap -m /tmp/snapshot -s size=16M -i f/dev/rmt0 /home/abc/test
This command creates a logical volume of 16 megabytes for the snapshot of the JF
S2 file system (/home/abc/test). The snapshot is mounted on /tmp/snapshot and th
en a backup by name of the snapshot is made to the tape device. After the backup
completes, the snapshot remains mounted. Use the -R flag with the backsnap comm
and if you want the snapshot removed when the backup completes.
1 To create a snapshot for the /home/janet/sb file system and perform a backu
p on the snapshot by name, enter:
/usr/sbin/backsnap -m /tmp/snapshot/janetsb -s size=16M -i -f/dev/rmt0 /hom
e/janet/sb
This command creates a logical volume of size 16 megabytes and then creates
a snapshot for the /home/janet/sb file system on the newly created logical volu
me. It then mounts the snapshot on /tmp/snapshot/janetsb and backs up the files
and directories in that file system by name to the /dev/rmt0 device.
2 To create a snapshot for the /home/janet/sb file system and perform a backu
p on the snapshot by inode, enter:
/usr/sbin/backsnap -R -m /tmp/snapshot/janetsb -s size=16M -0 -f /dev/rmt0
/home/janet/sb
This command creates a logical volume of size 16 megabytes and then creates
a snapshot for the /home/janet/sb file system on the newly created logical volu
me. It then mounts the snapshot on /tmp/snapshot/janetsb and backs up the data i
n the snapshot by inode to the /dev/rmt0 device. After the backup completes, the
snapshot is deleted.
#####################
# defrag a filesystem
#####################
1. To defragment the /data1 file system located on the /dev/lv00 logical
volume, enter:
defragfs /data1
-q Reports the current state of the file system.
-r Reports the current state of the file system and the state that would result
if the defragfs command is run without either -q or -r flag.
##########
# jfs/jfs2
##########
Function JFS Enhanced JFS
Optimization 32-bit kernel 64-bit kernel
Maximum file system size 1 terabyte 4 petabytes1
Maximum file size 64 gigabytes 4 petabytes1
Number of I-nodes Fixed at file system creation Dynamic, limited
by disk space
Large file support As mount option Default
Online defragmentation Yes Yes
namefs Yes Yes
DMAPI Yes No
Compression Yes No
Quotas Yes No
Deferred update Yes No
Direct I/O support Yes Yes
######################
# mount option dio/cio
######################
direct IO oder Concurrent IO bei jfs2 ab AIX 5.2 ML02
mount -o cio /filesystem
mount -o dio /filesystem
oder permanent
chfs -a options=cio /your/filesystem
chfs -a options=dio /your/filesystem
zuruecksetzen mit:
chfs -a options= /your/filesystem
# folgende parameter muessen in Oracle dafuer eingerichtet sein:
lock_sga=true
filesystemio_options=setall or directIO
# Concurrent I/O should only be used for Oracle .dbf files (data & index, rbs or
undo, system and temp) online redo logs and/or control files. When used for onl
ine redo logs or control files, these files should be isolated in their own JFS2
filesystem(s) that have been created with agblksize=512. Filesystem containing
.dbf files should be created with agblksize=2048 if DB_BLOCK_SIZE=2k, or agblksi
ze=4096 if DB_BLOCK_SIZE>= 4k. Failure to implement these agblksize guidelines i
s likely to result in a severe performance penalty.
# Do not under any circumstances, use CIO mount option for the filesystem contai
ning the Oracle binaries (!!!). Additionally, do not use DIO/CIO options for fil
esystem containing archive logs or any other files not already discussed.
####################################
# defragmentiere alle gemounteten fs
####################################
for i in `df|grep -v Mounted |awk '{print $7}'`
do
defragfs $i
done
####################
# defrag pagingspace
####################
Paging space hd6 on volume group rootvg is fragmented
reorgvg rootvg hd6
######################
# creating large files
######################
1. Create a 1GB file:
/usr/sbin/lmktemp filename1 10737418424
2. Create a second 1GB file:
cp filename1 filename2
3. To create a 2GB file, append the first file to the second file:
cat filename1 >> filename2
4. To create a 3GB file, append the first file to the second file again:
cat filename1 >> filename2
####################
# find growing files
####################
find . -type f -xdev -ls | awk '{print $7" "$8" " $9" "$10" "$11}' | sort -rn |m
ore
##############
# enable quota
##############
lslpp -l |grep bos.sysmgt.quota
umount /home
chfs -a "quota = userquota,groupquota" /home
mount /home
edquota -u user_who_gets_quota
quotaon -u /home
quotacheck /home
###########################
# managing hang print queue
###########################
- one device has "dev/wait"
lpstat
- stop spooler
stopsrc -c -s qdaemon
- spooler down?
lssrc -s qdaemon
- checken der queue
lpstat
oder
lpstat -W (detailed)
oder
enq -sA
- in spool-verzeichnis schauen
cd /var/spool/lpd/stat
ls -al p*
cat /var/spool/lpd/stat/p.lpforu.lp0
- in prozesstabelle nach prozess schauen
ps -ef|grep `cat /var/spool/lpd/stat/p `
- killen
- start spooler
startsrc -s qdaemon
#################
# cancel printjob
#################
qcan -Plpforu -xJOBnummer
oder
cancel JOBnummer
##############################
# default systemdrucker setzen
##############################
smitty qdefault
oder
/usr/lib/lpd/pio/etc/piochdfq -q 'xyz'
oder
export LPDEST=xyz
###########################
# change ascii pass through
###########################
/usr/lib/lpd/pio/etc/piochpq -q 'DRUCKERNAME' -d 'HOSTNAME' -d 'a'
oder
/usr/lib/lpd/pio/etc/piochpq -q 'DRUCKERNAME' -d 'HOSTNAME' -d 'p'
##########################################
# Migrating Print Queues to Another System
##########################################
1. copy the /etc/qconfig (make a copy of the original before)
2. Copy the following files:
/var/spool/lpd/pio/@local/custom/*
/var/spool/lpd/pio/@local/dev/*
/var/spool/lpd/pio/@local/ddi/*
3. change the permissions on the copied files to 664
chmod 664 filename
4. redigest the queue's
enq -d
5. run the chvirprt command on each queue
chvirprt -q <queue name> -d <device name>
Note: If you have a lot of queues, the best thing is to create a short scri
pt to do this for you.
I grab the queue name and device name by running lsallq -c and saving it to
a file.
6. cycle the printer subsystem
stopsrc -cg spooler
startsrc -g spooler
##########################
# create new printer queue
##########################
/usr/lib/lpd/pio/etc/piomkjetd mkpq_jetdirect -p 'generic' -D asc -q print38 -
h '53.239.67.32' -x 9100
Make sure you edit /etc/host and enter queue name and ipaddress
Print38 53.239.67.32
Then issue stopsrc -s qdaemon ; startsrc -s qdaemon
################################################
# setting up remote printing form solaris to aix
################################################
I have set up a remote print que on our AIX server2 wich uses AIX server1's loca
l que successfully.
servers1,s qconfig entry is
>lp4:
> device = lp0
>lp0:
> file = /dev/lp0
> header = never
> trailer = never
> access = both
> backend = /usr/lib/lpd/piobe
I have set up another remote que on the sun solaris 5.5.1 machine to use AIX ser
ver1,s local que.
using 'lpadmin -p rempri -s server1!lp4 -T unknown -I any'
this looks OK until I try 'lpstat -p', it gives me 'printer rempri faulted.
enabled since Mon..... . available.
system not responding.'
You left out three commands. Here is the full procedure:
lpsystem -t bsd server1
lpadmin -p rempri -s server1\!lp4 -T unknown -I any
enable rempri
accept rempri
The lpsystem, enable, and accept commands are needed on Solaris 2.5.1
(SunOS 5.5.1) and previous, unless you have the SunSoft Print Client
(SSPC) package installed. Solaris 2.6 and later, or machines with SSPC,
only need the lpadmin command.
################################################
# moving print queues from one to another system
################################################
This is how you do it in AIX :
Migrating Print Queues to Another System
1. copy the /etc/qconfig (make a copy of the original before)
2. Copy the following files:
/var/spool/lpd/pio/@local/custom/*
/var/spool/lpd/pio/@local/dev/*
/var/spool/lpd/pio/@local/ddi/*
3. change the permissions on the copied files to 664
chmod 664 filename
4. redigest the queue's
enq -d
5. run the chvirprt command on each queue
chvirprt -q <queue name> -d <device name>
Note: If you have a lot of queues, the best thing is to
create a short script to do this for you.
I grab the queue name and device name by running lsallq -c
and saving it to a file.
6. cycle the printer subsystem
stopsrc -cg spooler
startsrc -g spooler
###################
# print queue start
###################
smitty qstart
oder
qadm -U QueueName
##################
# print queue stop
##################
smitty qstop
oder
qadm -D QueueName
#########################
# set default print queue
#########################
smitty qdefault
oder
/usr/lib/lpd/pio/etc/piochdfq -q
##########################
# hold a job or printqueue
##########################
smitty qhld
oder
qlhd -# JOBNUMMER
qhld -P QUEUENAME
qhld -u USERNAME
####################
# release a printjob
####################
qlhd -r -# JOBNUMMER
qhld -r -P QUEUENAME
qhld -r -u USERNAME
##############################
# move printjob between queues
##############################
smit qmov
oder
qmov -m DestinationQueue -# JobNumber
qmov -m DestinationQueue -P Queue
qmov -m DestinationQueue -u User
############################
# list all supported printer
############################
lsdev -P -c printer -F "type subclass description" | sort -u
###########################
# list all defined printers
###########################
lsdev -C -c printer | sort -u
#########################
# check queue qchk lpstat
#########################
# qchk -A
Queue Dev Status Job Files User PP % Blks Cp Rnk
------- ----- --------- --- ------------------ ---------- ---- -- ----- --- ---
pcl7872 hp@hp READY
QUEUED 1 STDIN.20880 root 7 1 1
ps78720 hp@hp READY
##############
# qprt options
##############
-q quality
0 Fast font
1 Draft quality
2 Near letter quality
3 Enhanced quality
300 300 dots per inch (dpi)
600 600 dpi
-#{j|h|v} Specifies a special functionality. The possible values for the Value
variable are:
j
Displays a job number for the specified print job.
H
Queues the print job but holds it in a HELD state.
v
Validates the specified printer backend flag values. As part of the validation
process, the command performs legality checking for illegal flag values, type
checking, range checking, list checking, and other types of validation.
Typically, the validation of backend flag values is useful because illegal
flags are identified when the print job is submitted rather than at a later
stage when the print job is processed.
-d input data
a Extended ASCII
c PCL
d Diablo 630
g Hewlett-Packard GL
p Pass-through (sent to printer unmodified)
s PostScript
-j Init Initializes the printer before each file is printed. You can specify any
of the following:
0 No initialization
1 Full initialization
2 Emulator selection only
-O PaperHand Sets the type of input paper handling to one of the following:
1 Manual (insert one sheet at a time)
2 Continuous forms
3 Sheet feed
-Y Duplex Sets duplexed output. Duplexed output uses both the front and back of
each sheet of paper for printing. You can set one of the following:
0 Simplex
1 Duplex, long edge binding
2 Duplex, short edge binding
#####################
# No login name found
#####################
Found this on the IBM Website after doing a search on "no login name found"
[1]http://www-1.ibm.com/support/docview.wss?uid=aix1d689ba01c7447fc285256cdb007d
f019
0781-111
* No login name found
* This problem often occurs during the process of trying to cancel
jobs to remote system, especially with Windows/NT servers when
using AIXSHORT for stat filter. Be sure to use bsdshort and
bsdlong.
* Clear unwanted files out of /var/spool/lpd/qdir. These frequently
give this problem.
* Remove /etc/qconfig.bin, and rerun lpstat.
#####
# ntp
#####
/etc/ntp.conf
server 172.28.2.8 --> btr008
ntpdate 172.28.2.8 --> sychronisiert die Zeit
setclock 172.28.2.8 --> tut dasselbe
ntpq -p --> zeigt infos an
# ntpq -p
remote refid st t when poll reach delay offset disp
==============================================================================
*colonia.sp.medi LOCAL(2) 4 u 41 64 377 1.19 0.326 0.03
################
# 32 oder 64 bit
################
To find out if server is running 32 or 64 bit enter;
# bootinfo -K
32
find out machine supports 64-bit enter
bootinfo -y
The 64-bit support is in bos.64bit. lslpp -L bos.64bit.
or check for the presence of the line "load64bit" in your inittab.
load64bit:2:once:/etc/methods/cfg64 >/dev/console 2>&1 # Enable 64-bit execs
To truly change the kernel to 64-bit, you need to be at the 5.1 oslevel. The mea
ns to change to a 64-bit kernel are:
From 32-bit to 64-bit:
ln -sf /usr/lib/boot/unix_64 /unix
ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix
lslv -m hd5
bosboot -ad /dev/hdisk0
bosboot -ad /dev/hdisk1
shutdown -Fr
bosboot -ad /dev/ipldevice # als alternative
To change the kernel back to 32-bit:
From 64-bit to 32-bit:
Monoprozessor:
ln -sf /usr/lib/boot/unix_up /unix
ln -sf /usr/lib/boot/unix_up /usr/lib/boot/unix
lslv -m hd5
bosboot -ad /dev/ipldevice
shutdown -Fr
Multiprozessor:
ln -sf /usr/lib/boot/unix_mp /unix
ln -sf /usr/lib/boot/unix_mp /usr/lib/boot/unix
lslv -m hd5
bosboot -ad /dev/ipldevice
shutdown -Fr
###################
# ipldevice corrupt
###################
0514-508 Cannot save the base customized information on /dev/ipldevice
ipldevice neu anlegen
bosboot -ad /dev/hdiskx
savebase -v
cd /dev
rm ipldevice
ln /dev/rhdiskx /dev/ipldevice
##################################
# groesse einer Platte feststellen
##################################
bootinfo -s hdisk0
####################
# anzahl prozessoren
####################
bootinfo -z
aixinstall0:/export/conf#bootinfo -z
0
Running this command returns one of the following: 0 = up (single processor) or
1 = mp (multiprocessor).
####################
# determing platform
####################
aixinstall0:/export/conf#bootinfo -T
rspc
#########################
# determing boot platform
#########################
aixinstall0:/export/conf#bootinfo -p
rspc
or
lscfg -vp |grep Arch
#################
# last bootdevice
#################
root@cws [~]# bootinfo -b
hdisk0
########################
# change / show bootlist
########################
to modify the bootlist where x is either 0 or 1, then reboot. Type:
change the bootlist
bootlist -m normal hdiskx cd0 rmt0
netboot
bootlist -m normal ent0 hdisk0
list the bootlist
bootlist -m normal -o
oder
# ipl_varyon -i
PVNAME BOOT DEVICE PVID VOLUME GROUP ID
hdisk0 YES 0045cfaa54ca198e 0045cfaabb9ec85b
hdisk1 NO 0045cfaa70510c0a 0045cfaabb9ec85b
#####################################
# check from which disk last boot was
#####################################
# bootinfo -b
####################
# bootblock loeschen
####################
mkboot -c -d /dev/hdisk0 -->to clear the boot image off a defective disk
##########################
# bosboot bootlv erstellen
##########################
1. To create a boot image on the default boot logical volume on the fixed disk
from which the system is booted, enter:
bosboot -a
2. To create a bootable image called /tmp/tape.bootimage for a tape device,
enter:
bosboot -ad /dev/rmt0 -b /tmp/tape.bootimage
3. To copy a given tape boot image to a tape device, enter:
bosboot -w /tmp/tape.bootimage -d rmt0
4. To create a boot image file for an Ethernet boot, enter:
bosboot -ad /dev/ent0 -M both
5. To create an uncompressed boot image for a hard disk /dev/hdisk1, enter:
bosboot -ad /dev/hdisk1 -U
6. To create a token ring boot image for a machine whose hardware platform
type is rspc while you are running on a machine whose hardware platform
type is rs6k, enter:
bosboot -ad /dev/tok -T rspc
#################
# shutdown system
#################
maintenance
shutdown -m
reboot
shutdown -Fr
######################
# remote reboot string
######################
# find out which tty is used for console
# grep cons /etc/inittab
# lscons -a
# odmget -q 'attribute=reboot_string AND name=tty0' CuAt
# chdev -l 'tty0' -a reboot_enable='reboot' -a reboot_string='#@pw@#' -P
aktivieren ueber Eingabe des Strings an der Console
If you set the REMOTE reboot enable parameter to reboot or dump, once the
chosen character sequence is typed on the terminal attached to the TTY device,
the character sequence will be erased and a prompt (>) will be presented. You
have the following two options at this prompt:
- Press 1 on the keyboard
Instructs the AIX kernel to perform a defined action (reboot or dump).
- Press any other key
The typed remote reboot string reappears on the screen as if you just typed it
now. Therefore, nothing will happen, and the current session on this terminal
will continue to be available.
##################
# times for a file
##################
"ls -l" shows atime
"ls -lc" shows ctime
"ls -lm" shows mtime
"istat filename" will show all three.
$ istat bb18b3.tar.gz
Inode 20 on device 10/9 File
Protection: rw-r--r--
Owner: 100(bb) Group: 100(bb)
Link count: 1 Length 427247 bytes
Last updated: Tue Aug 14 11:01:46 2001
Last modified: Thu Jun 21 07:36:32 2001
Last accessed: Thu Nov 01 20:38:46 2001
###########################
# datei auf welcher platte?
###########################
fileplace -p foo.dbf
when you have the information about the filename or his inode I think
you can determine the pv and the file-location with the following command:
fileplace -piv <path/filename>
########
# ncheck
########
List i-Nodes in Dirs
ncheck -a /VZ
List Filenames from Inodes
ncheck -i INODENR INODENR /VZ
List special and SUID Files
ncheck -s /VZ
############################################
# ssh benutzt priviligierten port unter 1024
############################################
Initial connection via port 22 is established ok. Looking at
iptrace output and netstat output I notice that the local port
allocation appears to be above the 1024 boundary. i.e. port 2151
is being assigned. Is there a flag on AIX or SSH that I can use to
force the allocation of ports below 1024 for ssh tasks?.
I think you might be looking for ssh -P, or in the config file:
man ssh ==>
UsePrivilegedPort
Specifies whether to use a privileged port for outgoing connec-
tions. The argument must be ``yes'' or ``no''. The default is
``yes''. Note that setting this option to ``no'' turns off
RhostsAuthentication and RhostsRSAAuthentication.
#################
# sendmail-config
#################
In /etc/sendmail.cf
Fuer DMZ
Dm<Domaene> --> Dmrzag.net
Cw localhost $?$m$.
Dj$m
DSmail.?.de --> DSmail.rzag.net
DM<Domaene> --> DMrzag.net
Fuer intern
Dm<Domaene> --> Dmrzag.net
Cw localhost $?$m$.
Dj$m
DSmail.?.de --> DSmail.intern.rzag.net
DM<Domaene> --> DMrzag.net
refresh -s sendmail
#########################
# sendmail which version?
#########################
According to O'Reilly, this is the command to find the version:
# /usr/lib/sendmail -d0.1 -bt < /dev/null
Version AIX 4.1/UCB 5.64.
Address Test Mode:
Enter <ruleset> <address>
#########################
# start sendmail over SRC
#########################
stopsrc -s sendmail
startsrc -s sendmail -a "-bd -q30m"
#########################
# start sendmail sendonly
#########################
stopsrc -s sendmail
startsrc -s sendmail (ohne Parameter)
#######################
# sendmail queue leeren
#######################
sendmail -q -v
###############################
# mail mit attachment versenden
###############################
cat /etc/motd |uuencode test|mail -s test2 recipient
will mail /etc/motd as a attachment called "test" to recipient with subject t
est2
################
# mailstatistics
################
# mailstats
Statistics from Tue Feb 7 02:15:25 MEZ 2006
M msgsfr bytes_from msgsto bytes_to msgsrej msgsdis Mailer
3 23 579K 0 0K 0 0 local
8 1 1K 24 582K 0 0 relay
=============================================================
T 24 580K 24 582K 0 0
C 24 24 0
########################
# sendmail config mit mc
########################
sendmail.mc
<snip>
#
# Restricted Materials of IBM
#
# (C) COPYRIGHT International Business Machines Corp. 1999,2003
# All Rights Reserved
#
# US Government Users Restricted Rights - Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#
# IBM_PROLOG_END_TAG
# Sample AIX file
#DOMAIN(`generic')dnl
divert(0)dnl
OSTYPE(`aixsample')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')
MASQUERADE_AS(`example.org')dnl
MASQUERADE_DOMAIN(`example.org')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(`masquerade_entire_domain')dnl
FEATURE(`no_default_msa')dnl
MAILER(local)dnl
MAILER(smtp)dnl
define(`SMART_HOST', `host.xyz.example.org')dnl
<snip>
cd /usr/samples/tcpip/sendmail/cf
/usr/bin/m4 ../m4/cf.m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
#####################
# rewrite mailaccount
#####################
to rewrite account [email protected] do:
- comment out the genericstable entry in sendmail.cf
- echo "account [email protected]" > /etc/mail/genericstable
- makemap hash /etc/mail/genericstable.db < /etc/mail/genericstable
- restart sendmail
############
# subsystems
############
$ lssrc -Ss sshd
#subsysname:synonym:cmdargs:path:uid:auditid:standin:standout:standerr:action:mu
lti:contact:svrkey:svrmtype:priority:signorm:sigforce:display:waittime:grpname:
sshd::-D:/usr/local/sbin/sshd:0:0:/dev/console:/dev/console:/dev/console:-R:-Q:-
S:0:0:20:15:9:-d:20:tcpip:
###########################
# aio-server running oracle
###########################
lsattr -El aio0
pstat -A | grep aioserver
ps aux | grep kproc
# pstat -a|grep aio|more
14 a e72 1 e72 0 0 1 aioserver
29 a 1d3c 1 1d3c 0 0 1 aioserver
30 a 1e44 1 1e44 0 0 1 aioserver
32 a 2048 1 2048 0 0 1 aioserver
33 a 214a 1 214a 0 0 1 aioserver
92 a 5cba 1 5cba 400 400 1 aioserver
121 a 791c 1 791c 400 400 1 aioserver
131 a 830c 1 830c 400 400 1 aioserver
132 a 8408 1 8408 400 400 1 aioserver
133 a 850a 1 850a 400 400 1 aioserver
134 a 860c 1 860c 400 400 1 aioserver
208 a d0ea 1 d0ea 400 400 1 aioserver
209 a d106 1 d106 400 400 1 aioserver
###################
# change aio server
###################
# default
chdev -l aio0 -P -a minservers=1 -a maxservers=10 -a maxreqs=4096
# oracle
chdev -l aio0 -P -a minservers=150 -a maxservers=750 -a maxreqs=16384
########################
# check idle aio servers
########################
ps -elfk > /tmp/ps.out.1
sleep 60
ps -elfk > /tmp/ps.out.2
echo "Idle AIO-Server:"
egrep aioser /tmp/ps.out.2 /tmp/ps.out.1 |sort -n +4 +13 +14|cut -f2-99 -d: |uni
q -c|awk '$1==2{print}'|wc -l
rm -f /tmp/ps.out.1
rm -f /tmp/ps.out.2
#################
# check ssa place
#################
If you want to check a pdisk or hdisk connected to which ssa adapater :
# ssaadap -l <pdisk? or hdisk?>
or
looking in /usr/ssa/ssaraid/ssaraid.README gives:
ssaraid -I -z -l ssa{n}
-z is summary and you get output like
pdisk1 0004AC509E8C00D member n/a 4.5GB Physical disk
pdisk17 0004AC50E80800D system n/a 2.3GB Physical disk
pdisk20 0004AC51B98200D system n/a 4.5GB Physical disk
pdisk2 0004AC51BB5C00D member n/a 4.5GB Physical disk
pdisk4 0004AC51D83F00D spare n/a 4.5GB Physical disk
pdisk5 0004AC7D540D00D member n/a 4.5GB Physical disk
pdisk6 0004AC7D74C000D member n/a 4.5GB Physical disk
pdisk21 0004AC7DBD9F00D system n/a 2.3GB Physical disk
pdisk23 0004AC9D4DB100D system n/a 2.3GB Physical disk
pdisk9 0006294FAD6900D member n/a 4.5GB Physical disk
pdisk3 00062992371600D member n/a 4.5GB Physical disk
pdisk0 000629D0BA2B00D member n/a 4.5GB Physical disk
hdisk11 239F3694BC71A4K good 27.1GB RAID-5 array
without the -z you obviously get much more detail. The examples
worked through in the above README are useful.
ssaraid -Il ssa0 -n hdisk2
name pdisk0
id 0004AC9DF01600D
class disk
use system
blocksize 512
size 4.5GB
state good
network_id A
fastwrite off
# ssaxlate -l pdisk28
hdisk30
################################
# ssa-platte zum blinken bringen
################################
um platte leichter zu identifizieren (LED leuchtet)
# bash
# ssaxlate -l hdisk2
pdisk0
# ssaidentify -l pdisk0 -y
Platte sollte jetzt blinken
# ssaidentify -l pdisk0 -n
Blinken sollte abgeschaltet sein
VG=oracle02VG
for i in `lsvg -p $VG|grep hdisk|awk '{print $1}'`
do
PDISK=`ssaxlate -l $i`
ssaidentify -l $PDISK -y
done
VG=oracle02VG
for i in `lsvg -p $VG|grep hdisk|awk '{print $1}'`
do
PDISK=`ssaxlate -l $i`
ssaidentify -l $PDISK -n
done
##########################
# pruefen auf welcher loop
##########################
ZAEHLER=1
PLATTEBIS=27
while true
do
HDISK=`ssaxlate -l pdisk${ZAEHLER}`
SIZE=`bootinfo -s $HDISK`
CONN=`ssaconn -l pdisk${ZAEHLER} -a ssa0`
echo "$CONN $HDISK $SIZE"
if [ $ZAEHLER = $PLATTEBIS ]
then
break
else
let ZAEHLER=$ZAEHLER+1
fi
done
pdisk18 ssa0 2 4 - - hdisk20 8689
pdisk19 ssa0 0 6 - - hdisk21 8689
pdisk20 ssa0 - - 2 4 hdisk22 8689
pdisk21 ssa0 - - 0 6 hdisk23 8689
pdisk22 ssa0 - - 1 5 hdisk4 8689
pdisk23 ssa0 - - 5 1 hdisk5 8689
pdisk25 ssa0 - - 3 3 hdisk27 8689
pdisk27 ssa0 - - 6 0 hdisk29 8689
Bedeutung:
pdisk19 und pdisk27 sind in unterschiedlichen Drawern, aber am selben Platz!
#######################
# microcode ssa-platten
#######################
# ssadload -s
pdisk0 294D2E1E 9191 DCHC
pdisk1 29CA0E99 9595 DCHC
pdisk2 29D1499C 0048 DGHC
pdisk3 29D302C6 9902 DGHC
pdisk4 294CB30F 8181 DCHC
pdisk5 29CA0E22 9595 DCHC
pdisk6 29D3081E 9902 DGHC
pdisk7 29D148C0 0048 DGHC
pdisk8 29D302BC 9902 DGHC
pdisk9 29D098F3 9902 DGHC
pdisk10 29D2608D 9902 DGHC
#######################
# microcode ssa-adapter
#######################
lscfg -v -l ssa0 | grep ROS
##################
# ssa-shared disks
##################
ssa_rescheck -l hdisk#
##########
# ssa raid
##########
States:
Good State
The array is online and it can be read and written. All the array components are
present. All parity data (except that affected by recently completed write
operations) is synchronized. No data or parity rebuilding is outstanding. The
array is fully protected against the loss of one component.
Exposed State
One component is missing from the array. When the array is read, data can be
reconstructed for the missing component. The first write operation causes the
array to enter the "Degraded" state, unless there is no hot spare available that
can be used to replace the missing component. In the "Exposed" state, the
missing component can be reintroduced or replaced. Then, after any necessary
rebuilding, the array is returned to the "Good" state.
Degraded State
One component is missing and a write operation has been received for the array.
Read and write operations to the array are supported. However, if power is lost
before all the parity data has been written, it might not be possible to
recreate all the data for the missing component. The missing component is
permanently excluded from the array.
Note :- While in Degraded state, an array is not protected. If another disk
drive in the array fails, or the power fails during a write operation, data
might be lost.
Rebuilding State
The array is online and it can be read and written. The full complement of array
components are present but data and parity are being rebuilt on one of the
components.
Offline State
An array enters Offline state when two or more member disk drives become
missing. Read and write operations are not allowed.
######################
# show status of array
######################
summary
ssaraid -Il ssa0 -z
detail
ssaraid -Il ssa0 -n arrayname
############################
# change from system to free
############################
change pdisk0 to array-candidate
SSARAID -H -l ssa0 -n pdisk0 -a use=free
##################
# ssa raid anlegen
##################
no hotspare
SSARAID -C -l ssa0 -t raid_5 -s pdisk0 pdisk1 pdisk2 pdisk3 -d -k hdisk1 -a
spare=false
hotspare
SSARAID -C -l ssa0 -t raid_5 -s pdisk0 pdisk1 pdisk2 pdisk3 -d -k hdisk1 -a
spare=true
##################
# disk replacement
##################
change pdisk0 to array-candidate
SSARAID -H -l ssa0 -n pdisk0 -a use=free
#################
# fastwrite cache
#################
check if possible
lscfg -v -l ssa0 | grep "(Z1)"
SSARAID -H -l ssa0 -n hdisk1 -a fastwrite=on
#####################################
# adding extra disks to an raid array
#####################################
* Backup the filesystems on the RAID array to tape or other media.
* Umount the filesystems on the RAID array.
* Remove the filesystems and logical volumes on the RAID array.
* Varyoff the volume group that is on the RAID array
* Export the volume group that is on the RAID array.
* Delete the RAID array
* Create a new RAID array including any new additional disks
* Re-create the volume group on the hdisk associated with the new RAID array.
* Re-create the logical volume and filesystems on the new RAID array.
* Mount the filesystems on the RAID array.
* Restore the backup from the tape or other media
#################
# ssa raid delete
#################
SSARAID -l ssa0 -d -l ssa0 -n hdisk1 -u
##############
# ftpd timeout
##############
You need to change the parameters in /etc/inetd.conf
ftp stream tcp6 nowait root /usr/sbin/ftpd ftpd -t 1200
-t TimeOut Logs out inactive sessions after the number of seconds specified
by the TimeOut variable. The default limit is 15 minutes (900 seconds).
-T MaxTimeOut Logs out inactive client sessions after a maximum number of
seconds specified by the MaxTimeOut variable. The default limit is 2 hours
(7200 seconds).
Once you make the change you will need to refresh inetd.
#################################
# Changing umask behaviour in ftp
#################################
In /etc/inetd.conf change the ftpd command to "ftpd -u OctVal" where
"OctVal" is the umask you want (default umask for ftpd is 027).
Refresh inetd so it recognizes the change: refresh -s inetd
#########################
# configure anonymous ftp
#########################
/usr/samples/tcpip/anon.ftp
node5:/> lslpp -w /usr/samples/tcpip/anon.ftp
File Fileset Type
----------------------------------------------------------------------------
/usr/samples/tcpip/anon.ftp bos.net.tcp.client File
#################
# interactive ftp
#################
echo "user username password" > ftp.txt
echo "cd /some/directory" >> ftp.txt
echo "put filename" >> ftp.txt
echo "bye" >> ftp.txt
ftp -nv xxx.xxx.xxx.xxx < ftp.txt > ftp.log
##############
# group limits
##############
I ran into this problem with NIS a long time ago. I believe it's limited to
255 or 255 characters per line after that just make a new line in your group
file something like this:
group1:123:user1,user2,user3
group1:123:user255,user256,user257
You can continue this forever as far as I know without any problems. We ran
like this for years and never had any problems with doing this.
OR:
group file has a line length limit, this can be got round by
hand defining multiple groups with the same id
staff:!:1:fred,jim,john,....
staff1:!:barny,david,ann,jane,....
########################################
# carriage return aus DOS-Datei loeschen
########################################
tr -d '\r"
#########
# filemon
#########
1. To monitor the physical I/O activity of the virtual memory, logical volume,
and physical volume levels of the file system, enter:
filemon
The filemon command automatically starts the system trace and puts itself
in the background. After this command, enter the application programs and
system commands to be run at this time, then enter:
trcstop
After the trcstop command is issued, the I/O activity report is displayed
on standard output (but will probably scroll off the screen). The virtual
memory I/O report will be limited to the 20 segments that incurred the most
I/O.
2. To monitor the activity at all file system levels, and write the report to
the fmon.out file, enter:
filemon -o fmon.out -O all
# check complete system
filemon -v -o /tmp/fmon_all.out -O all
trcstop
# check only pv,lv
filemon -d -o /tmp/fmon_pv_lv.out -O pv,lv
trcoff
trcon
trcstop
# monitor 90 seconds
sudo filemon -o /tmp/filemon.out -O lv,pv -T 5000000;sleep 90;sudo trcstop
##########################
# filemon.pl im scripte VZ
##########################
filemon -T 320000 -o /tmp/filemon.out; sleep 20; trcstop
/usr/local/bin/filemon.pl /tmp/filemon.out
#########
# telnetd
#########
Q:What does the -a switch do in telnetd -a?
It's the kerberised version of telnetd:
-a authmode This option may be used for specifying what mode
should be used for authentication.
######################
# large memory support
######################
ORACLE_HOME=/opt/oracle/product/9.2.0
ORACLE_HOME=/opt/oracle/product/10.2.0
ORACLE_HOME=/opt/oracle/product/11.1.0
ORACLE_HOME=/opt/oracle/product/11.2.0
lgpg_regions*lgpg_size=Memory_Configured_for_LP_Support
Vorarbeiten:
1 GB Large memory =
vmo -r -o lgpg_regions=64 -o lgpg_size=16777216
vmo -o lgpg_regions=64 -o lgpg_size=16777216
2 GB Large memory =
vmo -r -o lgpg_regions=128 -o lgpg_size=16777216
vmo -o lgpg_regions=128 -o lgpg_size=16777216
4 GB Large memory =
vmo -r -o lgpg_regions=256 -o lgpg_size=16777216
vmo -o lgpg_regions=256 -o lgpg_size=16777216
8 GB Large memory =
vmo -r -o lgpg_regions=512 -o lgpg_size=16777216
vmo -o lgpg_regions=512 -o lgpg_size=16777216
16 GB Large memory =
vmo -r -o lgpg_regions=1024 -o lgpg_size=16777216
vmo -o lgpg_regions=1024 -o lgpg_size=16777216
32 GB Large memory =
vmo -r -o lgpg_regions=2048 -o lgpg_size=16777216
vmo -o lgpg_regions=2048 -o lgpg_size=16777216
64 GB Large memory =
vmo -r -o lgpg_regions=4096 -o lgpg_size=16777216
vmo -o lgpg_regions=4096 -o lgpg_size=16777216
To use large pages for shared memory, you must enable the SHM_PIN shmget() syste
m call with the following command, which persists across system reboots:
vmo -p -o v_pinshm=1
lsuser -a capabilities oracle
chuser capabilities=CAP_BYPASS_RAC_VMM,CAP_PROPAGATE oracle
lsuser -a capabilities oracle
vi init.ora
LOCK_SGA=true
# Edit the XCOFF file header in the oracle bin enable it to use large page data:
ldedit -b lpdata $ORACLE_HOME/bin/oracle
ldedit: File /opt/oracle/product/10.2.0/bin/oracle has been updated.
or
LDR_CNTRL=LARGE_PAGE_TEXT=Y@LARGE_PAGE_DATA=M
export LDR_CNTRL
BEFORE starting Instance and Listener
#############################
# check for largepages in use
#############################
vmstat -l
ps -Z
pagesize -af
#########
# backout
#########
vmo -r -o lgpg_regions=0 -o lgpg_size=0
lsuser -a capabilities oracle
chuser capabilities= oracle
lsuser -a capabilities oracle
ldedit -b nolpdata $ORACLE_HOME/bin/oracle
ldedit: File /opt/oracle/product/10.2.0/bin/oracle has been updated.
or
vi ~oracle/.profile
chmod 6751 $ORACLE_HOME/bin/oracle
bosboot -ad /dev/ipldevice
shutdown -Fr
vmstat -l 2 (look for alp, flp)
alp allocated Large Pages
flp free Large Pages
##############################
# ps memory und cpu auslastung
##############################
you can see all your processes with %MEM and %CPU for each one with
Usage Memory + CPU
ps ug|more
hierbei wird die RSS-spalte (Real Mem Usage of Process) der ersten 6 Prozesse
ausgewertet
ps auxwww|awk '{ sum +=$6} END { print "SUM = ", sum; }'
SUM = 195464
<snip>
RSS
(v flag) The real-memory (resident set) size of the process (in 1KB units).
<snip>
im obigen Beispiel wird 195464 KB also 195 MB genutzt!
oder
<snip>
svmon -G
size inuse free pin virtual
memory 65372 42740 22632 6329 17492
pg space 193536 391
work pers clnt
pin 6135 194 0
in use 23721 19019 0
<snip>
# memory Usage 1 User
svmon -U <USERNAME>
# memory usage per user
svmon -Uut 10|more
svmon -Put 10 # top 10 users of memory
svmon -Pgt 10 # top 10 users or paging space
1) svmon -Put 10 | more
The top line will provide you with all the info you need, and it will list your
top 10 (oracle) memory hogs
FYI...(Inuse / 256) = MB (approximate)
2) ps vg|head -1;ps vg | sort -r +5 | head
Sorts on the SIZE column, then you can use the PID to find the offender (oracle)
- notice there is no '-' in front of the vg...very important
3) ps aux|head -1;ps aux | sort -nr +3 | head
Lists the %MEM column - +2 lists %CPU. Again, no '-' in front of the aux.
####################
# ipcs shared memory
####################
# all info
# ipcs -a
# shared mem
# ipcs -m
# semaphores
# ipcs -s
# unbenutzte shared mem segmente loeschen
ipcs -m suche in spalte NATTCH nach 0, diese koennen mit ipcrm -m NUMMER entfer
nt werden
# unbenutzte semaphoren loeschen
for i in `ipcs -s |grep "00000000 -----------" |awk '{print $2}'`
do
echo ${i}
ipcrm -s ${i}
done
#############################
# opened libraries at runtime
#############################
aixinstall0:/#which genld
/usr/bin/genld
Proc_pid: 0 Proc_name: swapper
Proc_pid: 1 Proc_name: init
d0004000 /usr/lib/libpthreads.a/shr_xpg
5.o
d0001000 /usr/lib/libpthreads.a/shr_com
...
1- To get a listing of the libraries an executable file needs to run:
# dump -Hv exec_file
To get a listing of the libraries a process uses:
# genld | grep -p pid
#####################################
# dump header information of a binary
#####################################
# dump -ov /usr/java131/jre/bin/java
/usr/java131/jre/bin/java:
***Object Module Header***
# Sections Symbol Ptr # Symbols Opt Hdr Len Flags
4 0x00009160 669 72 0x1002
Flags=( EXEC DYNLOAD )
Timestamp = "May 17 16:29:56 2004"
Magic = 0x1df (32-bit XCOFF)
***Optional Header***
Tsize Dsize Bsize Tstart Dstart
0x0000696b 0x00000301 0x0000081c 0x10000128 0x20000a93
SNloader SNentry SNtext SNtoc SNdata
0x0004 0x0002 0x0001 0x0002 0x0002
TXTalign DATAalign TOC vstamp entry
0x0005 0x0003 0x20000c70 0x0001 0x20000c14
maxSTACK maxDATA SNbss magic modtype
0x00000000 0x80000000 0x0003 0x010b UR
########################
# performance diagnostic
########################
/usr/sbin/perf/diag_tool/pdt_config
http://www.rs6000.ibm.com/doc_link/en_US/a_doc_lib/aixbman/prftungd/2365cd4.htm
######
# nmon
######
# alte 9er Version
export NMON="vlntDpkA"
# neue 10er Version
export NMON="BlnmtdkAa"
# vpathdevs
export NMON="BlnmtekAa"
# Linux
export NMON="Blnmtkd"
nmon -h
Hint: nmon [-h] [-s <seconds>] [-c <count>] [-f -d -t -r <name>] [-x]
-h FULL help information - much more than here
Interactive-Mode:
read startup banner and type: "h" once it is running
For Data-Collect-Mode (-f)
-f spreadsheet output format [note: default -s300 -c288]
optional
-s <seconds> between refreshing the screen [default 2]
-c <number> of refreshes [default millions]
-t spreadsheet includes top processes
-x capacity planning (15 min for 1 day = -fdt -s 900 -c 96)
For Interactive-Mode
-s <seconds> between refreshing the screen [default 2]
-c <number> of refreshes [default millions]
-g <filename> User decided Disk Groups
- file = on each line: group_name <hdisk_list> space seper
ated
- like: rootvg hdisk0 hdisk1 hdisk2
- upto 32 groups hdisks can appear more than once
-b black and white [default is colour]
example: nmon -s 1 -c 100
For Data-Collect-Mode = spreadsheet format (comma separated values)
Note: use only one of f,F,z,x or X and make it the first argument
-f spreadsheet output format [note: default -s300 -c288]
output file is <hostname>_YYYYMMDD_HHMM.nmon
-F <filename> same as -f but user supplied filename
-r <runname> goes into spreadsheet file [default hostname]
-t include top processes in the output
-T as -t plus saves command line arguments in UARG section
-s <seconds> between snap shots
-c <number> of refreshes
-l <dpl> disks/line default 150 to avoid spreadsheet issues. EMC=64
.
-g <filename> User decided Disk Groups (see above -g)
-D Skip disk configuration sections
-E Skip ESS configuration sections
-I <percent> Ignore process percent threshold (default 0.1)
don't save TOP stats if proc using less CPU than this %
-A Include Async I/O Section
-m <dir> nmon changes to this directory before saving data to a fil
e
example: collect for 1 hour at 30 second intervals with top procs
nmon -f -t -r Test1 -s30 -c120
To load into a spreadsheet like Lotus 1-2-3:
sort -A *nmon >stats.csv
transfer the stats.csv file to your PC
Start 1-2-3 and then Open <char-separated-value ASCII file>
Capacity planning mode - use cron to run each day
-x sensible spreadsheet output for CP = one day
every 15 mins for 1 day ( i.e. -ft -s 900 -c 96)
-X sensible spreadsheet output for CP = busy hour
every 30 secs for 1 hour ( i.e. -ft -s 30 -c 120)
Set-up and installation
If you get a "can't open /dev/kmem" message
then as root run: chmod ugo+r /dev/kmem
or run the tool as the root user
To enable disk stats as root: chdev -l sys0 -a iostat=true
- this adds the disk % busy numbers (otherwise they are zero)
If you have hundreds of disk this can take 1% to 2% CPU
Interactive Mode Commands
key --- Toggles to control what is displayed ---
h = Online help information
r = RS6000/pSeries type, machine name, cache details and AIX version +
LPAR
c = CPU by processor stats with bar graphs
l = long term CPU (over 75 snapshots) with bar graphs
m = Memory and Paging stats
k = Kernel Internal stats
n = Network stats
d = Disk I/O Graphs
D = Disk I/O Stats
o = Disk I/O Map (one character per disk showing how busy it is)
g = Disk Group I/O Stats (have to use -g commandline option)
a = Adapter I/O Stats
e = ESS vpath Logical Disk I/O Stats
j = JFS Stats
f = Fast Response Cache Accelerator Stats (IBM HTTP web server)
t = Top Process Stats 1=Basic-Details 2=Accumulated-CPU
Performance sorted by 3=CPU 4=Size 5=I/O
u = Top but with command arguments shown (used with 3,4 & 5)
to refresh arguments (for new processes) hit u twice
w = use with top to show AIX wait processes (good for SMP)
A = Summarise Async I/O (aioserver) processes
v = Verbose this highlights problems on the machine and
categorises them as either danger, warnings or OK
b = black and white mode (or use -b option)
. = minimum mode i.e. only busy disks and processes
key --- Other Controls ---
+ = double the screen refresh time
- = halves the screen refresh time
q = quit (also x, e or control-C)
0 = reset peak counts to zero (peak = ">")
space = refresh screen now
Startup Control
If you find you always type the same toggles every time you start
then place them in the NMON shell variable. For example:
export NMON=cmdrvtan
Others:
a) Use shell variable NMONAIX=4.3.2 to a force AIX version
To you want to stop nmon - kill -USR2 <nmon-pid>
b) Use -p and nmon outputs the background process pid
c) To limit the processes nmon lists (online and to a file)
Either set NMONCMD0 to NMONCMD63 to the program names
or use -C cmd:cmd:cmd etc. example: -C ksh:vi:syncd
d) If you want to pipe nmon output to other commands use a FIFO:
mkfifo /tmp/mypipe
nmon -F /tmp/mypipe &
grep /tmp/mypipe
e) If nmon fails please report it with:
1) nmon version like: v9a
2) the output of lslpp -L bos.mp (or for uniprocessor bos.up)
3) some clue of what you were doing
4) I may ask you to run the debug version
f) From version 7 nmon can output rrdtool friendly output
Use -R - you then have to create suitable rrd databases
and can run nmon output via ksh to update them
This is still experimental - help needed (see the README.txt)
Written by Nigel Griffiths [email protected] and Richard Cutler
Feedback welcome - on the current release only and state exactly the pro
blem
Version v9a - updated for each AIX release
No warranty given or implied.
#######################################
# daten fuer einen Tag mit nmon sammeln
#######################################
alle 300 sekunden (5 minuten) + 288 = 1 Tag
cd /tmp
nmon -f -s300 -c288
########
# vpaths
########
0:root@testy:/ # lsdev -Cl dpo
dpo Available Data Path Optimizer Parent
0:root@testy:/ # lsattr -El dpo
Enterpr_maxlun 600 Maximum LUNS allowed for Enterprise Products True =
=> Wieviele ESS, DS8000, DS6000 LUNs kann ich anschliessen?
Virtual_maxlun 512 Maximum LUNS allowed for Virtualization Products False =
=> Wieviele SAN Volume Controller LUNS kann ich anschliessen?
persistent_resv yes Subsystem Supports Persistent Reserve Command False
qdepth_enable no Queue Depth Control True
Das kann man entsprechend anpassen: chdev -l dpo -a Enterpr_maxlun=zzz.
Algorithmen zur Wahl des Pfades
Der SDD Treiber setzt verschiedene Algorithmen zur Verteilung des I/O auf die vo
rhandenen Pfade ein. Dieses lassen sich mit dem datapath-Kommando setzten.
* fo - Failover Only Saemtlicher Verkehr geht ueber einen preferred Adapter.
Faellt der aus, wird ein anderer Adapter genutzt.
* lb - Load Balancing Anhand der aktuellen I/O Operationen eines Adapters we
rden die Adapter priorisiert. Die Last wird so gleichverteilt; sind Adapter glei
ch ausgelastet, so wird per Zufall zwischen ihnen gewaehlt. Diese Policy wird au
ch als Optimized bezeichnet.
* rr - Round Robin Der Pfad fuer die anstehende I/O Operation wird per Zufal
l unter den Pfaden verteilt, der letzte aktive Pfad bzw. Adapter bleibt ausgenom
men.
* df - Default Die Default-Policy ist Load Balancing.
Die aktuelle Policy eines vpath findet sich in der Ausgabe des lsattr-Kommandos
(oder in der Ausgabe von datapath query device:
0:root@testy:/root # lsattr -El vpath5
active_hdisk hdisk7/00C27913/fscsi0 Active hdisk False
active_hdisk hdisk17/00C27913/fscsi1 Active hdisk False
policy df Scheduling Policy True
pvid 00c8ca9d7853d4340000000000000000 Physical volume identifier False
serial_number 00C27913 LUN serial number False
Der vpath5 zeigt also ueber die (virtuellen) Platten hdisk7 und hdisk17 und die
beiden Fiber-Channel Adapter fscsi0 und fscsi1 auf die ESS C27913. Die Policy st
eht auf Default, als wird die Last ueber Load Balancing verteilt. Die Policy kan
n man veraendern mit den datapath-Kommando:
0:root@testy:/root # datapath query device
Total Devices : 10
....
DEV#: 5 DEVICE NAME: vpath5 TYPE: 2105800 POLICY: Optimized
SERIAL: 00C27913
==========================================================================
Path# Adapter/Hard Disk State Mode Select Errors
0 fscsi0/hdisk7 CLOSE NORMAL 3345 0
1 fscsi1/hdisk17 CLOSE NORMAL 3417 0
....
0:root@testy:/root # datapath set device 5 policy rr
DEV#: 5 DEVICE NAME: vpath5 TYPE: 2105800 POLICY: Round Robin
SERIAL: 00C27913
==========================================================================
Path# Adapter/Hard Disk State Mode Select Errors
0 fscsi0/hdisk7 CLOSE NORMAL 3345 0
1 fscsi1/hdisk17 CLOSE NORMAL 3417 0
Es ist dabei egal, ob das Device OPEN oder CLOSE ist.
Welche Programme / Befehle kommen mit SDD?
Eine Auswahl der Dienstprogramme, die mit dem SDD Fileset installiert werden. Di
e Befehle sind teilweise sehr wichtig:
* addpaths - Fuegt einem bestehenden vpath-Device weitere Pfade zu. Das Komm
ando ist dynamisch, der vpath ist aktiv und im Status "available".
* cfallvpath - Legt das SDD Pseudo-Device dpo an sowie alle vpath Devices.
* chgvpath - aendert vpath Attribute.
* datapath - Eine Administrations-Konsole fuer SDD Treiber.
* lquerypr - Zeigt und setzt persistente Reservierungen (SCSI Locks).
* lsvpcfg - Zeigt die Zuordnung Platte - vpath Device.
* querysn - Zeigt die serielle Nummer der Devices.
* mkvg4vp - Legt SDD Volume Groups an.
* extendvg4vp - Erweitert SDD Volume Groups.
* dpovgfix - Repariert eine SDD Volume Group, die gemischte hdisk / vpath De
vices aufweist.
* pathtest - Umfangreiches Tool zum Testen und Debuggen.
Wie sind meine (virtuellen) Platten auf die vpath verteilt?
Dazu dient das Kommando lsvpcfg:
0:root@testy2:/root # lsvpcfg
vpath0 (Avail pv testy_vg) 00427298 = hdisk2 (Avail ) hdisk12 (Avail )
vpath1 (Avail ) 10427298 = hdisk3 (Avail ) hdisk13 (Avail )
vpath2 (Avail ) 30427298 = hdisk4 (Avail ) hdisk14 (Avail )
vpath3 (Avail pv hbb_vg) 30627298 = hdisk5 (Avail ) hdisk15 (Avail )
vpath4 (Avail ) 50427298 = hdisk6 (Avail ) hdisk16 (Avail )
vpath5 (Avail pv testy_vg) 00C27913 = hdisk7 (Avail ) hdisk17 (Avail )
vpath6 (Avail pv hbb_vg) 00D27913 = hdisk8 (Avail ) hdisk18 (Avail )
vpath7 (Avail pv ) 10727913 = hdisk9 (Avail ) hdisk19 (Avail )
vpath8 (Avail ) 20327913 = hdisk10 (Avail ) hdisk20 (Avail )
vpath9 (Avail ) 30227913 = hdisk11 (Avail ) hdisk21 (Avail )
Hier ist jeder vpath mit den zugeordneten Platten gezeigt. Platte hdisk2 und hdi
sk12 sind also "virtuelle" Platten auf der lokalen Maschine, die ueber zwei vers
chiedene Fiber-Channel Adapter auf diesselbe, physikalische Platte in einer Stor
age Box zeigen - das ist der vpath.
Wichtig ist, dass pro vpath mindestens 2 Platten im Zustand "Available" stehen.
Das Attribut pv (AIX sieht dieses Device als physikalisches Volume) darf nur dem
vpath zugeordnet sein. Taucht es bei hdisk-Devices auf, so muss das mit dem dpo
vgfix Kommando korriert werden.
Man kann die Ausgabe auf einzelne Typen von Storage Boxen oder Virtualisierungs
Einheiten beschräen, z.B. lsvpcfg -d 2105.
datapath Kommando
Ist eine Administrations-Konsole, mit der man Parameter auslesen und Setzen sowi
e Pfade oeffnen und schliessen kann. Dazu dienen entsprechende Subkommandos. Nue
tzlich sind folgende Kommandos zum Auslesen von Information:
* datapath query device - Zeigt jedes bekannte Device mit zugehoeriger Infor
mation.
* datapath query essmap - Zeigt Pfad und Lokation an.
* datapath query portmap - Zeigt die Verteilung der Devices auf die Ports de
r Storage Box an.
* datapath query wwpn - Zeigt die World Wide Port Number der FC Adapter.
* datapath query adapter - Zeigt Informationen zu den FC Adaptern.
* datapath query adaptertats - Zeigt Statistiken der Adapter.
Setzt man den Befehl ohne Subkommandos ab, so werden alle aktuellen Moeglichkeit
en angezeigt. Damit ist es leicht, die Kommandos zum Setzen der Parameter zu fin
den.
Was passiert, wenn ich cfgmgr oder chdev ausfuehrt
Beim Kommando cfgmgr ist zu beachten, dass er bei Platten, die schon eine PVID h
aben, pro Fiber-Channel Adapter einmal ausgefuehrt werden muss (cfgmgr findet di
e PVID, traegt sie in die ODM ein und setzt das Device in den Status "defined".
Findet er diese PVID dann nochmal ueber den anderen Adapter, macht er nichts meh
r. Ruft man cfgmgr nochmal auf, ist die Platte im Zustand "Available" und wird n
ochmal eingerichtet).
Beim Kommando chdev gegen eine der hdisk wird die PVID der Platte ausgelesen und
von der chdev-Methode in die ODM eingetragen. Das hat zur Folge, das sowohl fue
r vpath Device wie fuer eine der "virtuellen" hdisk eine PVID existiert und AIX
davon ausgeht, dass es sich um physikalische Devices handelt. Dieser Fehler tauc
ht in der Ausgabe des lsvpcfg-Kommandos auf (Attribut "pv" einer hdisk zugeordne
t) sowie in der Ausgabe des lsvg -p-Kommandos (statt eines vpath erscheint eine
hdisk). Dieses Problem muss mit dem dpovgfix-Kommando behoben werden, da sonst e
in vpath verloren geht. Die VG muss varyon sein, aber die Filesysteme sollten ni
cht gemountet sein.
Wie lege ich richtig Volume Groups an?
Anlegen von Volume Groups mit SDD Platten erfordert bestimmte Kommandos, die "no
rmalen" LVM Kommandos reichen nicht aus. Es gibt fuer alle SMIT Fenster und Komm
andozeilen Befehle spezielle Versionen fuer vpath Devices: mkvg4vp, extendvg4vp,
savevg4vp. Weitere Befehle sind zugleich auch SMIT Fenster und spezifisch fuer
vpath Devices: lsvpcfg, cfallvpath, addpaths.
Fehlermeldungen im Error-Report
Es werden eine Reihe Nachrichten zu vpath-Devices und sddsrv (errpt -a |grep VPA
TH bzw. SDD). Das ist teilweise nuetzlich, wenn man mit gelockten Devices kaempf
t.
* VPATH_FAIL_RELPRESERVE - Wird ausgegeben, wenn ein Device geschlossen wurd
e, aber die persistent reserve nicht geloest werden konnte. Das Device ist also
weiterhin gesperrt, und ein Versuch, es zu oeffnen, gibt den folgenden Fehler.
* VPATH_RESV_CFLICT - Der aktuelle Reservation Key ist nicht der, mit dem da
s SDD vpath-Device gesperrt ist. Jemand anders sperrt die Platte bzw. den vpath.
Besonders im HACMP Umfeld notorisch. Hier muss man mit lquerypr -vh das Lock we
gnehmen.
* VPATH_PATH_OPEN - Einer der Pfade eines vpath-Devices konnte nicht geoeffn
et werden (trotzdem ist der vpath ueber die anderen Pfade verfuegbar. Erst wenn
keiner der Pfade funktioniert, wird die Meldung VPATH_OUT_SERVICE geschrieben.
* VPATH_XBUF_NOMEM - Fuer ein vpath-Device sollte ein Device-special File an
gelegt werden. Es war aber kein Kernel-Memory mehr verfuegbar und der Aufruf ist
fehlgeschlagen.
* VPATH_DEVICE_OFFLINE - Nach mehreren erfolglosen Versuchen, I/O ueber eine
n Pfad abzusetzten, ist dieser Offline genommen und in den Status DEAD gesetzt w
orden.
* VPATH_DEVICE_ONLINE - Wenn ein Pfad nicht erreichbar ist (DEAD), kann er p
er auto_failback wieder aktiviert werden. Dabei wird nach 2000 I/O Aufrufen der
Pfad wieder angesprochen. Funktioniert es, geht der Status nach OPEN. Funktionie
rt der I/O nicht, so wird der Pfad zwar wieder online genommen, aber erst nach w
eiteren 50000 I/O Operationen auf den anderen Pfaden in den Status OPEN gesetzt.
In beiden Faellen gibt es diese Meldung.
* VPATH_OUT_SERVICE - Ein vpath Device hat keinen Pfad zu keiner Platte mehr
. Das Device ist damit im LIMBO, und jeder Aufruf wird sofort an den Verursacher
zurueckgegeben.
Wichtige Kommandos
Welche Devices sind an meine Maschine angeschlossen?
0:root@testy:/ # lsdev -C -t 2105
hdisk2 Available 05-08-01 IBM FC 2105
hdisk3 Available 05-08-01 IBM FC 2105
hdisk4 Available 05-08-01 IBM FC 2105
hdisk5 Available 05-08-01 IBM FC 2105
hdisk6 Available 05-08-01 IBM FC 2105
hdisk7 Available 05-08-01 IBM FC 2105
hdisk8 Available 05-08-01 IBM FC 2105
hdisk9 Available 05-08-01 IBM FC 2105
2105 ==> ESS (mit FC ==> Fiber Channel connected, sonst SCSI)
2107 ==> DS8000
1750 ==> DS6000
2145 ==> SAN Volume Controller Device
2062 ==> SAN Volume Controller for Cisco MDS 9000
Wie sehe ich den all die Sachen, die ich fuer meine Pfade definiert habe?
Mit lsattr -El vpathX und lsattr -El hdiskX.
0:root@testy:/ # lsattr -El vpath0
active_hdisk hdisk2/00427298/fscsi0 Active hdisk False
active_hdisk hdisk12/00427298/fscsi1 Active hdisk False
policy df Scheduling Policy True
pvid 00c8ca9d7853d69c0000000000000000 Physical volume identifier False
serial_number 00427298 LUN serial number False
0:root@testy:/ # lsattr -El hdisk2
PR_key_value none Reserve Key True
location Location Label True
lun_id 0x5004000000000000 Logical Unit Number ID True
lun_reset_spt yes Support SCSI LUN reset True
max_transfer 0x40000 N/A True
node_name 0x5005076300c0a83a FC Node Name False
pvid none Physical volume identifier False
q_type simple Queuing TYPE True
qfull_dly 20 delay in seconds for SCSI TASK SET FULL True
queue_depth 20 Queue DEPTH True
reserve_policy single_path Reserve Policy True
rw_timeout 60 READ/WRITE time out value True
scbsy_dly 20 delay in seconds for SCSI BUSY True
scsi_id 0x30600 SCSI ID True
start_timeout 180 START unit time out value True
ww_name 0x5005076300cba83a FC World Wide Name False
Hilfreich ist auch das lspath-Kommando.
Gibt es ein Debug- oder Testtool in der Art des AIX diag?
Das Kommando heisst /usr/sbin/pathtest.
Kann ich auf einen Blick meine Platten, die LUN, Art der Platte, Groesse sehen?
Das geht z.B. mit dem lsess-Kommando. Das nimmt die Daten, die der cfgmgr in das
File /var/adm/essmap.out geschrieben hat, generiert /var/adm/lsess.out, was dan
n ausgegeben wird.
Welche Platten unterstuetzt ein System den als MPIO faehig?
Mit dem Kommando odmget -q DvDr=aixdiskpcmke PdDv |more.
######################################
# check queue_depth for ESS, DS6k DS8k
######################################
# check
for i in `lspv|grep -v rootvg |grep hdisk|awk '{print $1}'`
do
echo "Beginn $i"
lsattr -El $i|grep "queue_depth"|awk '{print $2}'
done
# change to maximum of 256
for i in `lspv|grep -v rootvg |grep hdisk|awk '{print $1}'`
do
QUEUEDEPTH=`lsattr -El $i|grep "queue_depth"|awk '{print $2}'`
echo "Change of $i from $QUEUEDEPTH to 256"
# 20 = default
if [ $QUEUEDEPTH = 20 ]
then
chdev -l $i -P -a queue_depth=256
# falls disk nicht in Benutzung dann naechste Zeile aktivieren
#chdev -l $i -a queue_depth=256
fi
done
Boot erforderlich um die Parameter zu aktivieren
##################################
# datei loeschen mit sonderzeichen
##################################
Beispiel:
Dateiname = -I oder --files-from
Loesung:
rm -- -I oder rm -- --files-from
#####
# NIS
#####
You can bind across a subnet with AIX, I won't vouch for the security.
Here is how I've done it, all on the NIS client:
1. Set the domain name by entering the command:
chypdom -B newdomainname
For example: "chypdom -B ca" would set the domain to ca for
California.
2. Enter "startsrc -s ypbind -a -ypsetme" to start the ypbind daemon.
3. Enter "ypset nismaster" where nismaster is the ip address of the
NIS master server. This will cross the gateway and bind this slave
server to the your NIS master server. (Use ypwhich to see where it is
bound.)
4. Add these commands to a startup script if you want this to occur on
reboot.
######################
# list vg major-number
######################
node1:/usr/sbin> lvlstmajor
20,37..79,82...
############################################
# list der vg-major number der einzelnen vgs
############################################
xarcp01#for i in `lsvg`
> do
> ls -al /dev/$i
> done
crw-rw---- 1 root system 46, 0 May 19 07:00 /dev/docpvg2
crw-rw---- 1 root system 10, 0 Mar 22 2002 /dev/rootvg
crw-rw---- 1 root system 40, 0 Mar 22 2002 /dev/arcpvg
crw-ow---- 1 root system 85, 0 Mar 19 09:08 /dev/docpvg
for i in `lsvg -o |grep -v rootvg`
do
ls -al /dev/$i
done
crw-r----- 1 root system 55, 0 Sep 08 13:28 /dev/vpdb01VG
crw-r----- 1 root system 54, 0 Sep 08 13:28 /dev/mdepot02VG
crw-r----- 1 root system 53, 0 Sep 08 13:27 /dev/mnet01VG
crw-r----- 1 root system 52, 0 Sep 08 13:26 /dev/mdepot01
##########################
# belegter platz im system
##########################
summe=0
for i in `lsvg|grep -v rootvg`
do
wert=`lsvg $i|grep "TOTAL PPs:"|awk '{print $7}'|cut -f2 -d"("`; echo $w
ert
let summe=$summe+$wert
done
echo "Summe aller VG=$summe"
############
# redefinevg
############
examine each disk in system and determine which voloume group it belongs to and
updates the ODM
redefinevg -d /dev/hdisk? -i VGID VGNAME
###########
# synclvodm
###########
syncs the LVCB and the VGDA on disks
synclvodm -P -v myvg (-P preserves Ownership!)
#########################################
# importvg importieren einer volume group
#########################################
importvg -y'<name der vg>' hdiskx
#####################
# create volume group
#####################
mkvg -f -y'oracle01VG' -s'16' hdisk2
without automatic varyon:
mkvg -f -y'bdmVG' -s'16' '-n' hdisk8 hdisk10
Major Number:
mkvg -f -B -y'xyzVG' -s'16 -V 80 hdiskx
mkvg4vp -f -B -s 256 -y vg_edsprd vpath8
#####################
# remove volume group
#####################
reducevg -df aixinstall0VG hdisk2
but before
aixinstall2:/#mkboot -c -d /dev/hdisk2 --> removes bootlv from disk
aixinstall2:/#rmlv -f bootlv00 pagelv00 loglv00 fslv00 fslv01 fslv02 fslv03 fslv
04 paging00 local01VG tftboot01LV export01LV
0516-1246 rmlv: If bootlv00 is the boot logical volume, please run 'chpv -c <dis
kname>'
as root user to clear the boot record and avoid a potential boot
off an old boot image that may reside on the disk from which this
logical volume is moved/removed.
rmlv: Logical volume bootlv00 is removed.
rmlv: Logical volume pagelv00 is removed.
rmlv: Logical volume loglv00 is removed.
rmlv: Logical volume fslv00 is removed.
rmlv: Logical volume fslv01 is removed.
rmlv: Logical volume fslv02 is removed.
rmlv: Logical volume fslv03 is removed.
rmlv: Logical volume fslv04 is removed.
rmlv: Logical volume paging00 is removed.
rmlv: Logical volume local01VG is removed.
rmlv: Logical volume tftboot01LV is removed.
rmlv: Logical volume export01LV is removed.
aixinstall2:/#chpv -c hdisk2
varyoffvg aixinstall0VG
exportvg aixinstall0VG
#######################################
# changing pv from missing to available
#######################################
- correct problem, which causes missing state
chpv -v a hdisk
#############
# import a VG
#############
importvg -y applicationVG hdisk?
###############################
# syncvg stale partitions in vg
###############################
syncing a vg
syncvg -v rootvg
syncing a disk replaced by another
syncvg -p hdiskx
Plattenausfall SSA / Drawer
0516-934 /etc/syncvg: Unable to synchronize logical volume oralv0314.
cfgmgr -v # makes disk available
varyonvg -n VGNAME # makes disk active in VGNAME
synclvodm -P -v VGNAME
syncvg -l stale_LV
#######################
# mirror a volume group
#######################
extendvg rootvg hdisk1
mirrorvg rootvg hdisk1
# exact mirror
mirrorvg -m rootvg hdisk1
###############
# mirror rootvg
###############
http://techsupport.services.ibm.com/server/aix.techTips?refNo=90605212214784
http://mpfrye.hopto.org/aix/mirror_rootvg.html
#################
# unmirror rootvg
#################
unmirrorvg -c kopies vg platte_die_geleert_werden_soll
unmirrorvg -c 1 rootvg hdisk1
###########################
# paging space deaktivieren
###########################
chps -a'n' paging00
###########################
# paging space vergroessern
###########################
chps -s'48' hd6
#################################################
# How do I remove a non-existant physical volume?
#################################################
Thanks to Johnny Shieh ([email protected])
To delete a phantom disk from the ODM use reducevg with the pvid
instead of the disk name. You are running some command such as lsvg
or varyonvg and it is griping about a disk that is no longer findable
right? In that warning message, it should give you a pvid. Try one
of the following, (note: reducevg updates the VGDA but not the ODM).
reducevg -f <vgname> <pvid>
ldeletepv -g VGid -p PVid
-g Required, specify the VGid of the volume group you are
removing the physical volume from
-p Required, specif
# reducevg oracle01VG hdisk2
####################################
# volumegroup autovaryon ausschalten
####################################
node1:/> lsvg mdbVG
VOLUME GROUP: mdbVG VG IDENTIFIER: 000001307f545bdf
VG STATE: active PP SIZE: 16 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 2144 (34304 megabytes)
MAX LVs: 256 FREE PPs: 1243 (19888 megabytes)
LVs: 4 USED PPs: 901 (14416 megabytes)
OPEN LVs: 4 QUORUM: 5
TOTAL PVs: 8 VG DESCRIPTORS: 8
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 8 AUTO ON: yes
MAX PPs per PV: 1016 MAX PVs: 32
node1:/> chvg -a n mdbVG
node1:/> lsvg mdbVG
VOLUME GROUP: mdbVG VG IDENTIFIER: 000001307f545bdf
VG STATE: active PP SIZE: 16 megabyte(s)
VG PERMISSION: read/write TOTAL PPs: 2144 (34304 megabytes)
MAX LVs: 256 FREE PPs: 1243 (19888 megabytes)
LVs: 4 USED PPs: 901 (14416 megabytes)
OPEN LVs: 4 QUORUM: 5
TOTAL PVs: 8 VG DESCRIPTORS: 8
STALE PVs: 0 STALE PPs: 0
ACTIVE PVs: 8 AUTO ON: no
MAX PPs per PV: 1016 MAX PVs: 32
############################
# add physical volumes to vg
############################
# extendvg oracle01VG hdisk5
######################
# reorg a volume group
######################
# reorgvg applicationVG applicationLV
0516-962 reorgvg: Logical volume applicationLV migrated.
##################
# quorum abstellen
##################
You can prevent of this if rootvg is setting without quorum:
chvg -Qn <VGNAME>
chvg -Qn rootvg
#############
# PP aller vg
#############
lsvg -o|lsvg -i|grep 'TOTAL PPs'
root@cws [~]# lsvg -o|lsvg -i|grep 'TOTAL PPs'
VG PERMISSION: read/write TOTAL PPs: 127 (4064 megabytes)
VG PERMISSION: read/write TOTAL PPs: 254 (8128 megabytes)
VG PERMISSION: read/write TOTAL PPs: 537 (2148 megabytes)
############################
# mklv - make logical volume
############################
mklv -t raw -y <name_of_raw_lv> <name_of_VG> <size_of_LP> <hdiskx>
# mklv -t jfs -y oltpLV applicationVG 19 hdiskx
oltpLV
oder
# mklv -t jfs2 -y oltpLV applicationVG 19 hdiskx
oltpLV
-a position
c = center
m = outer middle
e = outer edge
ie = inner edge
im = inner middle
# mklv -a c -t jfs -y oltpLV applicationVG 19 hdiskx
# striped non mirrored lv
# mklv -y stripelv -S64k -u2 odmvg 2
# striped mirrored lv
# mklv -y mirrorstripelv -S64K -u2 -c2 odmvg 2
# sudo mklv -y lv_oraadmin -S64K -u2 -c2 rootvg 40 hdisk0 hdisk1 hdisk78 hdisk80
####################################
# ueber mehrere platten stripe raid0
####################################
mklv -y'kutestLV' -t'jfs' -e'x' oracle01VG 1020 hdisk14 hdisk15 hdisk16 hdisk17
oder
mklv -y'kutestLV' -t'jfs2' -e'x' oracle01VG 1020 hdisk14 hdisk15 hdisk16 hdisk17
oder
sudo mklv -e x -y lv_kutest -t jfs2 vg_oracle01 395 vpath5 vpath6 vpath7 vpath8
vpath9
############################
# extendlv - lv vergroessern
############################
extendlv kutestLV 30
##########################
# crfs - create filesystem
##########################
smitty crjfsbf
oder
crfs -v jfs -d <name_of_jfs_LV> -m /<mountpoint> -a bf=true -A <mount=true oder
false> yes | no
# crfs -v jfs -d oltpLV -m /usr/app/OLTP -a bf=true -A yes
Based on the parameters chosen, the new /usr/app/OLTP JFS file system
is limited to a maximum size of 134217728 (512 byte blocks)
New File System size is 622592
# mit INLINE log
crfs -v jfs2 -d <name_of_jfs_LV> -m /<mountpoint> -a logname=INLINE -A yes
##################
# aix 4.3.3 limits
##################
0506-276 JFS file systems have the following size limitations:
NBPI Minimum AG Size Fragment Size Maximum Size (GB)
512 8 512, 1024, 2048, 4096 8
1024 8 512, 1024, 2048, 4096 16
2048 8 512, 1024, 2048, 4096 32
4096 8 512, 1024, 2048, 4096 64
8192 8 512, 1024, 2048, 4096 128
16384 8 512, 1024, 2048, 4096 256
32768 16 1024, 2048, 4096 512
65536 32 2048, 4096 1024
131072 64 4096 1024
##################################
# agblksize fuer oracle cio option
##################################
crfs -v jfs2 -d oralogdepot02LV -m /usr/app/oracle/oradata/vpdepot/oralog2 -a ag
blksize=512 -A yes
###############################
# mklvcopy - spiegeln eines LVs
###############################
Auf bestimmter platte einen Spiegel ablegen
mklvcopy <LV-Name> <Count_of_copies> <hdiskname>
# mklvcopy oltpLV 2 hdisk13
Automatisch auf separate Disk spiegeln
mklvcopy -s y <LV-Name> <Count_of_copies>
direkt spiegeln
# mklvcopy -k -s y <LV-Name> <Count_of_copies>
Falls Spiegel sich nicht auf einer Platte anlegen laesst:
# chlv -s'n' oracle01LV
# exaktes spiegeln
lslv -m $LVNAME |awk '{print $3":"$2}'>/tmp/kutest
vi /tmp/kutest
- ersetze hdisk_orig durch hdisk spiegel
- wq
mklvcopy -s y -m /tmp/kutest $LVNAME 2
###########################
# check lvmirror which disk
###########################
# lslv -m oralv0300
oralv0300:N/A
LP PP1 PV1 PP2 PV2 PP3 PV3
0001 0110 hdisk23 0103 hdisk46
0002 0110 hdisk24 0103 hdisk31
0003 0110 hdisk25 0103 hdisk84
0004 0110 hdisk29 0103 hdisk32
0005 0110 hdisk33 0103 hdisk87
0006 0110 hdisk34 0103 hdisk35
0007 0110 hdisk68 0103 hdisk37
0008 0110 hdisk40 0103 hdisk39
0009 0110 hdisk43 0103 hdisk41
0010 0110 hdisk69 0103 hdisk42
0011 0111 hdisk20 0104 hdisk28
0012 0111 hdisk22 0104 hdisk36
0013 0111 hdisk3 0104 hdisk18
0014 0111 hdisk4 0104 hdisk11
0015 0111 hdisk5 0104 hdisk55
0016 0111 hdisk7 0104 hdisk70
0017 0111 hdisk8 0104 hdisk38
0018 0111 hdisk9 0104 hdisk82
0019 0111 hdisk10 0104 hdisk71
0020 0111 hdisk12 0104 hdisk78
0021 0111 hdisk14 0104 hdisk96
0022 0111 hdisk19 0104 hdisk60
0023 0111 hdisk23 0104 hdisk46
0024 0111 hdisk24 0104 hdisk31
0025 0111 hdisk25 0104 hdisk84
0026 0111 hdisk29 0104 hdisk32
0027 0111 hdisk33 0104 hdisk87
0028 0111 hdisk34 0104 hdisk35
0029 0111 hdisk68 0104 hdisk37
0030 0111 hdisk40 0104 hdisk39
0031 0111 hdisk43 0104 hdisk41
0032 0111 hdisk69 0104 hdisk42
##########################
# rmlvcopy loeschen lvcopy
##########################
# rmlvcopy hd6 1 hdisk1
# lslv -l hd6
hd6:N/A
PV COPIES IN BAND DISTRIBUTION
hdisk0 032:000:000 100% 000:032:000:000:000
Wenn mehrere copys vorhanden z.B. 3 dann
rmlvcopy hd6 2 hdisk1
Damit wird copy auf hdisk1 geloescht, jedoch alle anderen bleiben erhalten.
Nicht vergessen anschliessend syncvg -v VG durchzufuehren!
##################################################
# schauen welche platte mit welcher gespiegelt ist
##################################################
# lslv -m adsmpool01LV
adsmpool01LV:/adsm/pool/01
LP PP1 PV1 PP2 PV2 PP3 PV3
0001 0056 hdisk2 0056 hdisk4
0002 0057 hdisk2 0057 hdisk4
0003 0058 hdisk2 0058 hdisk4
0004 0059 hdisk2 0059 hdisk4
0005 0060 hdisk2 0060 hdisk4
0006 0061 hdisk2 0061 hdisk4
0007 0062 hdisk2 0062 hdisk4
################################
# copy lv from one vg to another
################################
cplv -y'<neuer Name>' -v<VG> <alter_Name>
cplv -y'local02LV' -v'rootvg' local01LV
cplv -y'application04LV' -v'application01VG' application02LV
#############
# rename a lv
#############
chlv -n'<NewLogicalVolume>' <LogicalVolume>
chlv -n'local01LV' local02LV
########################
# extend volumes on a lv
########################
Can I change the MAX NUMBER of PP's allocated to a logical volume on the
fly? For instance, I initially set this LV up with the default of 512 MAX
PP's. This LV currently has 240 PP's allocated to it, and I need to add 312
PP's - which will take me over my 512 hard limit.
chlv -x <max pps> <lvname>
##################
# cplv existing lv
##################
/usr/sbin/cplv -e DestinationLogicalVolume [ -f ] SourceLogicalVolume
#########
# lvmstat
#########
# finding hotspots
# enable
VGNAME=
lvmstat -v $VGNAME -e
# disable
lvmstat -v $VGNAME -d
# list statistics 4 seconds interval
lvmstat -v $VGNAME 4
# stat of lv
LVNAME=
lvmstat -l $LVNAME 4
# monitor die 5 groessten io alle 4 sekunden
lvmstat -l $LVNAME -c 5 4
####################################
# monitoring lv to find out hotspots
####################################
LVNAME=
MAXZAHL=10
ITERATION=100
INTERVAL=4
lvmstat -l $LVNAME -c 1 -s $INTERVAL $ITERATION >/tmp/lvmstat_$LVNAME.out
head -2 /tmp/lvmstat_$LVNAME.out >/tmp/lvmstat_$LVNAME.out.1 # headlines
cat /tmp/lvmstat_$LVNAME.out|grep -v "Log_part" >/tmp/lvmstat_$LVNAME.out.2
cat /tmp/lvmstat_$LVNAME.out.2|egrep "[.99]" > /tmp/lvmstat_$LVNAME.out.3
cat /tmp/lvmstat_$LVNAME.out.3|sort|awk '{print $1}'|uniq >/tmp/lvmstat_$LVNAME.
out.4
# find out hot spot
for i in `cat /tmp/lvmstat_$LVNAME.out.4`
do
ANZAHL_ZEILEN=`grep -cw $i /tmp/lvmstat_$LVNAME.out.3`
if [ $ANZAHL_ZEILEN -gt $MAXZAHL ]
then
echo "$LVNAME LP $i should be moved - more than [$ANZAHL_ZEILEN]
accesses during monitoring"
fi
done
# find out highest io read
echo "5 highest IO Read"
cat /tmp/lvmstat_$LVNAME.out.1; cat /tmp/lvmstat_$LVNAME.out.3 |sort +3 -nr |hea
d -5
# find out highest io write
echo "5 highest IO Write"
cat /tmp/lvmstat_$LVNAME.out.1; cat /tmp/lvmstat_$LVNAME.out.3 |sort +4 -nr |hea
d -5
rm -f /tmp/lvmstat_$LVNAME.out*
#########
# lspv -p
#########
where is your lv located
root@kerp-ebd001 /> lspv -p hdisk1
hdisk1:
PP RANGE STATE REGION LV NAME TYPE MOUNT POINT
1-110 free outer edge
111-219 used outer middle fslv01 jfs2 /oradata01
220-328 used center fslv01 jfs2 /oradata01
329-437 used inner middle fslv01 jfs2 /oradata01
438-510 used inner edge fslv01 jfs2 /oradata01
511-546 free inner edge
root@kerp-ebd001 /> lspv -p hdisk4
hdisk4:
PP RANGE STATE REGION LV NAME TYPE MOUNT POINT
1-110 free outer edge
111-219 used outer middle fslv01 jfs2 /oradata01
220-328 used center fslv01 jfs2 /oradata01
329-437 used inner middle fslv01 jfs2 /oradata01
438-510 used inner edge fslv01 jfs2 /oradata01
511-546 free inner edge
##################
# find file in lvm
##################
1. fileplace -p /etc/passwd
File: /etc/passwd Size: 53603 bytes Vol: /dev/hd4
Blk Size: 4096 Frag Size: 4096 Nfrags: 14 Compress: no
Physical Addresses (mirror copy 1) Logical
Fragment
----------------------------------
----------------
11449289-11449292 hdisk0 4 frags 16384 Bytes, 28.6%
0111017-0111020
11449299-11449308 hdisk0 10 frags 40960 Bytes, 71.4%
0111027-0111036
2. frag size = 4k and starting frag is 0111017. 0111017*4/1024 = 433M. The
file starts 433M into the filesystem.
3. Run lspv hdisk0 to get PP size.
lspv hdisk0
PP SIZE: 128 megabyte(s)
4. lslv -m hd4
hd4:/
LP PP1 PV1 PP2 PV2 PP3 PV3
0001 0329 hdisk0 0329 hdisk1
0002 0330 hdisk0 0330 hdisk1
0003 0331 hdisk0 0331 hdisk1
0004 0350 hdisk0 0350 hdisk1
0005 0365 hdisk0 0365 hdisk1
0006 0366 hdisk0 0366 hdisk1
0007 0367 hdisk0 0367 hdisk1
0008 0368 hdisk0 0368 hdisk1
0009 0369 hdisk0 0369 hdisk1
0008 0368 hdisk0 0368 hdisk1
0009 0369 hdisk0 0369 hdisk1
This is a map of LPs to PPs. 433M into the file at 128M/PP means you are on
the 4rd PP (0350) of the filesystem to get the file. That translates into LP4
in our example. (433/128 = 3.38 which is just past PP 3)
##############
# lvmo command
##############
# /> lvmo -v vg_oradata -a
vgname = vg_oradata
pv_pbuf_count = 512
total_vg_pbufs = 2048
max_vg_pbuf_count = 65536
pervg_blocked_io_count = 32
pv_min_pbuf = 512
global_blocked_io_count = 5986
# /> moni 'vmstat -v|grep "blocked with no"'
# /> vmstat -v |grep buf
5986 pending disk I/Os blocked with no pbuf
1979981 paging space I/Os blocked with no psbuf
2740 filesystem I/Os blocked with no fsbuf
0 client filesystem I/Os blocked with no fsbuf
570433 external pager filesystem I/Os blocked with no fsbuf
# /> lvmo -v vg_oradata -o pv_pbuf_count=1024
# /> lvmo -v vg_oradata -a
vgname = vg_oradata
pv_pbuf_count = 1024
total_vg_pbufs = 4096
max_vg_pbuf_count = 65536
pervg_blocked_io_count = 32
pv_min_pbuf = 512
global_blocked_io_count = 5986
# check vg settings
for i in `lsvg`; do lvmo -a -v $i; done
###########
# migratepv
###########
Migration von LV's oder ganzen Platten!
Beispiel:
Umzug von 2 LV's von hdisk11 nach hdisk19
Voraussetzung:
- Kein Prozess greift auf LV's zu
- Platten, auf die migriert werden soll, sind in die VG aufgenommen worden
# lspv -l hdisk11
hdisk11:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT
loglv00 1 1 00..01..00..00..00 N/A
application02LV 161 161 00..106..55..00..00 /usr/app/oracle
# migratepv -l application02LV hdisk11 hdisk19
# migratepv -l loglv00 hdisk11 hdisk19
# lspv -l hdisk11
# lsvg -l application01VG
application01VG:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
loglv00 jfslog 1 2 2 closed/stale N/A
application02LV jfs 161 322 2 closed/syncd /usr/app/oracle
###########
# migratelp
###########
# moving lp from one disk to another
# To move the first logical partitions of logical volume lv00 to hdisk1, type:
migratelp lv00/1 hdisk1
# To move second mirror copy of the third logical partitions of logicalvolume hd
2 to hdisk5, type:
migratelp hd2/3/2 hdisk5
# To move third mirror copy of the 25th logical partitions of logical volume tes
tlv to 100th partition of hdisk7, type:
migratelp testlv/25/3 hdisk7/100
# to move lp from one disk to another
# aufpassen bei lp groesser 1000 --> BEREICH und oneliner anpassen
QUELLDISK=
ZIELDISK=
BEREICH= # 01 oder 02 oder ...
for i in `lslv -m $LVNAME|grep ${QUELLDISK}|grep "^${BEREICH}"|awk '{print $1}'|
cut -c2-4`
do
echo "beginn lpp $i"
nice -n 15 migratelp $LVNAME/${i} $ZIELDISK
done
###################################
# increase the size of a filesystem
###################################
You can increase file system size too, by amount of additional space
chfs -a size=+{[additional space in MB]*1024*2} /fs_name
If "size" begins with a + it is interpreted as a rquest to increase the file
system size by the specified amount ( in 512-bytes block ).
[!]verleihnix:/usr/local/apachessl/template#chfs -a size=+1228800 /var/log/twist
er
Filesystem size changed to 1835008
OR
chfs -a size=$(( number_of_lps * PPSIZE * 2)) /filesystem_name
OR mountpoint aendern
chfs -m neu alt
chfs -m /tmp/Orainstall /mnt/OraInstall
###########
# shrink fs
###########
ab AIX 5.3 - reduziert FSNAME um 1 GB
chfs -a size=-1G /FSNAME
#######################
# move fs to another vg
#######################
1) umount old_fs
2) cplv -v new_vg -y new_lv_name old_lv_name
3) rmlv old_lv_name
4) chlv -n new_lv_name old_lv_name
4a) falls neues lvlog erstellt wurde:
mklv -t jfslog -y jfslog newvg 1 hdiskname
logform /dev/lvlogname
5) chfs -a log=log_of_new_vg old_fs
6) fsck old_fs
7) mount old_fs
step 6) will probably fail because it does not recognize the jfslog
no problem, just mount && umount && fsck then
just a note: cplv will not care about mirroring; you will have to
mirror+sync manually
or
cplv -y<new logical volume name> -v <new vg> sourcelogicalvolume
chfs -a dev=/dev/<new lv name> -a log=<jfslog in new vg> /<filesystem>
mount /<filesystem>
rmlv <sourcelogicalvolume>
#########
# logform
#########
mklv -t jfslog -y jfslog vg_oracle01 1 hdisk1
logform -V jfs /dev/jfslog
mklv -t jfs2log -y jfs2log vg_oracle01 1 hdisk1
logform -V jfs2 /dev/jfs2log
########################
# errlog entry jfs2_full
########################
# calc hex to number
REFERENCED
Detail Data
JFS2 MAJOR/MINOR DEVICE NUMBER
002B 000B
The major/minor numbers (002B 000B) are in hex: hex abcd =
a*16^3+b*16^2+c*16^1+d therefore hex
002B=0*16^3+0*16^2+2*16^1+11=2*16+11
000B=0*16^3+0*16^2+0*16^1+11=11
1=1 2=2 3=3 4=4 5=5 6=6 7=7 8=8 9=9 10=a 11=b 12=c 13=d 14=e 15=f 16=g 17=h 18=i
# find fs
ls -al /dev/* |grep 43|grep 11
# bc
obase=2
90
1011010
obase=16
90
5A
<ctrl+d>
1. 90 converted to bin format
1. 90 converted to hex format
########################
# size of jfs filesystem
########################
The maximum AIX file and filesystem size depends on the kernel type and AIX/JFS
versions. Here are the maximum supported values.
Maximum File/Filesystem Sizes in AIX 23-Jan-04
AIX 4.3 AIX 5.1 AIX 5.2
JFS JFS JFS JFS2 JFS JFS2
AIX Kernel 32/64 32/64 32 Bit 64 Bit 32/64 32 Bit 64 Bit
Maximum Supported
File Size 64 GB 64 GB 1 TB 1 TB 64 GB 1 TB 16 TB
Filesystem Size 1 TB 1 TB 1 TB 1 TB 1 TB 1 TB 16 TB
####################
# superblock failure
####################
The backup superblock can be copied over the primary superblock via one of these
commands:
All versions:
dd count=1 bs=4k skip=31 seek=1 if=/dev/lv00 of=/dev/lv00
For AIX 4.x only:
fsck -p /dev/lv00
Once the copying over is completed, check the integrity of the
file system by is suing:
fsck /dev/lv00
########################
# fsck check automatisch
########################
in /etc/filesystems
check=TRUE
bei filesystem eintragen
##################################
# filesystem einstellungen ansehen
##################################
# lsfs -q /usr/app
Name Nodename Mount Pt VFS Size Options Auto
Accounting
/dev/application02LV -- /usr/app jfs 1310720 rw
no no
(lv size: 1310720, fs size: 1310720, frag size: 4096, nbpi: 4096, compress: no
, bf: true, ag: 64)
##############
# mount groups mountgruppen
##############
add "type = xyz" stanza in /etc/filesystems
chfs -u '<MOUNTNAME>' <FILESYSTEM>
chfs -u 'I03sapdata' /oracle/I03/sapdata17
mount -t xyz to mount filesystems
umount -t xyz to umount filesystems
but
<snip>
One additional note, I think that the groups needed to be added via smit
and not just an editing of the /etc/filesystems file, so that they
became a part of the VGDA
<snip>
#######
# lsjfs
#######
# lsjfs /usr/local
#MountPoint:Device:Vfs:Nodename:Type:Size:Options:AutoMount:Acct:OtherOptions:Lv
Size:FsSize:FragSize:Nbpi:Compress:Bf:AgSize:
/usr/local:/dev/localLV:jfs:::1089536:rw:yes:no::1089536:1089536:4096:4096:no:tr
ue:8:
# lsjfs2
#MountPoint:Device:Vfs:Nodename:Type:Size:Options:AutoMount:Acct:OtherOptions:Lv
Size:FsSize:BlockSize:Sparse:InlineLog:InlineLogSz:
/usr/local:/dev/lvlocal01:jfs2:::1310720:rw:yes:no::1310720:1310720:4096:yes:yes
:6144:
/audit:/dev/lvaudit01:jfs2:::262144:rw:yes:no::262144:262144:4096:yes:yes:2048:
/usr/sap/P03/extern:/dev/lvsappextern:jfs2::P03sapsw:60817408:rw:no:no::60817408
:60817408:4096:yes:yes:65536:
/oracle/P03/sapdata1:/dev/lvsapdatap01:jfs2::P03sapdata:70254592:rw:no:no::70254
592:70254592:4096:yes:yes:65536:
/oracle/P03/sapdata2:/dev/lvsapdatap02:jfs2::P03sapdata:70254592:rw:no:no::70254
592:70254592:4096:yes:yes:65536:
/oracle/P03/sapdata3:/dev/lvsapdatap03:jfs2::P03sapdata:70254592:rw:no:no::70254
592:70254592:4096:yes:yes:65536:
/oracle/P03/sapdata4:/dev/lvsapdatap04:jfs2::P03sapdata:70254592:rw:no:no::70254
592:70254592:4096:yes:yes:65536:
/oracle/P03/sapdata5:/dev/lvsapdatap05:jfs2::P03sapdata:70254592:rw:no:no::70254
########################################
# find out which terminal type is on tty
########################################
ts5:/usr/local/lib !# /usr/sbin/lsattr -Eltty2 -a term
term vt100 TERMINAL type True
####################
# find out big files
####################
find /home -xdev -ls 2>/dev/null| sort +6 -nr | head -20
###########################
# performancetest ueber ftp
###########################
ftp> put "|dd if=/dev/zero bs=32k count=10000" /dev/null
200 PORT command successful.
150 Opening data connection for /dev/null.
10000+0 records in.
10000+0 records out.
226 Transfer complete.
327680000 bytes sent in 385.3 seconds (830.6 Kbytes/s)
local: |dd if=/dev/zero bs=32k count=10000 remote: /dev/null
oder
ftp> put "|dd if=/dev/zero bs=1k count=1000000" /dev/null
200 PORT command successful.
150 Opening data connection for /dev/null.
1000000+0 records in.
1000000+0 records out.
226 Transfer complete.
1024000000 bytes sent in 49.25 seconds (2.031e+04 Kbytes/s)
local: |dd if=/dev/zero bs=1k count=1000000 remote: /dev/null
oder
Allgemeiner perfomancecheck AIX
http://techsupport.services.ibm.com/cgi-bin/support/rs6000.support/techbrowse/tb
gaus?gaus_mode=8&documents=090605198014824&database=aix
#############
# tape haengt
#############
diag -cd /dev/rmt0
tctl -f /dev/rmt0 offline
##########################
# blocksize festellen tape
##########################
dd if=/dev/rmtxx bs=128k count=1 | wc -c
oder
tcopy /dev/rmtxx
<snip>
root@cws [~]#whichlpp tcopy
lppname: bos.rte.archive
location: /usr/bin/tcopy
<snip>
###########################
# trace a program under aix
###########################
You probably want the
-trace &
-trcon
-trcoff
-trcrpt
commands. More info in the manpages.
#trace
> !my_cmd
> quit
# trcrpt >/tmp/my_cmd.out
####################
# showmount-commands
####################
display exports of a machine
# showmount -e colonia
export list for colonia:
/spdata/sys1/install/pssplpp (everyone)
/spdata/sys1/install/images colon01,colon05,colon7,colon09,colon11,
colon17,colon19
/spdata/sys1/install/aix433006/lppsource (everyone)
/cdrom colon01,colon05,colon07,colon09,colon11
,colon17,colon19
display mounted dirs on server
# showmount -a
host1.xyz.de:/usr/sap/trans
host2.xyz.de:/usr/sap/trans
host3.xyz.de:/usr/sap/trans
host4.xyz.de:/usr/sap/trans
########
# cfgmgr
########
cfgmgr -i --> will install any required missing filesets (insert the AIX Cd in t
he drive)
cfgmgr -vi . --> will install from actual dir
#################
# RAN Adapter ran
#################
config des adapters
# smitty cxpasync
# lsdev -C|grep cxp
cxpa0 Available 04-01 IBM 128-Port Async (PCI) Adapter
# lsdev -C|grep 04-01
cxpa0 Available 04-01 IBM 128-Port Async (PCI) Adapter
sa2 Available 04-01-22 16-Port Enhanced RAN EIA-232 for 128-Port Adap
ter
tty1 Available 04-01-22-00 Asynchronous Terminal
Definition neues TTY in Terminalserver:
# -->maschine-port
-w = Port auf dem RAN-Adapter
-p = TTY-Anschluss an dem der RAN konfiguriert ist (s.o.)
# mkdev -c tty -t 'tty' -s 'rs232' -p 'sa2' -w '0' -a login='enable'
# -->fastt-port
# mkdev -c tty -t 'tty' -s 'rs232' -p 'sa2' -w '4' -a login='enable' -a speed='
19200'
Verzeichnen der tty to hostname-Map in /var/adm/ts/ran.list
Aufruf durch
/var/adm/ts/ran <HOSTNAME>
Monitor Async Adapters
# smitty cxpasync
##############
# kill signals
##############
The file /usr/include/sys/signal.h has the signal info and some
usage clues. You can get a full list of signal names by "kill -l":
sp4:/ # kill -l
1) HUP 14) ALRM 27) MSG 40) bad trap 53) bad trap
2) INT 15) TERM 28) WINCH 41) bad trap 54) bad trap
3) QUIT 16) URG 29) PWR 42) bad trap 55) bad trap
4) ILL 17) STOP 30) USR1 43) bad trap 56) bad trap
5) TRAP 18) TSTP 31) USR2 44) bad trap 57) bad trap
6) ABRT 19) CONT 32) PROF 45) bad trap 58) bad trap
7) EMT 20) CHLD 33) DANGER 46) bad trap 59) bad trap
8) FPE 21) TTIN 34) VTALRM 47) bad trap 60) GRANT
9) KILL 22) TTOU 35) MIGRATE 48) bad trap 61) RETRACT
10) BUS 23) IO 36) PRE 49) bad trap 62) SOUND
11) SEGV 24) XCPU 37) bad trap 50) bad trap 63) SAK
12) SYS 25) XFSZ 38) bad trap 51) bad trap
13) PIPE 26) bad trap 39) bad trap 52) bad trap
##########
# errclear
##########
1. To delete all entries from the error log, enter:
errclear 0
2. To delete all entries in the error log classified as software errors,
enter:
errclear -d S 0
3. To clear all entries from the alternate error-log file
/var/adm/ras/errlog.alternate, enter:
errclear -i /var/adm/ras/errlog.alternate 0
4. To clear all hardware entries from the alternate error-log file
/var/adm/ras/errlog.alternate, enter:
errclear -i /var/adm/ras/errlog.alternate -d H 0
##################
# viewing bootlogs
##################
alog -f /var/adm/ras/bootlog -o
alog -t boot -o
#############
# console log
#############
alog -t console -o
#################
# last reboot was
#################
root@cws [~]# who -b
. system boot 17 Jan 11:08
#####################################
# genkex shows used kernel extensions
#####################################
aixinstall2:/#genkex
Virtual Address Size File
11db7d0 35d0 /usr/lib/drivers/mceh
11d7640 4188 /usr/lib/drivers/bpf
4f87000 741c8 /usr/lib/drivers/nfs.ext
5009000 534 /unix
11d72e8 348 /usr/lib/drivers/nfs_kdes.ext
4f69000 518 /unix
11d70f8 1e8 /usr/lib/drivers/smt_loadpin
11d2600 4af0 /usr/lib/drivers/smt_load
4f5b000 518 /unix
11c4da0 d854 /etc/drivers/ptydd
4f40000 4d8 /unix
11c0720 465c /usr/lib/drivers/if_en
4d97000 4d4 /unix
4d98000 15d264 /usr/lib/drivers/netinet
4f03000 4d4 /unix
11adee0 12828 /etc/drivers/ldterm
##############
# kernel procs
##############
Kproc name Explanation
swapper does priority calculations/aging of cpu usage - runs at fixed pr
i of 16. Wakes up once per second.
wait (idle process) - runs at fixed pri of 127 One per CPU. Runs when
no other thread needs to run.
netm runs at fixed pri of 36 Used to free network memory back to the
VMM - runs when highwater marks for mbufs/clusters are reached.
gil "Global ISR List" ISR->Interrupt Service Routines - multithreade
d kproc runs at fixed pri of 37 Used to process various timers (tcp, streams, ..
..) and also used to pass packets from demux layer to IP layer for non-CDLI driv
ers.
lvmb/lvmbb (disk/lvm) - runs at floating pri of 60 Used to get bad block st
ructures - used in bad block relocations.
jfsc (filesystem compression) - decompresses/compresses JFS data on c
ompressed filesystems. Runs at fixed priority of 30.
rtcm/rtcmd (RPC transport connection manager) - used by NFS kernel extensio
n. Runs at floating priority of 60.
kbio/kbiod (nfs biod thread) - runs at floating priority of 60. Works just
like a biod process.
lrud least recently used daemon Only on SMP systems. Does VMM page re
placement when number of free frames reaches 'minfree'. Runs at fixed pri of 16.
aio/aioserver Asynchronous I/O servers. Used to take AIO requests from a queue
and send it to the device. Used mainly with JFS files, but could be used for LV
M or VSD if fastpath is disabled. Runs at fixed priority of 39.
PM Power Management kproc. Used to monitor and wake up devices that
have been hibernated. Runs at floating pri of 60.
############
# smtctl smt
############
/usr/sbin/smtctl (shows SMT on or off)
#####################
# bosdebug ausstellen
#####################
# bosdebug -o
Memory debugger off
Memory sizes 0
Network memory sizes 0
Kernel debugger off
Real Time Kernel off
# bosboot -ad /dev/ipldevice
bosboot: Boot image is 8205 512 byte blocks.
#####################
# bosdebug einstellen
#####################
# bosdebug -M
Memory debugger on
Memory sizes 0
Network memory sizes 0
Kernel debugger off
Real Time Kernel off
# bosboot -ad /dev/ipldevice
bosboot: Boot image is 8205 512 byte blocks.
############
# ipl_varyon
############
ipl_varyon -i hdisk0
root@xcws01 /tftpboot> ipl_varyon -i hdisk0
application01VG:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk11 active 542 158 34..00..00..15..109
hdisk12 active 542 130 18..00..00..03..109
==============================================================================
INSTALLED RESOURCE LIST
The following resources are installed on the machine.
+/- = Added or deleted from Resource List.
* = Diagnostic support not available.
Model Architecture: chrp
Model Implementation: Multiple Processor, PCI bus
+ sys0 00-00 System Object
+ sysplanar0 00-00 System Planar
+ mem0 00-00 Memory
+ proc0 00-00 Processor
+ L2cache0 00-00 L2 Cache
* pmc0 00-00 Power Management Controller
+ proc1 00-01 Processor
+ proc2 00-02 Processor
+ proc3 00-03 Processor
+ css0 00-f1000000 SP Switch Communications Adapter
(Check MX Type)
* pci1 00-fed00000 PCI Bus
+ ent1 20-58 IBM 10/100 Mbps Ethernet PCI Adapter
(23100020)
+ atm0 20-70 IBM PCI 155 Mbps ATM Adapter
(14107c00)
* pci2 20-78 PCI Bus
* pci0 00-fef00000 PCI Bus
* isa0 10-58 ISA Bus
+ fda0 01-D1 Standard I/O Diskette Adapter
* siokma0 01-K1 Keyboard/Mouse Adapter
+ sioka0 01-K1-00 Keyboard Adapter
+ sioma0 01-K1-01 Mouse Adapter
+ sa0 01-S1 Standard I/O Serial Port
+ tty0 01-S1-00-00 Asynchronous Terminal
+ sa1 01-S2 Standard I/O Serial Port
+ scsi0 10-60 Wide SCSI I/O Controller
+ hdisk0 10-60-00-0,0 16 Bit SCSI Disk Drive (4500 MB)
+ hdisk1 10-60-00-1,0 16 Bit SCSI Disk Drive (4500 MB)
+ ssa1 10-68 IBM SSA Enhanced RAID Adapter
(14104500)
+ ssa0 10-70 IBM SSA Enhanced RAID Adapter
(14104500)
+ ent0 10-80 IBM PCI Ethernet Adapter (22100020)
* hdisk2 10-70-L SSA Logical Disk Drive
* hdisk3 10-70-L SSA Logical Disk Drive
* hdisk4 10-70-L SSA Logical Disk Drive
* hdisk5 10-70-L SSA Logical Disk Drive
* hdisk6 10-70-L SSA Logical Disk Drive
* hdisk7 10-70-L SSA Logical Disk Drive
* hdisk8 10-70-L SSA Logical Disk Drive
* hdisk9 10-70-L SSA Logical Disk Drive
* hdisk10 10-70-L SSA Logical Disk Drive
* hdisk11 10-70-L SSA Logical Disk Drive
* hdisk12 10-70-L SSA Logical Disk Drive
* hdisk13 10-70-L SSA Logical Disk Drive
* hdisk14 10-70-L SSA Logical Disk Drive
* hdisk15 10-70-L SSA Logical Disk Drive
* hdisk16 10-70-L SSA Logical Disk Drive
* hdisk17 10-70-L SSA Logical Disk Drive
+ pdisk0 10-70-P 9.1GB SSA C Physical Disk Drive
+ pdisk1 10-70-P 9.1GB SSA C Physical Disk Drive
+ pdisk2 10-70-P 9.1GB SSA C Physical Disk Drive
+ pdisk3 10-70-P 9.1GB SSA C Physical Disk Drive
+ pdisk4 10-70-P 9.1GB SSA C Physical Disk Drive
+ pdisk5 10-70-P 9.1GB SSA C Physical Disk Drive
+ pdisk6 10-70-P 9.1GB SSA C Physical Disk Drive
+ pdisk7 10-70-P 9.1GB SSA C Physical Disk Drive
+ pdisk8 10-70-P 9.1GB SSA C Physical Disk Drive
+ pdisk9 10-70-P 9.1GB SSA C Physical Disk Drive
+ pdisk10 10-70-P 9.1GB SSA C Physical Disk Drive
+ pdisk11 10-70-P 9.1GB SSA C Physical Disk Drive
+ pdisk12 10-70-P 9.1GB SSA C Physical Disk Drive
+ pdisk13 10-70-P 9.1GB SSA C Physical Disk Drive
+ pdisk14 10-70-P 9.1GB SSA C Physical Disk Drive
+ pdisk15 10-70-P 9.1GB SSA C Physical Disk Drive
################
# list pci-slots
################
Only in hotplugable-Machines!
$ lsslot -c pci
# Slot Description Device(s)
U0.1-P1-I1 PCI 64 bit, 66MHz, 3.3 volt slot ssa0
U0.1-P1-I2 PCI 64 bit, 66MHz, 3.3 volt slot ent0
U0.1-P1-I3 PCI 64 bit, 66MHz, 3.3 volt slot Empty
U0.1-P1-I4 PCI 64 bit, 66MHz, 3.3 volt slot Empty
U0.1-P1-I5 PCI 64 bit, 66MHz, 3.3 volt slot ssa1
U0.1-P1-I6 PCI 32 bit, 33MHz, 5 volt slot Empty
U0.1-P1-I7 PCI 32 bit, 33MHz, 5 volt slot Empty
U0.1-P1-I8 PCI 64 bit, 66MHz, 3.3 volt slot Empty
U0.1-P1-I9 PCI 64 bit, 66MHz, 3.3 volt slot Empty
U0.1-P1-I10 PCI 64 bit, 66MHz, 3.3 volt slot ent1
U0.1-P1-I11 PCI 32 bit, 33MHz, 5 volt slot Empty
U0.1-P1-I12 PCI 32 bit, 33MHz, 5 volt slot Empty
U0.1-P1-I13 PCI 64 bit, 66MHz, 3.3 volt slot Empty
U0.1-P1-I14 PCI 64 bit, 66MHz, 3.3 volt slot Empty
###################
# Microcode lsmcode
###################
vor ML08
lscfg -vp | grep -i alter
nach ML08
lsmcode -A
DISPLAY MICROCODE LEVEL 802811
IBM,9076-WCN
System Firmware level is L00278
Service Processor level is wc000901
Use Enter to continue.
lscfg -vp |grep ROM
# AIX 5.3 TL 7
lsmcode -A
sys0!system:EM340_041 (t) EM340_041 (p) EM340_041 (t)
sissas0!53495320.02200070
ent2!14104003.EP0170
ent3!14104003.EP0170
ent4!14104003.EP0170
ent5!14104003.EP0170
fcs0!df1000fe-0002.271102
fcs1!df1000fe-0002.271102
fcs2!df1000fe-0002.271102
fcs3!df1000fe-0002.271102
hdisk0!HUS1530.A1700D13.41343234
hdisk1!HUS1530.A1700D13.41343234
ses1!A170027B.0021
ses2!A170027B.0021
cd0!IBM-DROM0020581.DA33
###########################################
# Gelbes Front LED auf p640 normal schalten
###########################################
/usr/lpp/diagnostics/bin/usysfault -s normal
oder
diag
Task Selection Menue
Log Repair Action
######
# diag
######
certify media
diag -c -d deviceName -T "certify"
diag -c -d hdisk0 -T "certify"
display microcode of device
diag -c -d device -T "disp_mcode"
device could be sys0, hdisk0,...
# temperatur
1. Display a list of the environmental sensors:
/usr/lpp/diagnostics/bin/uesensor -l
Sensor = Fan Speed
Status = Normal
Value = 2436 RPM
Location Code = F1
Sensor = Power Supply
Status = Normal
Value = Present and operational
Location Code = V1
Sensor = Power Supply
Status = Critical low
Value = Present and not operational
Location Code = V2
2. Display a list of the environmental sensors in a numerical list:
/usr/lpp/diagnostics/bin/uesensor -a
3 0 11 87 P1
9001 0 11 2345 F1
9004 0 11 2 V1
9004 1 9 2 V2
#########
# diagrpt
#########
/usr/lpp/diagnostics/bin/diagrpt
-o Displays the last diagnostic results file stored in the /etc/lpp/diagnostics/
data directory.
-s mmddyy Displays all diagnostic result files logged since the date specified.
-a Displays the long version of the Diagnostic Event Log.
-r Displays the short version of the Diagnostic Event Log.
################
# showled befehl
################
/usr/lib/methods/showled ID
/usr/lib/methods/showled --> resetted anzeige
###############
# PS? als datum
###############
tgdvkho1@tvgicsc1 404# typeset -RZ2 _x1 _x2 _x3
tgdvkho1@tvgicsc1 405# let SECONDS=$(date '+3600*%H+60*%M+%S')
tgdvkho1@tvgicsc1 406#
_s='(_x1=(SECONDS/3600)%24)==(_x2=(SECONDS/60)%60)==(_x3=SECONDS%60)'
tgdvkho1@tvgicsc1 407# TIME='"${_d[_s]}$_x1:$_x2:$_x3"'
tgdvkho1@tvgicsc1 408# export PS1=${TIME}
19:11:56
#######
# xargs
#######
Instead of : /usr/bin/file *
Use : ls | /usr/bin/xargs /usr/bin/file
ls . | xargs -i -t cp ./{} /export/lpp_source/lpp5300/RPMS/ppc
##############################
# errpt - errorreporter update
##############################
Vermeidung Eintrage im Errorreporter AIX:
# cat kutest
<snip>
=DADF69E4:
Report = False
Log = True
0 entries added.
0 entries deleted.
1 entries updated.
<snip>
# errupdate kutest
# cat umstellung_errorreporter_tape_clean.txt
<snip>
=D1A1AE6F:
Report = False
Log = False
=E507DCF9:
Report = False
Log = False
<snip>
# errupdate umstellung_errorreporter_tape_clean.txt
################################
# Testen, ob errlog funktioniert
################################
errlogger test
errpt |more --> Pruefen ob neuer Eintrag generiert wurde
###############################
# print out all possible errors
###############################
errpt -t
##################################
# recreating errlog if errpt fails
##################################
For future convience reasons with this procedure it would be a good idea to add
the following line to your "/.profile" file.
export PATH=$PATH:/usr/lib/
The default AIX errpt, log file is located in: "/var/adm/ras/errlog" to confirm
this enter the following command:
# /usr/lib/errdemon -l <ENTER>
Error Log Attributes
--------------------------------------------
Log File /var/adm/ras/errlog
Log Size 1048576 bytes
Memory Buffer Size 8192 bytes
To change the AIX errpt log name, type in the following:
# /usr/lib/errdemon -i /tmp/newlogfile <ENTER>
#
Now verify your changes by once again typing in:
# /usr/lib/errdemon -l <ENTER>
Error Log Attributes
--------------------------------------------
Log File /tmp/newlogfile
Log Size 1048576 bytes
Memory Buffer Size 8192 bytes
To stop the AIX errpt daemon, type in the following to find out it's Unix PID:
# ps -ef | grep -i err <ENTER>
Kill the process
# kill -9 PID_NUMBER <ENTER>
Now no errors will be appended to the AIX error log "errpt" while this daemon is
not running. To restart the AIX errpt daemon, type in the following:
# /usr/lib/errdemon <ENTER>
#############################
# logger - produce logentries
#############################
root@16-gd2vb6 140# grep -v ^# /etc/syslog.conf
daemon.notice /var/adm/SPlogs/SPdaemon.log
*.emerg;*.alert;*.crit;*.err;*.warning;*.notice;*.info /tmp/.tivoli/.tecad_logf
ile.fifo.gd2vb6.default
local4.debug /var/adm/ipsec.log
root@16-gd2vb6 136# logger -p daemon.notice bla
root@16-gd2vb6 137# logger -p local4.debug test
root@16-gd2vb6 138# tail -1 /var/adm/SPlogs/SPdaemon.log
Aug 5 12:45:57 gd2vb6 root: bla
root@16-gd2vb6 139# tail -1 /var/adm/ipsec.log
Aug 5 12:46:06 gd2vb6 root: test
######################
# syslog daemon remote
######################
Step 1 - On each client, edit /etc/syslog.conf to add an entry like this:
mark.debug;*.info @syslogserver
Make sure syslogserver resolves and is pingable. (This is covered in the man pag
e for syslog.conf, under "destination".)
Step 2 - Restart syslogd and make sure it starts without the -R option (lowercas
e r is ok). The man page says the -R option disables the ability to recieve. I'v
e discovered it also disables the ability to send across the network.
##################
# corefile analyse
##################
Herausfinden welches Program den core verursachte:
# lquerypv -h core 6b0 64
000006B0 7FFFFFFF FFFFFFFF 7FFFFFFF FFFFFFFF |................|
000006C0 7FFFFFFF FFFFFFFF 7FFFFFFF FFFFFFFF |................|
000006D0 00120000 1506DF90 00000000 00000013 |................|
000006E0 6F726163 6C650000 00000000 00000000 |oracle..........|
000006F0 00000000 00000000 00000000 00000000 |................|
00000700 00000000 00000000 00000000 0000FF6C |...............l|
00000710 00000000 00001091 00000000 0000FF25 |...............%|
Analyse mit:
dbx PFAD/PROGRAMM core-file
####################
# logical track size
####################
ermitteln:
/usr/sbin/lquerypv -M hdisk0
aendern:
/usr/bin/chvg -L256 vgname
#######
# xtalk
#######
x25 check
xtalk -s -l IBMXTALK
#####################
# x25 starten stoppen
#####################
Vorher rvs runterfahren!
rmdev -l x25s0
#rmdev -l xs0 # nur fuer ISDN
rmdev -l sx25a0
mkdev -l sx25a0
#mkdev -l xs0 # nur fuer ISDN
mkdev -l x25s0
x25status
######
# scsi
######
check scsi-bus
You can run
cfgmgr -v -l scsi1
to scan the buses on the scsi1 adapter and display the progess.
# cfgmgr -v -l scsi3
----------------
attempting to configure device 'scsi3'
Time: 0 LEDS: 0x2e6
invoking /usr/lib/methods/cfgncr_scsi -l scsi3
Number of running methods: 1
----------------
Completed method for: scsi3, Elapsed time = 8
return code = 0
****************** no stdout ***********
****************** no stderr ***********
----------------
Time: 8 LEDS: 0x539
Number of running methods: 0
----------------
calling savebase
return code = 0
****************** no stdout ***********
****************** no stderr ***********
Configuration time: 8 seconds
######################
# scsi-id herausfinden
######################
lsdev -Cc disk -H
<snip>
root@node1_i [~]#lsdev -Cc disk -H
name status location description
hdisk0 Available 00-08-00-0,0 2.2 GB SCSI Disk Drive
hdisk1 Available 00-08-00-1,0 2.2 GB SCSI Disk Drive
hdisk2 Available 00-13-L SSA Logical Disk Drive
hdisk3 Available 00-13-L SSA Logical Disk Drive
hdisk4 Available 00-13-L SSA Logical Disk Drive
hdisk5 Available 00-13-L SSA Logical Disk Drive
hdisk6 Available 00-13-L SSA Logical Disk Drive
hdisk7 Available 00-13-L SSA Logical Disk Drive
<snip>
1,0 ist scsi-id fuer hdisk1
##################
# changing scsi-id
##################
chdev -l 'scsi0' -a id='6' '-P'
on your SCSI board to change default ID from 7 to 6.
Look for correct SCSI name (here scsi0). Look also the option -P to do
changes on database only, cos this will require a reboot to take efect,
specially if you got only one SCSI controller or can't offline the controller.
######
# lsof
######
lsof -i:80
--> gets all open connections to http
########################################
# check which process is using a library
########################################
# /usr/bin/genld -l
##########
# CD Eject
##########
/usr/lpp/bosinst/cdeject /dev/cd0
##########
# timezone
##########
in /etc/environment
TZ=MEZ-1MSZ-2,M3.5.0/02:00:00,M10.5.0/03:00:00
oder
TZ=DFT-1DFT,M3.5.0,M10.5.0
##########
# lqueryvg
##########
node1:/> lqueryvg -Avtp hdisk10
Max LVs: 256
PP Size: 24
Free PPs: 1243
LV count: 4
PV count: 8
Total VGDAs: 8
Conc Allowed 0
MAX PPs per 1016
MAX PVs: 32
Conc Autovar 0
Varied on Co 0
Logical: 000001307f545bdf.1 mdbLV 1
000001307f545bdf.2 loglv00 1
000001307f545bdf.3 mdb01LV 1
000001307f545bdf.4 mdb02LV 1
Physical: 00000130acf95e16 1 0
00000130acf96704 1 0
00000130acf9475b 1 0
00000130acf98196 1 0
0000046683575106 1 0
00000130f3307a28 1 0
00000130a0e746a3 1 0
00000047859d43e4 1 0
VGid: 000001307f545bdf
Total PPs: 2144
node1:/usr/local> lqueryvg -g `getlvodm -v mdbVG` -At -p hdisk4
Max LVs: 256
PP Size: 24
Free PPs: 707
LV count: 4
PV count: 6
Total VGDAs: 6
Conc Allowed 16
MAX PPs per 1016
MAX PVs: 32
Conc Autovar 0
Varied on Co 0
Logical: 000001307f545bdf.1 mdbLV 1
000001307f545bdf.2 loglv00 1
000001307f545bdf.3 mdb01LV 1
000001307f545bdf.4 mdb02LV 1
Physical: 00000130acf95e16 1 0
00000130acf96704 1 0
00000130acf9475b 1 0
00000130acf98196 1 0
0000046683575106 1 0
00000130a0e746a3 1 0
Total PPs: 1608
#######################
# software installation
#######################
Voraussetzung .toc-datei
cws:/spdata/sys1/install/hacmp> installp -ld .|more
Fileset Name Level I/U Q Content
====================================================================
cluster.adt.es.client.demos 4.4.1.0 I N usr
# ES Client Demos
installp
Installs available software products in a compatible installation package.
Table 45. Commonly used flags of the installp command
Flag Description
-ac commit
-g includes requisites
-N overrides saving of existing files
-q quiet mode
-w does not place a wildcard at end of fileset name
-X attempts to expand file system size if needed
-d input device
-l list of installable filesets
-c commit an applied fileset
-C clean up after an failed installation
-u uninstall
-r reject an applied filset
-p preview of installation
-e define an installation log
-F forced overwrite of same or newer version
##################
# installp package
##################
root@cws [/usr/local/src]#installp -acXd. freeware.aix.tools.rte
...
Installation Summary
--------------------
Name Level Part Event Result
-------------------------------------------------------------------------------
freeware.aix.tools.rte 1.5.4.0 USR APPLY SUCCESS
################
# install_commit
################
# preview
/usr/lib/instl/sm_inst installp_cmd -c -f'all' '-p' '-g' '-X'
# do
/usr/lib/instl/sm_inst installp_cmd -c -f'all' '-g' '-X'
or
/usr/lib/instl/sm_inst installp_cmd -a -Q -d '.' -f 'bos.adt.libm' '-c' '-N' '-
g' '-X' '-G' '-Y'
########################
# list software on media
########################
installp -ld . (aktuelles vz + .toc-file vorhanden)
#####################
# list fixes on media
#####################
/usr/lib/instl/sm_inst instfix_list -d '.' >README
####################
# uninstall software
####################
/usr/lib/instl/sm_inst installp_cmd -u -f'IMNSearch.rte.httpdlite' '-g'
oder
/usr/lib/instl/sm_inst installp_cmd -u -f'openssh.base.client openssh.base.serve
r'
###################
# list dependencies
###################
lslpp -d <PACKAGE>
# lslpp -d
rsct.compat.clients.hacmp
Fileset Dependents
----------------------------------------------------------------------------
<Fileset> is a requisite of <Dependents>
Path: /usr/lib/objrepos
rsct.compat.clients.hacmp 2.2.1.0
rsct.compat.clients.rte 2.2.1.0
for i in `lslpp -l|grep -v Path|grep -v Fileset|awk '{print $1}'`
do
lslpp -d $i
done
###################################
# list when was a package installed
###################################
# lslpp -ha bos.mp
Fileset Level Action Status Date Time
----------------------------------------------------------------------------
Path: /usr/lib/objrepos
bos.mp
5.3.0.50 COMMIT COMPLETE 05/02/07 22:27:42
5.3.0.50 APPLY COMPLETE 05/02/07 22:27:42
Path: /etc/objrepos
bos.mp
5.3.0.50 COMMIT COMPLETE 05/02/07 22:27:44
5.3.0.50 APPLY COMPLETE 05/02/07 22:27:44
###################################################
# list packages that could be committed or rejected
###################################################
installp -s
##############
# restore look
##############
restore -qTvf packagename.bff
<snip>
cws:/spdata/sys1/install/kutest> /cluster.adt.es.4.4.1.0.I ./lppname <
New volume on ../hacmp/cluster.adt.es.4.4.1.0.I:
Cluster size is 51200 bytes (100 blocks).
The volume number is 1.
The backup date is: Do 7 Jun 21:36:10 2001
Files are backed up by name.
The user is BUILD.
0 ./
4422 ./lpp_name
0 ./usr
0 ./usr/lpp
0 ./usr/lpp/cluster.adt.es
144968 ./usr/lpp/cluster.adt.es/liblpp.a
0 ./usr/es
0 ./usr/es/include
0 ./usr/es/include/cluster
3740 ./usr/es/include/cluster/ast.h
<snip>
############
# restore do
############
restore -xvqf ../DBI-1.19.0.0.bff
##################
# alt_disk_install
##################
!!! NEVER ISSUE exportvg altinst_rootvg !!!
# lspv
hdisk0 000c91ade17a26ab rootvg
hdisk1 000c91ad9ae45533 None
hdisk2 000c91ad9aebadac None
# clone rootvg with
alt_disk_install -C hdisk2
<snip>
Calling mkszfile to create new /image.data file.
Checking disk sizes.
Creating cloned rootvg volume group and associated logical volumes.
Creating logical volume alt_hd5.
Creating logical volume alt_hd6.
Creating logical volume alt_hd8.
Creating logical volume alt_hd4.
Creating logical volume alt_hd2.
Creating logical volume alt_hd9var.
Creating logical volume alt_hd3.
Creating logical volume alt_hd1.
Creating logical volume alt_hd10opt.
Creating /alt_inst/ file system.
Creating /alt_inst/home file system.
Creating /alt_inst/opt file system.
Creating /alt_inst/tmp file system.
Creating /alt_inst/usr file system.
Creating /alt_inst/var file system.
Generating a list of files
for backup and restore into the alternate file system...
Backing-up the rootvg files and restoring them to the alternate file system...
Modifying ODM on cloned disk.
Building boot image on cloned disk.
forced unmount of /alt_inst/var
forced unmount of /alt_inst/usr
forced unmount of /alt_inst/tmp
forced unmount of /alt_inst/opt
forced unmount of /alt_inst/home
forced unmount of /alt_inst
Changing logical volume names in volume group descriptor area.
Fixing LV control blocks...
Fixing file system superblocks...
Bootlist is set to the boot disk: hdisk2
<snip>
# lspv
hdisk0 000c91ade17a26ab rootvg
hdisk1 000c91ad9ae45533 None
hdisk2 000c91ad9aebadac altinst_rootvg
bootlist -m normal hdisk2
shutdown -Fr
nach reboot
# lspv
hdisk0 000c91ade17a26ab old_rootvg
hdisk1 000c91ad9ae45533 None
hdisk2 000c91ad9aebadac rootvg
# To delete the old_rootvg volume group
alt_disk_install -X old_rootvg
# applying patches and clone rootvg to another disk
alt_disk_install -C -F IY24217 -l /mnt hdisk2
alt_disk_install -C -b update_all -l /vz_vom_ML hdisk_name
# wake up altinst_rootvg to modify files
alt_disk_install -W hdisk2
Now you can modify under /alt_inst/etc/resolv.conf eg.
# suspend altinst_rootvg
alt_disk_install -S
# Determine Volume Group Boot Disk:
alt_disk_install -q disk
# Rename Alternate Disk Volume Group:
alt_disk_install -v new_volume_group_name disk
# Wake-up Volume Group:
alt_disk_install -W disk
# new in aix 5.3
alt_disk_copy - To copy rootvg to Alternate Disk
alt_disk_mksysb - Installs an alternate disk with a mksysb install base install
image
alt_rootvg_op - Performs operations on existing alternate rootvg volume groups
# cloning
To clone the running rootvg to hdisk3 and hdisk4, and execute update_all on all
updates from /updates do:
alt_disk_copy -d "hdisk3 hdisk4" -b update_all -l /updates
###################
# aliases unter aix
###################
alias dmesg='alog -f /var/adm/ras/conslog -o'
alias df='/usr/bin/df -k'
alias l='/usr/bin/ls'
alias ll='/usr/bin/ls -ltr'
alias m='/usr/bin/more'
alias psf='ps -ef|grep '
alias slog='tail -f /var/adm/messages'
#######
# fuser
#######
fuser -x -c /vz
root@cws [/tmp]#fuser -x -c /tmp
/tmp: 2132 10624 14716 32550c
oder
fuser -dVu /dev/lvname
#################
# network options
#################
list
no -a
set
no -o
#################
# crontab entries
#################
minute(0-59) hour(0-23) day(1-31) month(1-12) weekday(0-6 with 0=Sunday)
0 10 1 12 0 /something/to/do
will execute on 01.12 at 10:00 if the day is a Sunday
##########
# xwindows
##########
running exceed
<snip>
You need to turn off reverse name resolution. Change the exec line in
/etc/inetd.conf to.
exec stream tcp6 nowait root /usr/sbin/rexecd rexecd -c
restart your inetd daemon with
refresh -s inetd
<snip>
###########################################
# loeschen der letzten 4 zeilen einer datei
###########################################
wc -l inputfile | awk '{x=$1-4; print x}' | xargs -i sed '{},$d' inputfile
oder
tac /etc/passwd | sed '1,4d' | tac
'tac' is the reverse of 'cat' and is found in GNU textutils on the
freeware collection.
##################
# convert dos2unix
##################
1) If you have VIM, you can edit the file and enter "set fileformat=unix"
and then write quit the file.
2) If you have perl, you can: cat file | perl -pe ";"
or from within VIM as: :%!perl -pe ";"
or
dos2unix
##################
# convert unix2dos
##################
if you have VIM, you can edit the file and enter "set fileformat=dos"
and then write quit the file.
or
unix2dos
####
# vi
####
nicht sichtbare zeichen anzeigen
set list
#################
# workloadmanager
#################
http://publib16.boulder.ibm.com/pseries/en_US/aixbman/admnconc/wlm_concepts.htm#
wlm_concepts
start
wlmcntrl -a
stop
wlmcntrl -o
check running
wlmcntrl -q
root@cws [~]# wlmcntrl -q
WLM is stopped
################
# location codes
################
Network interfaces and protocols 25 AIX location codes In the following, the AIX
location codes are described for the purpose of identifying the location of net
work adapters on your system. The AIX location code is a way of identifying phys
ical devices. The actual location code values vary among the different server ar
chitecture types such as MCA, PCI RSPC, and PCI CHRP, but the same format is use
d. The location code consists of up to four fields of information depending on t
he type of device. The basic formats of the AIX location codes are:
AB-CD-EF-GH For planars, adapters and any non-SCSI devices
AB-CD-EF-G,H For SCSI devices/drives
For planars, adapter cards, and non-SCSI devices, the location code is defined
as:
- AB The AB value identifies a bus type or PCI parent bus as assigned by the fir
mware.
- CD The CD value identifies adapter number, adapter's devfunc number or physica
l location. The devfunc number is defined as the PCI device number times 8 plus
the function number.
- EF The EF value identifies the connector
- ID used to identify the adapter sconnector that a resource is attached to.
- GH Identifies a port, address, device, or field replaceable unit (FRU).
Adapters such as network adapters and network cards are identified with just AB-
CD.
The possible values for AB are:
00 Processor bus
01 ISA bus
02 EISA bus
03 MCA bus
04 PCI bus (used in the case where the PCI bus cannot be identified)
05 PCMCIA buses xy For PCI adapters where x is equal to or greater than 1. The x
and y are characters in the range of 0-9, A-H, J-N, P-Z (O, I, and lowercase ar
e omitted) and are equal to the parent bus's ibm, aix-loc Open Firmware Property
.
The possible values for CD depend on the adapter/card:
- PCI adapters/cards CD is the device's devfunc number. The C and D are characte
rs in the range of hexadecimal numbers 0-F.
- Pluggable ISA adapters CD is equal to the order the ISA cards are defined/conf
igured either by SMIT or the ISA Adapter Configuration Service Aid.
- Integrated ISA adapters CD is equal to a unique code identifying the ISA
adapter. In most cases this is equal to the adapter's physical location code.
In cases where a physical location code is not available, CD will be FF.
node5:/> lsdev -Cc adapter | grep ent
ent0 Available 00-11 Ethernet High-Performance LAN Adapter (8ef5)
ent1 Available 00-16 IBM 10/100 Mbps Ethernet TX MCA Adapter (8f62)
ent2 Available 00-17 IBM 10/100 Mbps Ethernet TX MCA Adapter (8f62)
################
# firmware menue
################
7026-6H1
14900 auf service processor menue ebene eingeben fuer erweiterte funktionen
########
# driver
########
lsdev -Cc driver
######
# snap
######
ACHTUNG!!!
genug Plattenplatz unter /tmp/ibmsupt
loeschen alter snap
snap -r
neuer snap anlegen
snap -acg
########
# vmtune
########
display mem pools
/usr/samples/kernel/vmtune -A
# permanentes tuning
# vmo -p -o maxclient%=20
Setting maxclient% to 20 in nextboot file
Setting maxclient% to 20
# vmo -p -o minperm%=3
Setting minperm% to 3 in nextboot file
Setting minperm% to 3
# vmo -p -o maxperm%=20
Setting maxperm% to 20 in nextboot file
Setting maxperm% to 20
# reset of tuning
root@eric /home/root> vmo -d maxperm%
Setting maxperm% to 80
root@eric /home/root> vmo -d minperm%
Setting minperm% to 20
root@eric /home/root> vmo -d maxclient%
Setting maxclient% to 80
###############
# tuning in AIX
###############
Starter set of tuneables
Current recommended AIX* 5.3 Performance Parameters: Please ensure you test thes
e first before implementing in production as your mileage may vary
# Network
no -p -o rfc1323=1
no -p -o sb_max=1310720
no -p -o tcp_sendspace=262144
no -p -o tcp_recvspace=262144
no -p -o udp_sendspace=65536
no -p -o udp_recvspace=655360
nfso -p -o rfc_1323=1
nfso -p -o nfs_socketsize=60000
nfso -p -o nfs_tcp_socketsize=600000
# Memory Settings
vmo -p -o minperm%=5
Leave maxperm and maxclient at default of 80
Leave strict_maxperm and strict_maxclient at their defaults
vmo -p -o minfree=960
vmo -p -o maxfree=1088
vmo -p -o lru_file_repage=0
vmo -p -o lru_poll_interval=10
# IO Settings
Leave minpgahead and J2_minPageReadAhead at their defaults of 2
ioo -p -o j2_maxPageReadAhead=128
ioo -p -o maxpgahead=16
ioo -p -o j2_maxRandomWrite=32
ioo -p -o maxrandwrt=32
ioo -p -o j2_nBufferPerPagerDevice=1024
ioo -p -o pv_min_pbuf=1024
ioo -p -o numfsbufs=2048
If doing lots of raw I/O you may want to change lvm_bufcnt
Default is 9
ioo -p -o lvm_bufcnt=12
Others left to default that you may want to tweak include:
ioo -p -o numclust=1
ioo -p -o j2_nRandomCluster=0
ioo -p -o j2_nPagesPerWriteBehindCluster=32
###########
# schedtune
###########
/usr/samples/kernel/schedtune
############
# autoexpect
############
/usr/bin/autoexpect -f test1.exp sftp blafasel
erstellt expect-script in test1.exp und fuehrt eine sftp-verbindung zu blafasel
durch
##################################
# lpar anzeigen der partition info
##################################
# ./ncommand "uname -aLs"
Beginn node host1 ...
AIX host1 1 5 00379B2A4C00 3 host1
Ende node host1 !
Beginn node host2 ...
AIX host2 1 5 0037917A4C00 3 host2
Ende node host2 !
Beginn node host3 ...
AIX host3 1 5 0037917A4C00 1 host3
Ende node host3 !
Beginn node host4 ...
AIX host4 1 5 0037917A4C00 2 host4
Ende node host4 !
Beginn node host5 ...
AIX host5 1 5 00379B2A4C00 1 host5
Ende node host5 !
Beginn node host6 ...
AIX host6 1 5 0037917A4C00 4 host6
Ende node host6 !
###################
# LTG Size anpassen
###################
Under AIX 5 you have a new feature for logical group track size. I think its fro
m 128K - 1024 K.
You can run lquerypv -M hdiskx to get the maximum allowable setting for you dis
ks.
Change with:
chvg -L 1024 vgname
#####################
# vim on aix 5.1 ML04
#####################
E363: Pattern ...
No Searches possible
use
vim -u NONE
#####################
# print out to STDERR
#####################
in ksh:
print -u2 "text"
in perl:
but you would have to run it like `script.pl "Text to STDERR"`
<snip>
#!/usr/bin/perl
print STDERR @ARGV;
print STDERR "\n";
<snip>
##########################
# restore only permissions
##########################
found this on the man pages for restore command on
http://publib16.boulder.ibm.com/pseries/en_US/cmds/aixcmds4/aixcmds4tfrm.htm
:
-Pstring Restore only the file attributes. Does not restore the file
contents. If the file specified does not exist in the target directory path,
the files is not created. This flag restores file attributes selectively
depending on the flags specified in the string parameter. String parameter
can be a combination of the following characters:
A
restore all attributes.
a
restore only the permissions of the files.
o
restore only the ownership of the files.
t
restore only the timestamp of the files.
c
restore only the ACL attributes of the files.
Note:
Among the existing options for the restore command, options v, h, b, s, f,
B, d, and q are valid with the P option. The P option can be used with both
file-name and filesystem archives. If the File argument is a symbolic link,
then the metadata of the target file will be modified and not that of the
symbolic link.
#####
# wsm
#####
/usr/websm/bin/wsmserver -enable
/usr/websm/bin/wsmserver -disable
#####
# pax
#####
sichern:
cd /home/kutz
pax -wf home.pax .
archiv anschauen:
pax -f home.pax|less
auspacken:
cd /tmp/kutz
pax -rvf /home/kutz/home.pax
pax erkennt cpio und tar archive:
-z = komprimiert
pax -rzvf /home/kutz/home.tar.gz
pax -rvf /home/kutz/home.tar
eingabeaufforderung zu jedem restore file:
pax -rif /home/kutz/home.tar
baum kopieren:
cd ziel
pax -rw . /quelle/vz
inkrementelles backup:
basis
cd quelle
pax -wvf /zieldir/montag.pax .
increment:
pax -wv -T 0000 -f /zieldir/dienstag.pax
############
# desktop dt
############
stopsrc -s dtsrc (stoppen)
startsrc -s dtsrc (starten)
refresh -s dtsrc (refresh)
kommentieren mit : in inittab
###########
# dns named
###########
AIX supports three versions of BIND: 4, 8, and 9. By default, named links to nam
ed4, nsupdate to nsupdate4, named-xfer to named-xfer4. To use a different versio
n of named, you must relink the symbolic links accordingly for the named and nam
ed-xfer daemons.
For example, to use named8:
ln -fs /usr/sbin/named8 /usr/sbin/named
ln -fs /usr/sbin/named8-xfer /usr/sbin/named-xfer
nsupdate4 can be used with named8, but nsupdate9 must be used with named9 becaus
e the security process is different. It does not matter what named-xfer is linke
d to when using named9 because the daemon does not use it.
#############
# timeout dns
#############
On AIX, a DNS query will wait a total of 75 seconds before failing over to the s
econd nameserver entry in the resolv.conf.
The 75 sec timeout period comes from two values RES_RETRY and RES_TIMEOUT. The w
ay it works is the dns client will try to contact the dns server, then if it doe
sn't get an answer back it will wait 5 seconds and try again, then it will wait
10 secs and try again, 20 sec and try again, 40 secs and try again.
.
5 + 10 + 20 + 40 = 75 seconds
If you want to change these on the dns client do the following:
.
# export RES_RETRY=value
# export RES_TIMEOUT=value
.
The timeout is defined by two values :
RES_TIMEOUT (default 5 sec)
RES_RETRY (defautl 4 times)
Each retry the initial timeout value is multipied by 2
###################
# snmpd + oracle ia
###################
stopsrc -s snmpd
su - oracle -c ". mnet.ksh;lsnctrl dbsnmp_stop;lsnctrl dbsnmp_start;"
startsrc -s snmpd
##########################
# Switch to snmp Version 1
##########################
# snmpv3_ssw -1
$ sudo snmpv3_ssw
Password:
Usage: /usr/sbin/snmpv3_ssw [-e|-n|-1]
-e Switch to encrypted version of snmpdv3 agent.
-n Switch to non-encrypted version of snmpdv3 agent.
-1 Switch to snmpdv1 agent.
###############
# snmpd restart
###############
stopsrc -s aixmibd
stopsrc -s dpid2
stopsrc -s snmpmibd
stopsrc -s hostmibd
stopsrc -s snmpd
startsrc -s snmpd
startsrc -s dpid2
startsrc -s aixmibd
startsrc -s hostmibd
startsrc -s snmpmibd
start ohne dpid2 wenn snmpdv3 und aix 5.3
startsrc -s snmpd
startsrc -s aixmibd
startsrc -s hostmibd
startsrc -s snmpmibd
# status
lssrc -a|egrep "snmpd|aixmibd|snmpmibd|hostmibd"
lssrc -a|egrep "snmpd|aixmibd|snmpmibd|hostmibd|dpid2"
#########################
# agent could not contact
#########################
/etc/snmpdv3.conf
smux 1.3.6.1.4.1.2.3.1.2.2.1.1.2 dpid_password #dpid2
if the snmpd.peers file shows :
"dpid2" 1.3.6.1.4.1.2.3.1.2.2.1.1.2 "dpid_password"
and the snmpd.conf shows :
smux 1.3.6.1.4.1.2.3.1.2.2.1.1.2 public #dpid
then this shows that the password stored in each file does not match. For this c
ase, it is necessary to update the snmpd.conf file and change the dpid2 smux sta
tement
from : smux 1.3.6.1.4.1.2.3.1.2.2.1.1.2 public #dpid
to : smux 1.3.6.1.4.1.2.3.1.2.2.1.1.2 dpid_password #dpid2
################
# 1 AIX Commands
################
TITLE : AIX Command Crib Sheet
OS LEVEL : AIX
DATE : 22/10/2001
VERSION : 1.9
>> 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
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.
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
alog -o -t boot View the boot log
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
SOFTWARE INSTALLATION
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"
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
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
/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
TERMINALS / DISPLAYS
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
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) ( gatewa
y )
Adds route and adds entry into ODM, route survives a reboot,
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 (name or ipaddress) Same as traceroute except repeats.
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"
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
:set list lists all signs in vi
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
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.
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.
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
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.
mkvg -y(vg) -s(PP size) (pv) Create a volume group
mkvg -y datavg -s 4 hdisk1
reducevg -d (vg) (pv) Removes a volume group
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 eg deletes it!
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.
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 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
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
chlv -n (new lv) (old lv) Rename a logical volume
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.
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.
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
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.
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.
BOOT LOGICAL VOLUME (BLV)
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.
SYSTEM DUMP
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
PAGING SPACE (PS's)
lsps -a Lists out all paging space
lsps -s Displays total paging and total useage
lsps (ps)
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.
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.
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
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.
lslicense Displays number of current user licensese
chlicense -u (number) Changes the number of user licenses
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
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.
ERROR LOGGING
/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.
PERFORMANCE MONITORING
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
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
kill -l (sendmail PID)
#####################
# useful aix commands
#####################
Useful AIX commands
svmon
svmon -P <pid>
Further:
use can user svmon command to monitor memory usage as follows;
(A) #svmon -P -v -t 10 | more (will give top ten processes)
(B) #svmon -U -v -t 10 | more ( will give top ten user)
smit install requires "inutoc ." first. It'll autogenerate a .toc for you
I believe, but if you later add more .bff's to the same directory, then
the inutoc . becomes important. It is of course, a table of contents.
dump -ov /dir/xcoff-file
topas, -P is useful # similar to top
When creating really big filesystems, this is very helpful:
chlv -x 6552 lv08
Word on the net is that this is required for filesystems over 512M.
esmf04m-root> crfs -v jfs -g'ptmpvg' -a size='884998144' -m'/ptmp2'
-A''`locale yesstr | awk -F: '{print $1}'`'' -p'rw' -t''`locale yesstr |
awk -F: '{print $1}'`'' -a frag='4096' -a nbpi='131072' -a ag='64'
Based on the parameters chosen, the new /ptmp2 JFS file system
is limited to a maximum size of 2147483648 (512 byte blocks)
New File System size is 884998144
esmf04m-root>
If you give a bad combination of parameters, the command will list
possibilities. I got something like this from smit, then seasoned
to taste.
If you need files larger than 2 gigabytes in size, this is better.
It should allow files up to 64 gigabytes:
crfs -v jfs -a bf=true -g'ptmpvg' -a size='884998144' -m'/ptmp2' -A''` |
| locale yesstr | awk -F: '{print $1}'`'' -p'rw' -t''`locale yesstr | aw |
| k -F: '{print $1}'`'' -a nbpi='131072' -a ag='64'
Show version of SSP (IBM SP switch) software:
lslpp -al ssp.basic
llctl -g reconfig - make loadleveler reread its config files
oslevel (sometimes lies)
oslevel -r (seems to do better)
lsdev -Cc adapter
pstat -a looks useful
vmo is for VM tuning
On 1000BaseT, you really want this:
chdev -P -l ent2 -a media_speed=Auto_Negotiation
Setting jumbo frames on en2 looks like:
ifconfig en2 down detach
chdev -l ent2 -a jumbo_frames=yes
chdev -l en2 -a mtu=9000
chdev -l en2 -a state=up
Search for the meaning of AIX errors:
http://publib16.boulder.ibm.com/pseries/en_US/infocenter/base/eisearch.htm
nfso -a shows AIX NFS tuning parameters; good to check on if you're
getting badcalls in nfsstat. Most people don't bother to tweaks these
though.
##################################
# check who is mounting my exports
##################################
netstat -an | grep 2049
nfsstat -m shows great info about full set of NFS mount options
Turn on path mtu discovery
no -o tcp_pmtu_discover=1
no -o udp_pmtu_discover=1
TCP support is handled by the OS. UDP support requires cooperation
between OS and application.
nfsstat -c shows rpc stats
To check for software problems:
lppchk -v
lppchk -c
lppchk -l
List subsystem (my word) status:
lssrc -a
mkssys
rmssys
chssys
auditpr
refresh
startsrc
stopsrc
traceson
tracesoff
This starts sendmail:
startsrc -s sendmail -a "-bd -q30m"
This makes inetd reread its config file. Not sure if it kills and
restarts or just HUP's or what:
refresh -s inetd
lsps is used to list the characteristics of paging space.
Turning off ip forwarding:
/usr/sbin/no -o ipforwarding=0
Detailed info about a specific error:
errpt -a -jE85C5C4C
BTW, Rajiv Bendale tells me that errors are stored in NVRAM on AIX,
so you don't have to put time into replicating an error as often.
Some or all of these will list more than one number. Trust the first,
not the second.
lslpp -l ppe.poe
...should list the version of poe installed on the system
Check on compiler versions:
lslpp -l vac.C
lslpp -l vacpp.cmp.core
Check on loadleveler version:
lslpp -l LoadL.full
If you want to check the bootlist do bootlist -o -m normal if you want to
update bootlist do bootlist -m normal hdisk* hdisk* cd* rmt*
prtconf
Run the ssadiag against the drive and the adapter and it will tell you if it
fails or not. Then if its a hot plugable it can be replaced online.
You can get patches from:
http://www-912.ibm.com/eserver/support/fixes
You'll need to click through a bit of red tape before getting to where
you actually can list corequisites and start a download.
BTW, "Add to my download list" does not work in konqueror, but it does
work in mozilla.
Backup to tape:
env - /usr/bin/mksysb '-m' '-i' '-X' /dev/rmt0
The "env -" is because some sort of environment variable can confuse
mksysb, making it error out instead of doing your backup
There's also "smitty mksysb"
You can create an image using the savevg command i.e.
savevg -v -n -9 / _rootvg.img rootvg
This can be used to build a NIM installable image to recover your systems
alternatively, the command line call for a mksysb to tape (to include map
and exclude files) is /usr/bin/mksysb '-m' '-e' '-i' /dev/rmt0
Finding which lpp contains a file:
lslpp -w /usr/sbin/umount
There exists a "diag CD" for AIX.
/usr/samples/kernel/vmtune
lsattr -El sys0 | grep realmem
lsattr -El mem0
See if you AIX system's hardware is CHRP (some sort of PowerPC reference
platform spec, I believe) :
bootinfo -p
chrp
Some really funky hardware-looking problems can be fixed by draining
the NVRAM battery for 5 minutes, and then reinstalling the microcode.
We used to do this on some IBM RT's in Cincinnati, and a recent poster
to AIX-L indicates that it's still useful in some situations.
From AIX-L:
AIX 4.3.2 -> AIX 4.3.3 is the most easiest Upgrade of ALL. Place the
AIX 4.3.3 Vol 1 of CD on the CDROM drive and run smitty update_all ,
this will upgrade the OS
On the subject of running out of paging space, from AIX-L:
Look into npswarn, npskill stuff in Performance Management Guide
Changing the boot device order:
Boot the server, and hit 1 or F1 (depending if you have an ascii console
or a graphics console) when the logos come up to get to sms mode. In
the menus select multiboot, select boot devices, select boot order.
You should start tracing for inetd subsystem with
traceson -s inetd
and then issue:
trpt -j
you will see the protocols control blocks (PID) you're tracing, and then with:
trpt -p <PID>
you should see output for telnet communications. But this is not working.
Why don't you try using iptrace and ipreport to see the behavior of your
telnet sessions ??
Purportedly orks with JFS 1 and 2:
To split off a mirrored copy of the /home/xyz file system to a new mount
point named /jfsstaticcopy, type the following:
chfs -a splitcopy=/jfsstaticcopy /home/xyz
You can control which mirrored copy is used as the backup by using the
copy attribute. The second mirrored copy is the default if a copy is
not specified by the user. For example:
chfs -a splitcopy=/jfsstaticcopy -a copy=1 /home/xyz
At this point, a read-only copy of the file system is available in
/jfsstaticcopy. Any changes made to the original file system after the
copy is split off are not reflected in the backup copy.
To reintegrate the JFS split image as a mirrored copy at the /testcopy
mount point, use the following command:
rmfs /testcopy
The rmfs command removes the file system copy from its split-off state
and allows it to be reintegrated as a mirrored copy.
Working around a loader domain problem:
esmf04m-strombrg> /usr/local/bin/gribmap
exec(): 0509-036 Cannot load program /usr/local/bin/gribmap because of
the following errors:
0509-030 Insufficient permission to create loader domain
/usr/lib/libiconv.a
0509-026 System error: The file access permissions do not allow
the specified action.
esmf04m-strombrg> LIBPATH=$TMPDIR/gribmap-ld /usr/local/bin/gribmap
gribmap v1.4 for GrADS Version 1.8SL11
Apparently you can also link your application with -L$TMPDIR/loaderdomain
or so, but you'd need a unique one for each set of shared libraries.
This one apparently must be the first -L in the link line.
Please see also:
http://dcs.nac.uci.edu/~strombrg/AIX-shared-libs.html
/usr/bin/uname -M
Anyway, set the timezone variable TZ in /etc/environment like this:
TZ=MST7
...takes effect after everyone logs out and back in. This is just an
example, not something for California.
"svmon" will give u this output which give u the information regarding
ur memory.
size inuse free pin virtual
memory 1310711 1298235 12476 103782 711466
pg space 2097152 585219
work pers clnt lpage
pin 103782 0 0 0
in use 438570 10130 849535 0
acledit
Scott (of IBM, onsite hardware tech) stuff:
lsdev -Cc adapter
"defined" means at one time the piece of hardware was on system - as
opposed to "available". A card which is being newly added should not
temporarily pass through "defined" state. Hardware should be in the
"available" state.
/////
lsslot -c pci
p1-i1 is the first slot on the back left
/////
diag
diadiagnostic routines
problem determination
sfp: phones home (to IBM) over modem
previously reported problem
/////
task selection
hot plug task
pci or scsi
identify function will blink light, so you can make sure the hardware
and software are on the same page.
u1.1 drawer address, bottom left
/////
EIA numbers on right and left of rack, goes to lowest of the numbers
adjacent to the equipment in question. EG, something in the rack might
be 3 EIA numbers high - the software should identify the hardware by
the lowest number of the 3.
/////
hotplug in os removes voltage from slot, slot light should blink yellow,
same as for identify.
/////
we have older "hotswap cassettes" - which means lots of screws.
Newer ones snap together. It also can take a bit of wrestling to get
the card in and out of the old cassettes (shades of Sun's IPX's :)
/////
yellow llight continues blinking after card inserted, until software is
told to let the slot have voltage again.
/////
advanced diagnostics, search for thing to test visually
/////
cfgmgr
takes awhile to run, checks all devices on machine
no output, but then lsdev -Cc adapter again should change afterward
/////
ps -ef | grep Worm
splstdata -a
should not say not_configured
use rc.switch to make it configured
ps -ef pipe | Worm again, should show up now
Eunfence 49 - 49 is 04m
/////
spmon -d
"d" for diagnostic
like front panel leds
"host responds" and "switch responds" should say yes for all css adapters
/////
errpt (no args)
/////
Scott says that sometimes an SP2 system will refuse to acknowledge the
new adapter, in which case you have to lie to the ODM to make the system
see the card. He suggested that maybe we did not need to do that this
time, because we have the latest pssp (ssp.*) software on the system.
/////
We also had to Eunfence the node whose card was replaced.
Rajiv tells me that it does not matter which host is Eprimary, as long as
one of the nodes is, and there aren't things fenced off that shouldn't be.
mount -v cdrfs -o ro /dev/cd0 /mnt
Mount iso9660 filesystem
More on cfgmgr, from aix-l:
you can execute cfgmgr on line without trouble
normally cfgmgr have 3 steps named phases :
phase 1 during boot
phase 2 during normal boot (after phase1)
phase 3 durinf service boot (after phase1)
if you run cfgmgr without flags (-p or -f) cfgmgr executes phase 2 only by
default
in fact cfgmgr and cfgmgr -p2 are the sames commands
flag -v for verbose
AIX 5.2 has builtin CIFS client?
mount -v cifs -n winserver/myuser/mypassword /home /mnt
Can also "smitty cifs_fs"
This is supposed to be included in lpp bos.cifs_fs
Apparently this was added in AIX 5.2
please check if your cd device is being used by some process by running:
fuser -c /dev/cd0
you can also chack if cdromd is up and running by:
lssrc -a | grep cd
if cdromd is running, then try with the following commands:
cdumount
cdeject
here is some commands to manipulate the ODM directly (I don't suggest you
do so, at least you know exactly what you are doing).
odmget, odmshow, odmchange, odmadd, odmdelete, odmdrop
lsps -a
nmon - free, unsupported download from IBM
What's this about chmod'ing kmem to be world readable though?!
esmf04m-dcsew> instfix -i | grep ML
All filesets for 5.1.0.0_AIX_ML were found.
All filesets for 5100-01_AIX_ML were found.
All filesets for 5100-02_AIX_ML were found.
All filesets for 5100-03_AIX_ML were found.
All filesets for 5100-04_AIX_ML were found.
esmf04m-dcsew>
The specifix fixes can be checked using instfix command:
#instfix -ivk <APAR no.>
e.g #instfix -ivk IY56076
instfix -ciqk 4330-08_AIX_ML | grep ":-:"
Lists what filesets need to be installed for instfix to show "All filesets
for 4330-08 were found".
instfix -k "IX#####" -d /dev/rmt0.1
Installs the APAR and its prerequisites on the system.
installp -Xagqd /dev/rmt0.1 X11.base.rte
Installs Xwindows on the system.
# delete an AIX lpp
installp -u
or
/usr/lib/instl/sm_inst installp_cmd -u -f'rsct.msg.en_US.core.utils'
Copious network statistics:
entstat -d ent0
Making AIX 5.1 see a change to /etc/inetd.conf and/or /etc/services
and/or /etc/rpc is different from most other systems (only verified
using one rpc/udp service so far)
You can't just kill -HUP inetd's pid
What you can do, is "smitty inetd", stop inetd, start inetd, and exit smitty.
Alternatively, it -should- work to:
stopsrc -s inetd
startsrc -s inetd
Or better:
Edit /etc/inetd.conf and comment out ftp and refresh inetd by issuing
"refresh -s inetd"
startsrc -t ftpd -u 022 -l
##############
# check kernel
##############
/usr/sbin/lsconf -k
Kernel Type: 64-bit
###############
# change kernel
###############
To truly change the kernel to 64-bit, you need to be at the 5.1 oslevel. The
means to change to a 64-bit kernel are:
From 32-bit to 64-bit:
ln -sf /usr/lib/boot/unix_64 /unix
ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix
lslv -m hd5
bosboot -ad /dev/ipldevice
shutdown -Fr
bootinfo -K (should now be 64)
To change the kernel back to 32-bit:
From 64-bit to 32-bit:
ln -sf /usr/lib/boot/unix_mp /unix
ln -sf /usr/lib/boot/unix_mp /usr/lib/boot/unix
lslv -m hd5
bosboot -ad /dev/ipldevice
shutdown -Fr
bootinfo -K (should now be 32)If you are running AIX 5.1
Switching From 32 to 64 Bit Mode
To switch from 32-bit mode to 64-bit mode run the following commands,
in the given order:
1.ln -sf /usr/lib/boot/unix_64 /unix
2.ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix
3.bosboot -ad /dev/ipldevice
4.shutdown -Fr
5.bootinfo -K (should now show 64)
Switching From 64 To 32-Bit Mode
To switch from 64-bit mode to 32-bit mode run the following commands,
in the given order:
1.ln -sf /usr/lib/boot/unix_mp /unix
2.ln -sf /usr/lib/boot/unix_mp /usr/lib/boot/unix
3.bosboot -ad /dev/ipldevice
4.shutdown -Fr
5.bootinfo -K (should now show 32)
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
Moulay Rachid BOUSSETA
To see if you're running with a 32 bit or 64 bit kernel, run:
bootinfo -K
...or...
prtconf -k
EG:
esmf04m-root> PATH=/usr/bin:/usr/sbin prtconf -k
Kernel Type: 64-bit
esmf04m-root> bootinfo -K
64
bootinfo -s hdiskxxx
lspv hdiskXX as well is defined on a Volume Group
lsattr -El hdiskXX
lscfg -vp -l hdiskXX
These should give you the raw disk capacity
Go to: http://www-912.ibm.com/eserver/support/fixes/fcgui.jsp
Choose: 1)pSeries family
2)AIX OS,Java, compilers
3)Specifi fix
4)Your OS
Press continue....
type in your requisites in the text box. thats it!
LPP history:
lslpp -h
sar 1 10
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
bootinfo -y reports your hardware arquitecture (32
bits or 64 bits)
bootinfo -K reports if the kernel in memory is 32
bits or 64 bits
You can submit/check a pSeries PMR via the web at:
https://techsupport.services.ibm.com/ssr/ssr.slprob