LVM and VxVM

mirroring on a strict stripe LV

 
SOLVED
Go to solution
William Wan_1
Frequent Advisor

mirroring on a strict stripe LV

I created a 1 VG with 18 LV's using all disk from 1 entire DS. Now I want to use the second DS to mirror the entire VG from the first DS.

But i think i made a mistake while creating LV. I need confirmation or solution to my problem.

First, i create the VG with 9 disks using the following command
vgcreate /dev/vgdata01 /dev/dsk/c9t8d0 /dev/dsk/c9t9d0 /dev/dsk/c9t10d0 /dev/dsk/c9t11d0 /dev/dsk/c9t12d0 /dev/dsk/c10t0d0 /dev/dsk/c10t1d0 /dev/dsk/c10t2d0 /dev/dsk/c10t3d0

Then the LV stripting over 9 disks by
lvcreate â i 9 â I 64 â n lvdt1 â L 3500 /dev/vgdata01

Yes, it's just strict striping without PVG / distributed allocation. Stupid me who can only create a proper LVM configue using LUN's
I just find out the only way to mirror a stripe LV, is using extend-base stripting which require PVG and distributed allocation.

My questions are:
1. Is it true that with my current LVM configuration, I cannot make a mirror of my LV's?

2. I've seen some parm of lvchange, but not sure how to use them.
Is there a way to change the LV's configuration into distributed allocation and whatever more needed to be done, and then add the mirror's WITHOUT restoring the data. If this is possible, how to get this done?

Thanks in advance
14 REPLIES 14
William Wan_1
Frequent Advisor

Re: mirroring on a strict stripe LV

Sorry for the bad character

the command for create a LV should be:

lvcreate -i 9 -I 64 -n lvdt1 -L 35856 /dev/vgdata01
Devender Khatana
Honored Contributor
Solution

Re: mirroring on a strict stripe LV

Hi,
Apart from this what you are asking, you also need to increase 'max PV' parameter to atleast 18 to add another 9 PVs to this VG. There is no other way of doing that except taking backup,recreating VG & restoring backup.

HTH,
Devender
Impossible itself mentions "I m possible"
shankar_3
Advisor

Re: mirroring on a strict stripe LV

Hi Wan,

From your help what i understood ..

1. you have a two diskstataions with same configuration.

2.created LVs in one DS using all disks with strict stripe.

3.Now you want implemaent mirror LVs with second DS. right

your question is..

1.Your LVM on DS1 is true.?

Yep . its ok

2.How to change the allocation of LV on DS1?

Better you can do PVG- strict then start miiroring your DS1 to DS2

#vi /etc/lvmpvg
VG /dev/vgdata01
PVG pvg_DS1
/dev/dsk/c9t8d0
/dev/dsk/c9t9d0
/dev/dsk/c9t10d0
/dev/dsk/c9t11d0
/dev/dsk/c9t12d0
/dev/dsk/c10t0d0
/dev/dsk/c10t1d0
/dev/dsk/c10t2d0
/dev/dsk/c10t3d0
PVG pvg_DS2
/dev/ds/cXtYdZ
....
...
then sav and exit
Before mirring a LV you need to set it's allocation policy to PVG-strict, e.g

#lvchange -s g /dev/vgdtat01/lvol1
....
... etc.

#lvdisplay /dev/vgdtat01/lvol1 | grep allocation

More details do
#man lvmpvg

With Cheers,
Shankar



Bob_Vance
Esteemed Contributor

Re: mirroring on a strict stripe LV

1) yes, you *cannot* mirror a "-i" striped LVOL.

