AIX Jumpstart Notes

25
AIX JUMPSTART COURSE NOTES 20 th September 2010 Day One 2 List and connect to a LPAR ....................................................................................................................... 2 List the managed system on the HMC ....................................................................................................... 2 List all LPARS on managed system .......................................................................................................... 2 List the name and states of the running systems ........................................................................................ 2 Open a console ........................................................................................................................................... 2 SMIT (system management interface tool) ................................................................................................ 2 OS Levels ................................................................................................................................................... 2 Packages ..................................................................................................................................................... 2 Fixes ........................................................................................................................................................... 3 SUMA ........................................................................................................................................................ 3 System Config and devices ........................................................................................................................ 3 Networking ................................................................................................................................................ 4 System start up and shutdown .................................................................................................................... 5 Day Two 7 Logical Partitions ....................................................................................................................................... 7 AIX Installation ......................................................................................................................................... 7 LVM ........................................................................................................................................................... 7 Day Three .......................................................... 15 File systems .............................................................................................................................................. 15 Backups / Mksysb ................................................... 15 ODM ........................................................................................................................................................ 16 Day 4 19 System initialization ................................................................................................................................. 19 System boot .............................................................................................................................................. 20 LVM Metadata ......................................................................................................................................... 20 Disk management recovery ...................................................................................................................... 22 Dump facility ........................................................................................................................................... 23 Day 5 24 Install techniques ..................................................................................................................................... 24 Performance tools .................................................. 24 WPAR (system or application) ....................................... 25 APPENDIX 25 1

Transcript of AIX Jumpstart Notes

Page 1: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010

Day One 2 List and connect to a LPAR ....................................................................................................................... 2 List the managed system on the HMC ....................................................................................................... 2 List all LPARS on managed system .......................................................................................................... 2 List the name and states of the running systems ........................................................................................ 2 Open a console ........................................................................................................................................... 2 SMIT (system management interface tool) ................................................................................................ 2 OS Levels ................................................................................................................................................... 2 Packages ..................................................................................................................................................... 2 Fixes ........................................................................................................................................................... 3 SUMA ........................................................................................................................................................ 3 System Config and devices ........................................................................................................................ 3 Networking ................................................................................................................................................ 4 System start up and shutdown .................................................................................................................... 5 Day Two 7 Logical Partitions ....................................................................................................................................... 7 AIX Installation ......................................................................................................................................... 7 LVM ........................................................................................................................................................... 7 Day Three .......................................................... 15 File systems .............................................................................................................................................. 15 Backups / Mksysb ................................................... 15 ODM ........................................................................................................................................................ 16 Day 4 19 System initialization ................................................................................................................................. 19 System boot .............................................................................................................................................. 20 LVM Metadata ......................................................................................................................................... 20 Disk management recovery ...................................................................................................................... 22 Dump facility ........................................................................................................................................... 23 Day 5 24 Install techniques ..................................................................................................................................... 24 Performance tools .................................................. 24 WPAR (system or application) ....................................... 25 APPENDIX 25

1

Page 2: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010

Day One

List and connect to a LPARvtmenu

List the managed system on the HMClssyscfg -r sys -F name:serial_num:state

List all LPARS on managed systemlssyscfg –r sys –F namelssyscfg -m sys154 -r lpar -F name:state

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

Open a consolemkvterm -m sys154 -p sys154_lpar3

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>

OS Levelsoslevel –s6100-02-02-0849

PackagesList packages

• lslpp -l• rpm -qa

Install a package (see page 3-19)• installp –aBd (apply only)• installp –acd (apply and commit)• installp –c (commit)• rpm –I• installp –acpgXYd . <package name>• geninstall –I “–acgXYd” –p –d . <package name>

Create a package• bffcreate

