1838081 Members
3485 Online
110124 Solutions
New Discussion

Ugh!

 
Pete Devlin
Valued Contributor

Ugh!

/dev/vg00/lvol8 Mirrored & set up like this :-

C0t15d0--------c4t15d0
c4t15d0--------c4t12d0
c4t12d0--------c0t12d0.

I want the primary on one controller & secondary on the other (obviously). Question is how do I do it?? I know you can specify which disk logical volumes can be removed from when reducing mirroring but, given that 2 of the disks are both primary & secondary, will LVM only remove secondary references or will it just remove references to that disk full stop.
Cheers.
Pete
7 REPLIES 7
Ashwani Kashyap
Honored Contributor

Re: Ugh!

Take a look at the pvmove command . With PV move you can move the PE belonging to an LV from one PV to another PV in the same VG .
Ken Hubnik_2
Honored Contributor

Re: Ugh!

lvcreate -n lvol8 /dev/vg00
lvextend -lxx /dev/vg00/lvol8 /dev/dsk/c0t5d0
lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c4t12d0
Jean-Louis Phelix
Honored Contributor

Re: Ugh!

Hello,

The order between primary and secondary is only defined by the disk order in /etc/lvmtab.

So you can modify the order using pvmove, lvreduce or lvextend, but once you've deactivated/reactivated the volume, it will go back to the original order.

So I think that you have to :

-remove everything from c4t12d0
-vgreduce vg00 c4t12d0
-vgextend vg00 c4t12d0
-mirror to c4t12d0
-remove everything from c4t15d0
-vgreduce vg00 c4t15d0
-vgextend vg00 c4t15d0
-mirror to c4t15d0

Regards,

Jean-Louis.
It works for me (© Bill McNAMARA ...)
S.K. Chan
Honored Contributor

Re: Ugh!

Since you're dealing with the root VG (vg00) you got to be careful here. What about the rest of the LVs ? If they do not reside in these PVs (c4t12d0,c4t15d0,c0t12d0,c0t15d0) how are they mirrored ? Ideally if you have more than 2 PVs in a single VG, I normally would configure my PVs in a separate PVG(physical volume group) when I set up my VG, that way I can get a clean mirror, ie the mirrored set does not reside on the same PVG. Ideally you would want ..
c0t15d0, c0t12d0 to be the primary
c4t12d0, c4t15d0 to be the secondary.
If ONLY lvol8 resides in these disks, you should be able to do this ..
1) Break the mirror, so you'll be left with extents sitting in c0t15d0, c4t15d0, c4t12d0.
Meaning you got one "unused" disk ie c0t12d0 to play with.
2) Extend the VG with c0t12d0, pvmove all the extents from c4t12d0 to c0t12d0. BTW are the disks all the same size ? It'll be tricky if they are not, for now I'm assuming they are. Now you got c4t12d0 free up. Vgreduce it.
3) Whats's left now are c0t15d0,c4t15d0,c0t12d0. Now the question is are they enough extents left in c0t12d0 so that extents residing in c4t15d0 can be pvmove as well. If you can free up c4t15d0, it can be added with c4t12d0 into the VG later to hold the mirrored set.
You'll have to provide more details.
Pete Devlin
Valued Contributor

Re: Ugh!

Thanks for your replies guys. Here is exactly how the lv is split up :-

LE
0-187 c0t15d0------c4t15d0
188-212 c4t15d0------c4t12d0
213-374 c4t12d0------c0t12d0.

I'm just after confirmation that if I lvreduce & specify c4t15d0 & c4t12d0 it will either leave a copy or get rid of all reference to lvol8 for c4t15d0 etc thus rendering it useless. If that's the case then I'm looking at downtime to sort the mess out. I specified removing a logical volume from a disk before with no problem but never when the disk specified is both primary & secondary as far as this particular lv is concerned.
Cheers
Pete.
Pete Devlin
Valued Contributor

Re: Ugh!

Hi S.K. Only one other lv is affected & is much simpler because the mirror is on 2 c0 & c4. this lvol (var) is the only one that is a real mess. As you can see if we lose controller 4 I'm in a spot of trouble! I see what you're getting at & will have a think over the weekend & come back to it Monday. Level 42 tonight so leaving early!
Cheers
Pete.
Pete Devlin
Valued Contributor

Re: Ugh!

This can now be resolved as we have a VG that recently has stopped being used. This has 2 disks so I can blow away the old VG, extend vg00 to these & lvextend -m 2....., lvreduce from the the offending disks with no danger & then reextend. Thanks for all your suggestions!
Cheers,
Pete.