Operating System - HP-UX
1753609 Members
6157 Online
108797 Solutions
New Discussion юеВ

mirroring a lvol ... where how does it know where to place the mirror copy?

 
Tim Killinger
Regular Advisor

mirroring a lvol ... where how does it know where to place the mirror copy?

I'm new to MirrorDisk/UX.... does anyone know where there is a MirrorDisk/UX concepts/admin guide? Specifically, I'm trying to understand how

lvcreate -m 1 -L 800 -n lvomniback /dev/vg00

knows which pv to mirror to, since none is specified here. Where is the physical relationship estahblished between the "mirroree" and the "mirror"? How dooes it know?

Thanks!
6 REPLIES 6
John Poff
Honored Contributor

Re: mirroring a lvol ... where how does it know where to place the mirror copy?

Hi,

You can pass the PV name as an argument to the lvextend command to specify which PV to use. Normally we just do the lvcreate, and then do the lvextend -m ... PV to specify which PV we want the mirror to go to.

JP
Michael Steele_2
Honored Contributor

Re: mirroring a lvol ... where how does it know where to place the mirror copy?

Mirroring follows these steps:

vgextend /dev/vg## /dev/dsk/cXtYdZ

lvcreate -L ### -n "lvolname" /dev/vg##

lvextend -m 1 /dev/vg## /dev/dsk/cXtYdZ

Its good to use the same SCSI targets when mirroring. So c1t4do should mirror to cXt4d0.

Use 'pvdisplay -v' to see what lvols reside upon a pv.

pvdisplay -v /dev/dsk/cXtYdZ
Support Fatherhood - Stop Family Law
Marco Santerre
Honored Contributor

Re: mirroring a lvol ... where how does it know where to place the mirror copy?

As mentionned already, you can specify the disk that you wanna use for your mirror copy, but if you don't specify a disk, it will take any disk that will correspond to the strict allocation policy.
Cooperation is doing with a smile what you have to do anyhow.
James R. Ferguson
Acclaimed Contributor

Re: mirroring a lvol ... where how does it know where to place the mirror copy?

Hi:

Mirror placement is constrained by the 'strict' and 'contiguous' allocation policies the logical volume as established by 'lvcreate' and/or modified by 'lvchange'.

See the man pages for 'lvcreate', 'lvextend' and 'lvchange' for more information.

Regards!

...JRF...
Uday_S_Ankolekar
Honored Contributor

Re: mirroring a lvol ... where how does it know where to place the mirror copy?

S.K. Chan
Honored Contributor

Re: mirroring a lvol ... where how does it know where to place the mirror copy?

As for the doc, see if this explains it well for you.
http://www.docs.hp.com/cgi-bin/onlinedocs.py?mpn=B2355-90742&service=hpux&path=00/00/1&title=Managing%20Systems%20and%20Workgroups%3A%20A%20Guide%20for%20HP-UX%20System%20Administrators
Goto "Managing Disks&Files"->"Managing FS".
Before you run lvcreate with the mirror option, you can examine what is the allocation policy set on that LV by running ..
# lvdisplay /dev/vg0X/lvolX|grep -i allocation
By default when you create the LV it'll set the allocation policy to "strict". That simply means the mirrored extents can reside in any other PVs BUT not in the same PVs where the "primary" copy sits. For example ..
/dev/vg02/lvol1
diskA = 200 extents here
diskB = 400 extents here
diskC = none here
If you extend a mirror copy of lvol1 (based on strict), the "primary" extents that resides on diskA can have it's mirrore copies sitting in diskB or diskC, not on diskA.
My favorite way of setting up mirror LVs is to create PVG (physical volume group) and placing sets of disks into separate PVG. Telling the LVs to mirror as PVG-strict so that I know which PVG has the mirrored extents. This way I have more control.