Uninstalling a package• installp –u or smit (see page 3-25

2

Page 3: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010

Recovery• lppchk –v (check see page 3-26)• installp –C (cleanup see page 3-26)

Discover LPP filesets• lslpp –w /usr/bin/whois (what file set does this belong to)• lslpp –h bos.net.tcp.server (history of fileset)

Fixesinstfix (list the updates applied to a server)

• See page (3-8 & 3-23)emgr (interim fix management)

• Emergency fix package (see page 3-8 & 3-24)

SUMAService update management assistant used to download and install updates (see page 3-28)

System Config and devicesPrint configuration

• prtconf• As an example

o * ent0 U8204.E8A.652B032-V4-C12-T1 Virtual I/O Ethernet Adapter (l-lan) U8204.E8A.652B032 = enclousure T1 = port V4 = parent bus C12 = card 12

List configuration• lscfg –v –l ent0 (this will show mac addresses, wwn etc) ent0 U8204.E8A.652B032-V4-C12-T1 Virtual I/O Ethernet Adapter (l-lan) Network Address.............0EB2FAE7D60C Displayable Message.........Virtual I/O Ethernet Adapter (l-lan) Hardware Location Code......U8204.E8A.652B032-V4-C12-T1

List devices• lsdev | grep ent or –Cc disk• lsdev –C –H | more • Parent devices

o lsdev -Cl ent0 -F parento lsparent –Cl ent0

Display DR slots• lsslot

Change a device• chdev

Make a device ready for use(defined = known about)

3

Page 4: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010(available = can be used)

• mkdev

Configure a device• cfgmgr

Unload a device driver• rmdev• rmdev –l rmt0 (defined)• rmdev –dl rmt0 (deleted undefined)

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

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

4

Page 5: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010

• lsattr –El inet0

System start up and shutdownStart a managed system

• chsysstate –m <managed system name> -r sys –o on

Booting LPAR• 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

o mkitabo chitabo rmitab

System resource controller• ps -ef | grep src

o root 172200 1 0 Sep 18 - 0:00 /usr/sbin/srcmstr

• ps -T 172200PID TTY TIME CMD172200 - 0:00 srcmstr86270 - 0:00 |\--writesrv147662 - 0:00 |\--dtlogin163978 - 0:02 |\--sendmail192726 - 0:00 |\--snmpmibd200878 - 0:00 |\--sshd315424 - 0:01 | \--sshd434380 pts/0 0:00 | \--ksh454710 pts/0 0:00 | \--ps204934 - 0:00 |\--rpc.statd217224 - 0:00 |\--rpc.lockd233596 - 0:00 |\--biod237756 - 0:00 |\--hostmibd245904 - 0:00 |\--syslogd249980 - 0:00 |\--aixmibd254094 - 0:00 |\--portmap262274 - 0:00 |\--inetd323746 - 0:00 | \--rpc.ttdbserver278690 - 0:00 |\--snmpdv3ne291008 - 0:00 |\--ksh168126 - 0:00 | \--ksh319660 - 0:38 | \--java422122 - 0:00 | \--pconsole_exec295088 - 0:16 |\--java303252 - 0:00 |\--qdaemon331796 - 0:00 |\--IBM.DRMd352456 - 0:08 |\--IBM.CSMAgentRMd356526 - 0:05 |\--rmcd368832 - 0:00 \--IBM.ServiceRMd

5

Page 6: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010

• Subsystemso lssrc –ao lssrc –g tcpip o stopsrc –s <subsystem>o startsrc –s <subsystem>o refreshsrc –s <subsystem>

6

Page 7: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010

Day Two

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”.

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

LVM

• LVM Commands:o smitty lvm

SMIT OPTION COMMAND LINEList 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>

7

Page 8: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010

• Mirror a vgo Mirrorvg rootvg <hdisk>

Logical volumes • smit lv

SMIT OPTION COMMAND LINE List All Logical Volumes by Volume Group lslv

Add a Logical Volume

mklv –y <volume name> -t <type> -c (copies) 1 <vg name> <size in LP’s> <hdisks>

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)

8

Page 9: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010

LVs: 0 USED PPs: 0 (0 megabytes)OPEN LVs: 0 QUORUM: 2 (Enabled)TOTAL PVs: 1 VG DESCRIPTORS: 2STALE PVs: 0 STALE PPs: 0ACTIVE 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

