question about PVG

 
SOLVED
Go to solution
Ji Lei
Frequent Advisor

question about PVG

If I do the actions as below:
# vgcreate -g pvg1 vg02 /dev/dsk/c1t5d0
# vgextend -g pvg2 vg02 /dev/dsk/c2t5d0
# lvcreate -s g /dev/vg02/lvol1
===> PVG-strict on
# lvextend -L 2000 /dev/vg02/lvol1 /dev/dsk/c1t5d0
===> extend it to c1t5d0


should lvol1 mirror to /dev/dsk/c2t5d0 automatically?
thanks!
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: question about PVG

Hi:

The 'strict' allocation policy will in itself prevent mirrors from being allocated on the same physical volume.

Since you have setup two physical volume groups, though, when you do your 'lvextend -m 1' to create mirrors of a logical volume, you can specify the pvg_group name as an argument to control where you want the mirrors allocated.

Regards!

...JRF...
Mark S Meadows
Valued Contributor
Solution

Re: question about PVG

Hi,

The answer to your question is yes due to the requested strict allocation policy, but you will need to either add "-m 1" to your existing lvextend command or run "lvextend -m 1 /dev/vg02/lvol1" in order to generate the mirror.

Your vgcreate and then vgextend commands will have created and then populated the following /etc/lvmpvg file :

cat /etc/lvmpvg
VG /dev/vg02
PVG PVG1
/dev/dsk/c1t5d0
PVG PVG2
/dev/dsk/c2t5d0

Regards,

Mark
Administrating HP-UX systems for more years than I care to admit, but still enjoying it (most of the time!).
Ji Lei
Frequent Advisor

Re: question about PVG

Hi Mark S Meadows,

As you said,
"you will need to either add "-m 1" to your existing lvextend command or run "lvextend -m 1 /dev/vg02/lvol1" in order to generate the mirror"

I need do the following if I want to create a LV lvol1 on c1t5d0, while there is a mirror copy on c2t5d0

# vgcreate -g pvg1 vg02 /dev/dsk/c1t5d0
# vgextend -g pvg2 vg02 /dev/dsk/c2t5d0
# lvcreate -s g /dev/vg02/lvol1
# lvextend -L 100 -m 1 /dev/vg02/lvol1 /dev/dsk/c1t5d0

Am I right?

Another question is, the PV_path in upper lvextend cmd can be either c1t5d0 or c2t5d0, Yes or No ?

Michael Steele_2
Honored Contributor

Re: question about PVG

Hi

When you lvcreate the lvol is put on the first pv found in the vg. You can find this for yourself with this command

strings /etc/lvmtab

When you lvextend a mirror its always to the 2nd pv, c2t5d0 in this case. So your last command is incorrect.
Support Fatherhood - Stop Family Law