Operating System - HP-UX
1753435 Members
4651 Online
108793 Solutions
New Discussion

Reducing LV with lvmpvg issue

 
SOLVED
Go to solution
Andrew_adm
Advisor

Reducing LV with lvmpvg issue

Hi everyone!
Two systems with service guard have configured the logical volumen with PVG´s as follows:
VG /dev/vg_nasma
PVG pvg1
/dev/dsk/c4t8d0
/dev/dsk/c4t10d0
PVG pvg2
/dev/dsk/c5t10d0
/dev/dsk/c5t8d0
PV´s from PVG2 are working as mirror PV´s
Customer want halt cluster and create a similar VG with another LV on the second node using controller balance.
One system mounts the logical volume while the other doesn´t mount it.
What i need is to use a C4txdx PV and other from PVG2 (C5txdx) to create the new Volume group on the second node getting in this way balancing controllers but i dont know if its possible to use lvreduce to reduce one disk from each PVG. If i couldn´t, what will i have to do? changing allocation policy?.After i want to do system A will must to use one c4txdx PV and other C5txdx, in the same way that system B, each system will have mounted ,as stand alone systems, a VG with a LV.
Thx a lot !.
Regards
11 REPLIES 11
Calandrello
Trusted Contributor

Re: Reducing LV with lvmpvg issue

Friend this this a little confused. you it could explain better?
Deoncia Grayson_1
Honored Contributor

Re: Reducing LV with lvmpvg issue

First i'm not sure if I'm understanding you correctly, so lets clarify a couple of your statements. Do you want to create a new Volume Group to be controlled by Service Guard, i.e. only active on one cluster in which the package is active? Also are you wanting to remove disks from the first volume group in order to create the second one?

Am I understanding you correctly?
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
Andrew_adm
Advisor

Re: Reducing LV with lvmpvg issue

The new volume group wont be controlled by service guard, the systems will run as stand alone systems, so i want remove disks from first VG in order to use them to create the other VG on the other systems these removed disks have to be one from c4 controller and other from c5 controller.
Sorry my previous explanation, i hope this be a bit clear.
Thx again.
Deoncia Grayson_1
Honored Contributor

Re: Reducing LV with lvmpvg issue

First thing first before you reduce and physical volumes out of the first volume group, what is the size of logical volume that is inside of vg_nasma? Does it need both physical volumes to retain its current size? Is it spread across by physical volumes in pvg1????

If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
Andrew_adm
Advisor

Re: Reducing LV with lvmpvg issue

The logical volume contained inside vg_nasma is extended across the 2 entire pv´s on pvg1 and mirrored on pvg2, i dont know how to eliminate mirror disks and take one pv from each pvg to extend along them the new vg on the other system.
Bill Costigan
Honored Contributor

Re: Reducing LV with lvmpvg issue

First remove the mirror from the unwanted disks for each LV

lvreduce -m 0
/dev/vg_nasma/lvol1 /dev/dsk/c5t10d0
/dev/dsk/c5t8d0
lvreduce -m 0
/dev/vg_nasma/lvol2 /dev/dsk/c5t10d0
/dev/dsk/c5t8d0

etc.

Then remove each of the PVs
vgreduce /dev/vg_nasma /dev/dsk/c5t10d0
vgreduce /dev/vg_nasma /dev/dsk/c5t8d0


You'll then have to reimport the modified vg_nasma onto the second node of the cluster because this nod still thinks the VG has 4 PVs instead of 2.

You now have two disks that you can use as you wish.
Sandman!
Honored Contributor

Re: Reducing LV with lvmpvg issue

How about asking the customer to provide you with two new LUNs where one LUN is on controller 4, c4d#t#, and the other is on 5, c5d#t#. This way you won't have to destroy/recreate your current volume group and can go ahead with creating the new lvol with minimal disruption.

~hope it helps
Andrew_adm
Advisor

Re: Reducing LV with lvmpvg issue

Hi, its clear all above, but im not sure it be the solution i was looking for, at this point i would have the 2 disks C4 on a system and c5´s on the other, as i want one of each controller on every system, should i extend VG with one C5 moving data from one c4 to this last c5 and after this, reducing a c4 disk from VG to be able to use on the other system? or would i have destroy the VG and create another one as i want and restore data?. Data are not necessary on second system, this vg will start as a new vg, without data and the first system should keep them.
Bill Costigan
Honored Contributor
Solution

Re: Reducing LV with lvmpvg issue

First you have to figure out where the mirrors are. Do an lvdisplay -v for each of the lvols. This will show you where the primary and mirror for each extend is.

You can just do a lvreduce -m 0 for each lvol and not specify from what disks to remove the extents.

You can then do the lvdisplay to see where the data is and use pvmove to move it from the disk you want to free up to the disk you want to keep.

e.g. c4t10d0 -> c5t10d0
c5t8d0 -> c4t8d0

do a vgdisplay -v to ensure there is no more data on the PVs you wish to remove. If they are completely free then do the vgreduce to remove them.