• Remove hdisk2 from brianvgreducevg brianvg hdisk2lspvhdisk0 0002b0323725c902 rootvg activehdisk1 0002b032387eb769 brianvg activehdisk2 0002b0323885d741 Nonehdisk3 none None

• Export the VGlsvg –o (show all that online that is vary on)brianvgrootvgvaryoff brianvgksh: varyoff: not found.lsvg -obrianvgrootvgvaryoffvg brianvglsvg -orootvglspvhdisk0 0002b0323725c902 rootvg activehdisk1 0002b032387eb769 brianvghdisk2 0002b0323885d741 Nonehdisk3 none Noneexportvg brianvglspvhdisk0 0002b0323725c902 rootvg activehdisk1 0002b032387eb769 Nonehdisk 0002b0323885d741 Nonehdisk3 none None

Import the VG{sys154_lpar3} / # lspvhdisk0 0002b0323725c902 rootvg active

9

Page 10: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010hdisk1 0002b032387eb769 brianvg activehdisk2 0002b0323885d741 Nonehdisk3 none None{sys154_lpar3} / # lsvgrootvgbrianvg{sys154_lpar3} / # lsvg -obrianvgrootvg

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

Extend scaleable VGextendvg -f convbrianvg hdisk2 hdisk3{sys154_lpar3} / # lspvhdisk0 0002b0323725c902 rootvg activehdisk1 0002b032387eb769 convbrianvg activehdisk2 0002b0323885d741 convbrianvg activehdisk3 0002b03238cc8f31 convbrianvg active

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

10

Page 11: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010

{sys154_lpar3} / # lspv -l hdisk1hdisk1:LV 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

Create a mirror of the LV{sys154_lpar3} / # mklvcopy -k datalv1 2 hdisk3{sys154_lpar3} / # lslv -l datalv1datalv1:N/APV COPIES IN BAND DISTRIBUTIONhdisk1 010:000:000 100% 000:010:000:000:000hdisk3 010:000:000 60% 000:006:004:000:000{sys154_lpar3} / # lslv datalv1LOGICAL VOLUME: datalv1 VOLUME GROUP: convbrianvgLV IDENTIFIER: 0002b0320000d9000000012b387eb791.1 PERMISSION: read/writeVG STATE: active/complete LV STATE: closed/syncdTYPE: jfs2 WRITE VERIFY: offMAX LPs: 512 PP SIZE: 64 megabyte(s)COPIES: 2 SCHED POLICY: parallelLPs: 10 PPs: 20STALE PPs: 0 BB POLICY: relocatableINTER-POLICY: minimum RELOCATABLE: yesINTRA-POLICY: middle UPPER BOUND: 1024MOUNT POINT: N/A LABEL: NoneMIRROR WRITE CONSISTENCY: on/ACTIVEEACH LP COPY ON A SEPARATE PV ?: yesSerialize IO ?: NODEVICESUBTYPE : DS_LVZCOPY 1 MIRROR POOL: NoneCOPY 2 MIRROR POOL: NoneCOPY 3 MIRROR POOL: None

Create a RAID0{sys154_lpar3} / # mklv -y stripelv -t jfs2 -S64K convbrianvg 24 hdisk1 hdisk2 hdisk3{sys154_lpar3} / # lslv -l stripelvstripelv:N/APV COPIES IN BAND DISTRIBUTIONhdisk1 008:000:000 100% 000:008:000:000:000hdisk2 008:000:000 75% 000:006:002:000:000

11

