Operating System - HP-UX
1847084 Members
5215 Online
110262 Solutions
New Discussion

Procedure to reduce a Mirrored LV into 2 independent LV's

 
SURI  HUNJAN
Advisor

Procedure to reduce a Mirrored LV into 2 independent LV's

Hi all,

I am upgrading HP UNIX from 11.0 to 11i on a mirrored system, and trying to put together a procedure to split OR reduce the mirror copies into 2 sepatate valid LV's.

The idea is that after the split, upgrade 1 disk and if all goes wrong I could boot off the 2nd disk and re-mirror/sync the LV/VG's.

I am trying to determine what lvreduce -m 0 does : will this completely remove the LV infomation and data from the PV Disk or can I boot the system off the PV disk if required.

Alternatively any tips on this will be welcome.
I am aware of the TAPE Ignite recovery as a worse case scenario but am looking for a quicker rollback procedure.

Many Thanks.
10 REPLIES 10
Torsten.
Acclaimed Contributor

Re: Procedure to reduce a Mirrored LV into 2 independent LV's

Normally you split a logical volume with lvsplit, but this is not the right thing for your scenario. Also the lvreduce isn't the right thing, this will delete the data from the disk.

I would use an ignite tape, the restore takes about 30 min with a dds4 tape drive, I guess this is OK.

The second way is to shutdown the server and remove a disk, reboot again and lvreduce the vg to the only one disk. If the upgrade fails, put the disk back and boot from it.
But I would prefer ignite ;-))


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
baiju_3
Esteemed Contributor

Re: Procedure to reduce a Mirrored LV into 2 independent LV's

Hi Suri ,

No need of lvreduce . Simply do the OS installation on the disk you want , during OS installation do not add the second disk (contains original OS) to VG00 ie Just leave the mirror copy untouched .

If you face any problem with your OS installation , you can boot from the mirror disk , by just selecting the corerct boot path .

Incase if you face any problem in booting the system from the mirrired disk , just use hpux -lq (LVM Maintenance Mode) to boot.


thx,
bl.

Good things Just Got better (Plz,not stolen from advertisement -:) )
Sivakumar TS
Honored Contributor

Re: Procedure to reduce a Mirrored LV into 2 independent LV's


Dear Suri,

Its better to remove one the mirror disks physically and proceed with the installation. You can either boot thru this is disk incase of the upgrade failure if it is a root disk.

If it is a data disk you do a vgimport latter.

With Regards,

Siva.
Nothing is Impossible !
Mark Nieuwboer
Esteemed Contributor

Re: Procedure to reduce a Mirrored LV into 2 independent LV's

Hi Suri,

I agree with lalb, Just do the install without a mirror disk.
After this and the os upgrade is correct.
you have to do all the commands to make a boot mirror disk.

i used as example disk c2t2d0 but it can be an other one for you.

pvcreate â f â B /dev/rdsk/c2t2d0
vgextend /dev/vg00 /dev/dsk/c2t2d0
mkboot /dev/rdsk/c2t2d0
mkboot â l
mkboot â a â hp-ux â lq (;0)/stand/vmunixâ /dev/rdsk/c2t2d0
mkboot â b /usr/sbin/diag/lif/updatediaglif â p ISL â p HPUX â p PAD â p LABEL /dev/rdsk/c2t2d0

for i in 1 2 3 4 5 6 7 8
do
lvextend â m 1 /dev/vg00/lvol$i
done

Check if the BDRA is correct.
/usr/sbin/lvlnboot -R /dev/vg00
Verify that the mirrors were properly created.
lvlnboot -v /dev/vg00
The output of this command is shown in a display like the following:
Boot Definitions for Volume Group /dev/vg00:
Boot Definitions for Volume Group /dev/vg00:
Physical Volumes belonging in Root Volume Group:
/dev/dsk/c0t6d0 (1/0/0/3/0.6.0) -- Boot Disk
/dev/dsk/c2t2d0 (1/0/1/0/0/1/2.2.0) -- Boot Disk
Boot: lvol1 on: /dev/dsk/c0t6d0
/dev/dsk/c2t2d0
Root: lvol3 on: /dev/dsk/c0t6d0
/dev/dsk/c2t2d0
Swap: lvol2 on: /dev/dsk/c0t6d0
/dev/dsk/c2t2d0
Dump: lvol2 on: /dev/dsk/c0t6d0, 0

vgdisplay -v vg00

Devender Khatana
Honored Contributor

Re: Procedure to reduce a Mirrored LV into 2 independent LV's

Hi,

lvreduce will not leave any data on the second copy of the disk as mentioned earlier. lvsplit will not do it as it is a root vg. Allthough for anything other than root vg lvsplit will be the best bet.

