AIX
Frequently-Asked Questions
Pour plus d'information au sujet de cette faq, contactez Jean-Louis BICQUELET
FAQ Revised: Friday 07 June 2013 20:34:18
Par exemple :
Tapez sur la tourche f8 ou
Tapez sur la tourche f6 ou
Par exemple pour nim:
#ODMDIR=/usr/lib/objrepos #odmget sm_menu_opt | awk ' ( $1 =="id" ) ||( $1 =="next_id") { print substr($3,2,length($3)-2) }' | sort |uniq |grep nim
Il suffit de modifier le grep en fonction des chemins chercher, ou de le retirer si on désire tous les fastpaths
connus par smit, pour lister les fastpath.
#cd #vi smit.log
Il est possible de rediriger ver un fichier donné les logs d'une sessions.
#smit -l logs
#smit -f shell
Le script correspondant est écrit dans le fichier shell.
smit -x
En particulier la vitesse et le type de processeur, la mémoire primaire et secondaire disponible, les caractéristiques réseaux...
#prtconf | head -n 27 System Model: IBM,7040-671 Machine Serial Number: 838000C Processor Type: PowerPC_POWER4 Number Of Processors: 3 Processor Clock Speed: 1500 MHz CPU Type: 64-bit Kernel Type: 64-bit LPAR Info: 4 batman Memory Size: 10240 MB Good Memory Size: 10240 MB Firmware Version: IBM,RG050215_d79e02_r Console Login: enable Auto Restart: true Full Core: true Network Information Host Name: batman IP Address: 176.247.2.1 Sub Netmask: 255.255.255.0 Gateway: 176.247.2.250 Name Server: 176.247.2.15 Domain Name: mondomain.fr Paging Space Information Total Paging Space: 23040MB Percent Used: 1%
prtconf peut bien sur fournir davantages de renseignements.
last reboot wtmp begins May 30 23:10
Une autre façon de faire est d'utiliser uptime.
On obtient avec lsconf le type de serveur, la mémoire utilisée, le nombre de CPU, les modes d'adressages utilisés, la configuration réseaux et les cartes d'entrées-sorties utilisées.
lsconf System Model: IBM,9117-MMA Machine Serial Number: 65BEEE2 Processor Type: PowerPC_POWER6 Processor Implementation Mode: POWER 6 Processor Version: PV_6_Compat Number Of Processors: 1 Processor Clock Speed: 3504 MHz CPU Type: 64-bit Kernel Type: 64-bit LPAR Info: 2 batgirl Memory Size: 6144 MB Good Memory Size: 6144 MB Platform Firmware level: EM340_041 Firmware Version: IBM,EM340_041 Console Login: enable Auto Restart: true Full Core: false Network Information Host Name: batgirl IP Address: 176.242.2.200 Sub Netmask: 255.255.255.0 Gateway: 176.242.2.246 Name Server: Domain Name: Paging Space Information Total Paging Space: 512MB Percent Used: 1% Volume Groups Information ============================================================================== rootvg: PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION hdisk2 active 546 497 109..73..97..109..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 System Object + sysplanar0 System Planar * vio0 Virtual I/O Bus * vsa0 U9117.MMA.65B5E82-V2-C0 LPAR Virtual Serial Adapter * vty0 U9117.MMA.65B5E82-V2-C0-L0 Asynchronous Terminal * pci6 U7311.D20.652D9AC-P1 PCI Bus * pci13 U7311.D20.652D9AC-P1 PCI Bus + fcs2 U7311.D20.652D9AC-P1-C02-T1 FC Adapter + fscsi2 U7311.D20.652D9AC-P1-C02-T1 FC SCSI I/O Controller Protocol Device * fcnet2 U7311.D20.652D9AC-P1-C02-T1 Fibre Channel Network Protocol Device * pci5 U7311.D20.652D92C-P1 PCI Bus * pci12 U7311.D20.652D92C-P1 PCI Bus + sisscsia1 U7311.D20.652D92C-P1-C04 PCI-XDDR Dual Channel Ultra320 SCSI Adapter + scsi2 U7311.D20.652D92C-P1-C04-T1 PCI-X Dual Channel Ultra320 SCSI Adapter bus + hdisk2 U7311.D20.652D92C-P1-C04-T1-L8-L0 16 Bit LVD SCSI Disk Drive (146800 MB) + ses5 U7311.D20.652D92C-P1-C04-T1-L15-L0 SCSI Enclosure Services Device + scsi3 U7311.D20.652D92C-P1-C04-T2 PCI-X Dual Channel Ultra320 SCSI Adapter bus * pci4 U7311.D20.652D92C-P1 PCI Bus * pci11 U7311.D20.652D92C-P1 PCI Bus + fcs1 U7311.D20.652D92C-P1-C06-T1 FC Adapter * fcnet1 U7311.D20.652D92C-P1-C06-T1 Fibre Channel Network Protocol Device + fscsi1 U7311.D20.652D92C-P1-C06-T1 FC SCSI I/O Controller Protocol Device * pci3 U789D.001.DQD51XB-P1 PCI Bus + ent1 U789D.001.DQD51XB-P1-C5-T1 10/100/1000 Base-TX PCI-X Adapter (14106902) * pci0 U7311.D20.652DCDC-P1 PCI Bus * pci7 U7311.D20.652DCDC-P1 PCI Bus + ent0 U7311.D20.652DCDC-P1-C01-T1 10/100/1000 Base-TX PCI-X Adapter (14106902) * pci8 U7311.D20.652DCDC-P1 PCI Bus + fcs0 U7311.D20.652DCDC-P1-C02-T1 FC Adapter * fcnet0 U7311.D20.652DCDC-P1-C02-T1 Fibre Channel Network Protocol Device + fscsi0 U7311.D20.652DCDC-P1-C02-T1 FC SCSI I/O Controller Protocol Device * pci9 U7311.D20.652DCDC-P1 PCI Bus + sisscsia0 U7311.D20.652DCDC-P1-C04 PCI-XDDR Dual Channel Ultra320 SCSI Adapter + scsi0 U7311.D20.652DCDC-P1-C04-T1 PCI-X Dual Channel Ultra320 SCSI Adapter bus + hdisk0 U7311.D20.652DCDC-P1-C04-T1-L8-L0 16 Bit LVD SCSI Disk Drive (146800 MB) + ses4 U7311.D20.652DCDC-P1-C04-T1-L15-L0 SCSI Enclosure Services Device + scsi1 U7311.D20.652DCDC-P1-C04-T2 PCI-X Dual Channel Ultra320 SCSI Adapter bus + L2cache0 L2 Cache + mem0 Memory + proc0 Processor
On peut aussi obtenir les parametres un à un, exemple :
getconf BOOT_DEVICE hdisk0
getconf KERNEL_BITMODE 64
getconf REAL_MEMORY 3932160
etc ...
#prtconf -k Kernel Type: 32-bit
prtconf fournit d'autre information comme:
-c | Displays cpu type, for example, 32-bit or 64-bit |
-k | Display the kernel in use, for example, 32-bit or 64-bit |
-L | Displays LPAR partition number and partition name if this is an LPAR partition, otherwise returns "-1 NULL" |
-m | Displays system memory |
-s | Displays processor clock speed in MegaHertz |
-v | Displays the VPD found in the Customized VPD object class for devices |
lscfg -pl sysplanar0 | grep Model | awk ' {print $2}' IBM,7038-6M2
Une autre manière de faire:
uname -M IBM,9117-570
lsdev -P 3dx 03000008 usbif USB 3D mouse PCM fcpother friend AIX SCSI/FCP Disk Path Control Module PCM scsiscsd friend AIX SCSI/FCP Disk Path Control Module adapter AT97SC3201_r chrp N/A
#lsdev -C L2cache0 Available L2 Cache aio0 Available Asynchronous I/O (Legacy) en0 Available 02-08 Standard Ethernet Network Interface en1 Defined 02-09 Standard Ethernet Network Interface ent0 Available 02-08 2-Port 10/100/1000 Base-TX PCI-X Adapter (14108902) ent1 Available 02-09 2-Port 10/100/1000 Base-TX PCI-X Adapter (14108902) et0 Defined 02-08 IEEE 802.3 Ethernet Network Interface et1 Defined 02-09 IEEE 802.3 Ethernet Network Interface
# lsparent -C -k fcp fscsi0 Available 03-00-01 FC SCSI I/O Controller Protocol Device fscsi1 Available 07-00-02 FC SCSI I/O Controller Protocol Device
Pour passer du mode 32 bits à 64 bits:
#ln -sf /usr/lib/boot/unix_64 /unix #ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix #bosboot -ad /dev/ipldevice #shutdown -Fr #bootinfo -K
Pour passe du mode 32 bits à 64 bits:
#ln -sf /usr/lib/boot/unix_mp /unix #ln -sf /usr/lib/boot/unix_mp /usr/lib/boot/unix #bosboot -ad /dev/ipldevice #shutdown -Fr #bootinfo -K
export EXTENDED_HISTORY=ON
# fc -t 1282 ? :: lslpp -JL | grep pow 1283 ? :: oslevel -r 1284 ? :: oslevel -s 1285 ? :: cd 1286 ? :: vi .profile 1287 2009/03/09 09:41:30 :: ls -l 1288 2009/03/09 09:41:33 :: fc -l 1289 2009/03/09 09:41:41 :: history 1290 2009/03/09 09:41:45 :: man fc 1291 2009/03/09 09:42:13 :: fc -t
#lsmcode -A sys0!system:3H050215 |System Firmware:RG050215_d79e02_regatta|SPCN Firmware:0000RHE11193 ent0!14108902.DV0210 ent1!14108902.DV0210 hdisk0!HUS1030.50503031.52505152 ses0!A0900724.0017 ses1!A0900724.0017 fcs1!df1080f9.181301 fcs2!df1080f9.181301 fcs0!df1080f9.181301 hdisk1!IC35L03.44543031.53323846
Pour une information générale de la frame utilise l'option -c.
#lsmcode -c Platform Firmware level is 3H050215 System Firmware level is RG050215_d79e02_regatta SPCN Firmware level is 0000RHE11193
#lsdev -CH name status location description L2cache0 Available L2 Cache aio0 Defined Asynchronous I/O (Legacy) en0 Available 05-08 Standard Ethernet Network Interface en1 Defined 04-08 Standard Ethernet Network Interface ent0 Available 05-08 10/100/1000 Base-TX PCI-X Adapter (14106902) ent1 Available 04-08 10/100/1000 Base-TX PCI-X Adapter (14106902) et0 Defined 05-08 IEEE 802.3 Ethernet Network Interface et1 Defined 04-08 IEEE 802.3 Ethernet Network Interface fc2 Defined 0A-08-02 Fibre Channel Network Interface fcnet0 Defined 06-08-02 Fibre Channel Network Protocol Device fcnet1 Defined 08-08-02 Fibre Channel Network Protocol Device fcnet2 Available 0A-08-02 Fibre Channel Network Protocol Device fcs0 Available 06-08 FC Adapter fcs1 Available 08-08 FC Adapter fcs2 Available 0A-08 FC Adapter fscsi0 Available 06-08-01 FC SCSI I/O Controller Protocol Device fscsi1 Available 08-08-01 FC SCSI I/O Controller Protocol Device fscsi2 Available 0A-08-01 FC SCSI I/O Controller Protocol Device hd1 Defined Logical volume hd2 Defined Logical volume hd3 Defined Logical volume hd4 Defined Logical volume hd5 Defined Logical volume hd6 Defined Logical volume ...
lsresource -l ent0 TYPE DEVICE ATTRIBUTE S G CURRENT B ent0 busmem 0x0000000080120000 - 0x000000008013ffff B ent0 rom_mem 0x00000000800c0000 - 0x00000000800fffff I ent0 busintr 131241 (A1)
On peut rechercher par classe de périphérique (option -Cc.
# lsdev -Cc tape rmt0 Available 0G-08-02 LTO Ultrium Tape Drive (FCP) rmt1 Available 0G-08-02 LTO Ultrium Tape Drive (FCP) rmt2 Available 0G-08-02 LTO Ultrium Tape Drive (FCP) rmt3 Defined 0G-08-02 LTO Ultrium Tape Drive (FCP) rmt4 Available 0G-08-02 LTO Ultrium Tape Drive (FCP) rmt5 Available 0G-08-02 LTO Ultrium Tape Drive (FCP)
On peut retrouver les classes possibles ainsi:
lsdev -P -H class type subclass description 3dx 03000008 usbif USB 3D mouse PCM ds4k-ui fcp DS3/4K PCM User Interface PCM ds4k-ui friend Active/Passive Disk Path Control Module PCM fcpother friend AIX SCSI/FCP Disk Path Control Module PCM iscsiother friend AIX SCSI/FCP Disk Path Control Module PCM otherapdisk friend Active/Passive Disk Path Control Module PCM sasother friend AIX SCSI/FCP Disk Path Control Module PCM scsiscsd friend AIX SCSI/FCP Disk Path Control Module PCM sisarray friend AIX SCSI/FCP Disk Path Control Module PCM vscsi friend AIX SCSI/FCP Disk Path Control Mo ...
#lsdev -C -l lb2 lb2 Defined 0H-08-02 Library/MediumChange # lsdev -C -l lb0 lb0 Available 0G-08-02 Library/MediumChanger
dans ce cas le périphérique est défini mais pas available. Il faut alors soit le reconfigurer avec cfgmgr
soit trouver la raison pour laquelle il n'est pas disponible.
On a choisi ici sys0. On obtient le type du système, la mémoire du système.
lsattr -El sys0 SW_dist_intr false Enable SW distribution of interrupts True autorestart true Automatically REBOOT system after a crash True boottype disk N/A False capacity_inc 1.00 Processor capacity increment False capped true Partition is capped False conslogin enable System Console Login False cpuguard enable CPU Guard True dedicated true Partition is dedicated False ent_capacity 1.00 Entitled processor capacity False frequency 2660000000 System Bus Frequency False fullcore false Enable full CORE dump True fwversion IBM,EM340_041 Firmware version and revision levels False id_to_partition 0X800011DC24200002 Partition ID False id_to_system 0X800011DC24200000 System ID False iostat false Continuously maintain DISK I/O history True keylock normal State of system keylock at boot time False log_pg_dealloc true Log predictive memory page deallocation events True max_capacity 2.00 Maximum potential processor capacity False max_logname 9 Maximum login name length at boot time True maxbuf 20 Maximum number of pages in block I/O BUFFER CACHE True maxmbuf 0 Maximum Kbytes of real memory allowed for MBUFS True maxpout 0 HIGH water mark for pending write I/Os per file True maxuproc 128 Maximum number of PROCESSES allowed per user True min_capacity 1.00 Minimum potential processor capacity False minpout 0 LOW water mark for pending write I/Os per file True modelname IBM,9117-MMA Machine name False ncargs 6 ARG/ENV list size in 4K byte blocks True nfs4_acl_compat secure NFS4 ACL Compatibility Mode True pre430core false Use pre-430 style CORE dump True pre520tune disable Pre-520 tuning compatibility mode True realmem 6291456 Amount of usable physical memory in Kbytes False rtasversion 1 Open Firmware RTAS version False sed_config select Stack Execution Disable (SED) Mode True systemid IBM,0265B5E82 Hardware system identifier False variable_weight 0 Variable processor capacity weight False
Ou encore
lsattr -l lb2 -E -H attribute value description user_settable FCPORT_ID 0x48a400 FC Port ID True LUNMAP_ID 0x0 Mapped LUN ID of the device True PRODUCT_ID L700 Product ID of the device False WW_NAME 0x2100001b32053482 WW Name of the Port False
Le tableau qui suit résume ce que l'on peut obtenir:
uname -n | nom du serveur |
uname -s | type du serveur (AIX) |
uname -v | version du système |
uname -r | release |
uname -m | l'id du serveur (005BB77F4C00) |
uname -a | information complete (AIX batman 3 5 005BB77F4C00) |
uname -x | information complete avec la mémoire (AIX batman 1538756428 3 5 005BB77F4C00) |
uname -u | constructeur et numéro de série |
uname -p | type de processeur |
uname -M | type de serveur (IBM,7028-6C4) |
#lsdev -l fcs0 -F parent pci12
lsdev -Ct power hdiskpower0 Available 08-08-01 PowerPath Device hdiskpower1 Available 08-08-01 PowerPath Device hdiskpower2 Available 08-08-01 PowerPath Device
#lsdev -p sissas0 sas0 Available 0A-08-00 Controller SAS Protocol sata0 Available 0A-08-00 Controller SATA Protocol # lsdev -p sas0 #hdisk0 Available 0A-08-00 SAS Disk Drive ses0 Available 0A-08-00 SAS Enclosure Services Device ses1 Available 0A-08-00 SAS Enclosure Services Device ses2 Available 0A-08-00 SAS Enclosure Services Device
Pour retrouver le parent d'un périphérique on utilise lsparent:
lsparent -C -l cd0 sata0 Available 0A-08-00 Controller SATA Protocol sata1 Available 01-08-00 Controller SATA Protocol
On peut ainsi remonter au slot pour retirer dynamiquement le périphérique quand on est
en lpar dynamique.
for i in `lsdev -Cc adapter | awk '/fcs/ { print $1 }'` do lscfg -l $i lscfg -vpl $i | awk '/Network Address|fcs/ { M=length($0)-11; ACF=substr($0,M); print ACF }' done
#lsdev -Cc processor | wc -l
ou si l'on désire trouver le nom des processeurs d'un serveur
lsdev -Cc processor proc0 Available 00-00 Processor proc2 Available 00-02 Processor proc4 Available 00-04 Processor proc6 Available 00-06 Processor proc8 Available 00-08 Processor
# lsattr -El proc0 frequency 3720000000 Processor Speed False smt_enabled true Processor SMT enabled False smt_threads 2 Processor SMT threads False state enable Processor state False type PowerPC_POWER7 Processor type False
# lsattr -E -l proc0 | grep "Processor Speed" frequency 1654344000 Processor Speed False
ou
# pmcycles This machine runs at 1654 MHz
ou encore
#lsattr -El `lsdev -Cc processor | head -1 | cut -f "1" -d ' '`
lsdev -Cc disk hdisk0 Available Virtual SCSI Disk Drive hdisk1 Available 01-08-00-5,0 16 Bit LVD SCSI Disk Drive hdisk2 Available Virtual SCSI Disk Drive
# lsdev -l hdisk14 -F parent vscsi0 # lsdev -l vscsi0 -F parent vio0 # lsdev -l vio0 -F parent sysplanar0 # lsdev -l sysplanar0 -F parent sys0 # lsdev -l sys0 -F parent
plus rien. sys0 est le dernier élément de la chaine.
Une utilisation courrante consiste à déterminer le pci associé au lecteur de bande ou de cdrom, afin de libérer la ressource pour pouvoir effectuer un déplacement dynamique de celle-ci.
# lsdev -l rmt17 -F parent scsi4 # lsdev -l scsi4 -F parent sisscsia2 # lsdev -l sisscsia2 -F parent pci16 # lscfg -l pci16 pci16 U7311.D20.65770BB-P1 PCI Bus Hardware Location Code......U7311.D20.65770BB-P1 # rmdev -dl pci16
bootinfo -b hdisk0
bootlist -m normal -o hdisk0 hdisk1
on peut changer le mode (de normal à service).
bootlist -m normal hdisk1 bootlist -m service hdisk1 hdisk0
ipl_varyon -i PVNAME BOOT DEVICE PVID VOLUME GROUP ID hdisk0 YES 00xxxxxda382b4670000000000000000 00xxxxxd00004c00 hdisk1 YES 00xxxxxdb73f8bf20000000000000000 00xxxxxd00004c00 hdisk2 YES 00xxxxxdca772e380000000000000000 00xxxxxd00004c00 hdisk3 NO 00xxxxxd71463a600000000000000000
Avec bootinfo -k on peut déterminé dans quel mode on a démarré.
ln -sf /usr/lib/boot/unix_64 /unix ln -sf /usr/lib/boot/unix_64 /usr/lib/boot/unix lslv -m hd5 bosboot -ad /dev/ipldevice shutdown -Fr
init:2:initdefault:
par
init:s:initdefault:.
Il faut se rappeler que l'unix d'AIX ne comporte que deux niveaux:
Il n'y a pas de mode graphique 5 comme sous linux par exemple.
l2:2:wait:/etc/rc.d/rc 2 l3:3:wait:/etc/rc.d/rc 3 l4:4:wait:/etc/rc.d/rc 4 l5:5:wait:/etc/rc.d/rc 5 l6:6:wait:/etc/rc.d/rc 6 l7:7:wait:/etc/rc.d/rc 7 l8:8:wait:/etc/rc.d/rc 8 l9:9:wait:/etc/rc.d/rc 9
C'est lignes vont chercher les scripts se trouvant dans les répertoires /etc/rc.d/rc2.d etc .. ; afin de les exécuter. On peut ainsi hiérarchiser les départs des démons, comme on le ferai sous sun ou sous linux.
Par exemple avec ssh dans /etc/rc.d/rc2.d on va trouver les scripts suivants:
# ls -ltr total 16 -r-xr-xr-x 1 root system 308 Nov 14 16:49 Ssshd -r-xr-xr-x 1 root system 307 Nov 14 16:49 Ksshd # more Ksshd #!/bin/ksh ################################################## # name: Ksshd # purpose: script that will start or stop the sshd daemon. ################################################## case "$1" in start ) startsrc -g ssh ;; stop ) stopsrc -g ssh ;; * ) echo "Usage: $0 (start | stop)" exit 1 esac
lspv | head -2 hdisk1 00384f0c2dcfdd0b altinst_rootvg hdisk0 00384f0c6b17258c rootvg active # alt_disk_install -X Bootlist is set to the boot disk: hdisk0 lspv | head -2 hdisk1 00384f0c2dcfdd0b None hdisk0 00384f0c6b17258c rootvg active
#lspv hdisk0 00ccd2cde83c037c old_rootvg hdisk1 00ccd2cd26257aa4 datavg active alt_disk_install -X old_rootvg #lspv |head -n 4 hdisk0 00ccd2cde83c037c None hdisk1 00ccd2cd26257aa4 datavg active hdisk2 none None hdisk3 none None alt_disk_install -O -C hdisk3 Calling mkszfile to create new /image.data file. ....
Un nouveau rootvg se trouve sur hdisk3
#mksysb /datafs/mksysb_aix_53TL05_base Creating list of files to back up. Backing up 41166 files..... 41166 of 41166 files (100%) 0512-038 mksysb: Backup Completed Successfully.
restore -Tqf mksysb_serveur
restore -xqvf mksysb_batman_140807_0645 /var/spool/cron/crontabs/root more /var/spool/cron/crontabs/root
Pour un répertoire il faut terminer le nom par un /.
Dans les nouvelles version d'AIX (6.1 et 5.3 TL11), on peut restorer plus simplement:
lsmksysb -f /dev/rmt0 -r -s -d /data/files ./myfs/test
lsmksysb -c -f old_mksysb_polux_220107_2330 New volume on old_mksysb_polux_220107_2330: Cluster 51200 bytes (100 blocks). Volume number 1 Date of backup: Mon Jan 22 23:30:46 2007 Files backed up by name User root 5741 ./bosinst.data 9497 ./image.data 49722 ./tmp/vgdata/rootvg/backup.data 0 ./dgi 0 ./dgi/lost+found 311 ./dgi/.profile 239055351 ./dgi/CA.TDF2005.DEMAPERS.N01.GZ.gpg 1179729 ./dgi/fic_CC.gz.gpg 239054994 ./dgi/CA.TDF2005.DEMAPERS.N01.GZ
chdev -l rmt0 -a clock_size=0 mt -t /dev/rmt0.1 fsf 3 lsmksysb -c -f /dev/rmt0.1
#/usr/bin/mksysb '-e' '-i' /dev/rmt27 Creating information file (/image.data) for rootvg.. Creating tape boot image...... bosboot: Boot image is 31747 512 byte blocks. ***** ATTENTION ***** The boot image you just created might fail to boot because the size exceeds the system limit. For information about fixes or workarounds, see /usr/lpp/bos.sysmgt/README. ***** ATTENTION ***** . Creating list of files to back up.. Backing up 70517 files............. ..... 70399 of 70517 files (99%).. 0512-003 mksysb may not have been able to archive some files. The messages displayed on the Standard Error contained additional information. bosboot: Boot image is 31747 512 byte blocks.
Le mksysb généré se fait avec un format UDF. C'est ce qu'indique l'option -U.
Vous n'êtes pas obligé d'utiliser cette option. Par défaut le format est ISO9660.
Le format Uniniversal Disk Format (UDF) permet de manipuler directement les fichiers sur le support DVD-RAM. En autre on peut changer facilement les fichiers bosinst.data, image.data ou vgname.data.
/usr/sbin/mkcd -U -d '/dev/cd1' '-e' -V 'rootvg' 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. Backing up 70525 files....................... 70525 of 70525 files (100%) 0512-038 mksysb: Backup Completed Successfully. Populating the CD or DVD file system... Copying backup to the CD or DVD file system... ............................................. ............................................. ........................................ Building chrp boot image... Removing temporary file system: /mkcd/mksysb_image...
#lsmksysb -V -f /dev/rmt0
#lsmksysb -f mksysb_batman_20110617 -L Fileset Level State Type Description (Uninstaller) ---------------------------------------------------------------------------- BullSAN.ucode 1.0.6.9 C F Firmware for FC infrastucture ECC.MAGENT 5.2.0.0 C F EMC SOFTWARE EMC.CLARiiON.aix.rte 5.3.0.2 C F EMC CLARiiON AIX Support Software EMC.CLARiiON.fcp.rte 5.3.0.2 C F EMC CLARiiON FCP Support Software EMC.Symmetrix.aix.rte 5.3.0.2 C F EMC Symmetrix AIX Support
# lsmksysb -lf mksysb_hugo_20110617 VOLUME GROUP: rootvg BACKUP DATE/TIME: Fri Jun 17 21:04:03 DFT 2011 UNAME INFO: AIX hugo 1 6 00C20A304C00 BACKUP OSLEVEL: 6.1.2.1 MAINTENANCE LEVEL: 6100-02 BACKUP SIZE (MB): 34048 SHRINK SIZE (MB): 20686 VG DATA ONLY: no rootvg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT hd5 boot 1 2 2 closed/syncd N/A hd6 paging 16 32 2 open/syncd N/A hd8 jfslog 1 2 2 open/syncd N/A hd4 jfs 6 12 2 open/syncd / hd2 jfs 52 104 2 open/syncd /usr hd9var jfs 12 24 2 open/syncd /var hd3 jfs 4 8 2 open/syncd /tmp lg_dumplv1 sysdump 8 8 1 open/syncd N/A hd10opt jfs 1 2 2 open/syncd /opt lg_dumplv sysdump 8 8 1 open/syncd N/A paging00 paging 32 64 2 open/syncd N/A
Cependant, l'ODM peut aussi contenir des informations propres à des programmes (arrêt/relance de
programmes), et de nouveaux menus qu'on aurait configurer pour se fabriquer un smit.
cd / tar -cvf /home/padamin/odmbackup.tar ./usr/lib/objrepos ./etc/objrepos
getlvodm -v VG01 00c7ab6e00004c0000000107dbc83173
odmdelete -q value=00c7ab6e00004c0000000107dbc83173 -o CuAt 0518-307 odmdelete: 1 objects deleted.
odmget -q name=VG01 CuAt CuAt: name = "VG01" attribute = "pv" value = "00c7ab6edbc814f90000000000000000" type = "R" generic = "" rep = "sl" nls_index = 0 CuAt: name = "VG01" attribute = "timestamp" value = "438c3be50f9650fe" type = "R" generic = "DU" rep = "s" nls_index = 0 CuAt: name = "VG01" attribute = "quorum" value = "n" type = "R" generic = "" rep = "sl" nls_index = 0
ou
odmget -q name=VG01 CuDv CuDv: name = "VG01" status = 0 chgstatus = 1 ddins = "" location = "" parent = "" connwhere = "" PdDvLn = "logical_volume/vgsubclass/vgtype"
#getlvcb -AT hd5 AIX LVCB intrapolicy = e copies = 1 interpolicy = m lvid = 00ccd2cd00004c000000010681212188.1 lvname = hd5 label = None machine id = CD2CD4C00 number lps = 3 relocatable = n strict = y stripe width = 0 stripe size in exponent = 0 type = boot upperbound = 32 fs = time created = Sat Mar 24 00:28:22 2007 time modified = Sat Mar 24 00:28:22 2007
odmget -q subsysname=routed SRCsubsys SRCsubsys: subsysname = "routed" synonym = "" cmdargs = "" path = "/usr/sbin/routed" uid = 0 auditid = 0 standin = "/dev/console" standout = "/dev/console" standerr = "/dev/console" action = 2 multi = 0 contact = 3 svrkey = 0 svrmtype = 0 priority = 20 signorm = 0 sigforce = 0 display = 1 waittime = 20 grpname = "tcpip"
Il est ensuite possible de le supprimer ou de lemodifier.
odmget lpp odmget -q name=bos.acct lpp
#prtconf -L LPAR Info: 1 batgirl
#lsslot -c slot # Slot Description Device(s) U7311.D20.65A5DDA-P1-C07 Logical I/O Slot pci7 fcs2 U7879.001.DQD2P2G-P1-C1 Logical I/O Slot pci5 fcs0 U7879.001.DQD2P2G-P1-C2 Logical I/O Slot pci6 fcs1 U7879.001.DQD2P2G-P1-T6 Logical I/O Slot pci4 ent0 ent1 U7879.001.DQD2P2G-P1-T14 Logical I/O Slot pci3 sisscsia0 U9117.570.65CD2CD-V4-C0 Virtual I/O Slot Unknown
Il faut utiliser lsparent.
#lsparent -C -l hdisk0 scsi0 Available 02-08-00 PCI-X Ultra320 SCSI Adapter bus scsi1 Available 02-08-01 PCI-X Ultra320 SCSI Adapter bus root@phebe:/ #lsparent -C -l scsi0 sisscsia0 Available 02-08 PCI-X Ultra320 SCSI Adapter #lsslot -c slot | grep sisscsia0 U7879.001.DQD2P2G-P1-T14 Logical I/O Slot pci3 sisscsia0
Créez un répertoire pour l'installation et copiez y les filesets:
#cd /tmp/dlpar #ls .toc csm.client.1.6.0.10.bff csm.core.1.6.0.12.bff csm.client.1.6.0.0.bff csm.core.1.6.0.0.bff
Installez avec smit les packages:
#smitty install
Vérifiez leur installation:
# lslpp -l|grep csm csm.client 1.6.0.10 COMMITTED Cluster Systems Management csm.core 1.6.0.12 COMMITTED Cluster Systems Management csm.client 1.6.0.10 COMMITTED Cluster Systems Management csm.core 1.6.0.12 COMMITTED Cluster Systems Management
Vérifiez que les services sont actifs.
lssrc -a |grep rsct IBM.ERRM rsct_rm 614446 active IBM.ServiceRM rsct_rm 565284 active IBM.AuditRM rsct_rm 503910 active ctrmc rsct 458770 active IBM.CSMAgentRM rsct_rm 2232500 active IBM.HostRM rsct_rm 2113706 active IBM.DRM rsct_rm 2650154 active ctcas rsct inoperative
ctcas n'est pas actif. C'est tout à fait normal c'est un "lazy service qui ne s'active qu'en cas de besoin.
ifconfig -l en0 en10 en20 lo0
ifconfig -a | grep inet | cut -f 2 -d ' '
hostname
hostname nouveau_nom
lsparent -C -k ent ent0 Available Virtual I/O Ethernet Adapter (l-lan) ent1 Available Virtual I/O Ethernet Adapter (l-lan)
lsattr -E -l en0 -a'state' state up Current Interface Status True
ifconfig en0 en0: flags=5e080863,80inet 208.128.11.12 netmask 0xffffff00 broadcast 208.128.11.255
#lsdev -C -l ent0 ent0 Available Virtual I/O Ethernet Adapter (l-lan) frgbdtsprda0_GB:/root # lsattr -E -l ent0 alt_addr 0x000000000000 Alternate Ethernet Address True chksum_offload yes Checksum Offload Enable True copy_buffs 32 Transmit Copy Buffers True copy_bytes 65536 Transmit Copy Buffer Size True desired_mapmem 0 I/O memory entitlement reserved for device False max_buf_huge 64 Maximum Huge Buffers True max_buf_large 64 Maximum Large Buffers True max_buf_medium 256 Maximum Medium Buffers True max_buf_small 2048 Maximum Small Buffers True max_buf_tiny 2048 Maximum Tiny Buffers True min_buf_huge 24 Minimum Huge Buffers True min_buf_large 24 Minimum Large Buffers True min_buf_medium 128 Minimum Medium Buffers True min_buf_small 512 Minimum Small Buffers True min_buf_tiny 512 Minimum Tiny Buffers True trace_debug no Trace Debug Enable True use_alt_addr no Enable Alternate Ethernet Address True # lsattr -E -l en0 alias4 IPv4 Alias including Subnet Mask True alias6 IPv6 Alias including Prefix Length True arp on Address Resolution Protocol (ARP) True authority Authorized Users True broadcast Broadcast Address True mtu 1500 Maximum IP Packet Size for This Device True netaddr 192.168.19.85 Internet Address True netaddr6 IPv6 Internet Address True netmask 255.255.255.0 Subnet Mask True prefixlen Prefix Length for IPv6 Internet Address True remmtu 576 Maximum IP Packet Size for REMOTE Networks True rfc1323 1 Enable/Disable TCP RFC 1323 Window Scaling True security none Security Level True state up Current Interface Status True tcp_mssdflt 1460 Set TCP Maximum Segment Size True tcp_nodelay 1 Enable/Disable TCP_NODELAY Option True tcp_recvspace 167772160 Set Socket Buffer Space for Receiving True tcp_sendspace 167772160 Set Socket Buffer Space for Sending True
ifconfig en0 down ifconfig en0 up
# lsattr -HEl ent0 attribute value description user_settable alt_addr 0x000000000000 Alternate ethernet address True busintr 305 Bus interrupt level False busmem 0xffe80000 Bus memory address False chksum_offload yes Enable hardware transmit and receive checksum True compat_mode no Gigabit Backward compatability True copy_bytes 2048 Copy packet if this many or less bytes True failover disable Enable failover mode True flow_ctrl yes Enable Transmit and Receive Flow Control True intr_priority 3 Interrupt priority False intr_rate 10000 Max rate of interrupts generated by adapter True jumbo_frames no Transmit jumbo frames True large_send yes Enable hardware TX TCP resegmentation True media_speed Auto_Negotiation Media speed True rom_mem 0xfff00000 ROM memory address False rom_mem_amt 0x40000 ROM memory size False rx_hog 1000 Max rcv buffers processed per rcv interrupt True rxbuf_pool_sz 2048 Rcv buffer pool, make 2X rxdesc_que_sz True rxdesc_que_sz 1024 Rcv descriptor queue size True slih_hog 10 Max Interrupt events processed per interrupt True tx_que_sz 8192 Software transmit queue size True txdesc_que_sz 512 TX descriptor queue size True use_alt_addr no Enable alternate ethernet address True
# lsattr -El ent0 -a media_speed media_speed Auto_Negotiation Media speed True
Après avoir arrêté la carte et l'avoir détaché:
chdev -l ent0 -a media_speed='100_Full_Duplex'
ifconfig en1 inet 192.168.0.1 netmask 255.255.255.0 up
# netstat -nr Routing tables Destination Gateway Flags Refs Use If Exp Groups Route Tree for Protocol Family 2 (Internet): default 170.247.2.250 UG 2 21023 en0 - - 127/8 127.0.0.1 U 5 465 lo0 - - 170.247.2.0 170.247.2.64 UHSb 0 0 en0 - - => 170.247.2/24 170.247.2.64 U 1 415194 en0 - - 170.247.2.64 127.0.0.1 UGHS 6 118 lo0 - - 170.247.2.255 170.247.2.64 UHSb 0 0 en0 - - Route Tree for Protocol Family 24 (Internet v6): ::1 ::1 UH 0 0 lo0 - -
netstat -Cn Routing tables Destination Gateway Flags Wt Policy If Cost Config_Cost Route Tree for Protocol Family 2 (Internet): default 192.168.39.1 UG 1 - en1 0 0 127/8 127.0.0.1 U 1 - lo0 0 0 192.168.39.0 192.168.39.132 UHSb 1 - en1 0 0 => 192.168.39/24 192.168.39.132 U 1 - en1 0 0 192.168.39.132 127.0.0.1 UGHS 1 - lo0 0 0 192.168.39.255 192.168.39.132 UHSb 1 - en1 0 0 192.171.19.0 192.171.19.85 UHSb 1 - en0 0 0 => 192.171.19/24 192.171.19.85 U 1 - en0 0 0 192.171.19.85 127.0.0.1 UGHS 1 - lo0 0 0 192.171.19.255 192.171.19.85 UHSb 1 - en0 0 0 Route Tree for Protocol Family 24 (Internet v6): ::1 ::1 UH 1 - lo0 0 0
# lsattr -EHl inet0 attribute value description user_settable authm 65536 Authentication Methods True bootup_option no Use BSD-style Network Configuration True gateway Gateway True hostname wrumlms02 Host Name True rout6 IPv6 Route True route net,,0,192.168.0.1 Route True
# odmget -q "name=inet0" CuAt CuAt: name = "inet0" attribute = "route" value = "net,,0,192.168.0.1" type = "R" generic = "DU" rep = "s" nls_index = 0 CuAt: name = "inet0" attribute = "hostname" value = "batman" type = "R" generic = "DU" rep = "s" nls_index = 24Il peut y avoir plusieures routes. Dans ce cas c'est surement un problème d'odm qu'il faut corriger.
route add 0 192.168.13.1
route add -net 192.168.101.0 192.168.13.1La première adresse correspond à l'IP du réseau, la seconde à celle de la passerelle. La route ne sera biens ur plus valide au reboot suivant.
route add 192.168.101.1 192.168.13.1
route delete 192.168.101.0 192.168.13.1
chdev -l inet0 -a route=net,-hopcount,0,-netmask,255.255.255.0,-if,en2,,192.168.13.1
chdev -l inet0 -a route=host,-hopcount,0,,-if,en0,,192.168.101.1,192.168.13.1
chdev -l inet0 -a delroute=host,,192.168.101.1,192.168.13.1Pour un net:
/usr/lib/methods/chginet -l inet0 -a delroute="net,-hopcount,0,-if,en1,-netmask,255.255.255.224,0,192.168.13.1"
Il faut préciser l'adresse et le netmask (ici un réseau local), éventuellement suivi d'un serveur DNS et du nom de domaine.
/usr/sbin/mktcpip -h'serveur' -a'192.168.50.1' -m'255.255.255.0' -i'en2' -n'170.200.100.100' -d'mondoamin.fr' -A'no' -t'N/A'
Si vous devez préciser la gateway:
/usr/sbin/mktcpip -h'serveur' -a'192.168.50.1' -m'255.255.255.0' -i'en2' -n'170.200.100.100' -g'170.200.100.250' -d'mondoamin.fr' -A'no' -t'N/A'
Il faut descendre le réseau puis changer le netmask.
ifconfig en2 down ifconfig en2 detach chdev -l 'en2' -a netmask='255.255.255.252' -a state='up'
Pensez à utiliser le séparateur ;. Cela permet de lancer plusieurs commandes séquentiellement. On eput ainsi faire sans perdre la connexion:
ifconfig en2 down;ifconfig en2 up
# entstat -d ent0 ------------------------------------------------------------- ETHERNET STATISTICS (ent0) : Device Type: 4-Port 10/100/1000 Base-TX PCI-X Adapter (14101103) Hardware Address: 00:11:25:cb:fa:8c Elapsed Time: 4 days 19 hours 53 minutes 29 seconds Transmit Statistics: Receive Statistics: -------------------- ------------------- Packets: 435995 Packets: 1749629 Bytes: 57686410 Bytes: 1267561572 Interrupts: 0 Interrupts: 1724725 Transmit Errors: 2155 Receive Errors: 0 Packets Dropped: 1 Packets Dropped: 0 Bad Packets: 0 Max Packets on S/W Transmit Queue: 13 S/W Transmit Queue Overflow: 0 Current S/W+H/W Transmit Queue Length: 1 Broadcast Packets: 337 Broadcast Packets: 910525 Multicast Packets: 3 Multicast Packets: 9 No Carrier Sense: 0 CRC Errors: 0 DMA Underrun: 0 DMA Overrun: 0 Lost CTS Errors: 0 Alignment Errors: 0 Max Collision Errors: 0 No Resource Errors: 0 Late Collision Errors: 2155 Receive Collision Errors: 0 Deferred: 152541 Packet Too Short Errors: 0 SQE Test: 0 Packet Too Long Errors: 0 Timeout Errors: 0 Packets Discarded by Adapter: 0 Single Collision Count: 123 Receiver Start Count: 0 Multiple Collision Count: 18153 Current HW Transmit Queue Length: 1 General Statistics: ------------------- No mbuf Errors: 0 Adapter Reset Count: 0 Adapter Data Rate: 100 Driver Flags: Up Broadcast Running Simplex 64BitSupport ChecksumOffload PrivateSegment LargeSend DataRateSet 4-Port 10/100/1000 Base-TX PCI-X Adapter (14101103) Specific Statistics: ------------------------------------------------------------------------ Link Status : Up Media Speed Selected: Auto negotiation Media Speed Running: 100 Mbps Half Duplex PCI Mode: PCI-X (100-133) PCI Bus Width: 64-bit Latency Timer: 144 Cache Line Size: 128 Jumbo Frames: Disabled TCP Segmentation Offload: Enabled TCP Segmentation Offload Packets Transmitted: 7351 TCP Segmentation Offload Packet Errors: 0 Transmit and Receive Flow Control Status: Disabled Transmit and Receive Flow Control Threshold (High): 45056 Transmit and Receive Flow Control Threshold (Low): 24576 Transmit and Receive Storage Allocation (TX/RX): 16/48
On peut aussi utiliser netstat.
netstat -v en0
#ifconfig en0 down #ifconfig en0 detach #chdev -l ent0 -a media_speed='100_Full_Duplex' ent0 changed #ifconfig en0 up #lsattr -El ent0 -a media_speed media_speed 100_Full_Duplex Media speed True
hosts=local,bind
Ici local indique qu'on va en premier lieu chercher dans le fichier /etc/local puis bind que c'est le dns qui est consulté. On peut évidement inverser cette ordre.
Ensuite, il faut définir dans le fichier /etc/ressolv.conf le nom ou les adresses IP des serveurs DNS, puis le nom de domaine. Cela donne un fichier de ce type:
nameserver 172.110.32.1 nameserver 172.110.32.2 domain mondomain.net
Une autre solution est d'utiliser la commande namerslv. >p>Par exemple pour lister la configuration:
#namerslv -s nameserver 170.247.241.15 nameserver 170.247.241.6 nameserver 170.247.241.8 domain mydomain.tm.fr
Il est possible d'ajouter des search, ajouter un name server, le retirer, etc...
dig ; <<>> DiG 9.4.1 <<>> ;; global options: printcmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 99 ;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;. IN NS ;; ANSWER SECTION: . 28800 IN NS mydns001.fr. . 28800 IN NS mydns000.sortie.fr. . 28800 IN NS worker000.sortie.fr. . 28800 IN NS mydns002.fr. ;; Query time: 4 msec ;; SERVER: 172.003.100.51#53(172.003.100.51) ;; WHEN: Tue Jun 4 09:34:18 2013 ;; MSG SIZE rcvd: 197
/etc/netsvc.conf hosts=local, bind
Il faut remarquer qu'il existe d'autres mots clés qui peuvent être utilisés. bind4 désigne IP V4, bind6 désigne IP V6, etc.
# lsattr -El inet0 authm 65536 Authentication Methods True bootup_option no Use BSD-style Network Configurati on True gateway Gateway True True hostname lassie_1 Host Name True rout6 IPv6 Route True route net,-hopcount,0,,0,170.247.2.246 Route True route net,-hopcount,0,,0,170.247.2.250 Route True # chdev -l inet0 -a delroute="net,-hopcount,0,,0,170.247.2.246" inet0 changed # lsattr -El inet0 authm 65536 Authentication Methods True bootup_option no Use BSD-style Network Configurati on True gateway Gateway True hostname lassie_1 Host Name True rout6 IPv6 Route True route net,-hopcount,0,,0,170.247.2.250 Route True #
La deuxième méthode moins recommandable consiste à supprimer la route dans l'odm.
odmget CuAt |grep hopcount odmget -q"value=net,-hopcount,0,,0,192.168.2.250" CuAt odmdelete -O CuAt -q"value=net,-hopcount,0,,0,192.168.2.250"
#no -o ipforwarding=1
#no -r -a arpqsize = 12 arpt_killc = 20 arptab_bsiz = 7 arptab_nb = 149 ...
#no -L -------------- General Network Parameters -------------------------------------------------------------------------------- NAME CUR DEF BOOT MIN MAX UNIT TYPE DEPENDENCIES -------------------------------------------------------------------------------- fasttimo 200 200 200 50 200 millisecond D -------------------------------------------------------------------------------- nbc_limit 768K 768K 768K 0 8E-1 kbyte D thewall -------------------------------------------------------------------------------- nbc_max_cache 128K 128K 128K 1 768M byte D nbc_min_cache nbc_limit -------------------------------------------------------------------------------- nbc_min_cache 1 1 1 1 128K byte D nbc_max_cache -------------------------------------------------------------------------------- nbc_ofile_hashsz 12841 12841 12841 1 999999 segment D -------------------------------------------------------------------------------- nbc_pseg 0 0 0 0 2G-1 segment D -------------------------------------------------------------------------------- nbc_pseg_limit 1536K 1536K 1536K 0 3M kbyte D -------------------------------------------------------------------------------- ndd_event_name {all} {all} {all} 0 128 string D -------------------------------------------------------------------------------- ndd_event_tracing 0 0 0 0 64K-1 numeric D -------------------------------------------------------------------------------- net_buf_size {all} {all} {all} 0 128 string D tcp_pmtu_discover 1 1 1 0 1 boolean D -------------------------------------------------------------------------------- udp_pmtu_discover 1 1 1 0 1 boolean D -------------------------------------------------------------------------------- n/a means parameter not supported by the current platform or kernel Parameter types: S = Static: cannot be changed D = Dynamic: can be freely changed B = Bosboot: can only be changed using bosboot and reboot R = Reboot: can only be changed during reboot C = Connect: changes are only effective for future socket connections M = Mount: changes are only effective for future mountings I = Incremental: can only be incremented Value conventions: K = Kilo: 2^10 G = Giga: 2^30 P = Peta: 2^50 M = Mega: 2^20 T = Tera: 2^40 E = Exa: 2^60
Pour obtenir la même information à un format csv compatible excel, il faut utiliser l'option -x
#no -x arpqsize,12,12,12,1,32767,numeric,D,tcp_pmtu_discover,udp_pmtu_discover, arpt_killc,20,20,20,0,255,minute,D, arptab_bsiz,7,7,7,1,32767,bucket_size,R, arptab_nb,149,149,149,1,32767,buckets,R, bcastping,0,0,0,0,1,boolean,D, clean_partial_conns,0,0,0,0,1,boolean,D,
netstat -i Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll en0 1500 link#2 ca.ea.28.63.28.3 65557291 0 6891 0 0 en0 1500 192.171.19 server03-mgt 65557291 0 6891 0 0 en1 1500 link#3 ca.ea.28.63.28.4 679483523 0 781426584 0 0 en1 1500 182.168.39 server03 679483523 0 781426584 0 0 lo0 16896 link#1 188448595 0 188428977 0 0 lo0 16896 127 loopback 188448595 0 188428977 0 0 lo0 16896 ::1 188448595 0 188428977 0 0
entstat -d en0
iptrace -a /tmp/iptrace.log [2392174]
ipreport /tmp/iptrace.log IPTRACE version: 2.0 ====( 106 bytes transmitted on interface en1 )==== 10:39:46.185536939 ETHERNET packet : [ ca:ea:28:03:28:04 -> 00:00:0c:1f:10:01 ] type 800 (IP) IP header breakdown: < SRC = 192.168.39.132 > (server04) < DST = 192.171.10.20 > (server09) ip_v=4, ip_hl=20, ip_tos=16, ip_len=92, ip_id=63404, ip_off=0 DF ip_ttl=60, ip_sum=13f8, ip_p = 6 (TCP) TCP header breakdown:
ping -c1 -R server07 ----rnimserv2.prod.fr.hsbc PING Statistics---- 1 packets transmitted, 1 packets received, 0% packet loss round-trip min/avg/max = 33/33/33 ms
# arp -a | more server01.systems.fr (192.168.19.2) at 0:26:98:0b:32:c1 [ethernet] stored in bucket 7 server02.systems.fr (192.168.19.3) at 0:26:98:01:34:41 [ethernet] stored in bucket 8 server.systems.uk.fr (192.168.39.1) at 0:0:c:1f:d0:1 [ethernet] stored in bucket 79 bucket: 0 contains: 0 entries bucket: 1 contains: 0 entries
echo "/export/mksysb/client1 -sec=sys:krb5p:krb5i:krb5:dh,rw=client1,root=client1" >> /etc/exportsOn peut s'assurer de l'export avec le commande exportfs -a.
#mkdir /mksysb #mount serveur:/export/mksysb/client1 /mksysb df -g /mksysb Filesystem GB blocks Free %Used Iused %Iused Mounted on serveur:/export/mksysb/client1 9.00 4.25 53% 7 1% /mksysbLe lien est près, vous pouvez par exemple fair un mksysb via nfs:
mksysb /mksysb/mksysb_client1_140607_1500
# mount batman:/home /mnt nfsmnthelp: 1831-019 nas500: System call error number -1. mount: 1831-008 giving up on: batman:/home System call error number -1.
Editez la table d'hotes sur le serveur distant en éditant le fichier /etc/hosts ou en utilisant smitty hostent.
showmount -e lassie no exported file systems for lassie root@artemis:/root# showmount -e artemis export list for batman: /export/MKSYSB/batman (everyone) /export/MKSYSB/robin (everyone) /export/MKSYSB/superman lois /export/MKSYSB/wonderwoman (everyone) /export/MKSYSB/catwoman batman
On remarquera que les exporatation peuvent être limitées (lois, batman).
#lsnim -l darkstar phebe: class = machines type = standalone connect = shell platform = chrp netboot_kernel = mp if1 = network1 serveur 0 net_settings1 = 100 full cable_type1 = N/A Cstate = ready for a NIM operation prev_state = ready for a NIM operation Mstate = currently running
lsnim -c networks et-179-10-50-128 networks ent et-191-120-10-0 networks ent
nim -o define -t standalone -a if1='et-10-10-10-64 darkstar 0' darkstar
nim -o alt_disk_install -a source=rootvg -a disk=hdisk1 darkstar
Je vous conseille de nommer les spots et les mksysbs sous la forme spot_aix61TL02SP03 etc.
nim -o bos_inst -a source='mksysb' -a spot='spot_aix610' -a mksysb='mksysb_aix610' -a accept_licenses=yes -a installp_flags=-cNgX darkstar
nim -F -o reset darkstar
#lsnim -a info -a Cstate darkstar darkstar: Cstate = ready for a NIM operation
lsnim -l mksysb_darkstar mksysb_darkstar: class = resources type = mksysb Rstate = ready for use prev_state = unavailable for use location = /export/MKSYSB/darkstar/mksysb_darkstar_200307_0610 version = 5 release = 2 mod = 0 oslevel_r = 5200-08 alloc_count = 0 server = master
#nim -o lppchk -a lppchk_flags="-c" darkstar
nim -o alt_disk_install -a source=mksysb -a mksysb=mksysb_darkstar -a disk=hdisk1 darkstar #lsnim -a info -a Cstate darkstar darkstar: Cstate = alt_disk_install operation is being performed info = Creating cloned rootvg volume group and associated logical volumes. #lsnim -a info -a Cstate darkstar darkstar: Cstate = alt_disk_install operation is being performed info = Restoring mksysb image to alternate disk(s). #lsnim -a info -a Cstate ceto ceto: Cstate = ready for a NIM operation
nim -o remove -N mksysb_darkstar nim -o define -N mksysb_darkstar -t mksysb -s master -l '/export/MKSYSB/darkstar/mksysb_darkstar_100707_0610'
Create an LPP_SOURCE Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * Resource SERVER master Input device for installation images [/livraison/AIX53TL08] + (specify the device on the resource server) * LPP_SOURCE Name [AIXTL08SP00] * LPP_SOURCE Directory [/NIM/lpp_source] + Architecture of Resource [] + Show Progress [yes] + Create new filesystem for LPP_SOURCE? [no] + Filesystem SIZE (MB) [650] # VOLUME GROUP for new filesystem [VG_NIM] + Remove all newly added NIM definitions [no] + and filesystems if any part of this operation fails? F1=Help F2=Refresh F3=Cancel F4=List F5=Reset F6=Command F7=Edit F8=Image F9=Shell F10=Exit Enter=Do
nim -o define -t spot -a source=/NIM/mksysb_lacan/mksysb_lacan_23032009 -a server=master -a location=/export/spot spot_lacan
Sinon passez par les raccourcis smit smitty nim_mkres_spot_only
ou smitty nim_mkres.
bootinfo -m 134217804
bootinfo -r 33554432
#prtconf -m Memory Size: 18688 MB
ipcs| grep db2ins |awk '{ system("ipcrm -"$1" "$2)}'
#svmon size inuse free pin virtual memory 1048576 680659 367917 65396 246254 pg space 131072 37362 work pers clnt lpage pin 65396 0 0 0 in use 214957 465702 0 0
Les pages de la VMM ne font plus systématiquement 4K. Maintenant, on trouvera des pages de 64K.
#svmon size inuse free pin virtual memory 4718592 4713367 5225 1148753 1811789 pg space 4915200 10853 work pers clnt other pin 962379 0 0 186374 in use 1809027 0 2904340 PageSize PoolSize inuse pgsp pin virtual s 4 KB - 4551943 10437 1038481 1650205 m 64 KB - 10089 26 6892 10099
bootinfo -K 64 prtconf -k Kernel Type: 64-bit
lsattr -El sys0 -a realmem realmem 10485760 Amount of usable physical memory in Kbytes False svmon
mÚmoire totale | svmon | grep memory | awk '{ print $2/256 "MB"}' |
mÚmoire occupÚe | svmon | grep memory | awk '{ print $3/256 "MB"}' |
MÚmoire disponible | svmon | grep memory | awk '{ print $4/256 "MB"}' |
swap | svmon | grep "pg space" | awk '{ print $3/256 "MB"}' |
paging space | svmon | grep "pg space" | awk '{ print $4/256 "MB"}' |
lsattr -El sys0 -a ncargs chdev -l sys0 -a ncargs=8
#svmon -Pgt 5 ------------------------------------------------------------------------------- Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd 16MB 0 swapper 11520 7760 0 11520 Y N N Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual 0 0 work kernel segment s 11507 7751 0 11507 40005 ffffffff work application stack s 1 1 0 1 50004 f00000002 work process private s 12 8 0 12 ------------------------------------------------------------------------------- Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd 16MB 1 init 17495 7754 0 17476 N N N Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual 180039 2 work process private s 93 3 0 93 0 0 work kernel segment s 11507 7751 0 11507
#svmon -Put 2 | head -n 10 ------------------------------------------------------------------------------- Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd 16MB 299510 java 117196 7797 0 92235 N Y N Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual 18e4d9 3 work working storage s 54240 0 0 54240 1be4da 7 work working storage s 20334 0 0 20334 0 0 work kernel segment s 11507 7751 0 11507 1d309d d work shared library text s 5822 0 0 5822 ... Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd 16MB 299510 java 117197 7797 0 92236 N Y N Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual 18e4d9 3 work working storage s 54240 0 0 54240 1be4da 7 work working storage s 20334 0 0 20334 0 0 work kernel segment s 11508 7751 0 11508 1d309d d work shared library text s 5822 0 0 5822 1ee51f - clnt /dev/lapplpr0103:49218 s 2376 0 - - 101351 - clnt /dev/hd2:25927 s 1655 0 - - 1fe53e - clnt /dev/lapplpr0103:49213 s 1524 0 - - 1f135e - clnt /dev/hd2:25944 s 1342 0 - - 1ae55b - clnt /dev/lapplpr0103:49193 s 1206 0 - - b134a - clnt /dev/hd2:25863 s 1108 0 - - 1e135f - clnt /dev/hd2:25860 s 915 0 - - 13e552 - clnt /dev/lapplpr0103:49188 s 853 0 - - 10e5b1 - clnt /dev/lapplpr0103:51149 s 675 0 - - 1fe55e - clnt /dev/lapplpr0103:49203 s 675 0 - -
svmon -gS | pg Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual 90820 - work s 6993 0 59731 64079 9002 - work kernel heap s 45702 10499 48012 60767 108646 - work s 59847 0 47074 63503 184a65 - work s 60291 0 45336 63503 2f98d - work s 2326 3 38340 40535 6c81f - work s 0 0 18640 18640 6461d - work s 12495 0 18499 21569 140954 - work s 16008 0 18374 21411 134cc9 - work s 1059 3 15549 16483 170658 - work s 13285 0 8704 14145 f893a - work s 13476 0 8362 14145 1b4ceb - work s 3028 3 7719 10358 ...
svmon -gP -t 1 ------------------------------------------------------------------------------- Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd 16MB 839856 ecs.guisrv 47084 8478 84636 128814 N Y N PageSize Inuse Pin Pgsp Virtual s 4 KB 16956 8478 84636 98686 m 64 KB 1883 0 0 1883 Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual 90820 3 work working storage s 6993 0 59731 64079 6c81f 4 work working storage s 0 0 18640 18640 0 0 work kernel segment s 9065 8425 5129 14156 40894 f work shared library data s 635 0 972 1545 1ac86f - work s 168 50 101 197 140bd4 2 work process private s 6 3 63 69 cc6b7 5 work working storage s 0 0 0 0 1888e6 7 work working storage s 0 0 0 0 30788 6 work working storage s 0 0 0 0 c46b5 8 work working storage s 0 0 0 0 158652 9 work working storage s 0 0 0 0 b30ad d work shared library text m 1883 0 0 1883 c0834 a work working storage s 0 0 0 0 5c913 - clnt /dev/lv_soft:119732 s 1 0 - - 54b91 - clnt /dev/lv_soft:119606 s 0 0 - - 168b5e - clnt /dev/lv_soft:119463 s 0 0 - - 2c90f - clnt /dev/lv_soft:119412 s 3 0 - - 6cc1f - clnt /dev/lv_soft:119408 s 0 0 - - 1d09f0 - clnt /dev/lv_soft:108883 s 1 0 - - 1cc03 1 clnt code,/dev/lv_soft:98486 s 84 0 - -
On fait un ps et on extrait la valeur d'une colonne.
if [ "`ps -ef | grep [t]race | awk '{print $8}' `" != "trace" ] then echo "le demon trace est present" fi
who -r . run-level 2 Oct 06 07:15 2 0 S
Ici le run-level est 2, on est en mode multi-user. Sous AIX seul les 2 premiers modes sont vraiment utilisés.
#telinit S INIT: New run level: S INIT: SINGLE-USER MODE Password: root@phebe:/root #who -r . run-level S Mar 10 10:07 S 1 2
On recherche tous les processus appartenant à cet utilisateur et on en extrait à l'aide de la commande svmon la taille mémoire utilisée.
total=0 for i in `ps -ef | grep oracle| awk '{ print $2}'` do v=`svmon -P $i | sed -n "4p" |perl -lane '$a=$F[3]+$F[5]; print $a/256'` # echo $v total=`echo $total $v |perl -lane 'print $F[0]+$F[1]' ` done ; printf "%4.4f \n" $total 31830.7812
ps -u mqm -o pid,args PID COMMAND 5713924 -ksh
#ps vx | head -1; ps vx | grep -v PID | sort -rn +6 | head -10
#ps vx | head -1;ps vx | grep -v PID | sort -rn +3 | head -10
#ps vx | head -1; ps vx | grep -v PID | sort -rn +4 | head -10 PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND 344264 - A 0:17 33674 6032 33848 32768 16670 27816 0.0 0.0 /usr/bin 299190 - A 0:00 502 2516 3556 xx 538 1040 0.0 0.0 /usr/sbi 372950 - A 0:01 268 2228 5264 xx 814 3036 0.0 0.0 /usr/sbi 450792 - A 0:19 242 19856 19928 32768 44 72 0.0 0.0 /usr/bin 352330 - A 0:00 221 2036 3980 32768 3311 1944 0.0 0.0 /usr/tiv 94272 - A 0:00 206 396 448 32768 33 52 0.0 0.0 /usr/ccs 463022 - A 43:16 168 30016 35796 32768 7747 5780 1.6 0.0 /usr/tiv 290972 - A 0:00 154 1228 1820 32768 338 592 0.0 0.0 /usr/sbi 454882 - A 0:00 146 1064 2328 32768 998 1264 0.0 0.0 sendmail 200874 - A 0:00 146 1400 1744 xx 272 344 0.0 0.0 /usr/sbi
#ps aux | head -1; ps aux | sort -rn +3 | head USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND sas 581742 0.1 2.0 298952 298988 - A 06:53:16 0:45 /usr/java14/bin/ xxprod 782354 0.0 0.0 728 776 pts/2 A 10:48:15 0:00 -ksh xxgo 827556 0.0 0.0 736 784 pts/0 A 11:50:08 0:00 -ksh xxgo 520394 0.0 0.0 820 1012 - A 11:50:08 0:00 sshd: xxgo@pts/ x2vu 794862 0.0 0.0 820 1008 - A 10:48:08 0:00 sshd: x2vu@pts/2 x2vu 786668 0.0 0.0 720 768 pts/2 A 10:48:08 0:00 -ksh topx 577608 0.0 0.0 1052 1072 - A 13:24:19 0:30 topxagent -b /ap sas 630836 0.0 0.0 704 752 - A 06:53:08 0:00 /bin/sh /apps/pr sas 618576 0.0 0.0 2328 2340 - A 06:53:12 0:02 /apps/products/s sas 561204 0.0 0.0 732 780 - A 06:53:12 0:00 /bin/sh /apps/p
svmon -uP -t 1 |pg ------------------------------------------------------------------------------- Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd 16MB 774186 java 118132 65644 82 117991 Y Y N PageSize Inuse Pin Pgsp Virtual s 4 KB 37060 60 66 36903 m 64 KB 971 3 1 972 Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual 0 0 work kernel segment (lgpg_vsid=0) L 16 16 0 16 279757 11 work text data BSS heap s 34131 0 0 34131 1870b0 90000000 work shared library text m 966 0 1 967 8001 9ffffffd work shared library s 1489 0 16 1502 3501e8 90020014 work shared library s 698 0 49 724 86b06 9001000a work shared library data s 235 0 0 235 115536 - work s 202 60 0 202 76518 f00000002 work process private m 5 3 0 5 ... 346fea - clnt /dev/lv_soft:35744 s 0 0 - - 114c20 - clnt /dev/lv_soft:26582 s 0 0 - - 1bc935 - clnt /dev/lv_soft:25827 s 0 0 - - 13013 fffffff4 work application stack s 0 0 0 0 17c92d - clnt /dev/lv_soft:25819 s 0 0 - - 24506 - clnt /dev/lv_soft:24756 s 0 0 - -
On peut obtenir les 3,10,20 processus consommateurs en remplacant la valeur 1 qui suit l'option -t par la valeur correspondante.
#ps -eakl | sort -n +6 | head F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 303 A 0 0 0 120 16 -- 30004190 384 - 0:16 swapper 303 A 0 16392 0 0 16 -- 4000a190 1024 f1000700091fa7c0 - 1:30 lrud 303 A 0 24588 0 0 16 -- 6000e190 1024 f1000700091fa7c8 - 0:00 psmd 303 A 0 28686 0 0 16 -- 90010190 512 - 0:00 xmfreed 303 A 0 32784 0 0 16 -- 80012190 448 - 0:00 memp_rbd ..
Si c'est par ordre de nice changer la colonne de tri en:
#ps -eakl | sort -n +7
#ps vg | head -1; ps vg | grep -w wait PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND 8196 - A 649:21 0 384 384 xx 0 0 23.3 0.0 wait 53274 - A 647:48 0 384 384 xx 0 0 23.3 0.0 wait
svmon -pP 774186 | pg ------------------------------------------------------------------------------- Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd 16MB 774186 java 118139 65644 82 117998 Y Y N PageSize Inuse Pin Pgsp Virtual s 4 KB 37067 60 66 36910 m 64 KB 971 3 1 972 Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual 0 0 work kernel segment (lgpg_vsid=0) L 16 16 0 16 115536 - work s 202 60 0 202 76518 f00000002 work process private m 5 3 0 5 28c353 - clnt /dev/lv_soft:24321 s 0 0 - - 38c3f3 - clnt /dev/lv_soft:24481 s 0 0 - - 77606 70000002 mmap maps 8 source(s) s 0 0 - - 24c34b - clnt /dev/lv_soft:24313 s 0 0 - - fc99d 10 clnt text data BSS heap, s 13 0 - - /dev/lv_soft:25939 1cc33b - clnt /dev/lv_soft:24297 s 0 0 - - 348cea - clnt /dev/lv_soft:43168 s 0 0 - - 38c472 - clnt /dev/hd2:217137 s 0 0 - - 37cb6d - clnt /dev/lv_soft:26403 s 0 0 - -
svmon -S -t 5 | pg Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual 3c70b - clnt /dev/lv_soft:42424 s 126089 0 - - ecdbc - clnt /dev/lv_ctmadump:10 s 124193 0 - - 183fe6 - clnt /dev/lv_ctmadump:18 s 110465 0 - - 6c99c - clnt /dev/lv_ctmadump:21 s 101991 0 - - 194762 - clnt /dev/lv_ctmadump:6 s 97930 0 - -
Inuse | émoire physique en cours d'utilisation par l'utilisateur |
Pgsp | espace utilisé en paging space par l'utilisateur |
Pin | espace en mémoire physique ne pouvant pas être swappé sur le paging space> |
Virtual | mémoire virtuelle consommé par l'utilisateur |
lsattr -HEl hdisk1 attribute value description user_settable PCM PCM/friend/scsiscsd Path Control Module False algorithm fail_over Algorithm True hcheck_interval 0 Health Check Interval True hcheck_mode nonactive Health Check Mode True max_transfer 0x40000 Maximum TRANSFER Size True pvid 001adfcf8e65c3200000000000000000 Physical volume identifier False queue_depth 3 Queue DEPTH False reserve_policy single_path Reserve Policy True size_in_mb 36400 Size in Megabytes False
lslv -p hdisk0 hdisk0::: USED FREE FREE FREE FREE FREE FREE FREE FREE FREE 1-10 FREE FREE FREE FREE FREE FREE FREE FREE FREE FREE 11-20 FREE FREE FREE FREE FREE FREE FREE FREE FREE FREE 21-30 FREE FREE FREE FREE FREE FREE FREE FREE FREE FREE 31-40 FREE FREE FREE FREE FREE FREE FREE FREE FREE FREE 41-50 FREE FREE FREE FREE FREE FREE FREE FREE FREE FREE 51-60 FREE FREE FREE FREE FREE FREE FREE FREE FREE FREE 61-70 FREE FREE FREE FREE FREE FREE FREE FREE FREE FREE 71-80 USED USED USED USED USED USED USED USED USED USED 81-90 USED USED USED USED USED USED USED USED USED USED 91-100 USED USED USED USED USED USED USED USED USED 101-109 USED USED USED USED USED USED USED USED USED USED 110-119 USED USED USED USED USED USED USED USED USED USED 120-129 USED USED USED USED USED USED USED USED USED USED 130-139 USED USED USED USED USED USED USED USED USED USED 140-149 USED USED USED USED USED USED USED USED USED USED 150-159
On peut aussi faire lslv -p hdisk0 hd2
#lspv hdisk0 00c1719e64ded2fa rootvg active hdisk1 00c1719e74e1d549 altinst_rootvg hdisk2 00c1719eae51856d None
On peut aussi limiter la liste avec lspv | head -10 par exemple.
#lspv | head -3 hdisk0 00c1719e64ded2fa rootvg active hdisk1 00c1719e74e1d549 altinst_rootvg hdisk2 00c1719eae51856d None
#lspv hdisk0 PHYSICAL VOLUME: hdisk0 VOLUME GROUP: rootvg PV IDENTIFIER: 00ccd2cde80bd90c VG IDENTIFIER 00ccd2cd00004c000000010beb5cdfa1 PV STATE: active STALE PARTITIONS: 0 ALLOCATABLE: yes PP SIZE: 128 megabyte(s) LOGICAL VOLUMES: 10 TOTAL PPs: 546 (69888 megabytes) VG DESCRIPTORS: 2 FREE PPs: 443 (56704 megabytes) HOT SPARE: no USED PPs: 103 (13184 megabytes) MAX REQUEST: 256 kilobytes FREE DISTRIBUTION: 109..41..75..109..109 USED DISTRIBUTION: 01..68..34..00..00
#lspv -l hdisk0 0516-320 : Physical volume 005b178f13b64dfb0000000000000000 is not assigned to a volume group. root@erebe:/root/bin #lspv -l hdisk1 hdisk1: LV NAME LPs PPs DISTRIBUTION MOUNT POINT lg_dumplv 32 32 00..32..00..00..00 N/A lrootsy0101 9 9 00..09..00..00..00 /var/adm/ras hd2 31 31 00..00..31..00..00 /usr hd4 5 5 00..00..05..00..00 / hd8 1 1 00..00..01..00..00 N/A hd6 256 256 00..08..49..108..91 N/A hd10opt 2 2 00..00..02..00..00 /opt hd1 8 8 00..00..08..00..00 /home hd3 9 9 00..00..09..00..00 /tmp hd9var 4 4 00..01..03..00..00 /var hd5 1 1 01..00..00..00..00 N/A
chdev -l hdisk6 -a pv=clear mkvg -f -y'vg_data2' hdisk6
lsparent -C -l hdisk10 fscsi0 Available 0D-08-02 FC SCSI I/O Controller Protocol Device fscsi1 Available 0F-08-02 FC SCSI I/O Controller Protocol Device
Le disque hdisk10 est un disque de baie.
lsparent -C -l hdisk1 scsi0 Available 05-08-00 PCI-X Dual Channel Ultra320 SCSI Adapter bus scsi1 Available 05-08-01 PCI-X Dual Channel Ultra320 SCSI Adapter bus scsi2 Available 09-08-00 PCI-X Dual Channel Ultra320 SCSI Adapter bus scsi3 Available 09-08-01 PCI-X Dual Channel Ultra320 SCSI Adapter bus
Le disque hdisk1 est un disque local.
# lspv -p hdisk0 hdisk0: PP RANGE STATE REGION LV NAME TYPE MOUNT POINT 1-1 used outer edge hd5 boot N/A 2-110 free outer edge 111-111 used outer middle hd6 paging N/A 112-119 used outer middle lg_dumplv sysdump N/A 120-122 used outer middle hd6 paging N/A 123-138 free outer middle 139-141 used outer middle lv_dump sysdump N/A 142-149 used outer middle hd6 paging N/A 150-219 free outer middle 220-220 used center hd8 jfs2log N/A 221-221 used center hd4 jfs2 / 222-222 used center hd2 jfs2 /usr 223-223 used center hd9var jfs2 /var 224-224 used center hd3 jfs2 /tmp 225-225 free center 226-226 used center hd10opt jfs2 /opt 227-232 used center hd2 jfs2 /usr 233-235 used center hd4 jfs2 / 236-252 used center hd2 jfs2 /usr 253-267 used center hd3 jfs2 /tmp 268-270 used center hd10opt jfs2 /opt 271-328 free center 329-437 free inner middle 438-546 free inner edge #
On veut étendre rootvg et la situation resemble à ceci:
#lspv hdisk1 00cde2f19f2f16bb rootvg active hdisk2 00cde2f194b3284a None
Il faut taper chpv -C hdisk2. On pourra alors faire un extendvg rootvg hdisk2.
#dd if=/dev/hdisk0 count=1 | od -x |grep 000200 1+0 records in 1+0 records out 0000200 00cb 5e82 ed45 a691 0000 0000 0000 0000
le recours à la commande lspv qui lit dans l'ODM:
#lspv hdisk0 PHYSICAL VOLUME: hdisk0 VOLUME GROUP: rootvg PV IDENTIFIER: 00cb5e82ed45a691 VG IDENTIFIER 00cb5e8200004c0000000121460abc10 PV STATE: active STALE PARTITIONS: 0 ALLOCATABLE: yes PP SIZE: 256 megabyte(s) LOGICAL VOLUMES: 10 TOTAL PPs: 546 (139776 megabytes) VG DESCRIPTORS: 1 FREE PPs: 487 (124672 megabytes) HOT SPARE: no USED PPs: 59 (15104 megabytes) FREE DISTRIBUTION: 109..78..82..109..109 USED DISTRIBUTION: 01..31..27..00..00
La lecture de la VGDA via lqueryvg qui retourne le descripteur du disque:
lqueryvg -p hdisk0 -At Max LVs: 256 PP Size: 28 Free PPs: 924 LV count: 11 PV count: 2 Total VGDAs: 3 Conc Allowed: 0 MAX PPs per PV 1016 MAX PVs: 32 Conc Autovaryo 0 Varied on Conc 0 Logical: 00cb5e8200004c0000000121460abc10.1 hd5 1 00cb5e8200004c0000000121460abc10.2 hd6 1 00cb5e8200004c0000000121460abc10.3 hd8 1 00cb5e8200004c0000000121460abc10.4 hd4 1 00cb5e8200004c0000000121460abc10.5 hd2 1 00cb5e8200004c0000000121460abc10.6 hd9var 1 00cb5e8200004c0000000121460abc10.7 hd3 1 00cb5e8200004c0000000121460abc10.8 hd1 1 00cb5e8200004c0000000121460abc10.9 hd10opt 1 00cb5e8200004c0000000121460abc10.10 lg_dumplv 1 00cb5e8200004c0000000121460abc10.11 loglv01 1 Physical: 00cb5e82f2c23ec2 2 0 00cb5e82ed45a691 1 0 Total PPs: 1092 LTG size: 128 HOT SPARE: 0 AUTO SYNC: 0 VG PERMISSION: 0 SNAPSHOT VG: 0 IS_PRIMARY VG: 0 PSNFSTPP: 4352 VARYON MODE: 0
Si une de ces méthodes n'est pas en phase, c'est que vous avez un problème sur votre disque.
#getlvodm -C hdisk0 hdisk1 hdiskpower0 hdiskpower1 hdiskpower2 hdiskpower3 hdiskpower4
La commande lspv permet d'identifier l'état du volume physique. Pour cela, le disque doit être assigné à un volume groupe. Les informations les plus utiles sont:
l'état (ctif ou inactif) |
le nombre de copies PP "stale" (pas à jour) |
le nombre total de PP |
le nombre de PP libres |
la distributions de l'espace libre dans le volume |
exemple:
lspv hdiskpower0 PHYSICAL VOLUME: hdiskpower0 VOLUME GROUP: vctmapr01 PV IDENTIFIER: 005bb78fdac73c90 VG IDENTIFIER 005bb78f00004c00000001013d427f20 PV STATE: active STALE PARTITIONS: 0 ALLOCATABLE: yes PP SIZE: 64 megabyte(s) LOGICAL VOLUMES: 3 TOTAL PPs: 159 (10176 megabytes) VG DESCRIPTORS: 2 FREE PPs: 154 (9856 megabytes) HOT SPARE: no USED PPs: 5 (320 megabytes) MAX REQUEST: 1 megabyte FREE DISTRIBUTION: 32..27..31..32..32 USED DISTRIBUTION: 00..05..00..00..00
readvgda hdisk0 | grep typeOn peut savoir ainsi si c'est un volume groupe normal, big ou scalable.
lsvgfs rootvg / /usr /var /tmp /home /opt /var/adm/ras
lqueryvg -p hdisk0 -At
Max LVs: 256 PP Size: 26 Free PPs: 430 LV count: 11 PV count: 2 Total VGDAs: 3 Conc Allowed: 0 MAX PPs per PV 1016 MAX PVs: 32 Conc Autovaryo 0 Varied on Conc 0 Logical: 001adfcf00004c00000001028cc13cbc.1 hd5 1 001adfcf00004c00000001028cc13cbc.2 hd6 1 001adfcf00004c00000001028cc13cbc.3 hd8 1 001adfcf00004c00000001028cc13cbc.4 hd4 1 001adfcf00004c00000001028cc13cbc.5 hd2 1 001adfcf00004c00000001028cc13cbc.6 hd9var 1 001adfcf00004c00000001028cc13cbc.7 hd3 1 001adfcf00004c00000001028cc13cbc.8 dumplv 1 001adfcf00004c00000001028cc13cbc.9 hd10opt 1 001adfcf00004c00000001028cc13cbc.10 lv00 1 001adfcf00004c00000001028cc13cbc.11 paging00 1 Physical: 001adfcf8cc13254 2 0 001adfcf8e65c320 1 0 Total PPs: 1084 LTG size: 128 HOT SPARE: 0 AUTO SYNC: 0 VG PERMISSION: 0 SNAPSHOT VG: 0 IS_PRIMARY VG: 0 PSNFSTPP: 4352 VARYON MODE: 0
On remarquera ici que le disque est sans doute mirroré puisqu'il y a deuxx disques physiques.
On peut aussi récupérer la partie pvid: des disques
##lqueryvg -p hdiskpower17 -P 00ccd2cd23965c11 1 0 00ccd2cd249ae53e 1 0 00384f0c914b5b61 1 0 00026338d98ed492 1 0 00026338d98934cd 1 0L'id de la machine
lqueryvg -p hdiskpower17 -v 00026338ce827f74La correspondance des volumes logiques:
#lqueryvg -p hdiskpower17 -L 00026338ce827f74.1 lwhamwh01 1 00026338ce827f74.2 lwhamwh02 1 00026338ce827f74.3 lwhamwh07 1 00026338ce827f74.4 lwhamwh04 1 00026338ce827f74.5 lwhamwh05 1 00026338ce827f74.6 lwhamwh0103 1 00026338ce827f74.7 lwhamwh0101 1 00026338ce827f74.9 lwhamwh0108 1 00026338ce827f74.11 lwhamwh0105 1 00026338ce827f74.13 lwhamwh03A 1 00026338ce827f74.14 lwhamwh0107 1
Le logical volume control block (LVCB) est écrit dans les 512 premiers octets du volume logique.
Ce bloc contient des informations importantes comme la date de création du volume logique,
ne nombre de copies mirrorées, les points de montages possibles.
/etc/v/vgGDID
getlvodm -u vdatawh01 y
getlvcb -AT hd2
AIX LVCB intrapolicy = c copies = 2 interpolicy = m lvid = 001adfcf00004c00000001028cc13cbc.5 lvname = hd2 label = /usr machine id = ADFCF4C00 number lps = 71 relocatable = y strict = y stripe width = 0 stripe size in exponent = 0 type = jfs upperbound = 32 fs = log=/dev/hd8:mount=automatic:type=bootfs:vol=/usr:free=false time created = Thu Mar 10 13:57:18 2005 time modified = Tue Mar 29 15:55:52 2005
getlvcb -AT hd3
AIX LVCB intrapolicy = c copies = 2 interpolicy = m lvid = 00ca332d00004c000000010506cb0974.7 lvname = hd3 label = /tmp machine id = A332D4C00 number lps = 8 relocatable = y strict = y stripe width = 0 stripe size in exponent = 0 type = jfs upperbound = 32 fs = time created = Mon Jul 11 16:47:11 2005 time modified = Mon Jul 11 16:47:11 2005
lslv -m hd3 (pour tmp) hd3:/tmp PV COPIES IN BAND DISTRIBUTION hdisk0 008:000:000 100% 000:000:008:000:000 hdisk1 008:000:000 100% 000:000:008:000:000 lslv -l hd3 hd3:/tmp LP PP1 PV1 PP2 PV2 PP3 PV3 0001 0315 hdisk0 0315 hdisk1 0002 0316 hdisk0 0316 hdisk1 0003 0317 hdisk0 0317 hdisk1 0004 0318 hdisk0 0318 hdisk1 0005 0319 hdisk0 0319 hdisk1 0006 0320 hdisk0 0320 hdisk1 0007 0321 hdisk0 0321 hdisk1 0008 0322 hdisk0 0322 hdisk1
Les disques à vérifier sont:
n=`getlvodm -l hd3` ; getlvodm -c $n
lsvg -n dlmfdrv201 VOLUME GROUP: prd_data_vg01 VG IDENTIFIER: 00ca332d00004c00000001059c34246a VG STATE: inactive PP SIZE: 32 megabyte(s) VG PERMISSION: read/write TOTAL PPs: 34080 (1090560 megabytes) MAX LVs: ??????? FREE PPs: 17253 (552096 megabytes) LVs: 16 USED PPs: 16827 (538464 megabytes) OPEN LVs: 0 QUORUM: 17 TOTAL PVs: 32 VG DESCRIPTORS: 32 STALE PVs: 0 STALE PPs: 0 ACTIVE PVs: 0 AUTO ON: yes MAX PPs per PV: 2032 MAX PVs: 16
redefinevg -d dlmfdrv101 prd_data_vg01 varyonvg prd_data_vg01 synclvodm prd_data_vg01
on crée le volume groupe datavg en utilisant le disque hdisk2. On pourrait fournir une liste de disque.
#mkvg -y datavg hdisk2 datavg root@phebe:/ #lsvg rootvg altinst_rootvg datavg
Il faut parfois forcer la création avec l'option -f lorsque le disque a appartenu à un autre volume groupe:
#mkvg -f -y appsvg01 hdisk1 appsvg01
Exemple:
#importvg hdiskpower17
Le volume groupe est constitué de 5 disques sur une baie
#lsvg -p vdatawh01 hdiskpower19 active 1839 0 00..00..00..00..00 hdiskpower49 active 63 0 00..00..00..00..00 hdiskpower18 active 6799 200 00..00..00..00..200 hdiskpower50 active 23999 3 00..00..00..00..03 hdiskpower17 active 23999 0 00..00..00..00..0
Je prend deux disques au hassard, on retourve les mêmes pvid.
#lqueryvg -p hdiskpower17 -P 00ccd2cd23965c11 1 0 00ccd2cd249ae53e 1 0 00384f0c914b5b61 1 0 00026338d98ed492 1 0 00026338d98934cd 1 0 #queryvg -p hdiskpower18 -P 00ccd2cd23965c11 1 0 00ccd2cd249ae53e 1 0 00384f0c914b5b61 1 0 00026338d98ed492 1 0 00026338d98934cd 1 0
lsvg -M vsystsy01 vsystsy01 hdiskpower15:1 lsystsy0119:27 hdiskpower15:2 lsystsy0119:28 hdiskpower15:3 lsystsy0119:29 hdiskpower15:4 lsystsy0119:30
lsfs -q /environnements/production/toto Name Nodename Mount Pt VFS Size Options Auto Accounting /dev/lapplpr0109 -- /environnements/production/toto jfs2 786432 rw yes no (lv size: 786432, fs size: 786432, block size: 4096, sparse files: yes, inline log: no, inline log size: 0, reserved: 0, reserved: 0, DMAPI: no, VIX: no)exemple pour un filesystem en jfs lsfs -q /environnements/production/test Name Nodename Mount Pt VFS Size Options Auto Accounting /dev/lapplpr0110 -- /environnements/production/test jfs 524288 rw yes yes (lv size: 524288, fs size: 524288, frag size: 4096, nbpi: 4096, compress: no, bf: true, ag: 64)
Au préalable on aura créé un volume groupe:
#mkvg -y appsvg01 hdisk1
Le volume groupe est appsvg01, le volume logique est lapps0101, le point de montage /apps/websphere , la taille de bloc est de 4096 et il est accessible en mode read/write (option-p'rw'), avec montage automatique au reboot (option-A y).
#mklv -y lapps0101 -t jfs2 appsvg01 1 lapps0101 #crfs -v jfs2 -d lapps0101 -m /apps/websphere -A y -p'rw' -a agblksize='4096' File system created successfully. 65328 kilobytes total disk space. New File System size is 131072 #mount /apps/websphere
On peut alors tailler à la bonne dimension avec :
chfS -a size=4G /apps/websphere
Meme procedure pour un filesystem jfs:
#mklv -y lsystsy0111 -t jfs vsystsy01 1 lsystsy0111 -A y -p'rw' -a agblksize='4096' Based on the parameters chosen, the new /root/test JFS file system is limited to a maximum size of 134217728 (512 byte blocks) New File System size is 65536 #mount /root/test #chfs -a size=3G /root/test
fileplace smit.log File: smit.log Size: 6165 bytes Vol: /dev/hd4 Blk Size: 4096 Frag Size: 4096 Nfrags: 2 Compress: no Logical Fragment ---------------- 0006496 1 frags 4096 Bytes, 50.0% 0006509 1 frags 4096 Bytes, 50.0%
# synclvodm -v vg_tsmdb synclvodm: Physical volume data updated. synclvodm: Logical volume lv_tsmdb updated. synclvodm: Logical volume loglv01 updated.
#lvmstat -v rootvg Logical Volume iocnt Kb_read Kb_wrtn Kbps hd8 34 0 136 0.00 hd4 18 0 72 0.00 hd3 6 0 24 0.00 hd10opt 6 0 24 0.00 hd9var 4 0 16 0.00 lrootvg0101 0 0 0 0.00 lg_dumplv 0 0 0 0.00 hd1 0 0 0 0.00 hd2 0 0 0 0.00 hd6 0 0 0 0.00 hd5 0 0 0 0.00
#reducevg -df vg_save_data hdisk3 rmlv: Logical volume lv_save_data is removed. rmlv: Logical volume loglv01 is removed. ldeletepv: Volume Group deleted since it contains no physical volumes.
lsfs -q /tmp Name Nodename Mount Pt VFS Size Options Auto Accounting /dev/hd3 -- /tmp jfs 1048576 -- yes no (lv size: 1048576, fs size: 1048576, frag size: 4096, nbpi: 4096, compress: no, bf: false, ag: 8)
for i in `lsfs | awk '{print $3}'` do r=`lsfs -q $i | grep "bf: true" ` if [ "$r" != "" ] then echo $i fi done
fuser -u /apps/products/ctmagent/REEL /apps/products/ctmagent/REEL: 598266c(mahe)
fuser -k /apps/products/ctmagent/REEL /apps/products/ctmagent/REEL: 598266c
#lspv hdisk0 00ccd2cde83c037c old_rootvg hdisk1 00ccd2cd26257aa4 None
Si il s'agit d'une baie, vérifier qu'il n'est pas attaché à un hdiskpower
#powermt display dev=all |grep hdisk1 1 fscsi1 hdisk105 SP B0 active alive 0 0 1 fscsi1 hdisk102 SP B0 active alive 0 0 1 fscsi1 hdisk103 SP B0 active alive 0 0 1 fscsi1 hdisk104 SP B0 active alive 0 0 0 fscsi0 hdisk10 SP B1 active alive 0 0 1 fscsi1 hdisk101 SP B0 active alive 0 0 0 fscsi0 hdisk19 SP B1 active alive 0 0 0 fscsi0 hdisk11 SP B1 active alive 0 0 0 fscsi0 hdisk14 SP B1 active alive 0 0 0 fscsi0 hdisk13 SP B1 active alive 0 0 0 fscsi0 hdisk17 SP B1 active alive 0 0 1 fscsi1 hdisk100 SP B0 active alive 0 0 0 fscsi0 hdisk12 SP B1 active alive 0 0 0 fscsi0 hdisk16 SP B1 active alive 0 0 0 fscsi0 hdisk18 SP B1 active alive 0 0 0 fscsi0 hdisk15 SP B1 active alive 0 0
mkvg -s 128 -f -y datavg hdisk1 datavg
La taille d'un PP a été fixé à 128 Mo. On pourrait mettre une valeur plus petite, mais il faut tenir compte de la taille du disque. En mettant 1Mo on obtiendrait ceci:
#mkvg -s 1 -f -y datavg hdisk1 0516-1208 mkvg: Warning, The Physical Partition Size of 1 requires the creation of 70006 partitions for hdisk1. The system limitation is 16256 physical partitions per disk at a factor value of 16. Specify a larger Physical Partition Size or a larger factor value in order create a volume group on this disk. 0516-862 mkvg: Unable to create volume group.
Une option interessante de mkvg est l'option -B qui permet de créer des Big volume.
#lsvg data 0516-306 : Unable to find volume group data in the Device Configuration Database. root@ceto:/root #lsvg datavg VOLUME GROUP: datavg VG IDENTIFIER: 00ccd2cd00004c0000000111925b7951 VG STATE: active PP SIZE: 128 megabyte(s) VG PERMISSION: read/write TOTAL PPs: 546 (69888 megabytes) MAX LVs: 256 FREE PPs: 546 (69888 megabytes) LVs: 0 USED PPs: 0 (0 megabytes) OPEN LVs: 0 QUORUM: 2 TOTAL PVs: 1 VG DESCRIPTORS: 2 STALE PVs: 0 STALE PPs: 0 ACTIVE PVs: 1 AUTO ON: yes MAX PPs per PV: 1016 MAX PVs: 32 LTG size: 128 kilobyte(s) AUTO SYNC: no HOT SPARE: no BB POLICY: relocatable
mklv -y datalv -t jfs2 datavg 1 crfs -v jfs2 -d datalv -m data -A ''`locale yesstr | awk -F: '{print $1}'`'' -p'rw' -a agblksize='4096' chfs -a size=40G /data Filesystem size changed to 83886080 root@ceto:/ #lsfs data Name Nodename Mount Pt VFS Size Options Auto Accounting /dev/datalv -- /data jfs2 83886080 rw yes no
#dumpfs /sauve | pg /sauve: Primary Superblock last update Fri Sep 26 11:16:51 2008 magic J2FS file system version 1 volume name lv_sau aggregate size in physical byte blocks 373281256 allocation group size 524288 aggregate block size 4096 log2 of aggregate block size 12 physical block size 512 log2 of physical block size 9 log2 of block size/physical block size 3 Aggregate attributes J2_GROUPCOMMIT Aggregate state: FM_MOUNT AIT's first extent: 45056 (11); 4 AIT's second extent: 102400 (25); 4 log device 0x8000002a00000002 log serial number 0x1 Inline Log: 0 (0); 0 fsck Service Log number of blocks: 50 Most recent fsck service: 1 (First one) fsck Working Space: 191120003072 (46660157); 1475 Extendfs aggregate size in physical blocks: 0 Extendfs fsck Working Space: 191120003072 (46660157); 1475 Extendfs Inline Log Working Space: 0 (0); 0 Compatible feature: 0x0000000000000000 Read-only feature: 0x0000000000000000 Incompatible feature: 0x0000000000000000 Features supported: Aggregate Inode Allocation Map: i_inostamp:0x48dca883 i_fileset:1 i_number:1 i_mode:0x00018000 i_nlink:1 i_ixpxd address:11 i_ixpxd length:4 i_size:8192 i_nblocks:2 B+-tree node: root flag:0x83 nextindex:3 maxentry:18 xad[2]: offset:0x0 address:0x9 length:2 Inode imap information gengen: 0 Inode Map Control Page
lsps -a Page Space Physical Volume Volume Group Size %Used Active Auto Type hd6 hdisk0 rootvg 10240MB 2 yes yes lv
cat /etc/swapspaces * /etc/swapspaces * * This file lists all the paging spaces that are automatically put into * service on each system restart (the 'swapon -a' command executed from * /etc/rc swaps on every device listed here). * * WARNING: Only paging space devices should be listed here. * * This file is modified by the chps, mkps and rmps commands and referenced * by the lsps and swapon commands. hd6: dev = /dev/hd6
mkps -s 1 rootvg hdisk1 lsps -a Page Space Physical Volume Volume Group Size %Used Active Auto Type paging00 hdisk1 rootvg 64MB 1 yes yes lv hd6 hdisk0 rootvg 10240MB 2 yes yes lv
ajouter -n pour l'activation immédiate et -a pour l'ajout au démarrage.
swapon /dev/paging01
lslv -m paging00 paging00:N/A LP PP1 PV1 PP2 PV2 PP3 PV3 0001 0339 hdisk1
lsvg -p rootvg rootvg: PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION hdisk1 active 542 133 00..00..00..94..39 hdisk0 active 542 134 00..00..00..95..39
swapon -a
mklvcopy paging00 2 hdisk1 hdisk0
lsvg -l rootvg rootvg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT hd5 boot 1 2 2 closed/syncd N/A hd6 paging 160 320 2 open/syncd N/A hd8 jfslog 1 2 2 open/syncd N/A hd4 jfs 16 32 2 open/syncd / hd2 jfs 80 160 2 open/syncd /usr hd9var jfs 32 64 2 open/syncd /var hd3 jfs 8 16 2 open/syncd /tmp paging00 paging 1 2 2 open/stale N/A hd10opt jfs 8 16 2 open/syncd /opt lg_dumplv sysdump 102 204 2 open/syncd N/A
lslv -m paging00 LP PP1 PV1 PP2 PV2 PP3 PV3 0001 0339 hdisk1 0339 hdisk0
lsps -a Page Space Physical Volume Volume Group Size %Used Active Auto Type paging00 hdisk1 rootvg 2112MB 1 yes yes lv hd6 hdisk0 rootvg 10240MB 2 yes yes lv chps -d 1 paging00 shrinkps: Temporary paging space paging01 created. shrinkps: Paging space paging00 removed. shrinkps: Paging space paging00 recreated with new size. lsps -a Page Space Physical Volume Volume Group Size %Used Active Auto Type paging00 hdisk1 rootvg 2048MB 1 yes yes lv hd6 hdisk0 rootvg 10240MB 2 yes yes lv
istat file Inode 57549 on device 10/4 File Protection: rw-r--r-- Owner: 0(root) Group: 0(system) Link count: 1 Length 22 bytes Last updated: Tue Jan 15 16:40:32 2008 Last modified: Tue Jan 15 16:40:32 2008 Last accessed: Tue Dec 2 09:11:01 2008
Vous obtiendrez les date de création, modification et d'access, les droits, le propriétaire et même son numéro d'ionde. On voit ici avec Link count qu'il est unique. Si on fait un lin le count passe à 2.
ln file file2 root@artemis:/root# istat filee Inode 57549 on device 10/4 File Protection: rw-r--r-- Owner: 0(root) Group: 0(system) Link count: 2 Length 22 bytes Last updated: Tue Dec 2 16:21:56 2008 Last modified: Tue Jan 15 16:40:32 2008
ncheck -i 57549 /dev/hd4: 57549 /root/file2 57549 /root/file1
3001-654 The group gdb2adm has no stanza in /etc/security/group. 3001-654 The group gfence has no stanza in /etc/security/group. 3001-654 The group gipief01 has no stanza in /etc/security/group. 3001-654 The group gr6 has no stanza in /etc/security/group. 3001-654 The group mi_group has no stanza in /etc/security/group. 3001-654 The group sasgrp has no stanza in /etc/security/group. 3001-664 The account for user daemon has expired. 3001-664 The account for user bin has expired. 3001-664 The account for user sys has expired. 3001-664 The account for user nobody has expired. 3001-664 The account for user lpd has expired. 3001-612 User lp has a non-existent or inaccessible home directory /var/spool/lp. 3001-648 The user lp has no stanza in /etc/security/user. 3001-648 The user lp has no stanza in /etc/security/user. 3001-612 User imnadm has a non-existent or inaccessible home directory /home/imnadm. 3001-662 User sshd is locked.
3001-227 User name "printq" not found in password file. 3001-233 Invalid admin value in /etc/security/group for "gusasqta" 3001-239 Missing stanza for "gusasqta" in /etc/security/group. 3001-238 Missing stanza for "gusas" in /etc/group.
3001-402 The user "imnadm" has an invalid password field in /etc/passwd. 3001-414 The stanza for "imnadm" was not found in /etc/security/passwd. 3001-402 The user "invscout" has an invalid password field in /etc/passwd. 3001-414 The stanza for "invscout" was not found in /etc/security/passwd. 3001-402 The user "ipsec" has an invalid password field in /etc/passwd. 3001-414 The stanza for "ipsec" was not found in /etc/security/passwd. 3001-402 The user "lp" has an invalid password field in /etc/passwd. 3001-414 The stanza for "lp" was not found in /etc/security/passwd. 3001-421 The user "lp" does not have a stanza in /etc/security/user. 3001-402 The user "nuucp" has an invalid password field in /etc/passwd. 3001-414 The stanza for "nuucp" was not found in /etc/security/passwd. 3001-402 The user "snapp" has an invalid password field in /etc/passwd. 3001-414 The stanza for "snapp" was not found in /etc/security/passwd. 3001-402 The user "sshd" has an invalid password field in /etc/passwd. 3001-414 The stanza for "sshd" was not found in /etc/security/passwd.
for user in àwk-F ":" '/^.*:.*:0/ {print $1}' /etc/passwd do echo "$user account ..\c" chuser rlogin=false $user check_status $? echo "modified" done
lsuser ALL
#lsuser -f root root: id=0 pgrp=system groups=system,bin,sys,security,cron,audit,lp home=/root shell=/usr/bin/ksh auditclasses=general login=true su=true rlogin=true daemon=true admin=true sugroups=ALL admgroups= tpath=nosak ttys=ALL expires=0 auth1=SYSTEM auth2=NONE umask=22 registry=files SYSTEM=compat logintimes= loginretries=0 pwdwarntime=0 account_locked=false minage=0 maxage=0 maxexpired=-1 minalpha=0 minother=0 mindiff=0 maxrepeats=8 minlen=0 histexpire=0 histsize=0 pwdchecks= dictionlist= fsize=2097151 cpu=-1 data=262144 stack=65536 core=2097151 rss=65536 nofiles=2000 time_last_login=1180684403 time_last_unsuccessful_login=1173802995 tty_last_login=/dev/pts/0 tty_last_unsuccessful_login=/dev/vty0 host_last_login=syst0001.getima.mutuagri.tm.fr host_last_unsuccessful_login=localhost unsuccessful_login_count=0 roles=
Sans l'option -f l'affichage se fai en vrac.
remet à zero le nombre de tentatives de connection erronee
#chuser unsuccessful_login_count=0 toto
change le descriptif d'un compte
#chuser gecos="Jean-Louis Bicquelet" toto
passe l'authentification de l'utilisateur en mode LDAP
#chuser registry=LDAP SYSTEM=LDAP toto
vérouillage d'un compte
#chuser account_locked=false toto
La comamnde pour créer un utilisateur est:
#mkuser id=2014 gecos='utilisateur systeme' unix_user
Les parametres de comptes pêuvent être ajoutés. Il peut être plus simple de créer d'abord le groupe puis l'utilisateur:
#mkgroup -A id=800 topx #mkuser id='800' pgrp='topx' groups='staff,topx' home='/home/topx' shell='/usr/bin/ksh' topx
en général on va grouper la création du compte avec celui du groupe et le mot de passe:
mkgroup -A id=2010 csme mkuser id=2301 pgrp=csme home='/home/exploit/judocsme' gecos='judocsme' judocsme passwd judocsme
#mkgroup id=2000 unix_users
id -gn dsadm dstage
Editez le fichier /etc/passwd et changer l'id de l'utilisateur. Dans l'exemple, on change l'utilisateur oracle id=207 en oracle id=216.
Lancez ensuite un find sur le user suivi d'un chown (éventuelement avec oracle:oracle).
find . -user 207 -exec chown oracle {} \;
pwdadm -q user user: lastupdate = 1188172800 flags = NOCHECK
les attibuts peuvent être:
NOCHECK pas de vérification ADMIN password uniquement modifiable par l'utilisateur ADMCHG le password devra etre changé par l'utilisateur à sa prochaine connection.
L'autre solution consiste à regarder le fichier /etc/security/passwd
# tail -4 /etc/security/passwd nmon: password = Wm7hpUyntWqWg lastupdate = 1229418107 flags = ADMCHG #pwdadm -c nmon # tail -4 /etc/security/passwd password = Wm7hpUyntWqWg lastupdate = 1229418107 flags =
#who /etc/security/failedlogin root pts/0 Apr 23 22:05 (170.127.106.223) UNKNOWN_ pts/1 Apr 23 23:02 (170.127.103.117) UNKNOWN_ pts/1 Apr 23 23:03 (170.127.103.117) UNKNOWN_ pts/2 Apr 24 00:26 (170.127.106.223) root pts/1 Apr 24 17:23 (c920001074.net) UNKNOWN_ ssh Apr 25 01:32 (170.127.101.31) UNKNOWN_ ssh Apr 25 01:32 (170.127.101.31) UNKNOWN_ ssh Apr 25 01:32 (170.127.101.31) root vty0 Apr 25 18:34
chsec -f /etc/security/lastlog -a "unsuccessful_login_count=0" –s USER chuser "account_locked=false" USER
echo "user:password" | chpasswd
pwdadm -c user
who batman pts/0 Jun 05 10:08 (workstations12.fr) root pts/1 Jun 05 11:21 (nimserv) cft pts/2 May 29 09:00 (workstations28.fr)pour savoir avec quel compte vous êtes conencté:
whoami root
#finger Login Name TTY Idle When Site Info I4435543 jean BICQUELET - p0 19 Wed 10:08 root User root p1 Wed 11:33 dscream Admin projet CREAM p2 20: Wed 09:00on peut obtenir la même chose en foramt long:
# finger -l Login name: I4435543 In real life: jean BICQUELET Directory: /home/I4435543 Shell: /bin/ksh On since Jun 05 10:08:57 on pts/0, 24 minutes Idle Time from workstations12.fr No Plan. Login name: root In real life: User root Directory: /root Shell: /bin/ksh On since Jun 05 11:33:26 on pts/1 from nimserv No Plan. Login name: dscream In real life: Admin projet CREAM Directory: /home/dscream Shell: /usr/bin/ksh On since May 29 09:00:55 on pts/2, 20 hours Idle Time from workstations28.fr No Plan.On peut bien entendu ne sélectionner qu'un seul utilisateur:
# finger -l Login name: I4435543 In real life: jean BICQUELET Directory: /home/I4435543 Shell: /bin/ksh On since Jun 05 10:08:57 on pts/0, 24 minutes Idle Time from workstations12.fr No Plan.
# finger -i Login TTY When Idle I4435543 pts/0 Wed Jun 05 10:08 22 minutes root pts/1 Wed Jun 05 11:33 dscream pts/2 Wed May 29 09:00 20 hours
Avec 't' fixé, seul le propriétaire d'un fichier peut le supprimer.
Le programme ainsi fixé sera executé avec les droits du propriétaire du fichier. Dans l'exemple qui suit on rend la commande ping utilisable par n'importe qui.
host-user[1] ping host 0821-067 ping: The socket creation call failed.: The file access permissions do not allow the specified action. host-user[2] which ping /usr/sbin/ping host-user[3] ls -ltr /usr/sbin/ping -rwxr-xr-x 1 root system 32566 Apr 23 2007 /usr/sbin/ping
On ne peut pas pinger avec le compte user pour de raison de droits. On fixe alors en tant que root le set-ID bit.
host-root # chmod u+s /usr/sbin/ping
Le compte user peut maintenant pinger.
host-user [1] ls -ltr /usr/sbin/ping -rwsr-xr-x 1 root system 32566 Apr 23 2007 /usr/sbin/ping host-user [2] ping host PING host: (192.168.2.66): 56 data bytes 64 bytes from 192.168.2.66: icmp_seq=0 ttl=255 time=0 ms
aclget rep attributes: base permissions owner(app): rwx group(cft): rwx others: r-x extended permissions enabled specify rwx u:user
aclget -o memo.txt REP
aclput -i memo.txt fichier
Les permissions Étendues permettent au propriétaire d'un fichier de définir l'accès à ce fichier plus précisément. Les permissions Étendues modifient les permissions de fichier de base (le propriétaire, le groupe, d'autres) en permettant, supprimant, ou spécifiant des modes d'accès pour des individus spécifiques, des groupes, ou des combinaisons de groupe et l'utilisateur. Les permissions sont modifiées à l'aide des mots-clés.
les mots clés permit, deny, and specify sont définis comme ceci:
/usr/sbin/ls-secldapclntd ldapservers=orange ldapport=389 active connections=1 ldapversion=3 userbasedn=ou=aixuser,cn=aixsecdb,cn=aixdata,o=systunix groupbasedn=ou=aixgroup,cn=aixsecdb,cn=aixdata,o=systunix idbasedn= usercachesize=1000 usercacheused=0 groupcachesize=100 groupcacheused=0 usercachetimeout=300 groupcachetimeout=300 heartbeatT=300 numberofthread=10 connectionsperserver=10 alwaysmaster=no authtype=UNIX_AUTH searchmode=ALL defaultentrylocation=LDAP ldaptimeout=60 userobjectclass=posixaccount,account,shadowaccount,aixauxaccount,ibm-securityIdentities groupobjectclass=posixgroup,aixauxgroup
exemple:
lsuser -R LDAP wbic lsuser -R LDAP ALL
Les commandes pour arrêter et redémarrer LDAP sont:
Pour vérifier le status:
#lsldap dn: ibm-replicaGroup=default,cn=aixsecdb,cn=aixdata,o=systunix dn: ou=aixuser,cn=aixsecdb,cn=aixdata,o=systunix dn: ou=aixgroup,cn=aixsecdb,cn=aixdata,o=systunix root@artemis:/etc/security/ldap# ls-secldapclntd ldapservers=orange ldapport=389 active connections=1 ldapversion=3 userbasedn=ou=aixuser,cn=aixsecdb,cn=aixdata,o=systunix groupbasedn=ou=aixgroup,cn=aixsecdb,cn=aixdata,o=systunix idbasedn= usercachesize=1000 usercacheused=0 groupcachesize=100 groupcacheused=0 usercachetimeout=0 groupcachetimeout=0 heartbeatT=60 numberofthread=10 connectionsperserver=10 alwaysmaster=no authtype=UNIX_AUTH searchmode=ALL defaultentrylocation=LDAP ldaptimeout=60 userobjectclass=posixaccount,account,shadowaccount,aixauxaccount groupobjectclass=posixgroup,aixauxgroup
#lsldap dn: ibm-replicaGroup=default,cn=aixsecdb,cn=aixdata,o=systunix dn: ou=aixuser,cn=aixsecdb,cn=aixdata,o=systunix dn: ou=aixgroup,cn=aixsecdb,cn=aixdata,o=systunix
Par défaut, lsldap n'affiche que les distinguished name (DN). Il faut utiliser l'option -a pour afficher les attributs:
# lsldap -a dn: ibm-replicaGroup=default,cn=aixsecdb,cn=aixdata,o=systunix objectclass: top objectclass: ibm-replicaGroup ibm-replicaGroup: default dn: ou=aixuser,cn=aixsecdb,cn=aixdata,o=systunix ou: aixuser objectClass: organizationalUnit objectClass: top dn: ou=aixgroup,cn=aixsecdb,cn=aixdata,o=systunix ou: aixgroup objectClass: organizationalUnit objectClass: top
export EXTENDED_HISTORY=ONOn ajoute alors la date et l'heure à l'historique:
#fc -l 646 fc -l 647 fc -t 648 which fc 649 fc -l #fc -t 647 2009/05/29 14:05:13 :: fc -t 648 2009/05/29 14:05:27 :: which fc 649 2009/05/29 14:05:30 :: fc -l 650 2009/05/29 14:05:52 :: fc -t
Il faut soit créer un fichier /var/adm/cron/cron.allow qui contient la liste des utilisateurs à raison d'une entrée par ligne, comme ceci:
sas topx root
soit créer un fichier /var/adm/cron/cron.deny, éventuellement vide.
pmlist -s POWER5 supports 6 counters Number of groups : 148 Number of sets : 9 Threshold multiplier (lower): 1 Threshold multiplier (upper): 32 Threshold multiplier (hyper): 64 Hypervisor counting mode is supported Runlatch counting mode is supported
#prtconf | grep Processor Processor Type: PowerPC_POWER5 Number Of Processors: 3 Processor Clock Speed: 1798 MHz Model Implementation: Multiple Processor, PCI bus + proc0 Processor + proc2 Processor + proc4 Processor
#prtconf | grep Speed Processor Clock Speed: 1798 MHz
pmlist -s -o c Processor Name,Counter Number,Group Number,Set Number,Lower Threshold,Upper Threshold,Hyper Threshold,Hypervisor Counting,Runlatch Counting POWER5,6,148,9,1,32,64,yes,yes
#svmon -P -v -t 10 | more (B) #svmon -U -v -t 10 | more
smtctl This system is SMT capable. SMT is currently enabled. SMT boot mode is not set. SMT threads are bound to the same physical processor. proc0 has 2 SMT threads. Bind processor 0 is bound with proc0 Bind processor 1 is bound with proc0
smtctl -m 'on' -w now smtctl: SMT is now enabled.-m 'off' pour désactiver le mode SMT.
/usr/bin/lsallq # PRINT QUEUE PRINTER DESCRIPTION printer1 @server1 Remote Printer printer2 @server2 Remote PrinterL'option -c permet un affichage à la mode smit.
/usr/bin/lsallq -c printer1 printer1:@server1 printer2 printer2:@server2
/usr/lib/lpd/pio/etc/piomisc_ext mkpq_remote_ext -q 'printer3' -h 'server3' -r 'HP2400_003' -t 'bsd' -C 'FALSE'
/usr/lib/lpd/pio/etc/piomisc_ext rmpq_other 'R_HP2400_003:@server3' 'remote'
cat fichier1.c fichier2.c | lpr -#2On peut aussi cumuler les noms comme ceci:
cat `ls *.pl` | lpr
enq -P printer2 fichier lpr -P printer 2 fichier
# enq -A Queue Dev Status Job Files User PP % Blks Cp Rnk ------- ----- --------- --- ------------------ ---------- ---- -- ----- --- --- p207 @verd READY p207: R_HP2300_B240 status: Idle 018608 @opal READY 018608: R_HP4200N_018608 status: Idle 018609 @opal READY 018609: R_HP4200N_018609 status: Idle
lsquedev -c -dR_HP4200_003 -qR_HP4200_003 #name:file:access:feed:header:trailer:backend:align R_HP4200_003:FALSE:write:never:never:never:/usr/lib/lpd/rembak:FALSE
#lssrc -g spooler Subsystem Group PID Status qdaemon spooler 614520 active writesrv spooler 794656 active lpd spooler 1912856 active
#lssrc -s cdromd Subsystem Group PID Status cdromd inoperative
tctl status rmt0 Available 0I-08-00-0,0 LVD SCSI 4mm Tape Drive attribute value description user_settable block_size 0 BLOCK size (0=variable length) True compress yes Use data COMPRESSION True density_set_1 71 DENSITY setting #1 True density_set_2 38 DENSITY setting #2 True extfm yes Use EXTENDED file marks True mode yes Use DEVICE BUFFERS during writes True ret no RETENSION on tape change or reset True ret_error no RETURN error on tape change or reset True size_in_mb 36000 Size in Megabytes False
tctl offline
# backup -ivqf /dev/rmt44 Backing up to /dev/rmt44. Cluster 51200 bytes (100 blocks). Volume 1 on /dev/rmt44
Pour lister de la bande
#restore -Tvf/dev/rmt
Pour restorer:
#restore -xvf/dev/rmt0 #restore -xvf/dev/rmt0 ./home/jlb #restore -xvf/dev/rmt0 ./home/*
La première commande restore tout, la seconde l'arborescence d'un compte unix, la dernière restore tous les
comptes se trouvantr dans /home.
#tapechk 2
#oslevel -r 5200-08
IL s'agit d'un AIX 5.2 TL 08 (car depuis cette version on parle de technical level).
Avec les technical level, pour connaitre le niveau de service pack, il faut utiliser l'option -s.
#oslevel -s 5200-09-CSP-0000
Une autre façon de faire est de chercher les ML:
instfix -i | grep -i ML All filesets for 5.2.0.0_AIX_ML were found. All filesets for 5200-01_AIX_ML were found. All filesets for 5200-02_AIX_ML were found. All filesets for 5200-03_AIX_ML were found. All filesets for 5200-04_AIX_ML were found. All filesets for 5200-05_AIX_ML were found. All filesets for 5200-06_AIX_ML were found. All filesets for 5200-07_AIX_ML were found. All filesets for 5200-08_AIX_ML were found. All filesets for 5200-09_AIX_ML were found. Not all filesets for 5200-10_AIX_ML were found.
#lslpp -l bos.txt.tfs.data 5.2.0.0 COMMITTED Text Formatting Services Data devices.common.IBM.modemcfg.data 5.2.0.0 COMMITTED Sample Service Processor Modem Configuration Files mqm.man.en_US.data 5.3.0.13 APPLIED WebSphere MQ Man Pages - U.S. English
Les packages peuvent être en mode COMMITTED ou APPLIED. En mode APPLIED, on peut faire un reject
pour revenir en arrière ou un commit pour valider l'instalaltion. Après une période de test et avant les montées de niveaux,
il vaut mieux faire un COMMIT.
lslpp -f xlC.aix50.rte Fileset File ---------------------------------------------------------------------------- Path: /usr/lib/objrepos xlC.aix50.rte 6.0.0.13 /usr/lpp/xlC/lib/profiled/libC128_r.a -> /usr/lpp/xlC/lib/profiled/aix51/libC128_r.a /usr/lpp/xlC/lib/aix50/libC.a /usr/lpp/xlC/lib/libC128_r.a -> /usr/lpp/xlC/lib/aix51/libC128_r.a /usr/lpp/xlC/lib/libC.a -> /usr/lpp/xlC/lib/aix51/libC.a /usr/lpp/xlC/lib/profiled/aix52/libC.a -> /usr/lpp/xlC/lib/profiled/aix50/libC.a /usr/lpp/xlC/lib/profiled/aix53/libC128.a -> /usr/lpp/xlC/lib/profiled/aix50/libC128.a /usr/lpp/xlC/lib/profiled/aix51/libC128.a -> /usr/lpp/xlC/lib/profiled/aix50/libC128.a ... /usr/lpp/xlC/lib/aix53/libC128_r.a -> /usr/lpp/xlC/lib/aix50/libC128_r.a /usr/lpp/xlC/lib/aix50 /usr/lpp/xlC/lib/aix51 /usr/lpp/xlC/lib/aix52 /usr/lpp/xlC/lib/aix53 /usr/lpp/xlC/lib/profiled/aix52/libC128_r.a -> /usr/lpp/xlC/lib/profiled/aix50/libC128_r.a /usr/lpp/xlC/lib/aix53/libC128.a -> /usr/lpp/xlC/lib/aix50/libC128.a
lslpp -L | grep MQ mqm.Client.Bnd 5.3.0.2 C F WebSphere MQ Client Bundle mqm.Server.Bnd 5.3.0.2 C F WebSphere MQ Server Bundle mqm.base.runtime 5.3.0.8 C F WebSphere MQ Runtime for mqm.base.samples 5.3.0.8 C F WebSphere MQ Samples mqm.base.sdk 5.3.0.8 C F WebSphere MQ Base Kit for mqm.client.rte 5.3.0.8 C F WebSphere MQ Client for AIX mqm.java.rte 5.3.0.8 C F WebSphere MQ Java Client and mqm.keyman.rte 5.3.0.8 C F WebSphere MQ Support for GSKit mqm.man.en_US.data 5.3.0.8 C F WebSphere MQ Man Pages - U.S. mqm.msg.en_US 5.3.0.8 C F WebSphere MQ Messages - U.S. mqm.server.rte 5.3.0.8 C F WebSphere MQ Server
cd /root/fixpack_13 inutoc .
Allez ensuite dans smitty
smitty -> Software Installation and Maintenance -> Install and Update Software -> Update Installed Software to Latest Level (Update All)
Et précisez :
input device .
#instfix -ivk 5200-10_AIX_ML |grep not
On peut aussi chercher ceux qui sont inférieur au niveau de référence avec grep ":-:". Si on remplace le signe - par + on trouve les packages d'un niveau supérieur au niveau de référence et si on utilise = on trouve uniquement les packages à niveau.
#instfix -ciqk 5200-10_AIX_ML|grep ":-:"
Une autre manière de faire est d'utiliser l'option -l avec oslevel -s ou oslevel -r.
#oslevel -rl 5300-07 Fileset Actual Level Recommended ML ----------------------------------------------------------------------------- ICU4C.rte 5.3.0.60 5.3.7.0 OpenGL.OpenGL_X.rte.base 5.3.0.61 5.3.7.0 OpenGL.OpenGL_X.rte.soft 5.3.0.60 5.3.7.0 X11.base.rte 5.3.0.60 5.3.7.0 bos.64bit 5.3.0.61 5.3.7.0 bos.acct 5.3.0.60 5.3.7.0 bos.adt.debug 5.3.0.60 5.3.7.0 bos.adt.include 5.3.0.61 5.3.7.0 bos.adt.prof 5.3.0.61 5.3.7.0 bos.adt.samples 5.3.0.40 5.3.7.0 bos.adt.sccs 5.3.0.60 5.3.7.0 bos.adt.syscalls 5.3.0.60 5.3.7.0 bos.clvm.enh 5.3.0.61 5.3.7.0 bos.compat.cmds 5.3.0.60 5.3.7.0 bos.cpr 5.3.0.60 5.3.7.0 bos.diag.com 5.3.0.61 5.3.7.0 bos.diag.rte 5.3.0.61 5.3.7.0 bos.diag.util 5.3.0.61 5.3.7.0 #oslevel -sl 5300-06-01-0732
exemple:
installp -u xlopt.tools
On peut aussi lister un groupe de fichier ainsi afin de vérifier qu'on ne supprimera rien de trop (tout ce qui est en japonais):
lslpp -JL | grep -i JP | awk '{print $1}'
Et le supprimer avec xargs:
lslpp -JL | grep -i JP | awk '{print $1}' |xargs installp -u
Lorsque la configuration est mauvaise, il peut être utile de supprimer la vérification de la validité du bosboot. Il faut alors utiliser l'option -
installp -u -b sysmgt.websm.* +-----------------------------------------------------------------------------+ Pre-deinstall Verification... +-----------------------------------------------------------------------------+ Verifying selections...done Verifying requisites...done Results... SUCCESSES --------- Filesets listed in this section passed pre-deinstall verification and will be removed.
#lslpp -Jl | grep -v "#"
#lslpp -w /usr/lib/libisns.a File Fileset Type ---------------------------------------------------------------------------- /usr/lib/libisns.a bos.net.tcp.client File
#lslpp -f
#installp -abcgd . devices.vdevice.IBM.v-scsi-host.rte
#bosboot -ad /dev/hdisk0 bosboot: Boot image is 36284 512 byte blocks. # bosboot -ad /dev/ipldevice bosboot: Boot image is 36284 512 byte blocks.
A l'exception de errlog qui se nettoye à l'aide de errclear, il faut périodiquement nettoyer ces fichier soit en rendant vide leur contenu:
cat /dev/null >/var/adm/sulogsoit en réduisant ceux-ci
tail -200 sulog > sulog_new rm sulog mv sulog_new sulog
# nulladm /var/adm/wtmp
#who -r . run-level 2 Apr 2 21:42 2 0 S #who -r . run-level 1 Apr 3 22:07 1 0 2 #who -r . run-level S Apr 3 22:11 S 1 1
#errpt IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION C6ACA566 0711114407 U S syslog MESSAGE REDIRECTED FROM SYSLOG C6ACA566 0711114407 U S syslog MESSAGE REDIRECTED FROM SYSLOG C6ACA566 0711084607 U S syslog MESSAGE REDIRECTED FROM SYSLOG A6DF45AA 0711084407 I O RMCdaemon The daemon is started. C6ACA566 0711084407 U S syslog MESSAGE REDIRECTED FROM SYSLOG C6ACA566 0711084407 U S syslog MESSAGE REDIRECTED FROM SYSLOG B38E3397 0711084307 U S SYSDUMP Previous system dump information C0AA5338 0711084307 U S SYSDUMP SYSTEM DUMP 9D035E4D 0711040007 P S SYSVMM DATA STORAGE INTERRUPT, PROCESSOR 9DBCFDEE 0711084307 T O errdemon ERROR LOGGING TURNED ON C6ACA566 0711034907 U S syslog MESSAGE REDIRECTED FROM SYSLOG
errpt -aj 9D035E4D --------------------------------------------------------------------------- LABEL: DSI_PROC IDENTIFIER: 9D035E4D Date/Time: Wed Jul 11 04:00:31 DFT Sequence Number: 9554 Machine Id: 00CCD2CD4C00 Node Id: ceto Class: S Type: PERM Resource Name: SYSVMM Description DATA STORAGE INTERRUPT, PROCESSOR Probable Causes SOFTWARE PROGRAM Failure Causes SOFTWARE PROGRAM Recommended Actions IF PROBLEM PERSISTS THEN DO THE FOLLOWING CONTACT APPROPRIATE SERVICE REPRESENTATIVE Detail Data DATA STORAGE INTERRUPT STATUS REGISTER 0000 0000 0000 0000 SEGMENT REGISTER, SEGREG 4000 0000 0000 00FF DATA STORAGE INTERRUPT ADDRESS REGISTER FFFF D000 0000 0000 EXVAL 044D 6B40 FFFF FFFF
errpt -aj SYSLOG
Voici une liste d'exemple de labels possibles:
#errpt -s 0711084307 -e 0711084407 IDENTIFIER TIMESTAMP T C RESOURCE_NAME DESCRIPTION B38E3397 0711084307 U S SYSDUMP Previous system dump information C0AA5338 0711084307 U S SYSDUMP SYSTEM DUMP 9DBCFDEE 0711084307 T O errdemon ERROR LOGGING TURNED ON
Par exemple pour lister les erreurs entre le 18 mai 2009 17h00 et le 19 mai 9h00 :
# errpt -s 0518170009 -e 0519090009.
alog -L boot bosinst nim console cfg dumpsymp lvmt lvmcfg
Les logs les plus souvent utilisées sont boot, bosinst, nim et cfg.
alog -L -t boot #file:size:verbosity /var/adm/ras/bootlog:131072:1
On visualise avec cat.
cat /var/adm/ras/bootlog:131072:1
trace -a -j30D,30E -L 268435368 -o $TRACE
L'option -L sert à définir une trace rotative.
trcrpt -t /usr/mqm/lib/amqtrc.fmt trc > trc.txt
# sysdumpdev -L 0453-039 Device name: /dev/lg_dumplv Major device number: 10 Minor device number: 10 Size: 448727040 bytes Uncompressed Size: 2888377946 bytes Date/Time: Tue Jun 19 08:39:14 DFT 2007 Dump status: 0 dump completed successfully
Le dump status à 0 indique que cela s'est bien passé.
#sysdumpdev -L |grep Date Date/Time: Wed Jul 11 04:00:31 DFT 2007
sysdumpdev -l primary /dev/lg_dumplv secondary /dev/sysdumpnull copy directory /var/adm/ras forced copy flag TRUE always allow dump TRUE dump compression ON
Pour désactiver le premier dump device temporairement:
sysdumpdev -p /dev/sysdumpnull
Pour changer le second dump device de manière permanente.
sysdumpdev -p /dev/sysdumpnull
sysdumpdev -e 0453-041 Estimated dump size in bytes: 264870297
sysdumpdev -C
-c désactive la compression du dump.
c0 The dump completed successfully. Go to Copying a System Dump. 0c1 An I/O error occurred during the dump. Go to System Dump Facility. 0c2 A user-requested dump is not finished. Wait at least 1 minute for the dump to complete and for the operator panel display value to change. If the operator panel display value changes, find the new value on this list. If the value does not change, then the dump did not complete due to an unexpected error. 0c4 The dump ran out of space . A partial dump was written to the dump device, but there is not enough space on the dump device to contain the entire dump. To prevent this problem from occurring again, you must increase the size of your dump media. Go to Increase the Size of a Dump Device. 0c5 The dump failed due to an internal error. 0c7 A network dump is in progress, and the host is waiting for the server to respond. The value in the operator panel display should alternate between 0c7 and 0c2 or 0c9. If the value does not change, then the dump did not complete due to an unexpected error. 0c8 The dump device has been disabled. The current system configuration does not designate a device for the requested dump. Enter the sysdumpdev command to configure the dump device. 0c9 A dump started by the system did not complete. Wait at least 1 minute for the dump to complete and for the operator panel display value to change. If the operator panel display value changes, find the new value on the list. If the value does not change, then the dump did not complete due to an unexpected error. 0cc An error occured dumping to the primary device; the dump has switched over to the secondary device. Wait at least 1 minute for the dump to complete and for the three-digit display value to change. If the three-digit display value changes, find the new value on this list. If the value does not change, then the dump did not complete due to an unexpected error. c20 The kernel debugger exited without a request for a system dump. Enter the quit dump subcommand. Read the new three-digit value from the LED display.
savecore -d /root/nfs 0481-183 Saving 1740395520 bytes of system dump in /root/nfs/vmcore.
savecore génère un fichier vmcore.O.Z qui dévompréssé peut être examiner par kdb.
savecore -d /tmp df -g /tmp uncompress vmcore.0.Z kdb /tmp/vmcore.0 /unix
stat SYSTEM_CONFIGURATION: CHRP_SMP_PCI POWER_PC POWER_4 machine with 2 available CPU(s) (64-bit registers) SYSTEM STATUS: sysname... AIX nodename.. serveur release... 2 version... 5 build date Oct 12 2005 build time 11:30:28 label..... yes machine... 00XXXX0C4C00 nid....... XXXX0C4C time of crash: Mon Jul 9 16:40:22 2007 age of system: 9 day, 23 hr., 52 min., 11 sec. xmalloc debug: disabled CRASH INFORMATION: CPU 0 CSA 02020E00 at time of crash, error code for LEDs: 70000000 pvthread+01EC00 STACK: [000B0268]v_jfscorruption+000068 (000000005D0C6080, FFFFFFFF08000003, 0000000002020440, 0000000002020E00, 0000000032223080 [??]) ... Except : csr FFFFFFFF00A001FF dsisr 0000000042000000 bit set: DSISR_PFT DSISR_ST esid 00000001FE379080 dar FFFFFFFF00A001FF dsirr 0000000000000106 [0000B67C].umem_move+00007C (??, FFFFFFFF00A001FF, F00000002FF38FF0, ??, 0000000000000000, 0000000000000000, ??, 0000000000000000, 0000000000000001, ??, F10000E3208E6E00, F100000040000000, ??, 0000000000000000, 0000000000000000, ??) [00185ECC]vmpcopy+0004B4 (??, ??, ??, ??, ??, ??, ??) [00186D9C]vmfcopyin+00052C (??, ??, ??, ??, ??, ??) [00186670]vm_uiomove+0003EC (??, ??, ??, ??) [006D9E58]writei+000140 (??, ??, ??, ??, ??) [0073C9C8]iextend+000090 (??, ??, ??)
(0)> status CPU TID TSLOT PID PSLOT PROC_NAME 0 1EC09F 492 15B086 347 oracle 1 1BB079 443 AF0A0 175 maragent 2-31 Disabled
(0)> lke ADDRESS FILE FILESIZE FLAGS MODULE NAME 1 082F5800 08C31000 00001218 00080272 /etc/pw-syscall.64bit_kernel 2 082F5900 08C54000 00001580 00180248 /unix 3 082F5700 0897C000 00004320 00080262 bpf64/usr/lib/drivers/bpf 4 082F5500 08BD8000 0000AE28 00080272 random64/usr/lib/drivers/random 5 082F5600 08C04000 000014D8 00180248 /unix 6 082F5400 08B93000 00044CA8 00080262 /sbin/comp.uext64 7 082F5300 083FB000 00000408 00080262 comp.kext64/sbin/comp.kext 8 082F5100 08ACC000 000849D8 00080272 nfs.ext64/usr/lib/drivers/nfs.ext 9 082F5200 08714000 000014D8 00180248 /unix ...
vfs 1 GFS DATA TYPE FLAGS 1 F10000E31D34F470 007127F0 F10000E31D350990 JFS DEVMOUNT ... /dev/hd4 mounted over / vfs_next..... F10000E31D34F4D0 vfs_gfs...... 00000000007127F0 vfs_mntd..... F10000E30862DF10 vfs_mntdover. 0000000000000000 vfs_vnodes... F10000E3049E7380 vfs_count.... 00000001 vfs_data..... F10000E31D350990 vfs_number... 00000001 vfs_mdata.... F10000E31E685500 vfs_bsize.... 00001000 vfs_lock@.... F10000E31D34F4C0 vfs_lock..... 0000000000000000 vmt_revision. 00000001 vmt_length... 00000078 vmt_vfsnumber 00000001 vmt_fsid..... 8000000A00000004 0000000000000003
dla Component Dump Table Cache (10000 entries) OVERFLOW Component Dump Table Cache resized from 10000 to 20000 entries [kdb_read_mem] no real storage @ F10000E3206F3410 [kdb_read_mem] no real storage @ F10000E3208E6E30 [kdb_read_mem] no real storage @ F10000E3208E6E30 [kdb_read_mem] no real storage @ F10000E3208E6E30 [kdb_read_mem] no real storage @ F10000E3208E6E30 ...
cdt 1) CDT head name dmp_minimal, len 00000108, entries 5 2) CDT head name proc entries 2473 3) CDT head name thrd entries 6833 4) CDT head name ldr, len 00000078, entries 2 5) CDT head name errlg, len 000000A8, entries 3 6) CDT head name lfs, len 00000048, entries 1 7) CDT head name bos, len 00000078, entries 2 8) CDT head name ipc, len 00000168, entries 7 9) CDT head name vmm, len 00000438, entries 22 10) CDT head name alloc entries 267 11) CDT head name rtastrc, len 00000198, entries 8 12) CDT head name sscsidd, len 00000048, entries 1 13) CDT head name aixpcm, len 00000108, entries 5 14) CDT head name efcdd, len 00000588, entries 29 15) CDT head name scdisk, len 00000228, entries 11 16) CDT head name lvm, len 00000078, entries 2 17) CDT head name tty, len 000000D8, entries 4 18) CDT head name efscsi, len 00000168, entries 7 19) CDT head name scsidisk, len 000030A8, entries 259 20) CDT head name netstat, len 000001F8, entries 10 21) CDT head name goent_dd, len 000000D8, entries 4 22) CDT head name jfs2, len 00000048, entries 1 (0)> cdt 5 5) CDT head name errlg, len 000000A8, entries 3 CDT 1 name errc addr 00000000002827A0, len 000009E8 CDT 2 name errc_io addr 0000000000DF46C8, len 00000048 CDT 3 name log addr F10000E3040E3000, len 00008000
iostat 1 | grep "hdisk0 " hdisk0 7.0 83.8 14.8 80387474 324942887 hdisk0 17.0 244.0 55.0 0 244 hdisk0 15.9 238.2 47.6 0 240 hdisk0 17.0 231.4 50.9 0 232 hdisk0 16.0 216.3 45.1 0 216 hdisk0 11.9 194.1 41.6 0 196
iostat | head -n5 tty: tin tout avg-cpu: % user % sys % idle % iowait 0.6 80.7 11.3 10.8 72.3 5.6 Disks: % tm_act Kbps tps Kb_read Kb_wrtn iostat | grep "hdisk1 " hdisk1 6.1 67.3 13.8 10609796 314630527
lvmstat -v rootvg Logical Volume iocnt Kb_read Kb_wrtn Kbps hd2 88 0 352 0.00 hd4 62 0 272 0.00 hd8 24 0 96 0.00 hd3 16 0 64 0.00 paging00 0 0 0 0.00 lv00 0 0 0 0.00 hd10opt 0 0 0 0.00 dumplv 0 0 0 0.00 hd9var 0 0 0 0.00 hd6 0 0 0 0.00 hd5 0 0 0 0.00 lvmstat -v rootvg Logical Volume iocnt Kb_read Kb_wrtn Kbps hd2 365 4 1456 0.00 hd4 190 0 800 0.00 hd8 74 0 296 0.00 hd3 62 0 248 0.00 hd6 4 0 16 0.00 paging00 0 0 0 0.00 lv00 0 0 0 0.00 hd10opt 0 0 0 0.00 dumplv 0 0 0 0.00 hd9var 0 0 0 0.00 hd5 0 0 0 0.00 lvmstat -v rootvg -d
lvmstat -v rootvg -e
-e enable -d disable.
lvmstat -v rootvg Logical Volume iocnt Kb_read Kb_wrtn Kbps hd8 126 0 504 0.00 hd2 100 0 464 0.00 hd3 60 0 800 0.00 hd4 34 0 144 0.00 hd9var 18 0 80 0.00 hd6 16 0 64 0.00 lg_dumplv 0 0 0 0.00 hd10opt 0 0 0 0.00 hd5 0 0 0 0.00
Dans le répertoire /etc/perf/daily on trouve des fichiers de noms:
xmwlm.091010 xmwlm.091012 xmwlm.091014 xmwlm.091016 xmwlm.091011 xmwlm.091013 xmwlm.091015
A partir de ces fichiers, on peut générer un rapport à l'aide de la commande topasout.
Pa rexemple pour obtenir un rapport résumé dud fichier du 15 octobre 2009 ( 091015) entre 8h du matin et 12h avec un intervale de 15 minutes (intervals possibles : 5, 10, 15, 30, ou 60 ).
#topasout -R summary -i 15 -b 1200 ./xmwlm.091015 Report: System Summary --- hostname: lacan version:1.2 Start:10/15/09 08:02:10 Stop:10/15/09 11:57:12 Int:15 Min Range: 235 Min Mem: 18.0 GB Dedicated SMT: ON Logical CPUs: 6 Time InU Us Sy Wa Id PhysB RunQ WtQ CSwitch Syscall PgFault %don %stl --------- --------------------------------- ----------------------- ---------- 08:17:09 18.0 3 4 0 93 20.70 1.3 0.7 1227 30345 1010 0.0 0.0 08:32:09 18.0 4 6 0 90 29.81 1.3 0.4 1628 42580 1065 0.0 0.0 08:47:09 18.0 6 8 0 86 40.90 1.4 0.3 1741 60159 1482 0.0 0.0 09:02:09 18.0 8 10 0 82 53.85 1.5 0.5 2222 79441 1680 0.0 0.0 09:17:10 18.0 10 13 1 76 69.10 1.6 0.7 2808 104508 2614 0.0 0.0 09:32:10 18.0 10 12 0 78 65.46 1.6 0.6 2687 99471 2029 0.0 0.0 09:47:10 18.0 11 14 0 75 74.71 1.8 0.7 3134 111482 2245 0.0 0.0 10:02:10 18.0 11 13 0 76 71.10 1.6 0.5 3137 102731 2136 0.0 0.0 10:17:10 18.0 13 16 1 70 87.66 1.8 0.9 4171 124198 2872 0.0 0.0 10:32:10 18.0 14 18 0 68 96.80 1.8 0.7 3907 140539 2637 0.0 0.0 10:47:11 18.0 14 22 0 63 109.71 1.9 0.6 3800 157682 2523 0.0 0.0 11:02:11 17.5 17 20 0 63 111.67 1.9 0.6 4253 153843 2780 0.0 0.0 11:17:11 17.5 20 23 0 57 128.58 2.2 0.8 4670 164897 9063 0.0 0.0 11:32:11 17.8 29 30 0 40 177.77 2.7 0.7 5645 197955 11139 0.0 0.0 11:47:11 17.1 25 31 1 43 167.90 2.5 0.9 4806 194283 4257 0.0 0.0 11:57:12 17.3 15 32 2 51 138.74 2.1 0.7 3497 168586 2841 0.0 0.0
les champs principaux champs sont:
Time | Ending time of the report interval. Metric values are averaged out over this interval and printed in the report |
InU | Memory that is used |
Us | Percentage of processor time spent in the user mode |
Sy | Percentage of processor time spent in the system mode |
Wa | Percentage of processor time spent waiting for I/O |
Id | Percentage of time that the processor is idle |
PhysB | Number of physical processors that are busy |
RunQ | The average number of threads that are ready to run but are waiting for a processor to become available |
WtQ | The average number of threads that are waiting for paging to be completed |
Cswitch | The number of context switches per second in the reporting interval |
Syscall | The number of system calls executed per second in the reporting interval |
PgFault | The number of I/O and other page faults |
%don | Sum of %idle cycles donated and %busy cycles donated |
%stl | Sum of %idle cycles stolen and %busy cycles stolen |
Les rapports suivants sont possibles:
summary | resumé |
detailed | détaillé |
disk | disques |
lan | réseau |
poolinfo | pool processeur partagé |
mempool | mémoire |
adapter | cartes adapteurs |
vadapter | cartes adapteurs virtuelles |
vios | Virtual I/O Server/Client |
vios_adapter | Virtual I/O Server/Client adapteurs et disques |
Il est possible aussi possible d'exporter des données vers nmon ou de générer des fichiers csv pour générer des graphes ou exploiter dans excel ces données.
Pour plus d'informations visitez Commands Reference, Volume 5, s - u topasout Command.
smitty -s command.sh
smit va créer un fichier command.sh. Il faut rendre celui-ci exécutable à l'aide de chmod +x.
Une autre manière de faire consiste à récupérer le fichier smit.log et l'éditer.
a=`bc << EOF > 6+8 > quit > EOF
Autre façon de faire:
a=2 awk -v a=$a 'BEGIN { print a+1 }'| read b echo $b 3
#a=`echo 45 + 6 |perl -pane "$F[0] + $F[1];"`
FICHIER=mon_fichier cp -pr $FICHIER "${FICHIER}_`date +%H%M%d%m%y`"
/usr/sbin/lmktemp filename1 100 filename1 # ls -l filename1 -rw-r--r-- 1 root system 100 Jun 14 14:11 filename1
istat lvmt.log Inode 5 on device 10/7 File Protection: rw-rw---- Owner: 0(root) Group: 0(system) Link count: 1 Length 204800 bytes Last updated: Thu Sep 25 16:31:21 CDT 2008 Last modified: Mon Oct 6 15:48:41 CDT 2008 Last accessed: Thu Sep 25 16:31:21 CDT 2008
On dispose de plus de l'inode du fichier ainsi que du nombre de lien (Link count). Ceci permet par exemple de supprimer un fichier grace à son inode.
Il faut passer par la commande find ou xargs afin de traiter ligne à ligne les paramêtres.
# ls |while read l do echo $l done .sh_history .vi_history DATASOFT SOFT TUX1 audit bin cd0
# cd /tmp # cd /NIM # cd ~- # pwd /tmp
export PS1=`hostname`:'$PWD# '
set -o vi
Cela vous permetra d'utiliser les touches
haut | |
bas | |
droit | |
gauche | |
x | suppresion d'un caractère |
i | insertion |
$ | fin de ligne |
c$ | changement jusqu'à la fin de la ligne |
recherche d'une commande |
et cetera
alias l='ls -l'
Ajoutez dans $HOME/.profile la ligne :
export ENV=$HOME/.kshrc
md5sum ne se trouve pas dans textutil mais dans coreutils. Il suffit de le recherchercher dans le CD AIX Toolbox ou de le télécharger à l'adresse Open Source packages available for installation on AIX 5L puis de l'installer pour qu'il soit disponible:
#rpm -uvh coreutils-5.2.1-2.aix5.1.ppc.rpm