Page 12: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010hdisk3 008:000:000 0% 006:000:002:000:000{sys154_lpar3} / # lspv -l hdisk1hdisk1:LV NAME LPs PPs DISTRIBUTION MOUNT POINTstripelv 8 8 00..08..00..00..00 N/Adatalv1 10 10 00..10..00..00..00 N/A{sys154_lpar3} / # lspv -l hdisk2hdisk2:LV NAME LPs PPs DISTRIBUTION MOUNT POINTstripelv 8 8 00..06..02..00..00 N/A{sys154_lpar3} / # lspv -l hdisk3hdisk3:LV NAME LPs PPs DISTRIBUTION MOUNT POINTstripelv 8 8 06..00..02..00..00 N/Adatalv1 10 10 00..06..04..00..00 N/A{sys154_lpar3} / # lslv -m stripelvstripelv:N/ALP PP1 PV1 PP2 PV2 PP3 PV30001 0049 hdisk10002 0007 hdisk20003 0017 hdisk30004 0050 hdisk10005 0008 hdisk20006 0018 hdisk30007 0051 hdisk10008 0009 hdisk20009 0001 hdisk30010 0052 hdisk10011 0010 hdisk20012 0002 hdisk30013 0053 hdisk10014 0011 hdisk20015 0003 hdisk30016 0054 hdisk10017 0012 hdisk20018 0004 hdisk30019 0055 hdisk10020 0013 hdisk20021 0005 hdisk30022 0056 hdisk10023 0014 hdisk20024 0006 hdisk3{sys154_lpar3} / # lslv stripelvLOGICAL VOLUME: stripelv VOLUME GROUP: convbrianvgLV IDENTIFIER: 0002b0320000d9000000012b387eb791.2 PERMISSION: read/writeVG STATE: active/complete LV STATE: closed/syncdTYPE: jfs2 WRITE VERIFY: off

12

Page 13: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010MAX LPs: 512 PP SIZE: 64 megabyte(s)COPIES: 1 SCHED POLICY: stripedLPs: 24 PPs: 24STALE PPs: 0 BB POLICY: relocatableINTER-POLICY: maximum RELOCATABLE: noINTRA-POLICY: middle UPPER BOUND: 3MOUNT POINT: N/A LABEL: NoneMIRROR WRITE CONSISTENCY: on/ACTIVEEACH LP COPY ON A SEPARATE PV ?: yes (superstrict)Serialize IO ?: NOSTRIPE WIDTH: 3STRIPE SIZE: 64kDEVICESUBTYPE : DS_LVZCOPY 1 MIRROR POOL: NoneCOPY 2 MIRROR POOL: NoneCOPY 3 MIRROR POOL: None{sys154_lpar3} / # rmlv stripelv

Add another data LV{sys154_lpar3} / # mklv -y datalv2 -a e -t jfs2 convbrianvg 5 hdisk1datalv2{sys154_lpar3} / # lspv -l hdisk1hdisk1:LV NAME LPs PPs DISTRIBUTION MOUNT POINTdatalv2 5 5 05..00..00..00..00 N/Adatalv1 10 10 00..10..00..00..00 N/A{sys154_lpar3} / # lslv -l datalv2datalv2:N/APV COPIES IN BAND DISTRIBUTIONhdisk1 005:000:000 100% 005:000:000:000:000

Migrate a LV{sys154_lpar3} / # migratepv -l datalv2 hdisk1 hdisk2{sys154_lpar3} / # lslv -l datalv2datalv2:N/APV COPIES IN BAND DISTRIBUTIONhdisk2 005:000:000 100% 005:000:000:000:000{sys154_lpar3} / # lspv -l hdisk2hdisk2:LV NAME LPs PPs DISTRIBUTION MOUNT POINTdatalv2 5 5 05..00..00..00..00 N/A

Remove the mirrored datalv1 to create space{sys154_lpar3} / # rmlvcopy datalv1 1 hdisk1{sys154_lpar3} / # lslv -l datalv1datalv1:N/APV COPIES IN BAND DISTRIBUTIONhdisk3 010:000:000 60% 000:006:004:000:000{sys154_lpar3} / # lspv -l hdisk1{sys154_lpar3} / # lspv -l hdisk3

13

Page 14: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010hdisk3:LV NAME LPs PPs DISTRIBUTION MOUNT POINTdatalv1 10 10 00..06..04..00..00 N/A

Remove hdisk1 from the scaleable VG{sys154_lpar3} / # reducevg convbrianvg hdisk1{sys154_lpar3} / # lspvhdisk0 0002b0323725c902 rootvg activehdisk1 0002b032387eb769 Nonehdisk2 0002b0323885d741 convbrianvg activehdisk3 0002b03238cc8f31 convbrianvg active

