Operating System - HP-UX
1833046 Members
2565 Online
110049 Solutions
New Discussion

Re-allocation of extents from breaking mirror

 
SOLVED
Go to solution
Kenneth Woolard
Advisor

Re-allocation of extents from breaking mirror

Have a LV of approx 200gb that is mirrored and there are 6 PV's (LUNS) associated with it.

I want to break the mirror with the usual command i.e. lvreduce -m 0 and then use the resulting extents for another LV within the same VG.

However I notice that one of the PV's extents is being used as the primary as well as the secondary i.e.

LE PV1 PE1 Status 1 PV2 PE2 Status 2
00000 /dev/dsk/c11t0d1 00940 current /dev/dsk/c11t1d7 00638 current

12169 /dev/dsk/c11t1d7 00544 current /dev/dsk/c11t1d5 04179 current

So I guess my question is:-

Once I break the mirroring will these extents automatically be available again within the VG to allocate to another LV ?

OR this was my idea

If c11t1d7 had not been used as both PV1 and PV2 in the mirroring I could have just done a pvremove from LVM and then pvcreate'd again.

Input would be mosr welcome



3 REPLIES 3
James R. Ferguson
Acclaimed Contributor
Solution

Re: Re-allocation of extents from breaking mirror

Hi Kenneth:

> Once I break the mirroring will these extents automatically be available again within the VG to allocate to another LV ?

Yes, once you do:

# lvreduce -m 0 /dev/vgNN/lvolM /dev/dsk/cXtYdZ

...the physical extents thus freed on cXtYdZ are available for reuse. You can choose the target *physical* disk from which to remove the logical extents.

At this point, you can use 'pvmove' [not 'pvremove'] to move the remaining logical extents around as you see fit.

Be aware that if you use 'pvmove', do not interrupt it or run it in a manner in which it might be interruped. To do so can leave your logical volume in an unusable state.

Regards!

...JRF...


Kenneth Woolard
Advisor

Re: Re-allocation of extents from breaking mirror

Thanks for that James. Will let LVM automatically take care of allocating the extents when I lvextend the LV that needs to be increased in size.
My main worry was that the freed extents from the breaking of the mirror would not automaticaly be available
James R. Ferguson
Acclaimed Contributor

Re: Re-allocation of extents from breaking mirror

Hi (again) Kenneth:

> Will let LVM automatically take care of allocating the extents when I lvextend the LV that needs to be increased in size.
My main worry was that the freed extents from the breaking of the mirror would not automaticaly be available

Yes. The 'lvreduce' will mark the previously used physical extents as free, and then as such, they are available for use during a subsequent 'lvextend' or 'lvcreate'.
The only constraint is that any strict and/or contiguous policies are enforced during subsequent allocation, as always. See the 'lvcreate' manpages for more information.

For mirrored logical volumes, increaing the size of the logical volume automatically adjusts all logical extents on all mirrors.

Regards!

...JRF...