This is a document to show how you can split the rootVG mirror on HP-UX for patching so that the Split mirrors can be used in order to roll-back to the older patch version.
Note : Depending on the basic setup of the server LVM root mirror this can need a bit of modification in your environment.
Also you can try using the DRD clone as an alternative for roll-back. Please look at the DRD Guide available for HP-UX at docs.hp.com
In the current scenario the setup has root VG has 2 disks which are mirrored in a strict manner using LVM mirroring.
This makes use of LVMPVG in order to have LVSPLIT and LVMERGE take care which PV are the source and destination of the original and the Split LV.
As a prerequisite you need to have understanding of HP-UX LVM Concepts.
1) create a file /etc/lvmpvg
VG vg00
PVG PVG1
/dev/dsk/c2t6d0
PVG PVG2
/dev/dsk/c0t6d0
2) vgdisplay -v vg00 | to confirm
3) lvlnboot -vR
4) make sure full mirror sync is there between the disks
for i in /dev/vg00/lv*
do
lvdisplay $i| grep -i copies
done
This should show 1 mirror copies for each LV
for i in /dev/vg00/lv*
do
lvdisplay -v $i | grep -i stale
done
this should show 0 stale PEs for the LVs
5)get the current setboot
Primary bootpath : 0/0/0/3/0.6.0 -- /dev/dsk/c2t6d0
HA Alternate bootpath : 0/0/0/2/0.6.0 -- /dev/dsk/c0t6d0
Alternate bootpath : 0/0/0/2/0.6.0
6) Make sure that the boot string for both the boot disks is set as “hpux /stand/vmunix -lq” for RP servers and “boot vmunix –lq” for RX servers.
FOR PA RISC(RP servers):
- lifls –l /dev/rdsk/c0t6d0
- lifls –l /dev/rdsk/c2t6d0
- lifcp /dev/rdsk/c0t6d0:AUTO –
- lifcp /dev/rdsk/c2t6d0 :AUTO –
- in case the auto boot string is not set as « hpux /stand/vmunix –lq” set this using the following commands
- mkboot –a “hpux /stand/vmunix –lq” /dev/rdsk/c0t6d0
- mkboot –a “hpux /stand/vmunix –lq” /dev/rdsk/c6t0d0
- check the same using commands c,d.
FOR ITANIUM servers(RX servers):
- lifls –l /dev/rdsk/c0t6d0s2
- lifls –l /dev/rdsk/c2t6d0s2
- efi_cp –u –d /dev/rdsk/c0t6d0s1 /efi/hpux/auto /tmp/auto11;cat /tmp/auto11
- efi_cp –u –d /dev/rdsk/c2t6d0s1 /efi/hpux/auto /tmp/auto22;cat /tmp/auto22
- in case the boot string is not set as “boot /stand/vmunix –lq” set this using the following commands.
- #echo “boot /stand/vmunix –lq” > /tmp/auto
- #efi_cp –d /dev/rdsk/c0t6d0s1 /tmp/auto /efi/hpux/auto
- #efi_cp –d /dev/rdsk/c2t6d0s1 /tmp/auto /efi/hpux/auto
Check the same using the commands in c,d.
7) Split the mirrors of LVs on root VG vg00
for i in /dev/vg00/lv*
do
lvsplit -g PVG2 $i
done
this shall create the split LVS in the name
/dev/vg00/<LV_name>b for all lvs
the all LVs after the split shall be as:
/dev/vg00/lvol1
/dev/vg00/lvol2
/dev/vg00/lvol3
/dev/vg00/lvol4
/dev/vg00/lvol5
/dev/vg00/lvol6
/dev/vg00/lvol7
/dev/vg00/lvol8
/dev/vg00/lvol1b – split LVs
/dev/vg00/lvol2b
/dev/vg00/lvol3b
/dev/vg00/lvol4b
/dev/vg00/lvol5b
/dev/vg00/lvol6b
/dev/vg00/lvol7b
/dev/vg00/lvol8b
- cp –pr /etc/fstab /etc/fstab.save
vi /etc/fstab.save --- MODIFY these lines in the file. Do not modify Lines pertaining to NON-VG00 FS.
/dev/vg00/lvol11 / vxfs delaylog 0 1 # lvol3 of original /etc/fstab
/dev/vg00/lvol9 /stand hfs defaults 0 1 # lvol1 of original /etc/fstab
/dev/vg00/lvol12 /home vxfs delaylog 0 2 # lvol4 of original /etc/fstab
/dev/vg00/lvol13 /opt vxfs delaylog 0 2 # lvol5 of original /etc/fstab
/dev/vg00/lvol14 /tmp vxfs delaylog 0 2 # lvol6 of original /etc/fstab
/dev/vg00/lvol15 /usr vxfs delaylog 0 2 # lvol7 of original /etc/fstab
/dev/vg00/lvol16 /var vxfs delaylog 0 2 # lvol8 of original /etc/fstab
NOTE: If the root VG has the LVs as lvol1,2,3,4,5,6,7,8, then we shall use in the new /etc/fstab.save the LVS as lvol9,10,11,12,13,14,15,16 respectivley.
Keep this file handy
10) Now the OS patching can be done. And reboot the server.
11) To mirror back the split LVS after patching and observing the same for over a period of time run the following command.
See man (1M) lvmerge for more information:
#for i in /dev/vg00/lv*
>do
>lvmerge ${i}b $i
>done
MAN LVMERGE Shows also:
/usr/sbin/lvmerge [-A autobackup] [-s] copy_lv_path master_lv_path
Merge /dev/vg00/lvol1b with /dev/vg00/lvol1. Data in /dev/vg00/lvol1b will be overwritten by /dev/vg00/lvol1 and /dev/vg00/lvol1b will be removed.
lvmerge /dev/vg00/lvol1b /dev/vg00/lvol1
In case the patching fails and we need to recover the system with the old pacth level, follow the following steps:
NOTE: following things need to be done before we start patching:
Recovery from the Split mirror disk that is /dev/dsk/c0t6d0 and is set at ALTERNATE boot path:
- PARISC SYSTEMS:Reboot the server and interrupting auto-boot from the BCH main menu choose to boot from the alt disk
BCH Main Menu > boot alt
Interact with IPL(y/n)? y
ISL> hpux –lm <for booting the system in LVM Maint mode.
The server shall boot up in the LVM maintenance Mode and you shall get the # prompt
Only root FS shall be mounted as /dev/root on /
Now give the following command:
#vgexport vg00
#mkdir /dev/vg00
#mknod /dev/vg00/group c 64 0x000000
#vgimport –v /dev/vg00 /dev/dsk/c0t6d0 – NOTE THE ALTERNATE BOOT DISK.
#lvrmboot –r /dev/vg00
#lvlnboot –v
#lvlnboot –r /dev/vg00/lvol11 --- specify new ROOT LV as lvol11: earlier this was lvol3
#lvlnboot –b /dev/vg00/lvol9 --- specify new BOOT LV as lvol9: earlier this was lvol1
#lvlnboot –s /dev/vg00/lvol10 --- specify new SWAP LV as lvol10: earlier this was lvol2
#lvlnboot –d /dev/vg00/lvol10--- specify new DUMP LV as lvol10: earlier this was lvol2
#lvlnboot –vR --- to check if the ROOT,BOOT,SWAP and DUMP settings have taken place
# cp –pr /etc/fstab /etc/fstab.ORIG
#cp –pr /etc/fstab.save /etc/fstab
#mount –a – to check if all the FS are mounted and check if all files are seen in there.
#setboot –p <give_path_of_current_ALT_boot_disk> -s on –a on --- to make this path as the pry boot path.
Reboot the server:
#shutdown –ry 00
- ITANUIM SYTEMS : Reboot the server and choose the alternate boot path from the EFI MAIN MENU.
Choose to interrupt the auto boot the system and Interact with IPL(y/n)? choose “y” to go to hpux>
On the “hpux>” prompt give the following command to boot in LVM Maintenance Mode:
HPUX> boot vmunix –lq OR
HPUX> hpux –lq
The server shall boot in LVM Maint mode and shall come to # prompt.
#vgexport vg00
#mkdir /dev/vg00
#mknod /dev/vg00/group c 64 0x000000
#vgimport –v /dev/vg00 /dev/dsk/c0t6d02– NOTE THE ALTERNATE BOOT DISK and SLICE 2.
#lvrmboot –r /dev/vg00
#lvlnboot –v
#lvlnboot –r /dev/vg00/lvol11 --- specify new ROOT LV as lvol11: earlier this was lvol3
#lvlnboot –b /dev/vg00/lvol9 --- specify new BOOT LV as lvol9: earlier this was lvol1
#lvlnboot –s /dev/vg00/lvol10 --- specify new SWAP LV as lvol10: earlier this was lvol2
#lvlnboot –d /dev/vg00/lvol10--- specify new DUMP LV as lvol10: earlier this was lvol2
#lvlnboot –vR --- to check if the ROOT,BOOT,SWAP and DUMP settings have taken place
# cp –pr /etc/fstab /etc/fstab.ORIG
#cp –pr /etc/fstab.save /etc/fstab
#mount –a – to check if all the FS are mounted and check if all files are seen in there.
#setboot –p <give_path_of_current_ALT_boot_disk> -s on –a on --- to make this path as the pry boot path.
Reboot the server:
#
No comments:
Post a Comment