Mirror rootvg{sys154_lpar3} / # extendvg -f rootvg hdisk1{sys154_lpar3} / # lspvhdisk0 0002b0323725c902 rootvg activehdisk1 0002b032387eb769 rootvg activehdisk2 0002b0323885d741 convbrianvg activehdisk3 0002b03238cc8f31 convbrianvg active{sys154_lpar3} / # mirrorvg rootvg hdisk1

Install boot image on hdisk1{sys154_lpar3} / # bosboot -a -d /dev/hdisk1

o Update boot devices{sys154_lpar3} / # bootlist -m normal hdisk0 hdisk1

Unmirror rootvg{sys154_lpar3} / # unmirrorvg -c 1 rootvg hdisk1

o Update bootlist{sys154_lpar3} / # bootlist -m normal hdisk0

o Update the PV{sys154_lpar3} / # chpv -c hdisk1Remove hdisk1 from rootvg

{sys154_lpar3} / # reducevg rootvg hdisk1{sys154_lpar3} / # lspvhdisk0 0002b0323725c902 rootvg activehdisk1 0002b032387eb769 Nonehdisk2 0002b0323885d741 convbrianvg activehdisk3 0002b03238cc8f31 convbrianvg active

14

Page 15: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010

Day Three

File systems

• Look at inode numberso ls –li28 -rw------- 1 root system 296 Sep 22 04:08 .TTauthority26 -rw------- 1 root system 425 Sep 22 04:07 .Xauthority

• Examine indoeso istat .sh_history

Inode 942 on device 10/4 FileProtection: rw-------Owner: 0(root) Group: 0(system)Link count: 1 Length 2116 bytesLast updated: Wed Sep 22 11:00:54 CEDT 2010Last modified: Wed Sep 22 11:00:54 CEDT 2010Last accessed: Wed Sep 22 11:00:54 CEDT 2010

Examine a file systemlsfs –cq /home

#MountPoint:Device:Vfs:Nodename:Type:Size:Options:AutoMount:Acct/home:/dev/hd1:jfs2:::32768:rw:yes:no(lv size 32768:fs size 32768:block size 4096:sparse files yes:inline log no:inline log size 0:EAformat v1:Quota no:DMAPI no:VIX yes:EFS no:ISNAPSHOT no)

When creating file systems ensure that you create the logical volume yourself otherwise you will have logical volume names of fslv00.

chfsmklv –t jfs2log –y myj2logv rootvg 1logform /dev/myj2loglv

Backups / Mksysb• Create a backup VG

{sys154_lpar3} / # mkvg -f -y backupvg hdisk1

• Create enhanced JFS2o Create a lv in backupvg

