Formatting code for AIX
{{parent page="UNIX"}}
===AIX===
~ [[AIXandNIM Deploy mksysb using NIM]]
~ [[AIXandGPFS GPFS]]
~ [[AIXSnaps Generate snap dumps]]
-----
Coming from the Linux world, every UNIX seems to be old and stinky. That is probably why Linux was created in the first place.
===Installing installp packages===
%%
# download and extract tar ball from IBM
# see what's available
installp -l -d .
# install JDK
installp -ac -Y -d . Java6_64.sdk
%%
===Install AIX service pack===
Backup your system first! Use mksysb and restore.
Download sp from fixcentral, in form of a bunch of bff files. When that's done, run
%%
# this is not necessary
# but it will convert the stupid names into slightly smarter names
# bffcreate -c -d /usr/sys/inst.images
# generate toc file, which is required for installp
inutoc .
%%
and generate a .toc file. Then you are ready to patch. Run
%%
smitty update_all
%%
When asked, enter . to denote the current directory. In the next menu, select accept license. Then press enter twice. You will then be presented a bunch of installp output. Mostly copyright information from two decades ago which is nothing put pollution to my screen. All I care is if the patch is installed or not.
When completed, reboot if kernel is updated. After that, verify AIX level with the following command:
%%
oslevel -s
%%
In my case, the oslevel did not change. Running the following command tells me what's missing
%%
instfix -i|grep SP
instfix -ciqk 61-06-011043_SP |grep ":-:"
%%
IBM recommends running the following commands after the update. If it's so damn important, why not run it for the user!? And there should be a way to query these information any time. It's just plain stupid.
%%
grep ^I .toc > apar.list
sort -u apar.list -o sorted.apars
%%
===OSLevel===
How on earth do you read the oslevel numbers? Take this for an example:
%%
# oslevel -s
6100-05-02-1034
%%
So I'm at AIX6.1 TL5 SP2.
List all known technology level
%%
# oslevel -rq
Known Recommended Maintenance Levels
------------------------------------
6100-06
6100-05
6100-04
6100-03
6100-02
6100-01
6100-00
%%
My system should be at 6100-05, so what's partially installed from 6100-06 (which is not yet released!)
%%
# oslevel -r -g 6100-05
Fileset Actual Level Recommended ML
-----------------------------------------------------------------------------
ICU4C.rte 6.1.5.1 6.1.5.0
X11.Dt.lib 6.1.5.1 6.1.5.0
...
%%
So some ML higher than 6.1 tl5 sp5 was installed on this system. Anything older then 6.1 tl5 sp5 - nope.
%%
oslevel -sq | head -5
Known Service Packs
-------------------
6100-05-05-1112
6100-05-04-1048
6100-05-03-1036
6100-05-02-1034
# oslevel -r -l 6100-05-05-1112
%%
===Update AIX using suma===
Start smitty
%%
smit suma
%%
Assuming you need to get TL5 SP5, choose " Download Updates Now (Easy)" > "Download Service Pack" > "6100-05-05"
Then
%%
cd /usr/sys/inst.images/installp/ppc
inutoc .
smit update_all
%%
===Filesystem resize===
Suppose I want to extend the /usr filesystem, first identify the PP size:
%%
> lsvg -l | grep /usr
# which tells me the lv is called hd2. next check the size of PP
> lslv hd2 | grep LP
MAX LPs: 32512 PP SIZE: 128 megabyte(s)
LPs: 75 PPs: 75
%%
Check if rootvg has available PP:
%%
> lsvg rootvg | grep FREE
MAX LVs: 256 FREE PPs: 214 (27392 megabytes)
%%
Now if I want to give /usr another 128M:
%%
extendlv hd2 1
%%
After extending the lv, extend the filesystem.
%%
# calculate size with PPsize * PP * 2 * 1024
chfs -a size=19660800 /usr
or
chfs -a size=+5120M /usr
%%
Then do a df and see the new size.
==Backup restore==
===Backup using mksysb===
AIX can be backed up using mksysb or savevg. savevg allows one to backup vg's other than rootvg
http://fengnet.com/book/Backup.and.Recovery/I_0596102461_CHP_13_SECT_2.html
%%
mksysb -e -m /opt/mksysb-tl6.image
savevg -e -m -f /NFS_mount/savevg/savevg-20110101 rootvg
%%
===Backup to bootable iso file===
%%
mkcd -e -S -I /path/to/cdimage/
%%
===Verify a mksysb file===
%%
restore -Tvf /path/to/file
%%
===Restore a particular file from mksysb===
%%
restore -xvf /export/images/your-backup.msb ./etc/inittab
# yea that dot is not a typo.
%%
==Perform hardware diagnosis==
Run "diag", select Advanced Diagnostics Routines > System Verification > All Resources then hit F7
===Install / query EFIX===
query
%%
emgr -P
%%
preview and install
%%
emgr -pXe IZ98622s05.110429.epkg.Z
emgr -Xe IZ98622s05.110429.epkg.Z
%%
rollback
%%
emgr -rL IZ98622s05
%%
===View console log===
%%
alog -o -t boot
alog -o -t console
%%
===AIX===
~ [[AIXandNIM Deploy mksysb using NIM]]
~ [[AIXandGPFS GPFS]]
~ [[AIXSnaps Generate snap dumps]]
-----
Coming from the Linux world, every UNIX seems to be old and stinky. That is probably why Linux was created in the first place.
===Installing installp packages===
%%
# download and extract tar ball from IBM
# see what's available
installp -l -d .
# install JDK
installp -ac -Y -d . Java6_64.sdk
%%
===Install AIX service pack===
Backup your system first! Use mksysb and restore.
Download sp from fixcentral, in form of a bunch of bff files. When that's done, run
%%
# this is not necessary
# but it will convert the stupid names into slightly smarter names
# bffcreate -c -d /usr/sys/inst.images
# generate toc file, which is required for installp
inutoc .
%%
and generate a .toc file. Then you are ready to patch. Run
%%
smitty update_all
%%
When asked, enter . to denote the current directory. In the next menu, select accept license. Then press enter twice. You will then be presented a bunch of installp output. Mostly copyright information from two decades ago which is nothing put pollution to my screen. All I care is if the patch is installed or not.
When completed, reboot if kernel is updated. After that, verify AIX level with the following command:
%%
oslevel -s
%%
In my case, the oslevel did not change. Running the following command tells me what's missing
%%
instfix -i|grep SP
instfix -ciqk 61-06-011043_SP |grep ":-:"
%%
IBM recommends running the following commands after the update. If it's so damn important, why not run it for the user!? And there should be a way to query these information any time. It's just plain stupid.
%%
grep ^I .toc > apar.list
sort -u apar.list -o sorted.apars
%%
===OSLevel===
How on earth do you read the oslevel numbers? Take this for an example:
%%
# oslevel -s
6100-05-02-1034
%%
So I'm at AIX6.1 TL5 SP2.
List all known technology level
%%
# oslevel -rq
Known Recommended Maintenance Levels
------------------------------------
6100-06
6100-05
6100-04
6100-03
6100-02
6100-01
6100-00
%%
My system should be at 6100-05, so what's partially installed from 6100-06 (which is not yet released!)
%%
# oslevel -r -g 6100-05
Fileset Actual Level Recommended ML
-----------------------------------------------------------------------------
ICU4C.rte 6.1.5.1 6.1.5.0
X11.Dt.lib 6.1.5.1 6.1.5.0
...
%%
So some ML higher than 6.1 tl5 sp5 was installed on this system. Anything older then 6.1 tl5 sp5 - nope.
%%
oslevel -sq | head -5
Known Service Packs
-------------------
6100-05-05-1112
6100-05-04-1048
6100-05-03-1036
6100-05-02-1034
# oslevel -r -l 6100-05-05-1112
%%
===Update AIX using suma===
Start smitty
%%
smit suma
%%
Assuming you need to get TL5 SP5, choose " Download Updates Now (Easy)" > "Download Service Pack" > "6100-05-05"
Then
%%
cd /usr/sys/inst.images/installp/ppc
inutoc .
smit update_all
%%
===Filesystem resize===
Suppose I want to extend the /usr filesystem, first identify the PP size:
%%
> lsvg -l | grep /usr
# which tells me the lv is called hd2. next check the size of PP
> lslv hd2 | grep LP
MAX LPs: 32512 PP SIZE: 128 megabyte(s)
LPs: 75 PPs: 75
%%
Check if rootvg has available PP:
%%
> lsvg rootvg | grep FREE
MAX LVs: 256 FREE PPs: 214 (27392 megabytes)
%%
Now if I want to give /usr another 128M:
%%
extendlv hd2 1
%%
After extending the lv, extend the filesystem.
%%
# calculate size with PPsize * PP * 2 * 1024
chfs -a size=19660800 /usr
or
chfs -a size=+5120M /usr
%%
Then do a df and see the new size.
==Backup restore==
===Backup using mksysb===
AIX can be backed up using mksysb or savevg. savevg allows one to backup vg's other than rootvg
http://fengnet.com/book/Backup.and.Recovery/I_0596102461_CHP_13_SECT_2.html
%%
mksysb -e -m /opt/mksysb-tl6.image
savevg -e -m -f /NFS_mount/savevg/savevg-20110101 rootvg
%%
===Backup to bootable iso file===
%%
mkcd -e -S -I /path/to/cdimage/
%%
===Verify a mksysb file===
%%
restore -Tvf /path/to/file
%%
===Restore a particular file from mksysb===
%%
restore -xvf /export/images/your-backup.msb ./etc/inittab
# yea that dot is not a typo.
%%
==Perform hardware diagnosis==
Run "diag", select Advanced Diagnostics Routines > System Verification > All Resources then hit F7
===Install / query EFIX===
query
%%
emgr -P
%%
preview and install
%%
emgr -pXe IZ98622s05.110429.epkg.Z
emgr -Xe IZ98622s05.110429.epkg.Z
%%
rollback
%%
emgr -rL IZ98622s05
%%
===View console log===
%%
alog -o -t boot
alog -o -t console
%%