Monday, 23 April 2012

Alternate Disk Install


Below commands are the system administrator responsibilities to make sure that server is up and running fine with the latest level of TL/ML levels.
Make sure that we have taken mksysb backup. Make sure that this procedure is not applicable for cluster servers, because it is depending on another server and customer awareness is required.
Take backup of the existing system configuration.
df –k
lspv
lsvg
lsvg –o
datapath query device --àif it is sddpcm ignore if this command is not excecuted
datapath query adapter --àif it is sddpcm ignore if this command is not excecuted
pcmpath query device -àif above commands executed ignore this.
pcmpath query adapter -àif above commands executed ignore this.
netstat –rn
netstat –an
ifconfig –a
lsvpcfg
lsvpcfg
lsdev -Cc adapter
lsdev -Cc if

Alternate Disk Install
PROCEDURE:
ALT_DISK_INSTALLFOR CLONING RUNNING SYSTEM TO ALTERNATE DISK
_ Assumption: Disks in rootvg are named hdisk0 & hdisk1. The alt_instvg will be created on hdisk1
(I) Install alt_disk_install Filesets if Required
The file sets bos.alt_disk_install.boot_images and bos.alt_disk_install.rte are required. Install the base file sets
and the updates for your current maintenance level. Installing only the base level filesets may not work.
(II) Break rootvg Mirror
Current system state: hdisk0 and hdisk1 are mirrored.
1. Confirm all LVs are mirrored (except the dump primary and secondary logical volumes).
/usr/sbin/lsvg -l rootvg
If not all the LVs are mirrored as required, proceed to next step, else skip to step 3.
2.Use either of the two steps to move.
Mirror LVs if needed. This command will add a copy of lvname onto destination disk hdisk0,
assuming lvname exists on hdisk1. Synchronize the data in new LP copy with the -k option.
/usr/sbin/mklvcopy -k ''lvname'' 2 hdisk0
Migrate the non mirrored lv from hdisk1 to hdisk0:
/usr/sbin/migratepv -l any_otherlv_on_hdisk1 hdisk1 hdisk0
3. Change secondary dump device to paging.
/usr/bin/sysdumpdev -P -s /dev/hd6
4. Break mirror now.
/usr/sbin/unmirrorvg rootvg hdisk1
5. Remove dump lv on hdisk1.
/usr/sbin/rmlv -f dumplv_sec
6. Make sure hdisk1 is empty.
/usr/sbin/lspv -l hdisk1
If not, migrate data from hdisk1 to hdisk0. See step #1 for migratepv command.
7. Clear boot record from hdisk1.
/usr/sbin/chpv -c hdisk1
8. Disable quorum.
/etc/chvg -Qn rootvg
9. Reinitialize boot records.
/usr/bin/bosboot -ad /dev/hdisk0
10. Modify bootlist to exclude hdisk1 & verify.
/usr/bin/bootlist -m normal hdisk0; bootlist -m normal -o

11. Update ODM with LV copies info.
/etc/synclvodm -Pv rootvg
12. Remove hdisk1 from rootvg.
/usr/sbin/reducevg rootvg hdisk1
13. Confirm hdisk1 is not assigned to any VG.
/usr/sbin/lspv
should show “none” for hdisk1
14a. On AIX 5.3, run:
/usr/bin/ls -l /dev/ipl_blv
If the link does not exist, run:
/usr/bin/ln /dev/rhd5 /dev/ipl_blv
14b. Also check that the link for /dev/ipldevice is the same as /dev/rhdisk0.

/usr/bin/ls -li /dev/ipldevice /dev/rhdisk0

If the inodes do not match, run:

