AIX JUMPSTART COURSE NOTES 20 th September 2010 1. Day One...................................................... 2 1.1. List and connect to a LPAR................................... 2 1.2. List the managed system on the HMC...........................2 1.3. List all LPARS on managed system.............................2 1.4. List the name and states of the running systems..............2 1.5. Open a console............................................... 2 1.6. SMIT (system management interface tool)......................2 1.7. OS Levels.................................................... 2 1.8. Packages..................................................... 2 1.9. Fixes........................................................ 3 1.10. SUMA....................................................... 3 1.11. System Config and devices..................................3 1.12. Networking................................................. 4 1.13. System start up and shutdown...............................5 2. Day Two...................................................... 6 1.14. Logical Partitions......................................... 6 1.15. AIX Installation........................................... 6 1.16. LVM........................................................ 6 3. Day Three................................................... 14 1.17. File systems.............................................. 14 1.18. Backups / Mksysb......................................... 14 1.19. ODM....................................................... 15 4. Day 4........................................................17 4.1. System initialization....................................... 17 4.2. System boot................................................. 18 4.3. LVM Metadata................................................ 19 4.4. Disk management recovery.................................... 20 4.5. Dump facility............................................... 21 5. Day 5........................................................22 APPENDIX..........................................................22 1
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
AIX JUMPSTART COURSE NOTES20th September 2010
1. Day One......................................................21.1. List and connect to a LPAR.....................................................................................21.2. List the managed system on the HMC..................................................................21.3. List all LPARS on managed system.......................................................................21.4. List the name and states of the running systems...................................21.5. Open a console..................................................................................................................21.6. SMIT (system management interface tool)......................................................21.7. OS Levels..............................................................................................................................21.8. Packages................................................................................................................................21.9. Fixes.......................................................................................................................................31.10. SUMA......................................................................................................................................31.11. System Config and devices...................................................................................31.12. Networking.......................................................................................................................41.13. System start up and shutdown............................................................................52. Day Two......................................................61.14. Logical Partitions....................................................................................................61.15. AIX Installation.........................................................................................................61.16. LVM........................................................................................................................................63. Day Three...................................................141.17. File systems.................................................................................................................141.18. Backups / Mksysb.........................................141.19. ODM......................................................................................................................................154. Day 4........................................................174.1. System initialization...............................................................................................174.2. System boot.......................................................................................................................184.3. LVM Metadata.....................................................................................................................194.4. Disk management recovery........................................................................................204.5. Dump facility..................................................................................................................215. Day 5........................................................22APPENDIX..........................................................22
1
AIX JUMPSTART COURSE NOTES20th September 2010
1.Day One
1.1. List and connect to a LPARvtmenu
1.2. List the managed system on the HMClssyscfg -r sys -F name:serial_num:state
1.3. List all LPARS on managed systemlssyscfg –r sys –F namelssyscfg -m sys154 -r lpar -F name:state
1.4. List the name and states of the running systemslssyscfg -m sys154 -r lpar -F name state os_versionlssyscfg -m sys154 -r lpar -F name:state
1.5. Open a consolemkvterm -m sys154 -p sys154_lpar3
1.6. SMIT (system management interface tool)* = Mandortory field+ = Pick list (press F4)F6 tells you the command F9 to access a shell CTRL+D to get back to SMITCheck your home directory for the smit logsYou can redirect smit output: smitty –s <script file> -l <logfile>
List attributes lsattr How much memory is assigned to LPAR:
o lsattr -El mem0ent_mem_cap I/O memory entitlement in Kbytes Falsegoodsize 1024 Amount of usable physical memory in Mbytes Falsesize 1024 Total amount of physical memory in Mbytes Falsevar_mem_weight Variable memory capacity weight False
HDISK & HD HDISK is the actual disk drive (virtual or physical) HD is the volume
1.12. Networking ent is the physical interface operates at layer 1 and layer 2
this has the MAC and MTU etc en and et uses layer 3
lsdev –Cc if (see page 5-3)
smit mktcpip (see page 5-5)
ODM (object data manager see page 5-8)
TCP/IP Startup (see page 5-10)
Setting hostname: Permanent
o chdev –l inet0 –a hostname=<new hostname> On the fly (gone after a reboot)
o hostname<new hostname>
Add an IP address to a interface Permanent
o chdev –l <dev> -a netaddr=<ip addr> -a netmask=<mask> -a state up
On the fly (gone after reboot)o Ifconfig <dev> <ip> <mask> up
Get all routes configured lsattr –El inet0
1.13. System start up and shutdownStart a managed system
chsysstate –m <managed system name> -r sys –o on
Booting LPAR
4
AIX JUMPSTART COURSE NOTES20th September 2010
bootlist –m normal –o (check the current boot list) bootlist –m normal ent0 bserver=<ip address> client=<ip address> chsysstate –m <managed system name> -r <lpar> -o on –n <lpar> -f
<profile name> -b <boot mode>
Inittab Default run level 2 Run level for HACMP isA Run level 3 to 9 are user defined Updating inittab
1.14. Logical PartitionsSee section 7 in the exercise book for an example on how to create an LPAR remember the number of “Maximum number of virtual adapters”.
1.15. AIX Installationlpp_source is like a CD
mksysb is a system backup using a IBM backup format, using restore you can extract files on an individual basis.
smit eznim Configure as a NIM Master Configure as a NIM Client
1.16. LVM LVM Commands:
o smitty lvmSMIT OPTION COMMAND LINE
List All Volume Groups lsvg (-o)Add a Volume Group mkvg <vg name>Set Characteristics of a Volume Group chvg <vg name>List Contents of a Volume Group lsvg <vg name>
Remove a Volume Groupreducevg –df <vg name> <hdisk>
Activate a Volume Group varyonvg <vg name>Deactivate a Volume Group varyoffvg <vg name>Import a Volume Group importvg <vg name>Export a Volume Group deportvg <vg name>Mirror a Volume Group mirrorvg <vg name> <hdisk>Unmirror a Volume GroupSynchronize LVM MirrorsBack Up a Volume GroupRemake a Volume GroupPreview Information about a BackupVerify the Readability of a Backup (Tape only)View the Backup LogList Files in a Volume Group BackupRestore Files in a Volume Group Backup
BB = bad block relocation STALE PP’s = mirrors not syncedHOT SPARE = allocate a host spare to Raid 5 pool
Volume groups Read the volume group descriptor area
o readvgda <hdisk>
Extend a VGo extendvg <vg name> <hdisk> <hdisk>
Mirror a vg
6
AIX JUMPSTART COURSE NOTES20th September 2010
o Mirrorvg rootvg <hdisk>
Logical volumes smit lv
SMIT OPTION COMMAND LINE List All Logical Volumes by Volume Group lslv
Set Characteristic of a Logical Volume chlv Show Characteristics of a Logical Volume lslv <lv name> Remove a Logical Volume rmlv
Copy a Logical Volumemklvcopy –k <lv name> <number of copies> <hdisk>
Enable “allocate each logical partition copy on a SEPARATE physical volume” this will assist by making migration easier and use “super strictness” so all primary LP copies are on the same physical volume.
Logical partitions to physical partitionso lslv –m <lv name>
Remove a lvo rmlv
Physical volumes
smit pvSMIT OPTION COMMAND LINE
List All Physical Volumes in System lspvAdd a DiskChange Characteristics of a Physical VolumeList Contents of a Physical VolumeMove Contents of a Physical Volume
Exercise making a VG section 9Section 9 Check the disk assignmentlspvhdisk0 0002b0323725c902 rootvg activehdisk1 none Nonehdisk2 none Nonehdisk3 none None
Make a VGmkvg -f -s 64 -y brianvg hdisk1lsvg brianvgVOLUME GROUP: brianvg VG IDENTIFIER: 0002b0320000d9000000012b387eb791VG STATE: active PP SIZE: 64 megabyte(s)VG PERMISSION: read/write TOTAL PPs: 191 (12224 megabytes)MAX LVs: 256 FREE PPs: 191 (12224 megabytes)LVs: 0 USED PPs: 0 (0 megabytes)OPEN LVs: 0 QUORUM: 2 (Enabled)TOTAL PVs: 1 VG DESCRIPTORS: 2STALE PVs: 0 STALE PPs: 0
7
AIX JUMPSTART COURSE NOTES20th September 2010
ACTIVE PVs: 1 AUTO ON: yesMAX PPs per VG: 32512MAX PPs per PV: 1016 MAX PVs: 32LTG size (Dynamic): 256 kilobyte(s) AUTO SYNC: noHOT SPARE: no BB POLICY: relocatable
Extend the VGextendvg -f brianvg hdisk2
Check the disk assignmentlspvhdisk0 0002b0323725c902 rootvg activehdisk1 0002b032387eb769 brianvg activehdisk2 0002b0323885d741 brianvg activehdisk3 none None
Convert the VG to scaleable{sys154_lpar3} / # varyoffvg brianvg{sys154_lpar3} / # chvg –G brianvg0516-1224 chvg: WARNING, once this operation is completed, volume group brianvg cannot be imported into AIX 5.2 or lower versions. Continue (y/n) ? y0516-1712 chvg: Volume group brianvg changed. brianvg can include up to 1024 physical volumes with 2097152 total physical partitions in the volume group.{sys154_lpar3} / # exportvg brianvg{sys154_lpar3} / # importvg -y convbrianvg hdisk1synclvodm: No logical volumes in volume group convbrianvg.convbrianvg{sys154_lpar3} / # lsvgrootvgconvbrianvg
Add a LV to scaleable VG{sys154_lpar3} / # mklv -y datalv1 -t jfs2 -c 1 convbrianvg 5{sys154_lpar3} / # lsvg -l convbrianvgconvbrianvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTdatalv1 jfs2 5 5 1 closed/syncd N/A
Check the disk the LV was created on{sys154_lpar3} / # lslv -l datalv1datalv1:N/APV COPIES IN BAND DISTRIBUTIONhdisk1 005:000:000 100% 000:005:000:000:000
{sys154_lpar3} / # lspv -l hdisk1hdisk1:
9
AIX JUMPSTART COURSE NOTES20th September 2010LV NAME LPs PPs DISTRIBUTION MOUNT POINTdatalv1 5 5 00..05..00..00..00 N/A
Extend the LV{sys154_lpar3} / # extendlv datalv1 5{sys154_lpar3} / # lspv -l hdisk1hdisk1:LV NAME LPs PPs DISTRIBUTION MOUNT POINTdatalv1 10 10 00..10..00..00..00 N/A
{sys154_lpar3} / # mklv -y backuplv -a e -t jfs2 backupvg 10 hdisk1Create a log for backup fs
{sys154_lpar3} / # mklv -y backuplog -t jfs2log backupvg 1{sys154_lpar3} / # logform /dev/backuplogCreate the file system and tie to log
{sys154_lpar3} / # crfs -v jfs2 -d backuplv -m /backup -A yes -a logname=backuplog{sys154_lpar3} / # lspv -l hdisk1hdisk1:LV NAME LPs PPs DISTRIBUTION MOUNT POINTbackuplog 1 1 00..01..00..00..00 N/Abackuplv 10 10 10..00..00..00..00 /backup
14
AIX JUMPSTART COURSE NOTES20th September 2010{sys154_lpar3} / # mount /backup{sys154_lpar3} / # lsfs /backupName Nodename Mount Pt VFS Size Options Auto Accounting/dev/backuplv -- /backup jfs2 327680 -- yes no{sys154_lpar3} / # grep backup /etc/filesystems/backup: dev = /dev/backuplv log = /dev/backuplog
1.19. ODMCfgmgr is ran at boot time and updates the customised devices (CuDv) using the predefined devices (PdDv). Predefined attribute (PdAt) customised attribute (CuAt).
lsdev lsattr odmshow PdDv, CuDv, PdAt, CuAT odmshow odmcreate to create a table odmadd <file name> odmdrop delete a table odmchange odmdelete to delete an attribute odmget
List all support devices on the system lsdev –P –H
List all disk devices attached to the system lsdev –Cc disk -H
Get the location of the devices lsdev -Cc disk -F "name status location physloc"
List ODM object to describe hdisk0 odmget -q name=hdisk0 CuDv lscfg | grep hdisk0
Use ODM to get the PVID from the class CuAt (32 bit) odmget -q "name=hdisk0 and attribute=pvid" CuAt
CuAt: name = "hdisk0" attribute = "pvid" value = "0002b0323725c9020000000000000000" type = "R" generic = "D" rep = "s" nls_index = 11
Get the physical location of and Ethernet interface lscfg | grep ent Model Implementation: Multiple Processor, PCI bus* ent1 U8204.E8A.652B032-V4-C13-T1Virtual I/O Ethernet Adapter (l-lan)* ent0 U8204.E8A.652B032-V4-C12-T1Virtual I/O Ethernet Adapter (l-lan)
Boot the server into sms mode
18
AIX JUMPSTART COURSE NOTES20th September 2010
chsysstate -m sys154 -r lpar -n sys154_lpar3 -o on -f normal -b sms
Re-install a boot block bosboot -ad /dev/hdisk0
4.2. System bootPhase 1 if the system does not pass here then could be a boot image issue
Process 1 (F05) rc.boot 1 (c06) restbase (548, 510) cfgmgr –f (f = first run not a full cfgmgr) bootinfo –b (511)
Phase 2 rc.boot 2 (551) ipl_varyon (552, 554, 556, 517) fsck hd4 and mount hd4 (555, 557) fsck –f hd2 and mount /usr (518 fsck hd9var and mount /var copy core and then unmount /var (518) swapon hd6 copy ram /dev files to disk mergedrv copy RAM ODM files to disk mount /var copy boot messages to alog Kernel removes RAMFS
Phase 3 Read /etc/inittab and /sbin/rc.boot (553) fsck hd3 and mount /tmp syncvg rootvg & (517) cfgmgr –p2 or cfgmgr p3 cfgcon and rc.dt boot (c31, c32, c33, c34) savebase syncd 60 errdemon turn off LED’s rm /etc/nologin chgstatus=3 CuDv Execute rest of inittab
Fix a file system fsck –y –V <file system type> /dev/hdxx
4.3. LVM MetadataIf you see this error
varyonvg backupvg0516-082 varyonvg: Unable to access a special device file.Execute redefinevg and synclvodm to build correct environment.
redefinevg -d hdisk1 backupvg (each disk has a priv region) varyonvg backupvg
If you are in a situation where the type of the file system is not known this can help:{sys154_lpar3} / # lsvg -l lvmtestvglvmtestvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTlvmtestlv ??? 4 4 1 open/syncd /lvmtestfsloglv00 jfs2log 1 1 1 open/syncd N/A{sys154_lpar3} / # umount /lvmtestfs{sys154_lpar3} / # varyoffvg lvmtestvg{sys154_lpar3} / # exportvg lvmtestvg{sys154_lpar3} / # importvg -y lvmtestvg hdisk1lvmtestvg{sys154_lpar3} / # lsvg -l lvmtestvglvmtestvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINTlvmtestlv jfs2 4 4 1 closed/syncd /lvmtestfsloglv00 jfs2log 1 1 1 closed/syncd N/A
Or we can run synclvodm rootvg
4.4. Disk management recoveryIf you ever need to replace the disk that rootvtg is on remember to migratepv hd5 first this way the first block is reserved for the boot block.
A varyonvg will do the following in the event of a replacing a failed drive:
Tests that the disk is accessiable Put the disk back to active
20
AIX JUMPSTART COURSE NOTES20th September 2010
Starts the syncvg (If you used varyonvg –n this will disable the feature to syncvg)
Disable a quorumYou need the minimum number of 51% quorums for the VG to come online to disable this variable:
chvg –Qn <vg> (AIX 6 or later) varyoffvg <vg> (AIX less than 6 and the rootvg) varyonvg <vg>
Remember if all the disks are not online the VG will not come back online you can force this:
varyonvg –f <vg> (the rootvg will force by default)
Move rootdisk to a new disk extendvg rootvg hdisk1 migratepv -l hd5 hdisk0 hdisk1 (hd5 = / mirror this first) bosboot -ad /dev/hdisk1 (install the bootblock) bootlist -m normal hdisk0 hdisk1 (update boot devices) migratepv hdisk0 hdisk1 (mirror the remaining slices)
Replacement of a failed data disk mkvg –f –s 16 –y datavg hdisk# crfs –v jfs2 –g datavg –a size=1 –m /myfs lspv extendvg datavg hdisk# migratepv (from) hdisk# (to) hdisk# reducevg datavg hdisk2 rmdev –dl hdisk# cfgmgr
Exporting and importing a VG umount /home/mars varyoffvg datavg exportvg datavg importvg –y datavg hdisk# lsvg –o mount /home/mars
QuorumsLoss of a quorum when you varyon the VG may look like this
errpt –aDescriptionActivation of a no quorum volume group with out 100% of the disksProbable CausesOne or more physical volumes are not available and MISSINGPV_VARYON variable is onDetail DataMAJOR/MINOR DEVICE NUMBER0022 0000
21
AIX JUMPSTART COURSE NOTES20th September 2010Bring back a removed device online
mkdev –l hdisk3
If the Vg does not come online you may need to use varyonvg –f datavg mkdev -l hdisk# varyonvg newvg chpv -v a hdisk#
4.5. Dump facilityLivedump can dump a part of the system without the need for downtime this uses ras.
livedumpstart dumpctrl core dumps are placed in /var/adm/ras sysdumpdev –p (will be lost after reboot) sysdumpdev –P (will be written in the ODM) dump device size is recommended 1GB for every 12GB sysdumpdev –e (estimate the dump device size) sysdumpdev –l (list the dump devices) dumpcheck will run automatically and check dump devices sysdumpstart (will cause a core dump) chdev –l sys0 –a autorestart=0 (auto reboot after a crash) sysdumpdev –L (check to dee if there is a core dump) dmpuncompress -p /var/adm/ras/vmcore.0.BZ (uncompress dump) kdb /var/adm/ras/vmcore.
o stat see dump codes page 18-19 see snap similar to explorer
22
AIX JUMPSTART COURSE NOTES20th September 2010
5.Day 5
5.1. Install techniquesInstall a mksysb on a disk
smit alt_clone alt_disk_mksysb
Cloning a root disk smit alt_mksysb alt_disk_copy –b update_all –l /dev/cd0 –d <new device>
Removing alternate disk install Go back to original version
o bootlist –m normal hdisk0o rebooto lsvgo alt_rootvg_op –X (remove the VG)
Go to new versiono bootlist –m normal hdisk0o rebooto lsvgo alt_rootvg_op –X old_rootvg
Using multibosCheck the free space
multibos –s -X
Booting from new bos image bosboot –m normal hdisk# blv# shutdown –Fr
Removing a multibos multibos -R
5.2. Performance toolsI/O
iostat filemon fileplace
Memory vmstat svmon
Network netstat enstat nfsstat
Processor ps sar
23
AIX JUMPSTART COURSE NOTES20th September 2010
tprof cuart lparstat -il mpstat
All in one topas (-C all partitions)
Virtual memory is physical ram plus paging space (paging space is disk) you do not want to use paging space.
See page 20-12
5.3. WPAR (system or application)System = physical wpar existsApplication = the wpar is virtual and removed once shutdown
Workload partitions are only on AIX 6 or onwards.
Advantages: Lightweight Run different OS versions from global
Making a WPAR makewpar –n <name of wpar> startwpar –v <wpar> clogin <wpar name> process ID 1 in the wpar with the parent of 0 is linked to
/etc/init in the global smit wpar makewpar –w ‘file name’ (output the config to a file)