########################## # LAST CHANGE : 24.01.2013 ########################## OS LEVEL AIX: 4.3.3 + 5.1 + 5.2 + 5.3 + 6.1 Linux On Power: Redhat 5.4 ############## # 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 ##################################### # Call opening Severity Levels at IBM ##################################### Severity 1 Critical business impact: You are unable to use the program, resulting in a critical impact on operations. This condition requires an immediate solution. Severity 2 Significant business impact: The program is usable but is severely limited. Severity 3 Some business impact: The program is usable with less significant features (not critical to operations) unavailable. Severity 4 Minimal business impact: The problem causes little impact on operations, or a reasonable circumvention to the problem has been implemented. ####################### # 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: Processes process 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 ":=:" instfix -qick 5200-02_AIX_ML|grep ":-:" instfix -qick 5200-03_AIX_ML|grep ":-:" instfix -qick 5300-10_AIX_ML|grep ":-:" instfix -qick 5300-11_AIX_ML|grep ":-:" instfix -qick 6100-07_AIX_ML|grep ":-:" instfix -qick 6100-08_AIX_ML|grep ":-:" oder /usr/bin/oslevel -rl 5300-11 /usr/bin/oslevel -rl 5300-12 ############################## # 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 ###### # package bos.suma # download TL suma -x -a DLTarget=/export/fixes/530TL07 -a Action=Download -a RqType=TL -a RqName=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 [-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 offline 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=sync" ######################## # 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 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 '************************************************************' ############## # aix 5.3 mkcd ############## # logfile /var/adm/ras/mkcd.log /usr/sbin/mkcd '-e' -V 'rootvg' '-R' '-S' Initializing mkcd log: /var/adm/ras/mkcd.log... Verifying command parameters... Creating image.data file... Creating temporary file system: /mkcd/mksysb_image... Creating mksysb image... Creating list of files to back up 81722 of 86594 files backed up (94%).. 0512-003 mksysb may not have been able to archive some files. The messages displayed on the Standard Error contained additional information. cannot open ./etc/vg/vg000DE1710000D90000000126B2F3EC1E: Text file busy Creating temporary file system: /mkcd/cd_fs... Populating the CD or DVD file system... Copying backup to the CD or DVD file system... Building chrp boot image... Creating temporary file system: /mkcd/cd_images... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_889022.vol1 Running mkisofs ... ... mkrr_fs was successful. Making the CD or DVD image bootable... Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_889022.vol2 Running mkisofs ... .. mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_889022.vol3 Running mkisofs ... mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_889022.vol4 Running mkisofs ... .. mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_889022.vol5 Running mkisofs ... . mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_889022.vol6 Running mkisofs ... mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_889022.vol7 Running mkisofs ... . mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_889022.vol8 Running mkisofs ... .. mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_889022.vol9 Running mkisofs ... . mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_889022.vol10 Running mkisofs ... . mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_889022.vol11 Running mkisofs ... mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_889022.vol12 Running mkisofs ... . mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... 0512-329 mkcd: User specified CD or DVD file system: /mkcd/cd_images needs an additional 8089601 bytes. Cleaning up... Removing temporary file system: /mkcd/cd_fs... Removing temporary file system: /mkcd/mksysb_image... ############################## # create DVD Images UDF Format ############################## /usr/sbin/mkcd '-e' '-R' '-S' '-P' -V 'rootvg' Verifying command parameters... Creating image.data file... Creating temporary file system: /mkcd/mksysb_image... Creating mksysb image... Creating list of files to back up Backing up 86608 files 80141 of 86608 files backed up (92%).................. 0512-003 mksysb may not have been able to archive some files. The messages displayed on the Standard Error contained additional information. cannot access ./opt/bbc-1.9e-btf/tmp/kerp-tsm001,unity,media,corp.iostat: No such file or directory cannot access ./opt/bbc-1.9e-btf/tmp/kerp-tsm001,unity,media,corp.iostat.vmstat.log.1568916: No such file or directory cannot access ./opt/bbc-1.9e-btf/tmp/kerp-tsm001,unity,media,corp.iostat.vmstat.error.1568916: No such file or directory cannot open ./etc/vg/vg000DE1710000D90000000126B2F3EC1E: Text file busy Creating temporary file system: /mkcd/cd_fs... Populating the CD or DVD file system... Copying backup to the CD or DVD file system... Building chrp boot image... Creating temporary file system: /mkcd/cd_images... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_2334948.vol1 Running mkisofs ... .. mkrr_fs was successful. Making the CD or DVD image bootable... Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_2334948.vol2 Running mkisofs ... mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_2334948.vol3 Running mkisofs ... mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_2334948.vol4 mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_2334948.vol8 Running mkisofs ... mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_2334948.vol9 Running mkisofs ... mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_2334948.vol10 Running mkisofs ... mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_2334948.vol11 Running mkisofs ... . mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... Creating Rock Ridge format image: /mkcd/cd_images/cd_image_2334948.vol12 Running mkisofs ... . mkrr_fs was successful. Copying the remainder of the backup to the CD or DVD file system... 0512-329 mkcd: User specified CD or DVD file system: /mkcd/cd_images needs an additional 10756267 bytes. Cleaning up... Removing temporary file system: /mkcd/cd_fs... Removing temporary file system: /mkcd/mksysb_image... /usr/sbin/mkcd '-U' '-e' '-R' '-S' '-P' -V 'rootvg' -d /dev/dvd0 ########################## # recover from failed mkcd ########################## umount /mkcd/cd_images rmfs /mkcd/cd_images rm -rf /mkcd ################# # mount iso image ################# # loopmount -i -o "-V cdrfs -o ro" -m / ############################### # 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= ############## # 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/product/8.1.7 app03LV jfs2 144 288 2 open/syncd /usr/app/oracle/product/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_hostname "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/ of=/dev/rmt0.1 bs=256k 2. To restore the raw device from tape: dd if=/dev/rmt0.1 of=/dev/ count=63 seek=1 skip=1 bs=4k mt -f /dev/rmt0.1 bsf 1 dd if=/dev/rmt0.1 of=/dev/ 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_bootable_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/ 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 bezueglich der anderen VG's mit aufgenommen. 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/ipasvgp03 Cluster 51200 bytes (100 blocks). Volume 1 on /usr/local/vgdata/ipasvgp03 a 226 ./tmp/vgdata/vgdata.files34008 a 226 ./tmp/vgdata/vgdata.files a 3758 ./tmp/vgdata/ipasvgp03/filesystems a 0 . a 4764 ./tmp/vgdata/ipasvgp03/ipasvgp03.data a 17 ./tmp/vgdata/ipasvgp03/logipasvgp03.map a 6101 ./tmp/vgdata/ipasvgp03/lvipasp11.map a 3528 ./tmp/vgdata/ipasvgp03/lvipasp12.map a 1476 ./tmp/vgdata/ipasvgp03/lvipasp13.map total size: 20096 Done at Tue Oct 8 10:53:44 MSZ 2002; 100 blocks on 1 volume(s) 0512-038 savevg: Backup Completed Successfully. To restore the volumye group image s/usr/local/vgdata/ipasvgp03 file onto the di sks specified in the vgname.data file contained within the backup image, enter: restvg -f/usr/local/vgdata/ipasvgp03 Creating information file for volume group ipasvgp02.. 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 ###################### # 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@verleihnix-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. # mkramdisk 16M /dev/rramdisk0 # mkfs -V jfs2 /dev/ramdisk0 mkfs: destroy /dev/ramdisk0 (yes)? y File system created successfully. 16176 kilobytes total disk space. Device /dev/ramdisk0: Standard empty filesystem Size: 32352 512-byte (DEVBLKSIZE) blocks # mkdir /ramdiskfs # mount -V jfs2 -o log=NULL /dev/ramdisk0 /ramdiskfs # df -m /ramdiskfs Filesystem MB blocks Free %Used Iused %Iused Mounted on /dev/ramdisk0 16.00 15.67 3% 4 1% /ramdiskfs ####################### # 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 ##################### # mcode update system ##################### # Update via HMC 1. A compatible version of HMC. 2. An Ethernet connection from the HMC to the p5 server (HMC1 port). 3. Desired firmware image on CD. The rpm and XML files are required. # Update via running AIX or Linux operating system 1. A running AIX or supported Linux operating system on a single LPAR environment, ie, no attached HMC. 2. Firmware image on a CD or file system. The rpm file only. 3. update_flash executable. For AIX, it is part of the diagnostic aids tool in the /usr/lpp/diagnostics/bin directory. For Linux, it is part of the Service and Productivity Tools. 4. Serial console and connection # Update via Standalone Diagnostic CD 1. Diagnostic CD 2. Firmware image (.img) file on a CD. Remember, the rpm file is not directly compatible. 3. Serial console and connection ################## # 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" ####################### # logins protokollieren ####################### tempvar=$$ user="`logname`.$tempvar" myfifo=/tmp/$user /usr/bin/rm -rf $myfifo /usr/bin/ksh -i "/usr/bin/script $myfifo" cat $myfifo >/tmp/logdir/$user.log 2>&1 & URL explaining it. http://linuxshellaccount.blogspot.com/2008/07/using-screen-script-mkfifo-and.html ################## # 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 /tmp/bla && mail -s login_failure someuser@somehost.com ftp mymachine-backup1 Connected to mymachine-backup1.unity.media.corp. 220 kerp-odb001 FTP server (Version 4.2 Wed Nov 26 05:54:26 CST 2008) ready. Name (mymachine-backup1:kutz): 331 Password required for kutz. Password: 230-Last unsuccessful login: Tue Sep 20 15:03:06 MST 2011 on ssh from kah80.unity.media.corp 230-Last login: Fri Jan 27 11:51:57 MEZ 2012 on ftp from mymachine-backup1.unity.media.corp 230-[files]: 3004-328 Your password will expire: Thu Feb 9 14:45:16 MEZ 2012 230 User kutz logged in. ############################### # 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 ############ # user roles ############ Possible Roles: AccountAdmin BackupRestore DomainAdmin FSAdmin SecPolicy SysBoot SysConfig auditadm fsadm isso pkgadm sa secadm so svcadm sysop Make User an Account Admin: # chuser roles='SecPolicy,AccountAdmin' user_name # activate Role on next login: # chuser default_roles=ALL user_name ############################## # 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 #################### # manage_disk_drives #################### root@kerp-nim002 /export/images> manage_disk_drivers 1: DS4100: currently MPIO; supported: RDAC/fcparray, MPIO 2: DS4300: currently MPIO; supported: RDAC/fcparray, MPIO 3: DS4500: currently MPIO; supported: RDAC/fcparray, MPIO 4: DS4700/DS4200: currently MPIO; supported: RDAC/fcparray, MPIO 5: DS4800: currently MPIO; supported: RDAC/fcparray, MPIO ####################### # copy PVID duplication ####################### You can change the PVID when the VG is exported using "chdev -l hdiskX -a pv=clear; chdev -l hdiskX -a pv=yes", but there is no way to change the VGID on the disk. 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 logical volumes to the new VG, then edit the /etc/filesystems file to create mount 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 /;restore -iqvf -) ################# # 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 for nfsd chnfs -b 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,aixinstall2,aixinstall3,aixinstall4,aixinstall5' -r 'aixinstall1,aixinstall2,aixinstall3,aixinstall4,aixinstall5' '-B' /export/conf root=aixinstall1:aixinstall2:aixinstall3:aixinstall4:aixinstall5,access=aixinstall1:aixinstall2:aixinstall3:aixinstall4:aixinstall5 Exported /export/conf change kurzschlus:/#chnfsexp -d '/export/nim/scripts/aixinstall1.script' -c 'aixinstall1' -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/_archive/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/anotherfilesystem 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 False bus_io_addr 0xdf800 Bus I/O address False bus_mem_addr 0xe8081000 Bus memory address False init_link al INIT Link flags True intr_priority 3 Interrupt priority False 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 False active_hdisk hdisk2/75235512325/fscsi0 Active hdisk False active_hdisk hdisk3/75235512325/fscsi0 Active hdisk False active_hdisk hdisk5/75235512325/fscsi2 Active hdisk False policy df Scheduling Policy True pvid 00025eb562b8fd8d0000000000000000 Physical volume identifier False qdepth_enable yes Queue Depth Control True serial_number 75235512325 LUN serial number False unique_id 210C37523551232507210790003IBMfcp Device Unique Identification False ############################# # 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. ########### # route get ########### #:/export/customize> route get kah25 route to: kah25.unity.media.corp destination: default mask: default gateway: kerp-rou_rz.unity.media.corp interface: en0 interf addr: kerp-nim002.unity.media.corp flags: recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire 0 0 0 0 0 0 0 60 ################################ # 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='10.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 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 information ( IP,SM ) for it come up right. ifconfig en0 netmask < if not base on segment > up I prefer to do a smitty chinet, select en0, and make sure the information is correct to bring it up. ##### # arp ##### The no command configures network tuning parameters and its ARP-related tunable parameters are: * arpqsize = 12 * arpt_killc = 20 (minutes) * arptab_bsiz = 7 * arptab_nb = 149 # loeschen alter arp eintraege no -o arpt_killc=1 arp -a|grep "?" no -o arpt_killc=20 ################# # 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 ##################### # config etherchannel ##################### mkdev -c adapter -s pseudo -t ibm_ech -a adapter_names='ent0,ent2' -a use_jumbo_frame='yes' -a mode='8023ad' -a hash_mode='src_dst_port' -a netaddr='172.25.46.1' -a num_retries='3' -a retry_time='1' lsdev -Cc adapter|grep Ether chdev -l en? ############################################### # add remove adapter from etherchannel - online ############################################### If you wish to add or remove additional devices to your live Etherchannel adapter then the following command will help - Add adapter ent4 into the EtherChannel device called ent5 /usr/lib/methods/ethchan_config -a ent5 ent0 To remove ent4 from the EtherChannel device ent5 /usr/lib/methods/ethchan_config -f ent7 ################## # 10 Gbit ethernet ################## ENT=ent15 EN=en15 chdev -l ${ENT} -a flow_ctrl=yes -a jumbo_frames=yes -a large_receive=yes chdev -l ${EN} -a mtu=9000 or chdev -l ${EN} -a mtu=65535 or chdev -l ${EN} -a mtu=65536 chdev -l ${EN} -a netaddr=10.49.1.227 -a broadcast=10.49.1.255 -a netmask=255.255.255.0 -a rfc1323=1 -a tcp_nodelay=0 -a tcp_sendspace=262144 -a tcp_recvspace=131072 no -o sb_max=262144 # shutdown en0 chdev -l en0 -a state=down chdev -l en0 -a state=detach # startup en15 chdev -l ${EN} -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.31.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.31.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=,-hopcount,,,, 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 |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 @ lsof -i : ######################################################### # Can I identify deleted files still opened by a process? ######################################################### Just run fuser -V -d on the filesystem you want to check for deleted but still opened files. This is an example for /filesystem1: user@localhost:/filesystem1 >fuser -V -d /filesystem1 /filesystem1: inode=205 size=8388624384 fd=17 1028162 inode=214 size=8388624384 fd=16 3465470 inode=113 size=8388624384 fd=26 3977340 inode=204 size=8388624384 fd=66 5316844 find out what the last column pid is: psf 1028162 ########### # procflags ########### # find out, what a process is doing root@localhost:/> procflags 962642 962642 : xmtopas -p3 data model = _ILP32 flags = PR_FORK /1204405: flags = PR_ASLEEP | PR_NOREGS http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.files%2Fdoc%2Faixfiles%2Fproc.htm ################################ # 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 < lparstat -i Node Name : kerp-sas001 Partition Name : SAS Partition Number : 2 Type : Dedicated-SMT Mode : Capped Entitled Capacity : 2.00 Partition Group-ID : 32770 Shared Pool ID : - Online Virtual CPUs : 2 Maximum Virtual CPUs : 2 Minimum Virtual CPUs : 1 Online Memory : 7936 MB Maximum Memory : 8192 MB Minimum Memory : 128 MB Variable Capacity Weight : - Minimum Capacity : 1.00 Maximum Capacity : 2.00 Capacity Increment : 1.00 Maximum Physical CPUs in system : 2 Active Physical CPUs in system : 2 Active CPUs in Pool : - Unallocated Capacity : - Physical CPU Percentage : 100.00% Unallocated Weight : - ######################### # cpu runs at which speed ######################### # /usr/bin/pmcycles This machine runs at 1201 MHz ####### # pwdck ####### check /etc/passwd list problems: pwdck -n -l ALL repair problems: pwdck -p -l ALL ################# # groupmembership ################# To remove jones as an administrator of the f612 group, enter: chgrpmem -a - jones f612 To add members davis and edwards to group f612, enter: chgrpmem -m + davis,edwards f612 To list members and administrators of group staff, enter: chgrpmem staff To list members of the LDAP I&A loadable module group monsters, enter: chgrpmem -R LDAP monsters ########### # group add ########### mkgroup id=999 GROUPNAME ############################ # password fuer user anlegen ############################ mkuser and pwdadm -c will get you part of the way to where you're going. ed - /etc/security/passwd </dev/kmem ####################### # dump-device erstellen ####################### # erstelllen mit mklv -t sysdump -y mklv -t sysdump -y hd7 rootvg 8 hdisk0 mklv -t sysdump -y hd77 rootvg 8 hdisk1 # 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 DestinationPhysicalVolume 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 testlv to 100th partition of hdisk7, type: migratelp testlv/25/3 hdisk7/100 # lslv -m LVNAME|grep hdiskname 6489 0399 hdisk42 # move lpp 6489 from hdisk42 to next free pp on disk hdisk23 # migratelp lv_tdwh01/6488 hdisk23 migratelp: Mirror copy 1 of logical partition 6487 of logical volume lv_tdwh01 migrated to physical partition 835 of hdisk23. ################################### # 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 False maxbuf 20 Maximum number of pages in block I/O BUFFER CACHE True maxmbuf 0 Maximum Kbytes of real memory allowed for MBUFS True maxuproc 256 Maximum number of PROCESSES allowed per user True autorestart false Automatically REBOOT system after a crash True iostat false Continuously maintain DISK I/O history True realmem 262144 Amount of usable physical memory in Kbytes False conslogin enable System Console Login False fwversion IBM,L99071 Firmware version and revision levels False maxpout 0 HIGH water mark for pending write I/Os per file True minpout 0 LOW water mark for pending write I/Os per file True fullcore false Enable full CORE dump True pre430core false Use pre-430 style CORE dump True rtasversion 1 Open Firmware RTAS version False modelname IBM,9076-WCN Machine name False systemid IBM,010078023 Hardware system identifier False boottype disk N/A False SW_dist_intr false Enable SW distribution of interrupts True cpuguard disable CPU Guard True ####################### # 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/aix433_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_packages/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, use 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 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. ######################### # 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 but 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 ###################### # 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: mick@oahu.cern.ch (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: dramm@csusm.edu (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_not_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 . From: Bernard.Kozyra@bull.net [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 ... Bernard.Kozyra@bull.net 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: 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 establishes a consistent block-level image of the file system at a point in time. The snapshot image remains stable even as the file system that was used to create the snapshot, called the snappedFS, continues to change. The snapshot retains the same 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 removable media without unmounting or quiescing the file system, all with one command: backsnap. You can also use the snapshot for other purposes, such as accessing 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 JFS2 file system (/home/abc/test). The snapshot is mounted on /tmp/snapshot and then 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 command 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 backup on the snapshot by name, enter: /usr/sbin/backsnap -m /tmp/snapshot/janetsb -s size=16M -i -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 volume. 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 backup 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 volume. It then mounts the snapshot on /tmp/snapshot/janetsb and backs up the data in the snapshot by inode to the /dev/rmt0 device. After the backup completes, the snapshot is deleted. # example snapshot In this demonstration, the file system is called /opt/portal. With a size of 512M, it has just over 281M of data files. # lsfs |grep -w portal /dev/fslv02 -- /opt/portal jfs2 1048576 rw yes no # df -m |grep portal /dev/fslv02 512.00 231.60 55% 7 1% /opt/portal # pwd /opt/portal # ls app_be app_fr app_nl lost+found To create an external snapshot, as a rule, I create it at about half the size of the original file system. The IBM documentation recommends the size be 10 to 15 percent of the source file system. However, I like to give the snapshot plenty of room and err on the side of safety. In this scenario, roughly 50 percent translates into 250M. The common format to create a snapshot is: snapshot -o snapfrom= -o size= Now to create the external snapshot: # snapshot -o snapfrom=/opt/portal -o size=250M Snapshot for file system /opt/portal created on /dev/fslv04 A logical volume is automatically created to hold the snapshot. To confirm it.s been created, query the snapshot of the file system in question, using the snapshot command, like so: # snapshot -q /opt/portal Snapshots for /opt/portal Current Location 512-blocks Free Time * /dev/fslv04 524288 523520 Sun Nov 4 10:57:46 GMT 2012 At this point, I can mount the snapshot to view the copied data, but first the directory where it.s to be mounted, needs to be created: # mkdir /snap_portal # mount -v jfs2 -o snapshot /dev/fslv04 /snap_portal # df -m |grep portal /dev/fslv02 512.00 231.60 55% 7 1% /opt/portal /dev/fslv04 256.00 255.62 1% - - /snap_portal Now, I can cd into that snapshot ( /snap_portal) and view the copied files; note that the file system is read only with no writes allowed: # cd /snap_portal # ls app_be app_fr app_nl lost+found # ls >file1 file1: The file system has read permission only. At this point, I could take a further backup of the snapshot file system to tape or SAN. Assuming I.ve done some data maintenance on /opt/portal and accidentally removed a file, I could simply copy the removed file back from the mounted snapshot into /opt/portal. But for now, let.s create another snapshot of /opt/portal: # snapshot -o snapfrom=/opt/portal -o size=250M Snapshot for file system /opt/portal created on /dev/fslv05 Like before, query the snapshots of /opt/portal: # snapshot -q /opt/portal Snapshots for /opt/portal Current Location 512-blocks Free Time /dev/fslv04 524288 523520 Sun Nov 4 10:57:46 GMT 2012 * /dev/fslv05 524288 523520 Sun Nov 4 11:00:53 GMT 2012 In the above output the * denotes the most recent snapshot. If I no longer needed a snapshot I could delete it using the snapshot command. The common format to remove a snapshot is: snapshot -d For example, to remove the fslv04, I could use: # snapshot -d /dev/fslv04 Suppose I now needed to restore the whole file system due to some update that had gone wrong on /opt/portal. I can choose which snapshot to rollback. For me, this is one of the main selling points of snapshots. If you.ve taken quite a few snapshots, you have multiple points from which to restore. For our demonstration, I.ll rollback the snap taken at 10:57 which is /dev/fslv04. I would first unmount all the snapshots (if they were mounted), then unmount /opt/portal, before issuing the rollback command. In this example, it.s Sunday, Nov. 4, at 10:57. The common format for the rollback command is: rollback -v When a rollback occurs, all snapshots of that file system will be removed. To rollback and restore to the original file system /opt/portal, I could use: # umount /opt/portal # rollback -v /opt/portal /dev/fslv04 Restoring block 1 Restoring block 1000 Restoring block 2000 ... Restoring block 12000 Total blocks restored = 12809 rmlv: Logical volume fslv04 is removed. rmlv: Logical volume fslv05 is removed. Rollback complete To confirm that no snapshots are left, list the snapshots: # snapshot -q /opt/portal /opt/portal has no snapshots. Now, we can remount /opt/portal and have the original contents of the file system restored! # mount /opt/portal # Backsnap The backsnap does most of the work for you in the background. It creates the logical volume to hold the snapshot, then copies the contents into an archived file or onto a tape device. The backed-up files can then be restored using the restore command. Using the /opt/portal file system to create the backsnap, let's see how it hangs together. A common format for the backsnap command is: backsnap -m -s size -f In this example, I will use the following values: /backsnap_portal is the temp mount point; 250M is the size; /opt/dump/backup_portal is the archive file; and /opt/portal will be the source file system. # backsnap -m /backsnap_portal -s size=250M -f /opt/dump/backup_portal /opt/portal Snapshot for file system /opt/portal created on /dev/fslv05 backup: Backing up /dev/rfslv05 to /opt/dump/backup_portal. backup: There are an estimated 286768 1k blocks. backup: There are 287321 1k blocks on 1 volumes. backup: The backup is complete. We now have an archive file called: backup_portal, in the directory:/opt/dump. Looking at the size of the archive, it.s 280M: # du -ms /opt/dump/backup_portal 280.56 backup_portal To confirm the files are present in the archive, I could list the files, using the restore command, like so: # restore -tvf /opt/dump/backup_portal To restore the file app_be from the archived file back to /opt/portal, I could use: # cd /opt/portal # restore -xvf /opt/dump/backup_portal app_be. Extracting directories from media. Initializing the symbol table. Extracting requested files.. Specify the next volume number: 1 Extracting file ./app_be. To take a snap and place the files on tape rmt0, using the attributes as in the previous backsnap, I could use: # backsnap -m /backsnap_portal -s size=250M -f /dev/rmt0 /opt/portal If you.ve taken a snapshot and the contents have gone to tape, use the restore command to list the tape, like so: # restore -tvf /dev/rmt0 The snapshot taken can also be listed using the command: # snapshot -q /opt/portal Snapshots for /opt/portal Current Location 512-blocks Free Time * /dev/fslv08 524288 522496 Sun Nov 4 11:30:25 GMT 2012 If you decide to remove the snapshot, the archived file or the files that went to tape will remain intact, unlike the removal of an external snapshot. That is, unless you.ve previously taken a further backup to some media of that snapshot. Keep an Eye on Space As a system admin, I believe snapshots are a great way of taking online backups, and having the capability of restores if events go wrong. Remember, though, to keep an eye on the space used in the file systems; you don.t want to get invalid snapshots because you ran out of space. ##################### # 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 online 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 agblksize=4096 if DB_BLOCK_SIZE>= 4k. Failure to implement these agblksize guidelines is likely to result in a severe performance penalty. # Do not under any circumstances, use CIO mount option for the filesystem containing the Oracle binaries (!!!). Additionally, do not use DIO/CIO options for filesystem 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 |more ############## # 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' ############################ # Manage the print subsystem ############################ Tasks Commands Show current print subsystem. switch.prt -d Switch print subsystem. switch.prt -s [aix | systemv] Manage spooler group. [lssrc | startsrc | stopsrc] -g spooler Manage qdaemon. [lssrc | startsrc | stopsrc] -s qdaemon ############################ # Manage local print devices ############################ List all defined printers and plotters. lsdev -C -c printer | sort -u List all supported printers and lsdev -P -c printer -F "type subclass plotters. description" | sort -u Add a printer/plotter device. mkdev -c printer -t type -s subclass -p parentname -w connection-location Move a printer/plotter device to chdev -l name -p parentname -w another port. connection-location Change/show characteristics of a chdev -l Name -w Connection-location -a printer/plotter device. Attribute='value' Remove a printer/plotter device. rmdev -l Name [-d] Configure a defined printer/plotter mkdev -l Name device (makes a defined device available for use). Install additional printer/plotter /usr/lib/instl/sm_inst installp_cmd -a software. -c -g -Q -X -d '/dev/cd0' -f 'printers' '-G' Change/show printer driver settings. splp [lpn] ##################### # Manage print queues ##################### Add a print queue. mkque [-D] -q Name [-a 'Attribute = Value'...] Change/show print queue chque -q Name [-a 'Attribute=Value'...] characteristics. chvirprt -d QueueDeviceName -q PrintQueueName -a Attribute=Value... Remove a print queue (after rmquedev removing all queue devices). rmque -q Name rmvirprt List all print queues. lsallq Show status of print queues (by enq, qchk, lpq, lpstat queue, by job, by user). Start a print queue. enq -U, qadm -U, enable Stop a print queue. enq -D, qadm -D, disable Set the default print queue. /usr/lib/lpd/pio/etc/piochdfq -q default_queue ###################### # Manage queue devices ###################### List all queue devices. lsallqdev -q queuename Add a queue device to an existing mkquedev queue. Change/show characteristics of a chquedev queue device. Remove a queue device. rmquedev Manage print jobs Submit a print job. enq, qprt, lpr, lp Cancel a print job. enq, qcan, lprm, cancel Show status of print jobs. enq, qchk, lpq, lpstat Prioritize a print job. enq, qpri Hold/release a print job. enq, qhld Move a job between print queues. enq, qmov Manage the lpd print server List remote clients with print access. ruser -sP Add print access for a remote client ruser -a -p remotehost (/etc/hosts.lpd). Remove print access for a remote ruser -d -p remotehost client (/etc/hosts.lpd). Manage the print server (lpd). [lssrc | startsrc | stopsrc] -s lpd Programming tools Change/show virtual printer lsvirprt attributes. ########################################## # 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 -d 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 #################### # supported printers #################### root@kerp-sap003:/> lsdev -Pc printer printer hplj-2 parallel Hewlett-Packard LaserJet II printer hplj-3 parallel Hewlett-Packard LaserJet III printer hplj-3si parallel Hewlett-Packard LaserJet IIISi printer hplj-4 parallel Hewlett-Packard LaserJet 4,4M printer hplj-4+ parallel Hewlett-Packard LaserJet 4 Plus printer hplj-4000 parallel Hewlett-Packard LaserJet 4000 printer hplj-4500 parallel Hewlett-Packard Color LaserJet 4500 printer hplj-5si parallel Hewlett-Packard LaserJet 5Si/5Si MX printer hplj-5siMopier parallel Hewlett-Packard LaserJet 5Si Mopier printer hplj-8000 parallel Hewlett-Packard LaserJet 8000 printer hplj-8500 parallel Hewlett-Packard Color LaserJet 8500 printer hplj-D640 parallel Hewlett-Packard LaserJet 5000 D640 Printer printer hplj-c parallel Hewlett-Packard LaserJet Color printer opp parallel Other parallel printer printer hplj-2 rs232 Hewlett-Packard LaserJet II printer hplj-3 rs232 Hewlett-Packard LaserJet III printer hplj-3si rs232 Hewlett-Packard LaserJet IIISi printer hplj-4 rs232 Hewlett-Packard LaserJet 4,4M printer hplj-4+ rs232 Hewlett-Packard LaserJet 4 Plus printer hplj-4000 rs232 Hewlett-Packard LaserJet 4000 ########################## # 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 /usr/lib/lpd/pio/etc/piomisc_ext mkpq_remote_ext -q 'ZSD1-PK-Fach2' -h 'koel-dru117.unity.media.corp' -r 'koel-dru117-PK-Fach2' -t 'aix' -C 'FALSE' -p 'FALSE' -d 'ZSD1-PK-Fach2' /usr/lib/lpd/pio/etc/piomisc_ext mkpq_remote_ext -q 'ZSD1' -h 'koel-prn001.unity.media.corp' -r 'koel-dru117-PK-Fach2' -t 'aix' -C 'FALSE' -p 'FALSE' -d 'ZSD1' # HP-GL2 Drucker /usr/lib/lpd/pio/etc/piomkjetd mkpq_jetdirect -p 'hplj-4000' -D gl -q 'ZSD1' -h 'koel-dru117.unity.media.corp' -x '9100' # PCL Drucker /usr/lib/lpd/pio/etc/piomkjetd mkpq_jetdirect -p 'hplj-4000' -D pcl -q 'ZSD1' -h 'koel-dru117.unity.media.corp' -x '9100' ############################ # Add printer to print queue ############################ /usr/lib/lpd/pio/etc/piomkjetd mkpq_jetdirect -p 'hplj-4000' -Q 'ZSD1' -D 'pcl' -h 'koe-dru129_sap.unity.media.corp' -x '9100' ##################################### # remove a printer from a print queue ##################################### /usr/lib/lpd/pio/etc/piomkjetd rmpq_jetdirect 'ZSD1:hp@Koel-Dru239_sap' #################### # change print queue #################### -z '!' = portrait -Q '4' = A4 /usr/lib/lpd/pio/etc/piochpq -q 'ZSD1' -d 'hp@koel-dru117' -z '!' -Q '4' qprt flag Description -dp Sets the data type. Use -dp for passthrough, -da for text and -ds for PostScript. -p17 Sets the pitch (characters per inch). Usually, the allowed values are -p10, -p12, and -p17. Sometimes the -p17 needs to be combined with -s lineprinter. -z+ Sets the page orientation. -z+ is landscape and -z! is portrait. Sometimes -z0, -z1, -z2 and -z3 are used. -Y1 Sets duplex or simplex. -Y0 simplex, -Y1 duplex, -Y2 simplex tumble and -Y3 duplex tumble. -u2 Selects the input paper tray. The number is printer dependent and you may need to do some testing. -j! Do not initialize the printer; -j+ initializes, which is the default. -v8 Sets the lines per inch. The usual allowed values are -v6 and v8 -w80 Sets the page width in columns -l66 Sets the page length in lines #################### # delete print queue #################### /usr/lib/lpd/pio/etc/piomkjetd rmpq_jetdirect 'Z5C0:hp@Z5C0' /usr/sbin/piomisc_base two_devices rmpq 'ZSD1-PK-Fach2' ############################## # delete jobs from print queue ############################## qcan -PQueueName -x JobNumber The following list contains examples of how to use the qcan command: * To cancel job number 123 on whichever printer the job is on, type the following: qcan -x 123 * To cancel all jobs queued on printer lp0, type the following: qcan -X -Plp0 ################################################ # 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 local 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 server1,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 -d 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 ################################### # detail info about printqueue jobs ################################### root@kerp-sap003:/> lpstat -pZ5M3 -t Queue Dev Status Job Name From To Submitted Rnk Pri Blks Cp PP % ------- ----- --------- --------- --- --- ----- --- ---- -- QUEUED 1 000eVPfd.PK1 pk1adm pk1adm 03/27/12 09:31:05 1 14 22 1 /var/spool/qdaemon/tH-aoEa QUEUED 2 000eVpFB.PK1 pk1adm pk1adm 03/27/12 09:31:39 2 14 22 1 /var/spool/qdaemon/t0Xacia QUEUED 3 000eXTXN.PK1 pk1adm pk1adm ############## # 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 root@kerp-sapt003:/>qprt -? usage: qprt [-cCnr] [-Bnn|-Bna|-Bng|-Ban|-Baa|-Bag|-Bgn|-Bga|-Bgg] [-aPreviewOpt] [-ALevel] [-bBottomMargin] [-dInputType] [-DUser] [-eEmpasizedOpt] [-EDblHigh] [-fFilter] [-FFontFile] [-gBegin] [-GCoord] [-hHeader] [-HHostname] [-iIndent] [-IFontID] [-jInit] [-JRestore] [-kColor] [-K] [-lLength] [-LLineWrap] [-mMessage] [-QValue] [-MMessageFile] [-NNumberCopies] [-OPaperHandl] [-PPrinter] [-pPitch] [-qQuality] [-r] [-RPriority] [-sNameType] [-SSpeed] [-tTopMargin] [-TTitle] [-uPaperSrc] [-UDirectional] [-vLinesPerIn] [-VVertical] [-wPageWidth] [-WDblWide] [-xLineFeed] [-XCodePage] [-yDblStrike] [-YDuplex] [-zRotate] [-ZFormFeed] [-#h] [-#j] [-#v] File ... Starts a print job. ##################### # 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=aix1d689ba01c7447fc285256cdb007df019 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 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/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 ################# # savebase failed ################# # /export/images> extendlv -e x lv_nim01 16 0516-1734 extendlv: Warning, savebase failed. Please manually run 'savebase' before rebooting. # /export/images> savebase # /export/images> savebase -v non-bootable LV name given # /export/images> bootlist -m normal -o hdisk0 pathid=1 hdisk0 pathid=0 # /export/images> bosboot -ad /dev/hdisk0 bosboot: Boot image is 49180 512 byte blocks. # /export/images> savebase -v saving to '/dev/hd5' 46 CuDv objects to be saved 134 CuAt objects to be saved 18 CuDep objects to be saved 9 CuVPD objects to be saved 354 CuDvDr objects to be saved 6 CuPath objects to be saved 0 CuPathAt objects to be saved 0 CuData objects to be saved 0 CuAtDef objects to be saved Number of bytes of data to save = 20110 Compressing data Compressed data size is = 6934 bi_start = 0x3600 bi_size = 0x1820000 bd_size = 0x1800000 ram FS start = 0x8d6ca0 ram FS size = 0xea31d5 sba_start = 0x1803600 sba_size = 0x20000 sbd_size = 0x1b1a Checking boot image size: new save base byte cnt = 0x1b1a Wrote 6938 bytes Successful completion # /export/images> # check echo "##########################" echo "# bootlist -m normal -o -v" echo "##########################" bootlist -m normal -o -v echo "#####################" echo "# getconf BOOT_DEVICE" echo "#####################" getconf BOOT_DEVICE echo "####################" echo "# bootinfo -B hdisk0" echo "####################" bootinfo -B hdisk0 echo "####################" echo "# bootinfo -B hdisk1" echo "####################" bootinfo -B hdisk1 ################################## # 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 ######## # 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 --> Dmrzag.net Cw localhost $?$m$. Dj$m DSmail.?.de --> DSmail.rzag.net DM --> DMrzag.net Fuer intern Dm --> Dmrzag.net Cw localhost $?$m$. Dj$m DSmail.?.de --> DSmail.intern.rzag.net DM --> 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
######################### # 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 test2 ################ # 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 # # 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 cd /usr/samples/tcpip/sendmail/cf /usr/bin/m4 ../m4/cf.m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf ######################################################################## # mails nicht zustellbar DNS lookup Error - nslookup funktioniert jedoch ######################################################################## DS Smarthost in [] setzen - von nun an wird kein MX-Lookup gemacht sondern ein nslookup ##################### # rewrite mailaccount ##################### to rewrite account xyz@hostname.domain.subdomain do: - comment out the genericstable entry in sendmail.cf - echo "account account@mydomain.subdomain" > /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:multi: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: |uniq -c|awk '$1==2{print}'|wc -l rm -f /tmp/ps.out.1 rm -f /tmp/ps.out.2 ############################# # Asynchronous I/O in AIX 6/7 ############################# What about asynchronous I/O? Synchronous and asynchronous I/O refers to whether or not an application is waiting for the I/O to complete to begin processing. Appropriate usage of asynchronous I/O can significantly improve the performance of writes on the I/O subsystem. The way it works is that it essentially allows an application to continue processing while its I/O completes in the background. This improves performance because it allows I/O and application processing to run at the same time. Turning on asynchronous I/O really helps in database environments. How can you monitor asynchronous I/O server utilization? Both iostat and nmon can monitor asynchronous I/O server utilization. Monitoring asynchronous I/O and changing the parameters is only possible if you have executed an application that requires asynchronous I/O. The AIX kernel enables the asynchronous I/O components. This can lead to confusion when trying to alter parameters as the ability to change them is unavailable until the module has been loaded. To determine whether asynchronous I/O has been enabled, you can check the output of the ioo command, as shown in Listing 1. Listing 1. Checking the output of the ioo command # ioo -a aio_active = 0 aio_maxreqs = 65536 aio_maxservers = 30 aio_minservers = 3 aio_server_inactivity = 300 j2_atimeUpdateSymlink = 0 j2_dynamicBufferPreallocation = 16 j2_inodeCacheSize = 200 j2_maxPageReadAhead = 128 j2_maxRandomWrite = 0 j2_metadataCacheSize = 200 j2_minPageReadAhead = 2 j2_nPagesPerWriteBehindCluster = 32 j2_nRandomCluster = 0 j2_syncPageCount = 0 j2_syncPageLimit = 16 lvm_bufcnt = 9 maxpgahead = 8 maxrandwrt = 0 numclust = 1 numfsbufs = 196 pd_npages = 65536 posix_aio_active = 0 posix_aio_maxreqs = 65536 posix_aio_maxservers = 30 posix_aio_minservers = 3 posix_aio_server_inactivity = 300 You can see from this listing that both the aio_active and posix_aio_active values are set to zero. The other parameters are configurable and will become enabled when the corresponding subsystem has been used. The aio kernel processes are now available as aioLpool and aioPpool (see Listing 2). Listing 2. aio kernel processes are available as aioPpool and aioLpool. l488pp065_pub[/] > pstat -a|grep aio 37 a 250068 1 250068 0 0 1 aioPpool 38 a 260052 1 260052 0 0 1 aioLpool The result is that the aio system takes up less memory and process space. The tunable parameters, for example aio_maxservers, are now configured per CPU tunable and specify the maximum number of servers that can be created. Note that changing these values will not change the immediate number of servers available, only the maximum created by the kernel when there is existing outstanding I/O. Additional parameters you may want to change are the maximum number of asynchronous I/O requests (aio_maxreqs) which alter the request queue size, and the aio_server_inactivity which controls when asynchronous services are killed when no more requests exist. To change the parameters, you can use either ioo or smit. You can find the asynchronous parameters within Performance & Resource Scheduling, Tuning Kernel & Network Parameters, and Tuning IO Parameters. Within smit, you can get good idea of both the current and the maximum possible values. The iostat -A command reports back asynchronous I/O statistics if the kernel modules are loaded (see Listing 3). Listing 3. iostat -A command # iostat -A System configuration: lcpu=2 drives=3 ent=0.60 paths=4 vdisks=4 aio: avgc avfc maxgc maxfc maxreqs avg-cpu: % user % sys % idle % iowait physc % entc 0 0 32 0 4096 6.4 8.0 85.4 0.2 0.1 16.0 Disks: % tm_ act Kbps tps Kb_read Kb_wrtn hdisk0 0.5 2.0 0.5 0 4 hdisk1 1.0 5.9 1.5 8 4 hdisk2 0.0 0.0 0.0 0 0 What does this all mean? * avgc: This reports back the average global asynchronous I/O request per second of the interval you specified. * avfc: This reports back the average fastpath request count per second for your interval. * maxgc: This reports back the max global asynchronous I/O request since the last time this value was fetched. * maxfc: This reports back the maximum fastpath request count since the last time this value was fetched. * maxreqs: This is the maximum asynchronous I/O requests allowed. The major difference between aio and posixaio is that the two involve different parameter passing, so you really need to configure both. In AIX 7, as in AIX 6, the fsfastpath and fastpath tunables are no longer modifiable. They are now classed as restricted tunables and are set to 1 (enabled) by default. As such, they both enable asynchronous I/O requests to be sent directly to underlying disk (instead of through the corresponding subsystem and filesystem support), thus producing better performance. One last concept is I/O pacing. This is an AIX feature that prevents disk I/O-intensive applications from flooding the CPU and disks. Appropriate usage of disk I/O pacing helps prevent programs that generate very large amounts of output from saturating the system's I/O and causing system degradation. Tuning the maxpout and minpout helps prevent threads performing sequential writes to files from dominating system resources. You can also limit the effect of setting global parameters by mounting file systems using an explicit 0 for minput and maxpout: # mount -o minpout=0,maxpout=0 /u. Since AIX 6, the I/O pacing is enabled by default on the sys0 device, but you can also control the pacing on your other drives. Note that you can also remount existing filesystems and set the I/O pacing, which can be helpful if you want to alter the performance of a disk that is already actively providing service. ################# # check ssa place ################# If you want to check a pdisk or hdisk connected to which ssa adapater : # ssaadap -l 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() system 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 ################### # blocked processes ################### vmstat -Iwt 4 --> shows blocked procs in b collumn tprof -x sleep 60 trcstop cat __prof.all Try to see what is actually waiting: #crash ?set logfile=crash.out ?th - ?quit cat crash.out | grep -p Waiting ######### # 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 RSS (v flag) The real-memory (resident set) size of the process (in 1KB units). im obigen Beispiel wird 195464 KB also 195 MB genutzt! oder 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 # memory Usage 1 User svmon -U # 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 entfernt 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 ###### # AIX # alte 9er Version export NMON="vlntDpkA" # neue 10er Version export NMON="BlnmtdkAa" # vpathdevs export NMON="BlnmtekAa" # pcmdevs export NMON="BlnmtkAa" # Linux export NMON="Blnmtkd" nmon -h Hint: nmon [-h] [-s ] [-c ] [-f -d -t -r ] [-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 between refreshing the screen [default 2] -c 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 between refreshing the screen [default 2] -c of refreshes [default millions] -g User decided Disk Groups - file = on each line: group_name space seperated - 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 _YYYYMMDD_HHMM.nmon -F same as -f but user supplied filename -r 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 between snap shots -c of refreshes -l disks/line default 150 to avoid spreadsheet issues. EMC=64. -g User decided Disk Groups (see above -g) -D Skip disk configuration sections -E Skip ESS configuration sections -I 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 nmon changes to this directory before saving data to a file 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 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 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 nag@uk.ibm.com and Richard Cutler Feedback welcome - on the current release only and state exactly the problem 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 vorhandenen 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 werden die Adapter priorisiert. Die Last wird so gleichverteilt; sind Adapter gleich ausgelastet, so wird per Zufall zwischen ihnen gewaehlt. Diese Policy wird auch als Optimized bezeichnet. * rr - Round Robin Der Pfad fuer die anstehende I/O Operation wird per Zufall unter den Pfaden verteilt, der letzte aktive Pfad bzw. Adapter bleibt ausgenommen. * 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 steht auf Default, als wird die Last ueber Load Balancing verteilt. Die Policy kann 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. Die Befehle sind teilweise sehr wichtig: * addpaths - Fuegt einem bestehenden vpath-Device weitere Pfade zu. Das Kommando 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 Devices 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 hdisk12 sind also "virtuelle" Platten auf der lokalen Maschine, die ueber zwei verschiedene Fiber-Channel Adapter auf diesselbe, physikalische Platte in einer Storage 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 dpovgfix 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 sowie Pfade oeffnen und schliessen kann. Dazu dienen entsprechende Subkommandos. Nuetzlich sind folgende Kommandos zum Auslesen von Information: * datapath query device - Zeigt jedes bekannte Device mit zugehoeriger Information. * datapath query essmap - Zeigt Pfad und Lokation an. * datapath query portmap - Zeigt die Verteilung der Devices auf die Ports der 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 Moeglichkeiten angezeigt. Damit ist es leicht, die Kommandos zum Setzen der Parameter zu finden. Was passiert, wenn ich cfgmgr oder chdev ausfuehrt Beim Kommando cfgmgr ist zu beachten, dass er bei Platten, die schon eine PVID haben, pro Fiber-Channel Adapter einmal ausgefuehrt werden muss (cfgmgr findet die 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 mehr. Ruft man cfgmgr nochmal auf, ist die Platte im Zustand "Available" und wird nochmal 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 fuer vpath Device wie fuer eine der "virtuellen" hdisk eine PVID existiert und AIX davon ausgeht, dass es sich um physikalische Devices handelt. Dieser Fehler taucht in der Ausgabe des lsvpcfg-Kommandos auf (Attribut "pv" einer hdisk zugeordnet) 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 ein vpath verloren geht. Die VG muss varyon sein, aber die Filesysteme sollten nicht gemountet sein. Wie lege ich richtig Volume Groups an? Anlegen von Volume Groups mit SDD Platten erfordert bestimmte Kommandos, die "normalen" LVM Kommandos reichen nicht aus. Es gibt fuer alle SMIT Fenster und Kommandozeilen 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 VPATH bzw. SDD). Das ist teilweise nuetzlich, wenn man mit gelockten Devices kaempft. * VPATH_FAIL_RELPRESERVE - Wird ausgegeben, wenn ein Device geschlossen wurde, 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 das 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 wegnehmen. * VPATH_PATH_OPEN - Einer der Pfade eines vpath-Devices konnte nicht geoeffnet 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 angelegt werden. Es war aber kein Kernel-Memory mehr verfuegbar und der Aufruf ist fehlgeschlagen. * VPATH_DEVICE_OFFLINE - Nach mehreren erfolglosen Versuchen, I/O ueber einen Pfad abzusetzten, ist dieser Offline genommen und in den Status DEAD gesetzt worden. * VPATH_DEVICE_ONLINE - Wenn ein Pfad nicht erreichbar ist (DEAD), kann er per auto_failback wieder aktiviert werden. Dabei wird nach 2000 I/O Aufrufen der Pfad wieder angesprochen. Funktioniert es, geht der Status nach OPEN. Funktioniert der I/O nicht, so wird der Pfad zwar wieder online genommen, aber erst nach weiteren 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 dann ausgegeben wird. Welche Platten unterstuetzt ein System den als MPIO faehig? Mit dem Kommando odmget -q DvDr=aixdiskpcmke PdDv |more. ################################ # sdd (subsystem device driver): ################################ It designed to support the multipath configuration in the ESS. The software used to balance ESS I/O traffic across all adapters. It provides multiple access to data from the host. when using sdd cfgmgr is run 3 times (cfgmgr -l fcs0, cfgmgr -l fcs1, cfgmgr (the third one builds the vpaths)) 3 policies exist for load balancing: -default: selecting the path with the least number of current I/O operations -round robin: choosing the path, that was not used for the last operation (alternating if 2 pathes exist) -failover: all I/O sent ove the most preferred path, until a failure is detected. SDDSRV: SDD has a server daemon running in the background: lssrc/stopsrc/startsrc -s sddsrv If sddsrv is stopped, the feature that automatically recovers failed paths disabled. vpath: A logical disk defined in ESS and recognized by AIX. AIX uses vpath instead of hdisk as a unit of physical storage. root@aix40m25a: /dev # lsattr -El vpath0 active_hdisk hdisk20/00527461/fscsi1 Active hdisk False active_hdisk hdisk4/00527461/fscsi0 Active hdisk False policy df Scheduling Policy True <-path selection policy pvid 0056db9a77baebb90000000000000000 Physical volume identifier False qdepth_enable yes Queue Depth Control True serial_number 00527461 LUN serial number False unique_id 1D080052746107210580003IBMfcp Device Unique Identification False policy: fo: failover only - all I/O operations sent to the same paths until the path fails lb: load balancing - the path is chosen by the number of I/O operations currently in process lbs: load balancing sequential - same as before with optimization for sequential I/O rr: round ropbin - path is chosen at random from the not used paths rrs: round robin sequential - same as before with optimization for sequential I/O df: default - the default policy is load balancing datapath set device N policy change the SDD path selection policy dynamically DPO (Data Path Optimizer): it is a pseudo device (lsdev | grep dpo), which is the pseudo parent of the vpaths root@xx40m25a: / # lsattr -El dpo SDD_maxlun 1200 Maximum LUNS allowed for SDD False persistent_resv yes Subsystem Supports Persistent Reserve Command False -------------------------------- software requirements for SDD: -host attachment for SDD (ibm2105.rte, devices.fcp.disk.ibm.rte) - this is the ODM extension The host attachments for SDD add 2105 (ESS)/2145 (SVC)/1750 (DS6000)/2107 (DS8000) device information to allow AIX to properly configure 2105/2145/1750/2107 hdisks. The 2105/2145/1750/2107 device information allows AIX to: - Identify the hdisk(s) as a 2105/2145/1750/2107 hdisk. - Set default hdisk attributes such as queue_depth and timeout values. - Indicate to the configure method to configure 2105/2145/1750/2107 hdisk as non-MPIO-capable devices ibm2105.rte: for 2105 devices devices.fcp.disk.ibm.rte: for DS8000, DS6000 and SAN Volume Controller) -devices.sdd.53.rte - this is the driver (sdd) it provides the multipath configuration environment support -------------------------------- addpaths dynamically adds more paths to SDD vpath devices (before addpaths, run cfgmgr) (running cfgmgr alone does not add new paths to SDD vpath devices) cfgdpo configures dpo cfgvpath configures vpaths cfallvpath configures dpo+vpaths dpovgfix fixes a vg that has mixed vpath and hdisk physical volumes extenfvg4vp this can be used insteadof extendvg (it will move pvid from hdisk to vpath) datapath query version shows sdd version datapath query essmap shows vpaths and their hdisks in a list datapath query portmap shows vpaths and ports --------------------------------------- datapath query adapter information about the adapters State: -Normal adapter is in use. -Degraded one or more paths are not functioning. -Failed the adapter is no longer being used by SDD. datapath query device information about the devices 8datapath query device 0) State: -Open path is in use -Close path is not being used -Failed due to errors path has been removed from service -Close_Failed path was detected to be broken and failed to open when the device was opened -Invalid path is failed to open, but the MPIO device is opened --------------------------------------- datapath remove device X path Y removes path# Y from device# X (datapath query device, will show X and Y) datapath set device N policy change the SDD path selection policy dynamically datapath set adapter 1 offline lsvpcfg list vpaths and their hdisks lsvp -a displays vpath, vg, disk informations lquerypr reads and releases the persistent reservation key lquerypr -h/dev/vpath30 queries the persistent resrevation on the device (0:if it is reserved by current host, 1: if another host) lquerypr -vh/dev/vpath30 query and display the persistent reservation on a device lquerypr -rh/dev/vpath30 release the persisten reservation if the device is reserved by the current host (0: if the command succeeds or not reserved, 2: if the command fails) lquerypr -ch/dev/vpath30 reset any persistent reserve and clear all reservation key registrations lquerypr -ph/dev/vpath30 remove the persisten reservation if the device is reserved by another host --------------------------------------- Removing SDD (after install a new one): -umount fs on ESS -varyoffvg (if HACMP and RG is online on other host: vp2hd ) <--it converts vpaths to hdisks) -rmdev -dl dpo -R <--removes all the SDD vpath devices -stopsrc -s sddsrv <--stops SDD server -if needed: rmdev -dl hdiskX <--removes hdisks (lsdev -C -t 2105* -F name | xargs -n1 rmdev -dl) -smitty remove -- devices.sdd.52.rte -smitty install -- devices.sdd.53.rte (/mnt/Storage-Treiber/ESS/SDD-1.7) -cfgmgr --------------------------------------- Removing SDD Host Attachment: -lsdev -C -t 2105* -F name | xargs -n1 rmdev -dl <--removes hdisk devices -smitty remove -- ibm2105.rte (devices.fcp.disk.ibm) --------------------------------------- Change adapter settings (Un/re-configure paths): -datapath set adapter 1 offline -datapath remove adapter 1 -rmdev -Rl fcs0 (if needed: for i in `lsdev -Cc disk | grep -i defined | awk '{ print $1 }'`; do rmdev -Rdl $i; done) -chdev -l fscsi0 -a dyntrk=yes -a fc_err_recov=fast_fail -chdev -l fcs0 -a init_link=pt2pt -cfgmgr; addpaths --------------------------------------- Reconfigure vpaths: -datapath remove device 2 path 0 -datapath remove device 1 path 0 -datapath remove device 0 path 0 -cfgmgr; addpaths -rmdev -Rdl vpath0 -cfgmgr;addpaths --------------------------------------- Can't give pvid for a vpath: root@aix40m25a: / # chdev -l vpath6 -a pv=yes Method error (/usr/lib/methods/chgvpath): 0514-047 Cannot access a device. in errpt:DEVICE LOCKED BY ANOTHER USER RELEASE DEVICE PERSISTENT RESERVATION # lquerypr -Vh /dev/vpath6 <--it will show the host key # lquerypr -Vph /dev/vpath6 <--it will clear the reservation lock # lquerypr -Vh /dev/vpath6 <--checking again will show it is OK now ######## # sddpcm ######## SDDPCM is a loadable path control module designed to support the multipath configuration environment in the IBM TotalStorage Enterprise Storage Server, the IBM System Storage SAN Volume Controller, and the IBM TotalStorage DS family. When the supported devices are configured as MPIO-capable devices, SDDPCM is loaded and becomes part of the AIX MPIO FCP (Fibre Channel Protocol) device driver. The AIX MPIO device driver with the SDDPCM module enhances the data availability and I/O load balancing. You cannot install SDD and SDDPCM together on a server. When supported storage devices are configured as non-MPIO capable devices (that is, multiple logical device instances are created for a physical LUN), you should install SDD to get multipath support. Where only one logical device instance is created for a physical LUN you must install SDDPCM. SDDPCM server daemon: SDDPCM has a server daemon running in the background: lssrc/stopsrc/startsrc -s pcmsrv psmsrv provides path-recovery function for SDDPCM devices these module added to the kernel: sddpcmke, sdduserke pcmpath pcmpath query adapter shows adapter configuration pcmpath query version shows the version of the sddpcm pcmpath query device shows the sddpcm devices (pcmpath query device 44 <--shows only this device) pcmpath query essmap good overview pcmpath set device algorithm dynamically change the path selection algorithm pcmpath set device hc_mode dynamically chane the path health check mode pcmpath set device hc_interval dynamically change the path healthcheck time interval pcmpath set device M path N online/offline dynamically enable (online) or disable (offline) a path pcmpath set adapter N online/offline dynamically enable (online) or disable (offline) an adapter (SDDPCM resereves the last path of a device, it will fail if the device is using the last path) pcmquerypr reads and clear persisten reserve and registration keys pcmquerypr -vh /dev/hdisk30 to query and display the persistent reservation pcmquerypr -rh /dev/hdisk30 release the persistent reservation if the device is reserved by the current host pcmquerypr -ch /dev/hdisk30 remove the persistent reservation and clear all reservation key registration pcmquerypr -ph /dev/hdisk30 remove the persistent reservation if the device is reserved by the other host pcmgenprkey set or clear the PR_key_value ODM attribute for all SDDPCM MPIO devices ------------------------------------ Change adapter settings (reconfigure paths): 1. If possible put the required adapter offline with the subsystem driver (pcmpath,dlnkmgr): (this will put into Disabled state) -pcmpath set adapter 3 offline -dlnkmgr offline -hba 08.07 2. Put all the Disabled path to Defined: -for i in `lspath | grep Dis | grep fscsiX| awk '{print$2}'`; do rmpath -l $i -p fscsiX; done 3. If there are other paths still in Enabled or Failed state put them into Defined: -rmpath -l hdisk9 -p fscsi1 4. Remove all devices from ODM from the mentioned adapter: -rmdev -Rl fcs2 -lsdev -p fscsi2 <--should not show the disks 5. Change the adapter settings -chdev -l fscsi1 -a dyntrk=yes -a fc_err_recov=fast_fail -chdev -l fcs1 -a init_link=pt2pt 6. Config: -cfgmgr ########################################## # check queue_depth for ESS, DS6k DS8k,VSP ########################################## # check for greater 0 fcstat fcs0|egrep "No" World Wide Node Name: 0x20000000C984F9F3 No DMA Resource Count: 0 No Adapter Elements Count: 0 No DMA Resource Count: 0 No Adapter Elements Count: 0 No Command Resource Count: 0 # check for hitachi disk /usr/local/bin/check_queue_depth_for_vios # controle parametres disques XP="PCMxparray fail_over 32 no_reserve" VSP="PCMHitachi round_robin 16 no_reserve" INTERN="PCMscsiscsd fail_over 16 no_reserve" echo $HOSTN for i in `lspv |cut -c1-8` do a=`lsattr -El $i | egrep "PCM|queue_depth|reserve_policy|algorithm " | sed -e "s#/friend/##g" | awk ' {print $2}'` b=`echo $a` case "$b" in $XP ) echo "XP ok $i $b " ;; $VSP ) echo "VSP ok $i $b " ;; $INTERN ) echo "INTERN ok $i $b" ;; * ) e=`echo $a | awk ' {print $1}'` echo $e case $e in PCMxparray ) echo "Error config for $i parm: $b " echo "for XP $XP " ;; PCMHitachi ) echo "Error config for $i parm: $b " echo "for HDS $VSP " ;; PCMscsiscsd ) echo "Error config for $i parm: $b " echo "for SCSI $INTERN " echo "Error config for $i parm: $b " echo "Unknow disk " ;; * ) ;; esac ;; esac done queue_depth 3 (three) IO Queue Depth 1 to 256 The number of concurrent outstanding I\u2044O requests that can be queued on the disk. Additional requests will be blocked and the 'sqfull' value shown with 'iostat -DR' will increase. Make sure you set the queue_depth on the corresponding VIO client disk to the same value!! My recommended values. IBM XIV = 32 IBM SVC = Various - See Here IBM SDD and SDDPCM = 20 EMC Symmetrix and Clariion = 16 Hitachi USPV and VSP = 32 Hitachi HDS 9910 and 9960 = 8 VENDOR=Hitachi VENDOR=IBM VENDOR=EMC QUEUE_DEPTH=32 QUEUE_DEPTH=20 # check lsdev -Cc disk|grep ${VENDOR}|awk '{print $1}'|while read DISK; do echo "${DISK}"; OLDQUEUE=`lsattr -El ${DISK}|egrep "queue"|awk '{print $2}'`; echo "Actual queue_depth ${OLDQUEUE} expected queue_depth ${VENDOR} Default=${QUEUE_DEPTH}"; done # change lsdev -Cc disk|grep ${VENDOR}|awk '{print $1}'|while read DISK; do echo "${DISK}"; OLDQUEUE=`lsattr -El ${DISK}|egrep "queue"|awk '{print $2}'`; echo "Changing queue_depth from ${OLDQUEUE} to ${VENDOR} Default=${QUEUE_DEPTH}"; chdev -P -l ${DISK} -a queue_depth=${QUEUE_DEPTH}; done or vios_advisor # Calculate max LUN's on VIOS: lsattr -El fcs0|grep num_cmd_elems num_cmd_elems 2048 Maximum number of COMMANDS to queue to the adapter True Formel: (max command elements - 2) / (queue_depth + 3) = max Anzahl LUN's (2048 - 2) / (2 + 3) = 409,2 for i in `lspv|grep -v rootvg |grep hdisk|awk '{print $1}'` oder lsdev -Cc disk |grep "Hitachi MPIO Disk"|awk '{print $1}'|while read i do echo "$i queue_depth `lsattr -El $i|grep "queue_depth"|awk '{print $2}'`" done # change to maximum NEWQUEUEDEPTH=20 for i in `lspv|grep -v rootvg |grep hdisk|awk '{print $1}'` oder lsdev -Cc disk |grep "Hitachi MPIO Disk"|awk '{print $1}'` do QUEUEDEPTH=`lsattr -El $i|grep "queue_depth"|awk '{print $2}'` echo "Change of $i from $QUEUEDEPTH to ${NEWQUEUEDEPTH}" # 2 = default if [ $QUEUEDEPTH = 2 ] then chdev -l $i -P -a queue_depth=${NEWQUEUEDEPTH} # falls disk nicht in Benutzung dann naechste Zeile aktivieren #chdev -l $i -a queue_depth=${NEWQUEUEDEPTH} fi done Boot erforderlich um die Parameter zu aktivieren ###### # mpio ###### Included as part of AIX at no charge. Packaged as a kernel extension and multipathing module (PCM, Path Control Module). Each storage device requires a PCM. PCM is storage vendor supplied code that gets control from the device driver to handle the path management. With AIX and multipathing (on IBM storage) we have the following options: -classic SDD: (ODM definitions: ibm2105.rte, SDD driver: deviceis.sdd.53.rte) -default PCM (MPIO): it comes with AIX (it is activated only if there are no SDD ODM definitions) -SDDPCM: SDD version which uses MPIO and has same commands as SDD (ODM def: devices.fcp.disk.ibm2105.mio.rte, SDDPCM driver:devices.sddpcm.53.rte) MPIO is installed as part of the base OS. Paths are discovered during system boot (cfgmgr) and disks are created from paths at the same time. No further configuration is required. By default fail_over is set to algorithm. To change it to round robin, first change reservation policy and then algorithm: chdev -l hdiskX -a reserve_policy=no_reserve chdev -l hdiskX -a algorithm=round_robin smitty mpio mkpath -l hdiskX -p fscsiY add extra path that are attached to an adapter lspath lists paths (lspath -l hdisk46) lspath -l hdisk44 -H -F "name path_id parent connection status" shows many info chpath changing path state (enabbled, disabled) chpath -s enabled -l hdisk -p vscsi0 it will set the path to enabled status rmpath -dl hdiskX -p fcsiY dynamically remove all paths under a parent adapter (-d: deletes, without it puts it to define state) (The last path cannot be removed, the command will fail if you try to remove the last path) rmpath -dl hdisk3 -p fscsi0 -w 50060e8000c3baf4,2000000000000 <--deletes a path Failed path handling: (there were Hitachi disks in Offline (E) state, but they were not unconfigured earlier) -lspath | grep -v Enab -rmpath -p fscsiX -d -cfgmgr -l fcsX -lspath | grep -v Enab -dlnkmgr view -lu -item ############# # list pathes ############# lspath -F 'status name path_id parent connection' # list pathes of a parent ADAPTER=fscsi1 lspath -p ${ADAPTER} -F 'status name path_id parent connection' # list pathes of a disk lspath -l hdisk114 -F 'status name path_id parent connection' ###################### # lspath failed pathes ###################### lspath -s dis -F 'status name path_id parent connection';lspath -s fai -F 'status name path_id parent connection' Failed hdisk0 0 vscsi0 810000000000 Failed hdisk1 0 vscsi1 810000000000 Failed hdisk2 0 vscsi1 820000000000 Failed hdisk3 0 vscsi1 830000000000 ############################################## # chpath enable failed paths after reboot vios ############################################## lspath -s dis -F 'status name path_id parent connection';lspath -s fai -F 'status name path_id parent connection' |while read STATUS DISK ID VSCSI CONNECTION do echo "enable Path ${DISK} ${VSCSI} ${CONNECTION}" chpath -s ena -l ${DISK} -p ${VSCSI} -w ${CONNECTION} done ########################### # delete paths for a parent ########################### ADAPTER=fscsi1 lspath -p ${ADAPTER} -F 'status name path_id parent connection'|while read STATUS NAME PATH_ID PARENT CONN do echo "rmpath -l ${NAME} -p ${PARENT} -w ${CONN} -d" done ######################## # io-verteilung auf lpar ######################## for load balancing to work, algorithm must be set to round_robin. but: sudo chdev -l hdisk5 -a algorithm=round_robin Method error (/etc/methods/chgdisk): 0514-018 The values specified for the following attributes are not valid: algorithm since native mpio only works in failover mode with this kind of setup,we have to do the "load balancing" manually. this means we redirect io to the unused path while maintaining the failover capability of the configuration. this would be a static LUN based load balancing setup. to do this, we set the priority for hdisk5 path via vscsi0 to a lower value. meaning the path via vscsi1 is the primary path. since most of the disks are using vscsi0, hdisk5 will then not contend to the bandwidth on vscsi0. so we set the path to vscsi0 to priority=2: chpath -l hdisk5 -p vscsi0 -w 860000000000 -a priority=2 path Changed checking the two paths: lspath -l hdisk5 -p vscsi0 -E priority 2 Priority True lspath -l hdisk5 -p vscsi1 -E priority 1 Priority True any I/O access now to/from hdisk5 will pass through vio2's fiber connection while still maintaining connection to vio1 in failover mode. # script fuer vg VSCSI=vscsi1 VSCSI_SEC=vscsi3 VG= lspv|grep $VG|awk '{print $1}'|while read DISK do CONNECTION=`lspath -F 'status name path_id parent connection'|grep $DISK|tail -1|awk '{print $5}'` PRIM_VSCSI=${VSCSI} echo "Changing Priority for $DISK on $PRIM_VSCSI to $VSCSI_SEC" chpath -l $DISK -p $PRIM_VSCSI -w $CONNECTION -a priority=2 done # back VSCSI=vscsi3 VSCSI_SEC=vscsi1 # script fuer logical volume root@kerp-sfs001 /> lspath -l hdisk20 Enabled hdisk20 vscsi1 Enabled hdisk20 vscsi3 root@kerp-sfs001 /> lsvg -l vg_smallworld vg_smallworld: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT lv_smallworld01 jfs2 2280 2280 8 open/syncd /gisdata lv_smallworld02 jfs2 1300 1300 7 open/syncd /giswork/share lv_smallworld03 jfs2 5 5 1 open/syncd /opt/giswork lv_smallworld04 jfs2 2280 2280 6 open/syncd /gisdata_new root@kerp-sfs001 /> lslv -l lv_smallworld04 lv_smallworld04:/gisdata_new PV COPIES IN BAND DISTRIBUTION hdisk15 380:000:000 21% 080:080:079:080:061 hdisk16 380:000:000 21% 080:080:079:080:061 hdisk17 380:000:000 21% 080:080:079:080:061 hdisk18 380:000:000 21% 080:080:079:080:061 hdisk19 380:000:000 21% 080:080:079:080:061 hdisk20 380:000:000 21% 080:080:079:080:061 VSCSI=vscsi1 VSCSI_SEC=vscsi3 LV=lv_smallworld04 lslv -l ${LV}|grep hdisk|awk '{print $1}'|while read DISK do CONNECTION=`lspath -F 'status name path_id parent connection'|grep $DISK|tail -1|awk '{print $5}'` PRIM_VSCSI=${VSCSI} echo "Changing Priority for $DISK on $PRIM_VSCSI to $VSCSI_SEC" chpath -l $DISK -p $PRIM_VSCSI -w $CONNECTION -a priority=2 done ###### # EMC: ###### EMC comes with the default settings. These settings are set by EMC technicians for the optimized performance. It is not recommended to change these configurations: queue_depth=16 init_link al dyntrk yes fc_err_recov fast_fail Because of queue_depth attributes which is 16 you may need to change num_cmd_elems attributes on FC card too. num_cmd_elems >= queue_depth * LUN numbers. Maximum num_cmd_elems could be 1024 OR 2048 which depend FC card type. ------------------ installed filesets: root@aixstdt14: /etc/emc # lslpp -L | grep EMC EMC.Symmetrix.aix.rte 5.3.0.3 C F EMC Symmetrix AIX Support EMC.Symmetrix.fcp.rte 5.3.0.3 C F EMC Symmetrix FCP Support EMCpower.base 5.3.1.0 C F PowerPath Base Driver and EMCpower.encryption 5.3.1.0 C F PowerPath Encryption with RSA EMCpower.migration_enabler EMCpower.mpx 5.3.1.0 C F PowerPath Multi_Pathing ------------------ EMCPOWERRESET: EMC has developed a binary called emcpowerreset for removing disk reservations, held by PowerPath devices, in the event that a node crashes. This binary is required for any HACMP installations on AIX 5.1, and higher when running PowerPath version 3.0.3 and higher. To determine the different emcpowerreset versions, run the following command: cksum emcpowerreset (or cksum /usr/lpp/EMC/Symmetrix/bin/emcpowerreset) Version 1 = 1108394902 7867 Version 2 = 1955156125 10311 The emcpowerreset binary takes as options two parameters, and these two parameters are automatically passed to the binary whenever it is invoked within the HACMP script logic. Reset reservation bit: If you run into not being able to access an hdiskpowerX disk, you may need to reset the reservation bit on it: # /usr/lpp/EMC/Symmetrix/bin/emcpowerreset fscsiX hdiskpowerX ------------------ smitty powerpath powermt version shows installed powerpath version powermt display shows short overview of hba, paths, managed classes powermt display paths shows the paths and dead paths to the storage port powermt display ports shows the storage ports information powermt display dev=all shows detailed info of all devices powermt display dev=hdiskpowerX shows detailed info of the specified device powermt display every= shows io stats on each adapter in the specified inerval /usr/lpp/EMC/Symmetrix/bin # ./inq.aix64_51 shows detailed info about the disks (type, serial numbers...) powermt remove hba=1 dev=all removes all pathes from an hba (it asks before reomving the last active path) powermt config configures back the pathes powermt disable hba=0 disables specified hba (it will show failed, errpt entry will also generated) - enable is needed later powermt enable hba=0 enables the specified hba powermt remove hba=2 dev=0 remove only 1 path from the specified devic powermt set mode=standby hba=1 dev=all sets the adapter to standby mode (it will be activated only if the other path failed) powermt unmanage class=hitachi powermt will not manage any hitachi devices powermt manage class=hitachi powermt will manage hitachi devices (not recommended, can cause trouble) powermt save file= saves powerpath configuration settings powermt load file= loads back powerpath configuration settings powermt restore dev=all it does an I/O path check, if a previously dead path is alive, it will be marked as alive (If you have dead I/O paths, and you fixed something, you can request PowerPath to re-check the paths.) powermt check check the I/O Paths (for example, if you manually removed an I/O path, it will detect a dead path and remove it from the list.) lsdev -Ct power shows the powerpath0 device (which is the pseudo parent of the hdiskpowerX devices) rmdev -dl powerpath0 this is needed for the full removing of powerpath -------------------------- removing a LUN: powermt display dev=19 powermt remove dev=19 rmdev -dl hdiskpower19 rmdev -dl hdisk59 rmdev -dl hdisk77 -------------------------- "powermt check" checks specified paths and, if desired, removes from the PowerPath configuration any paths marked dead. Warning: storage_system I/O path path_name is dead Do you want to remove it (y/n/a/q)? Valid responses are: y Remove the dead path, and continue checking remaining paths. n Do not remove the path, but continue checking remaining paths. a Remove the dead path and any subsequent paths marked dead. q Do not remove the dead path, and exit the command. Any paths that were already removed remain removed. -------------------------- Install: 0. preparations: -set FC adapter settings if needed: (init_link, dyntrk, fc_err_recov, num_cmd_elems) -remove already assigned EMC disks (if you see Other MPIO... (which is EMC) remove them, so cfgmgr will bring up correctly later) 1. ODM extension and Powerpath: -ODM_def_EMC.AIX.5.3.0.3: install only these: -EMC Symmetrix AIX Support Software -EMC Symmetrix FCP Support Software (Symmetrix MPIO and Symmmetrix Powerpath can't be installed on 1 system together.) -Powerpath_AIX.5.3.SP1: EMCpower: everything can be installed 2. add licence key (/mnt/Storage-Treiber/EMC/PowerPath_license) emcpreg -add XXXX-XXXX-XXXX-XXXX-XXXX-XXXX you can check if it is added: emcpreg -list or powermt check_registration (license key can be copied from an already installed system) 3. specifics for RAC,VIO (dual) and HACMP RAC and VIO (dual): set the reservation setting to no reserve in the ODM we have a script: /mnt/Storage-Treiber/EMC/emc_reserve.sh you will be asked: 1. Set reserve_lock=no in the PdAt for Symmetrix FCP devices. 2. Set reserve_lock=yes in the PdAt for Symmetrix FCP devices. choose #1 you can check the settings in the ODM: odmget PdAt | grep -p reserve | grep -p SYMMETRIX (deflt. should be on no) (reserve should be removed only for dual vio environment) HACMP: (full instruction: Host Connectivity Guide pg. 348) emcpowerreset utilit should be run, for HACMP to be able handle disk reservations correctly. It can be found here: /usr/lpp/EMC/Symmetrix/bin (makes sure it exists and root is the owner) smitty hacmp -> Ext. Conf. -> Ext. Res. Conf. -> HACMP Ext. Resources Conf. -> Conf. Custom Disk Methods -> Add Cust. Disk * Disk Type (PdDvLn field from CuDv) [disk/pseudo/power] * Method to identify ghost disks [SCSI3] + * Method to determine if a reserve is held [SCSI_TUR] + * Method to break a reserve [/usr/lpp/EMC/Symmetrix/bin/emcpowerreset] + Break reserves in parallel true + * Method to make the disk available [MKDEV] + Configure the same custom disk processing method on each node in the cluster and synchronize the cluster resources. (if you want NFS exports, same major numbers are needed for the hdispowerX devices) 4. Configure Powerpath to not manage other disks (ESS, Hitachi) (this is very important, otherwise Powerpath try to manage them, and can cause problems) change this (with vi) in /etc/emc/mpaa.lams root@aixstdt14-adm.lsy.dlh.de: /etc/emc # cat mpaa.lams global:version:5.3.0 managed:symm managed:clariion unmanaged:hitachi unmanaged:invista unmanaged:hpxp unmanaged:ess unmanaged:hphsx (this file will be used when configuring the paths) 5. Run config manager cfgmgr -S (this will config the devices sequentially. This way recommended to avoid troubles of parallel config.) (normal cfgmgr is OK as well) if needed, run : powermt config you can setup this link as well: ln -s /usr/lpp/EMC/Symmetrix/bin/inq.aix64_51 /usr/sbin/inq -------------------------- problem with bosboot after pprootdev fix: pprootdev fix, can help if rootvg is on hdiskpower devices and we have problems with bosboot. "bosboot -a" wants to use that disk, what is used during boot (bosboot -b), this disk should be in the output of "lsvg -p" after we did pprootdev fix. It can happen that pprootdev fix will put rootvg to a different disk, so bosboot will fail Solution: put the unneeded paths to failed state, that do pprootdev fix, so rootvg will be only on that disk what is available (what is used during boot). Then the other paths can be put back to available. Commands for determining which disk are needed: -odmget -q"name=rootvg and attribute=pv" CuAt | grep value value = "00080e82a47d2e5d0000000000000000" value = "00080e828106fa470000000000000000" -odmget -q "value=00080e828106fa470000000000000000 and attribute=pvid" CuAt <--this disks list is important CuAt: name = "hdisk12" attribute = "pvid" value = "00080e828106fa470000000000000000" type = "R" generic = "D" rep = "s" nls_index = 2 CuAt: name = "hdisk8" attribute = "pvid" value = "00080e828106fa470000000000000000" type = "R" generic = "D" rep = "s" nls_index = 2 0 comments Labels: STORAGE Adapter Connector can be PCI: -FC HBA - Fibre Channel Host Bus Adapter fcsx - hardware adapter, fscsix - fc-scsi protocol device (logical device) (scsi protocol over the fc protocol) fcstat fcsX fiber channel statistics report -SCSI HBA - SCSI Host Bus Adapter sisscsiaX - SCSI ADAPTER (internal disks are connected to this) lsdev -C | grep sisscsia list the scsi adapters lsdev -Cs scsi -H lists the scsi devices with location code ---------------------------------------- A host bus adapter is a physical Fibre Channel adapter that can be assigned to a logical partition. ------------------------------------- ################### # ADAPTER SETTINGS: ################### root@aix21b09: / # lsattr -El fscsi0 attach switch How this adapter is CONNECTED False <-- shows actual connection protocol (None,switch,al lehet) dyntrk no Dynamic Tracking of FC Devices True <-- dynamically follows SAN changes fc_err_recov delayed_fail FC Fabric Event Error RECOVERY Policy True <-- 3. delayed_fail or fast_fail scsi_id 0x133300 Adapter SCSI ID False sw_fc_class 3 FC Class for Fabric True root@aix21b09: / # lsattr -El fcs0 bus_intr_lvl 305 Bus interrupt level False bus_io_addr 0xffc00 Bus I/O address False bus_mem_addr 0xfffbf000 Bus memory address False init_link al INIT Link flags True <--al or pt2pt intr_priority 3 Interrupt priority False lg_term_dma 0x800000 Long term DMA True <--deafault 0x200000, max. 0x8000000 max_xfer_size 0x100000 Maximum Transfer Size True <--default is 100000, max 1000000 num_cmd_elems 200 Maximum number of COMMANDS to queue to the adapter True <--default 200, max is 1024 or 2048 pref_alpa 0x1 Preferred AL_PA True sw_fc_class 2 FC Class for Fabric True attach:(sets the Fiber Channel topology) none: if no cable has been plugged in al: all devices are in a loop or ring, similar to token ring networking. The failure of one device causes a break in the ring. switch: all devices or loops of devices are connected to Fibre Channel switches, similar conceptually to modern Ethernet implementations dyntrk: http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/fast_fail_dynamic_interaction.htm If it is on yes, it enables dynamic changing of fibre channel cable connections on switch ports or storage ports. We have changed few StoragePorts to another Switch last saturday ==> that means, that the HardwarePath changed for these servers, where the Option "dyntrk" is set to no. --> reconfigure your disks fc_err_recov: http://publib.boulder.ibm.com/infocenter/systems/index.jsp?topic=/com.ibm.aix.prftungd/doc/prftungd/fast_fail_dynamic_interaction.htm delayed_fail: waits some time before acting. fast_fail is useful where multipathing software is used. This would support faster failover to alternate paths init_link: from online help: "Do not change this attribute unless directed by IBM support." al: arbitrared loop : first tries al, then pt2pt, if not succes then link remains down pt2pt: tries pt2pt, if not succes then link remains down lg_term_dma: it controls the DMA memory resource that an adapter driver can use. If you have a dual port adapter the maximum value is divided between the adapter ports. max_xfer_size: controls the maximum transfer size. You can increase this value to improve performance. Different storages might need different values to utilize the performance num_cmd_elems: Maximum number of commands to be queued to the adapter. When a large number of supported storage devices are configured, you can increase this to improve performance. if queue_depth=16 (hdisk or power path) and we have 10 disks, num_cmd_element should be minimum 160 ----------------------- ############################### # HOT PLUG adapter replacement: ############################### 0. lsslot -c pci (check if the adapter hot pluggable) 1. paths are better in offline (C) state: dlnkmgr offline -hba 01.01 ------- it can be done with "smitty mpio" as well: > MPIO Management > MPIO Path Management > Remove Paths > Disable Paths under a Parent ------- 2. rmdev -Rl fcs1 <--(-R: unconfigures the device and its children, -l: specifies the logical device) 3. adapter replacement: diag --> task selection --> hot plug task ---> PCI Hot Plug Manager ---> Replace/Remove... After starting it, adapter will blink. During replacement we should leave this menu point in open,after replacement we can close this menu point in diag (enter) (If this menu option is in open state, it will lock the adapter and configuring it is not possible, so should be closed.) 4. cfgmgr, the new device will come up with new WWN (lscfg -vpl fcsX, lsattr -El fscsiX) 5. mail to storage team, for mapping the storage to the new WWN 6. Another cfgmgr will bring up the new disks 7. put adapter to online state: dlnkmgr online -hba 01.01 ------------------------ Adapter replacement with SDD dynamically (hot plug): datapath query adapter <--identify the adapter to be replaced datapath remove adapter X <--X is the adapter number to be removed ("select counts" shows I/O still running on other adapt.) rmdev -dl fcsX -R <--remove fcs0 and all of its child devices (lsdev -Cc disk, should not show any device) diag --> task selection --> hot plug task ---> PCI Hot Plug Manager ---> Replace/Remove... (from command line: lscfg -vpl fcs0| grep Adapter -> drslot -R -c pci -s P1-I8 <--P1-I8 is the slot location) go to the ESS specialist to update the WWN of the new adapter (the zone information of the fabric switch must be updated) cfgmgr <--check with lsdev -Cc adapter, lsdev -Cc disk addpaths <--configure the new adapter and its child devices to SDD ------------------------ Adapter parameter change with SDD: lsattr -El fcsX, lsattr -El fscsiX <--checking the needed settings (num_cmd_elements, fc_err_recov,...) rmdev -dl dpo -R <--remove SDD vpath devices rmdev -l fcsX -R <--put fc adapter and its children devices to Defined state chdev -l fcsX -a num_cmd_elems=1024 chdev -l fscsiX -a fc_err_recov=fast_fail cfgmgr -l fcsX <--configiure the fc adapter, children devices and hdisks cfallvpath <--configure SDD vpath devices (if they were removed) ################################## # 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 $wert 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'' 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 fslv04 paging00 local01VG tftboot01LV export01LV 0516-1246 rmlv: If bootlv00 is the boot logical volume, please run 'chpv -c ' 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 (shieh@austin.ibm.com) 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 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 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 # 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 -m / -a bf=true -A 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 -m / -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 agblksize=512 -A yes ############################### # mklvcopy - spiegeln eines LVs ############################### Auf bestimmter platte einen Spiegel ablegen mklvcopy # mklvcopy oltpLV 2 hdisk13 Automatisch auf separate Disk spiegeln mklvcopy -s y direkt spiegeln # mklvcopy -k -s y 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'' -v cplv -y'local02LV' -v'rootvg' local01LV cplv -y'application04LV' -v'application01VG' application02LV ############################################################ # Moving from a Journaled File System to Raw Logical Volumes ############################################################ To move from a journaled file system to raw devices without having to manually reload all the data, perform the following steps as the root user: 1. Create a raw device (preferably, in a BigVG) using the new raw logical volume device type (-T O), which enables putting the first Oracle block at offset zero for optimal performance: # mklv -T O -y new_raw_device VolumeGroup NumberOfPartitions Note: The raw device should be larger than the existing file. In addition, you must bear in mind the size of the new raw device to prevent wasting space. 2. Set the permissions on the raw device. 3. Use dd to convert and copy the contents of the JFS file to the new raw device as follows: # dd if=old_JFS_file of=new_raw_device bs=1m 4. Rename the data file. ############################################################ # Moving from Raw Logical Volumes to a Journaled File System ############################################################ The first Oracle block on a raw logical volume is not necessarily at offset zero. However, the first Oracle block on a file system is always at offset zero. To determine the offset and locate the first block on a raw logical volume, use the $ORACLE_HOME/bin/offset command. The offset can be 4096 bytes or 128 KB on AIX logical volumes or zero on AIX logical volumes created with the mklv -T O option. When you have determined the offset, you can copy over data from a raw logical volume to a file system using the dd command and skipping the offset. The following example assumes an offset of 4096 bytes: # dd if=old_raw_device bs=4k skip=1|dd of=new_file bs=256 You can instruct Oracle Database to use a number of blocks smaller than the maximum capacity of a raw logical volume. If you do this, then you must add a count clause to ensure that only data that contains Oracle blocks is copied. The following example assumes an offset of 4096 bytes, an Oracle block size of 8 KB, and 150000 blocks: # dd if=old_raw_device bs=4k skip=1|dd bs=8k count=150000|dd of=new_file bs=256k ############# # rename a lv ############# chlv -n'' 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 root@localhost /> extendlv lv_tdwh01 1197 hdisk27 hdisk28 hdisk29 0516-404 allocp: This system cannot fulfill the allocation request. There are not enough free partitions or not enough physical volumes to keep strictness and satisfy allocation requests. The command should be retried with different allocation characteristics. Look with smitt chlv on * Logical volume NAME lv_tdwh01 Logical volume TYPE [jfs2] + POSITION on physical volume middle + RANGE of physical volumes maximum + MAXIMUM NUMBER of PHYSICAL VOLUMES [17] # Change it with: /usr/sbin/chlv -u'50' lv_tdwh01 ################## # 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 |head -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 |head -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 hd2 to hdisk5, type: migratelp hd2/3/2 hdisk5 # To move third mirror copy of the 25th logical partitions of logical volume testlv 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/twister 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 Achtung: 1 JFS2 does not have nbpi or fragment size values to affect the resulting size of the file system. 2 You cannot shrink a filesystem if the requested size is less that a physical partition size. At least one physical partition size is asked to be reduced. 3 Shrinking a file system that has snapshots is not allowed. 4 During a shrink of the file system, writes to the file system are blocked. 5 During the period that the shrink or extend is running, the file system is not accessible. Large file systems with inline logs might not be usable for as long as several minutes. The inline log must be completely reformatted. 6 When the new file system size is specified, but its inlinelog size is NOT specified, the new logsize will be adjusted (extended/shrunk) proportionally, based on the specified extended/shrunk file system size. The log size increase or reduction should not be more than 40% of the file system size increase or reduction. 7 When a new file system size is not specified and there is an inlinelog, if a new logsize is specified, the file system size might be changed to include the new log size. 8 The freed space reported by the df command is not necessary the space that can be truncated by a shrinkFS request due to filesystem fragmentation. A fragmented filesystem may not be shrunk if it does not have enough free space for an object to be moved out of the region to be truncated, and shrinkFS does not perform filesystem defragmentation. In this case, the chfs command should fail with the returned code 28 (ENOSPC). ####################### # 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 -v sourcelogicalvolume chfs -a dev=/dev/ -a log= / mount / rmlv ######### # 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 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 '' chfs -u 'I03sapdata' /oracle/I03/sapdata17 mount -t xyz to mount filesystems umount -t xyz to umount filesystems but 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 ####### # lsjfs ####### # lsjfs /usr/local #MountPoint:Device:Vfs:Nodename:Type:Size:Options:AutoMount:Acct:OtherOptions:LvSize:FsSize:FragSize:Nbpi:Compress:Bf:AgSize: /usr/local:/dev/localLV:jfs:::1089536:rw:yes:no::1089536:1089536:4096:4096:no:true:8: # lsjfs2 #MountPoint:Device:Vfs:Nodename:Type:Size:Options:AutoMount:Acct:OtherOptions:LvSize: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::70254592:70254592:4096:yes:yes:65536: /oracle/P03/sapdata2:/dev/lvsapdatap02:jfs2::P03sapdata:70254592:rw:no:no::70254592:70254592:4096:yes:yes:65536: /oracle/P03/sapdata3:/dev/lvsapdatap03:jfs2::P03sapdata:70254592:rw:no:no::70254592:70254592:4096:yes:yes:65536: /oracle/P03/sapdata4:/dev/lvsapdatap04:jfs2::P03sapdata:70254592:rw:no:no::70254592: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/tbgaus?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 root@cws [~]#whichlpp tcopy lppname: bos.rte.archive location: /usr/bin/tcopy ########################### # 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 the 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 Adapter 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 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 pri 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 - multithreaded 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 drivers. lvmb/lvmbb (disk/lvm) - runs at floating pri of 60 Used to get bad block structures - used in bad block relocations. jfsc (filesystem compression) - decompresses/compresses JFS data on compressed filesystems. Runs at fixed priority of 30. rtcm/rtcmd (RPC transport connection manager) - used by NFS kernel extension. 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 replacement 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 LVM 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 PVNAME BOOT DEVICE PVID VOLUME GROUP ID hdisk0 YES 00423471584e7264 0090392912a5103f hdisk1 YES 00903929121ba344 0090392912a5103f hdisk2 NO 0020195528875d41 0090392912a5103f hdisk3 NO 002019552887591a 0090392912a5103f hdisk4 NO 009039292057621a 00903929ac9d54cc hdisk5 NO 00903929a9feef97 00903929ac9d54cc hdisk6 NO 009039299b4ca747 00903929a9b2345a hdisk17 NO 000762714f520335 00903929134829fb hdisk18 NO 000762714f52324a 00903929134829fb hdisk117 NO 000987fc47972c82 00903929134829fb hdisk118 NO 000987fc47969f77 00903929134829fb ############################## # change * to ! in /etc/passwd ############################## What are you needing to do this for? Has 'bob' been deactivated and now needs to be reactivated? If so, and there's already an entry in /etc/security/passwd for bob with his old password, you can use the pwdadm -c bob command. This will flip the star to a bang in /etc/passwd, place a star on the password line (meaning no password) in /etc/security/passwd (creating the entry if it's not already there). If you want bob to change the password, execute pwdadm -f ADMCHG. To query the last update string, pwdadm -q bob. To set a new password, pwdadm bob. ############################## # creating new random password ############################## < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c8 ############################## # increment with leading zeros ############################## I want to increment a count which is a six digit number, with leading zeros. typeset -Z6 i=0001 (( i += 1 )) echo $i gives 000002 or !/bin/ksh integer i i=0 while [ $i != 10000 ] do printf "%06d\n" $i i=i+1 done ############################ # kill all process of a user ############################ The most effective way would be to write a script which would include the following logic: 1.) su - bill 2.) killall 3.) exit kill -9 `ps -uBill -opid=` ###################### # mail with attachment ###################### cat $FILE | uuencode $FILE | mail -s $SUBJ $RCPT ######################################## # Cleanup and reset the spooler system : ######################################## # stopsrc -cg spooler (will stop the spooler daemons) # rm /etc/qconfig.bin (will remove the compiled version of the /etc/qconfig file) # rm /var/spool/lpd/qdir/* (will remove all queued jobs) # rm /var/spool/lpd/stat/* (will remove all queues and devices status files) # rm /var/spool/lpd/pio/@local/msg* # rm /var/spool/qdaemon/* # rm /var/spool/lpd/* # ps -ef | grep pio (then kill all processes start with pio) # ps -ef | grep qd (then kill all processes start with qd) # ps -ef | grep srcmstr (if there is more than one occurrence for "srcmstr" kill the ones with the higher PIDs) # startsrc -g spooler ######## # rmssys ######## loescht service aus src (system resource controller) ######## # mkssys ######## erstellt service in src (system resource controller) # aus tsm-scheduler einen dienst machen mkssys -s dsmc -G tsm -u 0 -p /usr/tivoli/tsm/client/ba/bin/dsmc -a schedule -o /dev/console \ -e /var/adm/ras/dsmerror.log -R -Q -S n1 -f 9 -E 38 -w 10 ########################################## # configuring look auf login prompt in AIX ########################################## As was already stated, to change the pre-login message, you must modify the "herald" stanza in /etc/security/login.cfg In /etc/security/login.cfg, change the "herald" line as follows... herald = "^[[2Jlogin: " where the first "^[" is one character (the ESC character) created by pressing CTRL-V followed by CTRL-[ This escape sequence (^[[2J) will clear the screen leaving the cursor where it's at so all the user will see is: login: If you want the login at the bottom of the screen, follow the escape sequence with a bunch of newlines: herald = " ^[[2Jlogin\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nlogin:" herald = "\nlogin:" The number of newlines is up to you. If you want NO prompt, use just the escape sequence: herald = "^[[2J" chsec -f /etc/security/login.cfg -s default -a herald=" Notice to Users\r\n\r\nUse of this machine waives all rights to your privacy,\r\n\r and is consent to be monitored.\r\n\rUnauthorized use prohibited,\r\n\r\n\r\nlogin: " #################### # unix prompt config #################### The default user prompt on Unix is "$" and the root prompt is "#". In this article you will find how you can change the prompt to display a lot of useful information. The same or other information can also be displayed in the windows title. The prompt is set by changing the PS1 environment setting. Some examples: 1. Username in prompt PS1="$USER >" Result: "user1 >" 2. Username and hostname in prompt PS1="$USER@$(hostname) >" Result: "user1@host1.mydomain.com" If your hostname is the hostname including your domain name you can truncate the domain name. 3. Username with truncated hostname in prompt PS1="$USER@$(hostname| awk -F . '{print $1}' ) >" Result: "user1@host1 >" 3. Username, hostname and current path in prompt PS1=$(echo "$USER@$(hostname| awk -F . '{print $1}') "'$PWD'" >") Result: "user1@host1 /home/user1 >" 4. Username, hostname, current Oracle SID and current path in prompt PS1=$(echo "$USER@$(hostname| awk -F . '{print $1}') "'$ORACLE_SID'" "'$PWD'" >") Result: "user1@host1 MainDB /home/user1 >" By putting all this information in the prompt the prompt can get extremely long. In the next example all the information is on one line and the prompt on the next line. 5. Prompt on two lines PS1=$(echo "\n[$USER@$(hostname| awk -F . '{print $1}') "'$ORACLE_SID'" "'$PWD'"] $(echo "\n")> ") Result: [user1@host1 MainDB /home/user1 ] > All the information can also be set in the windows title. This only works on "terminals" that support this option. So in the profile you best test the "TERM" environment setting first. This option also works with putty ssh sessions. Below a little script you can add to your personal profile or to your system profile. The prompt will look like: [ user1@host1 MainDB /home/user1 ] $ The windows title will look like: host1 as user1 {MainDB} /home/user1 When this user switches to root the prompt will look like: [ root@host1 / ] $ The windows title will look like: host1 as root {} / The name between <> is the real user name so it will always be "The first user" and will not change to the display name of root. Running a lot (putty) sessions to different Unix systems from windows you will get one grouped putty item. When clicking on this taskbar group you can quickly find the session you are looking for. The hostname is at the front of the windows title to make it easier to find the right session. When activating this script on every Unix system in your environment you can telnet, rsh, ssh and "su" as much as you want, the information on the prompt AND in the windows title will always be accurate. See Microsoft article kb#281628 (http://support.microsoft.com/kb/281628) to change the behavior of the grouping on windows. Changing the grouping setting to "2", windows will always group all applications. # Prompt settings REALUSER=$(who am i |head -1 |awk '{print $1}') REALNAME=$(cat /etc/passwd |grep "^$REALUSER:" |awk -F ':' '{print $5}') HOSTNAME=`hostname | awk -F . '{ print $1 }'` if [ "$USER" = "root" ] then PS2='# ' else PS2='$ ' fi PS1="" if [ "$TERM" = "xterm" -o "$TERM" = "dtterm" -o "$TERM" = "aixterm" ] then PS1=$(echo "\033]0;$HOSTNAME as $USER {"'$ORACLE_SID'"} <$REALNAME> "'$PWD'"\007") fi PS1=$PS1$(echo "\n[ $USER@$HOSTNAME "'$ORACLE_SID'" "'$PWD'" ]$(echo "\n$PS2")") export PS1 ################################# # tcpdump - snoop von Netzpaketen ################################# tcpdump -I -i en0 -I = ohne Pufferung direkte Ausgabe -i = Interface (en0, en1, enx) -x = hexprint -v = verbosity expr kann folgendes sein: host Hostname oder IP die gesnoopt werden soll (host aixinstall0) port Portname der gesnoopt werden soll (port 80) dst port portname destination src port portname source net pakete eines netzwerks # tcpdump from a specific host /usr/sbin/tcpdump -I -vvv -w /tmp/tcpdump.out -i en0 host xxx.xxx.xxx.xxx ############################# # herausfinden, ob Port aktiv ############################# nur bei p640 und hoeher netstat -v ent0 |grep RJ45 aixinstall1:/etc/postfix#netstat -v ent0 |grep RJ45 RJ45 Port Link Status : up ########################## # MAC-Adresse herausfinden ########################## netstat -v ent0|grep ardware; netstat -v|grep ETHER kurzschlus:/export/conf#netstat -v|grep ardware;netstat -v|grep ETHER Hardware Address: 08:00:5a:f8:b9:19 Hardware Address: 00:04:ac:de:95:e8 ETHERNET STATISTICS (ent0) : ETHERNET STATISTICS (ent1) : atm-karte MAC-Adresse ermitteln: lscfg -vl atm0 -v ##################### # atmle lan-emulation ##################### smitty atmle_panel ###################### # status atm-interface ###################### entstat -d atm0 The driver flags are particularly informative: - Up The LE client has been opened. - Running The LE client is connected with the LAN Emulation Servers and is operational. - Limbo Network recovery mode. The LE client lost contact with one or more LAN Emulation Servers. - Dead A hard failure has occurred. The LE client is no longer operational. atmstat -d atm0 ##################### # troubleshooting atm ##################### atmstat -d atm0 | grep Virtual Connections Virtual Connections in use: 10 Max Virtual Connections in use: 64 Virtual Connections Overflow: 0 lsattr -El atm0 -a min_vc min_vc 32 Minimum Guaranteed VCs Supported True erhoehen von min_vc chdev -l atm0 -a min_vc=64 # MCA-Adapter atmstat -d atm0 | grep overflow Small Mbuf overflow: 0 Medium Mbuf overflow: 0 Large Mbuf overflow: 0 Huge Mbuf overflow: 0 MTB Mbuf overflow: 0 falls overflow check: lsattr -El atm0 -a max_lrg_bufs max_lrg_bufs 400 Maximum Large ATM mbufs True We want to increase this value by 10 percent; so, we run the following command: chdev -l atm0 -a max_lrg_bufs=440 atmstat -d atm0 | grep "No " The output for our atm0 is as follows: No mbuf Errors: 0 Packets Dropped - No small DMA buffer: 0 Packets Dropped - No medium DMA buffer: 0 Packets Dropped - No large DMA buffer: 0 Receive Aborted - No Adapter Receive Buffer: 0 Transmit Attempted - No small DMA buffer: 0 Transmit Attempted - No medium DMA buffer: 0 Transmit Attempted - No large DMA buffer: 0 Transmit Attempted - No MTB DMA buffer: 0 Transmit Attempted - No Adapter Transmit Buffer: 0 lsattr -El atm0 -a med_highwater med_highwater 30 Minimum Medium ATM mbufs True aenderung +10% chdev -l atm0 -a med_highwater=33 ############# # mpoa-client ############# mpcstat -a ############## # core anaylse ############## kopiere core-file und programm welches den core verursacht in ein tmp-dir. anschliessend: dbx core where ############################################## # find out name list from stripped executables ############################################## stripnm #################################### # pruefen welche route pakete nehmen #################################### kurzschlus:/home/kutz>ping -R aixinstall1 PING aixinstall1: (172.28.255.11): 56 data bytes 64 bytes from 172.28.255.11: icmp_seq=0 ttl=255 time=1 ms RR: aixinstall1 (172.28.255.11) aixinstall0 (172.28.255.10) 64 bytes from 172.28.255.11: icmp_seq=1 ttl=255 time=0 ms (same route) 64 bytes from 172.28.255.11: icmp_seq=2 ttl=255 time=0 ms (same route) 64 bytes from 172.28.255.11: icmp_seq=3 ttl=255 time=0 ms (same route) 64 bytes from 172.28.255.11: icmp_seq=4 ttl=255 time=0 ms (same route) ^C ----aixinstall1 PING Statistics---- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 0/0/1 ms ################# # hostnew command ################# kurzschlus:/home/kutz>hostnew -a www Trying domain "intern.rzag.net" rcode = 3 (Non-existent domain), ancount=0 Trying domain "rzag.net" rcode = 0 (Success), ancount=1 www.rzag.net is www.yline-esolutions.de rcode = 0 (Success), ancount=1 www.yline-esolutions.de is 193.168.131.119 ################################# # verzeichnisse nfs reexportieren ################################# exportfs -a ################################### # nfs-mount in der /etc/filesystems ################################### Hardmount: /usr/sbin/mknfsmnt -f '/usr/app/twister' -d '/vol/vol0/unix/appl/twister' -h 'filer2-ext.prod.primus-online.de' '-n' '-B' '-A' -t 'rw' -w 'bg' '-Y' '-Z' '-X' '-H' '-j' '-q' '-g' Softmount: /usr/sbin/mknfsmnt -f '/usr/app/twister' -d '/vol/vol0/unix/appl/twister' -h 'filer2-ext.prod.primus-online.de' '-n' '-B' '-A' -t 'rw' -w 'bg' '-Y' '-Z' '-X' '-S' '-j' '-q' '-g' oder direkt eintragen in /etc/filesystems /usr/local/apachessl: dev = "/vol/vol0/unix/appl/apachessl-neu" vfs = nfs nodename = filer2-ext.prod.primus-online.de mount = true options = bg,soft,intr,rsize=8192,wsize=8192 account = false Wichtig Soft-Mount !!! ########################## # nfs-mount richtung filer ########################## mount -v'nfs3' -n'filer2.intern.rzag.net' -o rsize=8192 -o wsize=8192 -o soft -o bg -o proto=udp -o intr -o rw -o vers=3 /vol/vol0/unix/installserver /install_packages BACKUPNODE= VZ=/export mount -o bg,intr,proto=udp,vers=3 ${BACKUPNODE}:${VZ} /mnt VZ=/export/customize VZ=/export/fixes VZ=/export/lpp_source mount -o bg,intr,proto=udp,vers=3 ${BACKUPNODE}:${VZ} /mnt ############################## # nfs-mount optionen unter aix ############################## # nfso -a|grep use nfs_use_reserved_ports= 1 Falls nicht gesetzt, setzen # nfso -o nfs_use_reserved_ports=1 Anschliessend: stopsrc -s lockd;stopsrc -s statd ;startsrc -s statd;startsrc -s lockd ########## # chnfsmnt ########## chnfsmnt -f /import/filer2/appl/extern -d /vol/vol0/unix/appl/dmz -h filer2.intern.rzag.net -b 8192 -c 8192 chnfsmnt -f /import/filer2/appl/intern -d /vol/vol0/unix/appl/intern -h filer2.intern.rzag.net -b 8192 -c 8192 ############## # nfs-probleme ############## /etc/hosts gepflegt? Dienste gestartet? Funkt showmount -e Servername ? ################### # top CPU processes ################### kurzschlus:/#ps aux|tail +2 |sort -k 1.15,1.19nr root 516 98.6 2.0 264 6168 - A Jul 11 4941:12 kproc kutz 16458 0.5 0.0 544 380 pts/0 A Jul 13 10:27 topas root 1032 0.1 2.0 64 5960 - A Jul 11 3:59 kproc root 5676 0.1 1.0 3768 3080 - A Jul 11 3:18 /usr/local/bin/pe root 15936 0.1 0.0 212 20 - A Jul 12 5:13 /usr/sbin/nfsd 8 kutz 15758 0.0 0.0 924 680 pts/0 A Jul 12 0:00 -bash kutz 17056 0.0 0.0 928 1052 pts/1 A 21:45:43 0:00 -bash kutz 20572 0.0 0.0 924 552 pts/3 A Jul 12 0:00 -bash nobody 13736 0.0 0.0 660 280 - A Jul 11 0:51 /usr/sbin/tftpd - ################### # processes by user ################### kurzschlus:/#ps -u kutz UID PID TTY TIME CMD 211 15758 pts/0 0:00 bash 211 16458 pts/0 10:27 topas 211 17056 pts/1 0:00 bash 211 20572 pts/3 0:00 bash ############################################ # processes whith paging activity and status ############################################ kurzschlus:/#ps vg PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND 0 - A 1:21 7 12 5916 xx 0 5904 0.0 2.0 swapper 1 - A 0:07 128 708 260 xx 25 36 0.0 0.0 /etc/init 516 - A 4943:43 0 264 6168 xx 0 5904 98.6 2.0 kproc 774 - A 0:04 18 16 5920 xx 0 5904 0.0 2.0 kproc 1032 - A 3:59 0 64 5960 xx 0 5904 0.1 2.0 kproc 1822 - A 0:00 0 16 5912 xx 0 5904 0.0 2.0 kproc 2212 - A 0:00 9 672 32 xx 55 0 0.0 0.0 /usr/lib/ 2648 - A 0:00 0 16 5912 xx 0 5904 0.0 2.0 kproc 2872 - A 1:17 1064 156 36 xx 2 4 0.0 0.0 /usr/sbin 3224 pts/2 A 0:00 1 356 544 xx 201 208 0.0 0.0 -ksh 3386 - A 0:00 75 348 152 xx 37 0 0.0 0.0 /usr/sbin ####################################################### # problem determination - find out which device is down ####################################################### > A PROBLEM WAS DETECTED ON Thu Dec 14 04:00:47 WET > 2000 801014 > The Service Request Number(s)/Probable Cause(s) > (causes are listed in descending order of probability): > 29A00003:Refer to the Error Code to FRU Index in the system service > guide. > FRU: 11K0459 P1/K1 Do $ lscfg -vp | grep -p 11K0459 to see which device incurred the error. ####################### # iostat plattenzugriff ####################### $ iostat -d|sort -k 5nr hdisk5 11.8 150.4 34.4 781858272 8234386 hdisk9 12.5 135.3 30.5 681328109 29598747 hdisk4 7.8 117.9 27.9 610924112 8234386 hdisk8 8.4 115.1 25.4 597785921 6731777 hdisk10 9.3 110.7 25.7 551921805 29598747 hdisk2 7.3 96.4 16.2 475991898 30308499 hdisk7 4.6 82.1 19.0 424640473 6731777 hdisk13 3.6 50.5 11.4 235201105 30308499 hdisk14 4.6 45.8 8.5 172167032 68184540 hdisk6 3.0 40.2 7.3 170913201 40027245 hdisk11 3.2 34.7 3.6 51766705 130306707 hdisk15 3.3 22.5 4.7 50001400 68184540 hdisk3 1.0 17.0 2.5 49319945 40027245 hdisk0 1.0 12.4 1.1 41448749 23901193 hdisk12 3.1 25.9 3.4 5702505 130306707 hdisk17 0.1 1.0 0.1 5035731 273433 hdisk16 0.1 1.1 0.1 4755436 1250709 hdisk1 0.9 4.6 1.0 40145 23901193 Disks: % tm_act Kbps tps Kb_read Kb_wrtn $ iostat -d|sort -k 6nr hdisk11 3.2 34.7 3.6 51774073 130308904 hdisk12 3.1 25.9 3.4 5702509 130308904 hdisk14 4.6 45.7 8.5 172167049 68184542 hdisk15 3.3 22.5 4.7 50001409 68184542 hdisk3 1.0 17.0 2.5 49319955 40027364 hdisk6 3.0 40.2 7.3 170913227 40027364 hdisk13 3.6 50.5 11.4 235213251 30308523 hdisk2 7.3 96.4 16.2 476024128 30308523 hdisk10 9.3 110.7 25.7 551940163 29598750 hdisk9 12.5 135.3 30.5 681346479 29598750 hdisk0 1.0 12.4 1.1 41456117 23904238 hdisk1 0.9 4.6 1.0 40149 23904238 hdisk4 7.8 117.9 27.9 610937285 8234414 hdisk5 11.8 150.4 34.4 781872138 8234414 hdisk7 4.6 82.1 19.0 424647686 6731814 hdisk8 8.4 115.1 25.4 597793263 6731814 hdisk16 0.1 1.1 0.1 4755445 1250716 hdisk17 0.1 1.0 0.1 5035748 273440 Disks: % tm_act Kbps tps Kb_read Kb_wrtn iostat -ts - shows overall system statistics iostat -ta - shows adapter statistics iostat -tm - shows MPIO device path statistics # use filemon.pl script for monitoring IO filemon -T 320000 -o /tmp/filemon.out; sleep 20; trcstop filemon.pl /tmp/filemon.out iostat 5 10 | /usr/local/bin/analyse_iostat or iostat 10 30 | /usr/local/bin/analyze_iostat ###### # sort ###### # cat kutest prod10vg prod11vg prod12vg prod1vg prod2vg prod3vg prod4vg prod5vg prod6vg prod7vg prod8vg prod9vg # cat kutest |sort -n -k 1.5 prod1vg prod2vg prod3vg prod4vg prod5vg prod6vg prod7vg prod8vg prod9vg prod10vg prod11vg prod12vg ##################### # /dev/null erstellen ##################### mknod /dev/null c 2 2 ################# # ssaraid pruefen ################# # ssaraid -I -l ssa0|grep fastwrite|uniq ssaraid: No RAID manager found for ssa0 ############################################# # ssaxlate zeige hdisk zu pdisk und umgekehrt ############################################# # for i in `lspv|grep -v hdisk0 |grep -vw hdisk1|awk '{print $1}'`; do echo "$i ist" `ssaxlate -l $i`; done ssaxlate: Illegal device specified hdisk0 ist ssaxlate: Illegal device specified hdisk1 ist hdisk2 ist pdisk0 hdisk3 ist pdisk1 hdisk4 ist pdisk2 hdisk5 ist pdisk3 hdisk6 ist pdisk4 hdisk7 ist pdisk5 hdisk8 ist pdisk6 hdisk9 ist pdisk7 hdisk10 ist pdisk8 hdisk11 ist pdisk9 hdisk12 ist pdisk10 hdisk13 ist pdisk11 hdisk14 ist pdisk12 hdisk15 ist pdisk13 hdisk16 ist pdisk14 hdisk17 ist pdisk15 ################################## # summe der kapazitaet der platten ################################## VAR1=0 VAR2=0 for i in `lspv|grep None|awk '{print $1}'` do VAR1=`bootinfo -s $i` let VAR2="$VAR1+$VAR2" done echo $VAR2 ######## # lsconf ######## ML08 Voraussetzung # lsconf System Model: IBM,9076-WCN Processor Type: PowerPC_604 Number Of Processors: 4 Memory Size: 3064MB Good Memory Size: 3064MB Firmware Version: IBM,L00278 Console Login: enable Auto Restart: false Full Core: false /usr/sbin/lsconf: set: unknown option: A Network Information Host Name: IP Address: Sub Netmask: Gateway: Name Server: Domain Name: Paging Space Information Total Paging Space: 2560MB Percent Used: 1% Volume Groups Information ============================================================================== rootvg: PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION hdisk0 active 268 32 00..32..00..00..00 hdisk1 active 268 104 00..32..32..00..40 ============================================================================== oracle01VG: PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION hdisk2 active 542 73 08..00..00..00..65 hdisk6 active 542 0 00..00..00..00..00 hdisk13 active 542 73 08..00..00..00..65 hdisk3 active 542 0 00..00..00..00..00 hdisk9 active 542 37 00..00..00..25..12 hdisk10 active 542 37 00..00..00..25..12 hdisk8 active 542 8 00..00..00..00..08 hdisk7 active 542 8 00..00..00..00..08 hdisk5 active 542 40 20..00..00..00..20 hdisk4 active 542 40 20..00..00..00..20 hdisk14 active 542 1 00..00..00..00..01 hdisk15 active 542 1 00..00..00..00..01 hdisk16 active 542 158 109..00..00..00..49 hdisk17 active 542 158 109..00..00..00..49 ============================================================================== 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 Script get_aix_microcode.ksh ############################ # Download latest mcode file ############################ cd /var/adm/invscout/microcode mv catalog.mic catalog.mic.old /usr/bin/wget http://techsupport.services.ibm.com/server/mdownload/catalog.mic anschliessend invscout ausfuheren und file zu ibm uploaden ########################################### # 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 =DADF69E4: Report = False Log = True 0 entries added. 0 entries deleted. 1 entries updated. # errupdate kutest # cat umstellung_errorreporter_tape_clean.txt =D1A1AE6F: Report = False Log = False =E507DCF9: Report = False Log = False # 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 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 # Now verify your changes by once again typing in: # /usr/lib/errdemon -l 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 Kill the process # kill -9 PID_NUMBER 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 ############################# # 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_logfile.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 page for syslog.conf, under "destination".) Step 2 - Restart syslogd and make sure it starts without the -R option (lowercase r is ok). The man page says the -R option disables the ability to recieve. I've 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 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 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 --> use geninstall instead ################## 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 # preview geninstall -I "a -cgpNQqwXY -J" -Z -d . EMC.CLARiiON.aix.rte geninstall -I "a -cgpNQqwXY -J" -Z -d . EMC.CLARiiON.fcp.rte # doing PAKET=EMC.CLARiiON.aix.rte geninstall -I "a -cgNQqwXY -J" -Z -d . ${PAKET} geninstall -I "a -cgNQqwXY -J" -Z -d . EMC.CLARiiON.fcp.rte ################ # 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 # lslpp -d rsct.compat.clients.hacmp Fileset Dependents ---------------------------------------------------------------------------- is a requisite of 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 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 ############ # 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 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 # 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 root@kerp-dwh001 /> alt_disk_install -X old_rootvg +-----------------------------------------------------------------------------+ ATTENTION: calling new module /usr/sbin/alt_rootvg_op. Please see the alt_rootvg_op man page and documentation for more details. Executing command: /usr/sbin/alt_rootvg_op -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 root@kerp-dwh001 /> alt_disk_copy -? Usage alt_disk_copy: Copy rootvg to Alternate Disk alt_disk_copy -d [-i ] [-s