/usr/bin/ln -f /dev/rhdisk0 /dev/ipldevice
(III) Clone rootvg
On AIX 5.3, run:
/usr/sbin/alt_disk_copy -B -d hdisk1
AIX 5.2 or earlier run:
/usr/sbin/alt_disk_install -BC hdisk1
Where the -C option clones the system. The -B specifies not running the bootlist command after cloning. If
this is not specified the bootlist will be set to hdisk1, for subsequent reboots.
Depending on the hardware and software configuration, this step may take about 0.5-1.5 hours.
The output of the alt_disk_install command appears on the screen and a log containing the same output is
located at /var/adm/ras/alt_disk_inst.log.Upon successful completion of the alternate disk creation, the
output on both the screen and the log will end with the following lines:
Modifying ODM on cloned disk.
Building boot image on cloned disk.
Changing logical volume names in volume group descriptor area.
Fixing LV control blocks...
Fixing file system superblocks...
Verification: /usr/sbin/lspv should show altinst_rootvg on hdisk1, which will be varied off
( /usr/sbin/lsvg –o )
(IV) Perform Upgrades/Migration Activities Required
All the updates will be performed on hdisk0. TL upgrades, OS upgrades, etc.

12A) mount the filesystem on the server as per the software repository.
#mount ngdrlogr01:/usr/local/mrdr /mnt
Copy the filesets from  ngdrlogr01: /usr/local/mrdr/software/aix/5300-11-02-1009/ 5300-11-02-1009.tar.gz  to /tmp
Then
cd /tmp
#gunzip  5300-11-02-1009.tar.gz
tar file you do untar
tar –xvf 5300-11-02-1009.tar.tar


Make sure that all the /, /usr,/tmp,/home /var filesystems are below 80%.
#df -k
Make sure that all applications has stopped. If there are no instructions, you can go ahead with this.
Before patching 

12B)Commit all software filesets.
#installp -c -g -X all


13) Preview /install software.
 Update bos.rte.install file sets:
   A. cd  /tmp/5300-11-02-1009/
   B. smitty install
   C  Install and Update Software
   D. Install and Update from ALL Available Software
      Select the following:
      5.3.11.1  LPP Install Commands
                                        
14) Update_all from /tmp/5300-11-02-1009
# smitty update_all
15) check the commands as given below;
#oslevel -s
#lppchk -vm3
#instfix -ik 5300-11_AIX_ML
All filesets for 5300-11_AIX_ML were found     ---Result must be like this
#oslevel -rl 5300-11
#
16)shutdown -Fr   -to reboot the system


17) After 3 days, If there is no problem with the latest level, we have to unmirror the rootvg.
(V) Remove the cloned VG and Remirroring rootvg
Current state: New changes on system(s) are operational. Customer is ready to proceed with standard
mirrored rootvg configuration.
Backout to previous state, if required after this step is complete, will now have to be from other backup.
1. Remove the altinst_rootvg definition from ODM.
/usr/sbin/alt_disk_install -X
2. Verify lspv shows “none” for hdisk1.
/usr/sbin/lspv | /usr/bin/head
3. Add hdisk1 back to rootvg.
/usr/sbin/extendvg -f rootvg hdisk1
4. Mirror the rootvg.
/usr/sbin/mirrorvg rootvg
5. Reinitialize boot records.
/usr/sbin/bosboot -ad /dev/hdisk0 ; /usr/sbin/bosboot -ad /dev/hdisk1
6. Alter bootlist to include hdisk1.
/usr/bin/bootlist -m normal hdisk0 hdisk1
7. Create secondary dump device “dumplv_sec”, using mklv (use appropriate size)
/usr/sbin/lslv dumplv | /usr/bin/grep LPs
/etc/mklv -t sysdump -y dumplv_sec rootvg <# LPs> hdisk1
8. And redirect secondary dump.
/usr/bin/sysdumpdev -P -s /dev/dumplv_sec
9. Confirm disk usage matches.
/usr/sbin/lspv hdisk0|grep PPs
echo
/usr/sbin/lspv hdisk1|grep PPs
(VI) Reverting Back to Original VG
Current state: New upgrade/migration has issues and system state must be restored to pre-change status.
1. Modify bootlist.
/usr/bin/bootlist -m normal hdisk1
2. Reboot server in a change window.
/etc/shutdown -Fr
3. The upgraded VG will show up as “old_rootvg” (use lspv, lsvg to check)
4. Remove old_rootvg on hdisk0.
/usr/sbin/alt_disk_install -X old_rootvg
Follow steps in (V) to mirror back rootvg, using hdisk0 instead of hdisk1 in those steps
=====================================================
and verify/compare the previous o/p like df –k etc…