The best way here will be to physically remove one mirror disk and then before going for upgradation, try booting through both disks independently one at a time. If everyting is fine leave eiter one in the system and remove other while doing update. Also remember to use "hpux -lq" at the ISL prompt while booting of a single disk if not allready set in AUTO file.

If everything goes fine after a complete testing and successfully running for atleast a week or so if everything is fine do insert the other disk and do

#vgchange -a y /dev/vg00

#vgsync /dev/vg00

If you require to boot of the other disk if the update was unsuccessful then just remirror it again to the other disk.


HTH,
Devender
Impossible itself mentions "I m possible"
MarkSyder
Honored Contributor

Re: Procedure to reduce a Mirrored LV into 2 independent LV's

I don't usually reply saying "I agree", but as you've ben given contradictory answers I'll make an exception: I agree with the suggestion of taking an ignite backup and falling back on that if things go wrong. It appears the most reliable of the suggestions you've been given.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
SURI  HUNJAN
Advisor

Re: Procedure to reduce a Mirrored LV into 2 independent LV's

Thanks to every one.

All answers were very useful.

Main thing was that we did not want to loose data by lvreduce which was confirmed by all the answers.
Senthil Kumar .A_1
Honored Contributor

Re: Procedure to reduce a Mirrored LV into 2 independent LV's

Hi,

Though this tread is pretty old. I have a perspective to this requirement.

The steps I thought are as follows. Please feel free to comment if anyone thinks it is not possible.

Ex:

lets say /dev/dsk/c0t1d0(pri) and /dev/dsk/c0t2d0(sec) PV's are part of VG vg00. Now the requirement is that we upgrade from the first disk and something goes wrong, boot from the second. In my method, we cannot boot from the second per say, but I strongly believe that it can atleast help in restoration.

1) Split all the mirrored LV's in vg00.

lvsplit /dev/vg00/lvol1
lvsplit /dev/vg00/lvol2
lvsplit /dev/vg00/lvol3
lvsplit /dev/vg00/lvol4
lvsplit /dev/vg00/lvol5
lvsplit /dev/vg00/lvol6
lvsplit /dev/vg00/lvol7
lvsplit /dev/vg00/lvol8

after the slipt you will find these devices in /dev/vg00 directory.

lvsplit /dev/vg00/lvol1b
lvsplit /dev/vg00/lvol2b
lvsplit /dev/vg00/lvol3b
lvsplit /dev/vg00/lvol4b
lvsplit /dev/vg00/lvol5b
lvsplit /dev/vg00/lvol6b
lvsplit /dev/vg00/lvol7b
lvsplit /dev/vg00/lvol8b

2) Upgrade the OS now. Meaning it would affect the data only in the first disk(pri).

3) DECIDER :

a) If the upgrade succeeds, that is you are successful in booting through the pri disk, and you find all is find, just remove the second set of LV's

lvremove /dev/vg00/lvol1b
perform the same for other LV's aswell.

Now remirror the boot disk as prescribed by HP docs.

b) If the kernel refuses to boot from the pri. Boot with "/stand/vmunix.prev" to lvm maintenace mode.

at ISL prompt ...issue..

ISL>hpux -lm vmunix.prev

Once you are into the LVM maintenence mode..issue the following commands....

vgchange -a y vg00
lvmerge /dev/vg00/lvol1 /dev/vg00/lvol1b

NOTE: The order of LV specification is very important. The first LV is destination and the second is source. There by I overwrite the data on the lvol1 with the data that was orginally preserved in lvol1b. Now you repeat the procedure for the rest of LV's in vg00.

vgchange -a n vg00
reboot

4) Now you can boot again normally from primary boot disk. Once booted verify whether the version of HPUX is the previous one by issuing "uname -a".


Regards,
Senthil Kumar .A


Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
SURI  HUNJAN
Advisor

Re: Procedure to reduce a Mirrored LV into 2 independent LV's

Thanks Senthil,

Good to know of an alternative method - could be used in other scenario's as well.
S.J. Sarwar
Occasional Advisor

Re: Procedure to reduce a Mirrored LV into 2 independent LV's

Hi,

lvreduce will not leave any data on the second copy of the disk as mentioned earlier. lvsplit will not do it as it is a root vg. Allthough for anything other than root vg lvsplit will be the best bet.

The best way here will be to physically remove one mirror disk and then before going for upgradation, try booting through both disks independently one at a time. If everyting is fine leave eiter one in the system and remove other while doing update. Also remember to use "hpux -lq" at the ISL prompt while booting of a single disk if not allready set in AUTO file.

If everything goes fine after a complete testing and successfully running for atleast a week or so if everything is fine do insert the other disk and do

#vgchange -a y /dev/vg00

#vgsync /dev/vg00

If you require to boot of the other disk if the update was unsuccessful then just remirror it again to the other disk.