{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

15

Page 16: AIX Jumpstart Notes

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

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

Listing attributes• lsattr –El hdisk0• odmget –q “name=hdisk0 and attribute=pvid” CuAt• odmget CuAt | grep -p hdisk0 | grep -p pvid

Obtaining major and minor numbers• ls -l /dev/hdisk0

brw------- 1 root system 17, 0 Sep 22 12:23 /dev/hdisk0 • odmget -q value3=hdisk0 CuDvDr

16

Page 17: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010CuDvDr: resource = "devno" value1 = "17" value2 = "0" value3 = "hdisk0"

List ODM for rootvg and get dependencies• odmget -q name=rootvg CuDep• odmget -q parent=rootvg CuDv

Modifying an ODM attribute

• get the attributes for en1o lsattr -El en1

• get the maximum value that the remmtu can be set too lsattr -Rl en1 -a remmtu

• get from the odm the values you can use for remmtuo odmget -q name=en1 CuDvo odmget -q "uniquetype=if/EN/en and attribute=remmtu" PdAt

• use odmchange to alter the remmtu valueo odmget -q "uniquetype=if/EN/en and attribute=remmtu" PdAt

> /tmp/odm-remmtuo vi /tmp/odm-remmtuo odmchange -o PdAt -q "uniquetype=if/EN/en AND

attribute=remmtu" /tmp/odm-remmtu

1.1. Error monitoring• errpt • errpt –a• errpt –A• errpt –d H• errpt –a –d S

Error types• P = permanent, performance or pending• T = temporary• I = informational• U = unknown

Error Classes• H = hardware• S = software• O = operator• U = undetermined

Get error log attributes/usr/lib/errdemon -lError Log Attributes--------------------------------------------Log File /var/adm/ras/errlog

17

Page 18: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010Log Size 1048576 bytesMemory Buffer Size 32768 bytesDuplicate Removal trueDuplicate Interval 10000 millisecondsDuplicate Error Maximum 1000

Sending mail to notify of errors:• vi /tmp/notify.add

errnotify:en_name="sample"en_persistenceflg=0en_class="O"en_method="errpt -a -l $1 | mail -s ERRLOG root"

• change the ODMo odmadd /tmp/notify.add

• check the ODMo odmget -q "en_name=sample" errnotify

• send a message to checko errlogger test entry on the logo check with mail [t]

List the paging device and how much is used• lsps –a• vmo -a• ioo -a

18

Page 19: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010

Day 4

System initialization

What is the boot device• Bootlist –m normal –o

What disk has the boot block• lspv –l hdisk0 or LV NAME LPs PPs DISTRIBUTION MOUNT POINThd5 2 2 02..00..00..00..00 N/A

• lslv –m hd5hd5:N/ALP PP1 PV1 PP2 PV2 PP3 PV30001 0001 hdisk00002 0002 hdisk0

What is the logical volume of hd5• lsvg –l rootvgrootvg:LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINThd5 boot 2 2 1 closed/syncd N/A

Identify a VGID• lsvg rootvg

VG IDENTIFIER: 0002b0320000d9000000012b3725c9daGet the first disk PVID

• lspv (16 bit)hdisk0 0002b0323725c902 rootvg activehdisk1 0002b032387eb769 backupvg activehdisk2 0002b0323885d741 convbrianvg activehdisk3 0002b03238cc8f31 convbrianvg active

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)

19

Page 20: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010Boot the server into sms mode

• chsysstate -m sys154 -r lpar -n sys154_lpar3 -o on -f normal -b sms

Re-install a boot block• bosboot -ad /dev/hdisk0

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

LVM MetadataIf you see this error

20

Page 21: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010

• 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

Creat VG, LV and FS• mkvg -f -S -y lvmtestvg hdisk1• mklv -t jfs2 -y lvmtestlv lvmtestvg 4• crfs -v jfs2 -m /lvmtestfs -d lvmtestlv > /dev/null• mount /lvmtestfs• lsvg -l lvmtestvg | grep lvmtestfs

More ODM commands• odmdelete -o CuDv -q"parent=rootvg" >/dev/null 2>/dev/null• odmdelete -o CuAt -q"attribute=type and name like hd*" >/dev/null

2>/dev/null• odmdelete -o CuAt -q"attribute=lvserial_id and name like hd*"

>/dev/null 2>/dev/ • odmdelete -o CuAt -q "name=lvmtestlv"• odmdelete -o CuDv -q "name=lvmtestlv"• odmdelete -o CuAt -q "name=lvmtestlv"• odmdelete -o CuDv -q "name=lvmtestlv"

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

21

Page 22: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010Disk 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• 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

Quorums

22

Page 23: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010Loss of a quorum when you varyon the VG may look like this

varyonvg newvgPV Status: hdisk2 0002b0323885d741 PVACTIVE hdisk3 0002b03238cc8f31 PVMISSING

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

Bring 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#

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

23

Page 24: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010

Day 5

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

Performance toolsI/O

• iostat• filemon • fileplace

Memory• vmstat• svmon

Network• netstat• enstat• nfsstat

24

Page 25: AIX Jumpstart Notes

AIX JUMPSTART COURSE NOTES20th September 2010Processor

• ps• sar• 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

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)

APPENDIXwww.redbooks.ibm.comhttp://www.unixwerk.eu/aix/hmc-howto.htmlwww.bullfreeware.com

25