2) AKAIK, you can't convert the "-i".
You could convert manually with a copy as follows, but the LVOL would have to be quiet (apps down):
. create second VG, vgB with the other 9 disks
. create a distributed LVOL in this new VG
(you'll have to create a PVG with one group with these 9 disks in it)
. newfs on the LVOL
## newfs -F vxfs /dev/vgB/rlvol1
. umount current LVOL
. mkdir /tmp_mnt
. remount old LVOL manually there
## mount /dev/vgA/lvol1 /tmp_mnt
. change /etc/fstab to mount new LVOL
## /dev/vgB/lvol1 /app ...
. mount new LVOL
## mount /app
. copy the old data to the new spot
(cd /tmp_mnt ; tar cvf - .) | (cd /app ; tar xvf - )

At this point, the apps can come back up.
Now, you an mirror the new guy.

. umount the old
## umount /tmp_mnt
. vgchange -a b vgA ; vgexport vgA
. pvcreate -f the old PVs
. vgextend the old LVOLs into vgB
. create a second group in /etc/lvmpvg
containing the old PVs.
. lvextend /dev/vgB/lvol1 -m1

There are probably some errors in the details, above, but you get the idea.

hth
bv
"The lyf so short, the craft so long to lerne." - Chaucer
William Wan_1
Frequent Advisor

Re: mirroring on a strict stripe LV

Thanks Devender
I totally forgot the MAX PV issue.

Like you said already, I have to rebuild the entired VG.

Here is what I did:

create VG
vgcreate -e 17501 -p 25 -l 32 -g pvg_vg01_01 /dev/vg01 /dev/dsk/c4t0d0 /dev/dsk/c4t1d0 ... ... ...

extend VG
vgextend -g pvg_vg01_02 /dev/vg01 \
/dev/dsk/c9t8d0 /dev/dsk/c9t9d0 \
.... ... ...


create LV
lvcreate -D y -s g -n lvdt1 -l 8960 /dev/vg01

extend LV
lvextend -m 1 /dev/vg01/lvdt1 pvg_vg01_02



By doing this, I succesfully create a VG which strips over a numbers of disks of 1 single DS, and mirror to another DS.


1 more import things to learn was when creating a new VG, I need to define the MAX-PE / PV too.

The "primary side" of the VG was using smaller disks, when creating a VG using these disk, the value for "Max PE per PV" is default to the "Number of PE" of the biggest this. If I want to extend a larger disk later to this VG, I will get error that not all PE of the new large disk can be added to the currect VG.

So I have to predefine MAX PV, MAX PE per PV and also MAV LV.

I know there is a relationship between these numbers and there is a MAX value of it.

How to calculat this value?

if I run
vgcreate -e 17501 -p 25 -l 32 ... ...
the command will works
if i run
vgcreate -e 17501 -p 32 -l 32 ... ...
I will get an error:
VGRA for the disk is too big for the specified parameters. Increase the
extent size or decrease max_PVs/max_LVs and try again.


I cannot fine a good explanation about how to calculate the max allowed value in ITRC. Can anyone help me with this?

Thanks in advance

Devender Khatana
Honored Contributor

Re: mirroring on a strict stripe LV

Hi William,

The Max. No. Of Physical Volumes in a VG is 255 as displayed in man vgcreate. The reason for this error is because you have not altered the Default PE_Size Parameter.

When no. of PV's or LV's increase in a VG you should increase PE Size as well. This is required because increasing these parameters always increase LVM header size and then it grows above One PE Size. The rule of LVM says that LVM header in any case can not be more than the size of one PE.

HTH,
Devender

Impossible itself mentions "I m possible"
William Wan_1
Frequent Advisor

Re: mirroring on a strict stripe LV

Hi,

according to my man page, default value for max_pe is 1016.

Anyway.
I am using default PE_size which is 4Mb.
So you were saying when I was adjusting the max.numbers of PE per PV, max PV and max LV, the LVM header is getting bigger then 4Mb?

I am just wonder how to calculate the value of this LVM header size.

Thanks,

William
Ermin Borovac
Honored Contributor

Re: mirroring on a strict stripe LV

As indicated in the previous post you need to increase PE size (-s option to vgcreate). Don't need to specify maximum number of PEs per PV; it will be calculated for you based on the size of the biggest PV specified on vgcreate command line.

With your VG group size I think you need to go for PE size of 16MB.

# vgcreate -s 16 -p 32 ...

Sizing table you can use for these purposes is provided in LVM software recovery handbook.

http://www.itrc.hp.com -> navigate knowledge trees -> HP-UX Software Recovery Handbook -> Chapter 16 - Logical Volume Manager (LVM)

Look at the table in Section "Maximum max_pe values for non-boot disks".



shankar_3
Advisor

Re: mirroring on a strict stripe LV

Hi Wan,

1. Whenever you adding any disk (PV) per PE will adjust automatically. But explicitely if you define that will be useful for future. Thers is option after creating the VG thgen modify the PE of PV in VG.
2.LVM header size for non-bootable disk not fixed. Its depends on number of PVs, size of PEs.. etc. But usually its smaller. The LVM header has to fit in one PE normally.

With Cheers,
Shankar Ganesh