Operating System - HP-UX
1848477 Members
8583 Online
104029 Solutions
New Discussion

Re: Question on mirroring

 
SOLVED
Go to solution
Nobody's Hero
Valued Contributor

Question on mirroring

OK I am still on this LV mirroring thing:

If I have an 8GB disk that contains

/dev/vg01/lvol1 @4 GB
/dev/vg01/lvol2 @4 GB.

And I mirror /dev/vg01/lvol1 to c1t6d0,another 8gbyte disk.

How does it know to only use 4gbyte of mirror space.

And
Can I mirror lvol2 to that same 8 gbyte disk?
How does it keep track of 2 lvol's on one disk?

Just curious because I don't understand.
UNIX IS GOOD
3 REPLIES 3
Pete Randall
Outstanding Contributor
Solution

Re: Question on mirroring

Robert,

Mirroring is done at the lvol level. When you lvexted the volume to add the mirror copy, LVM allocates the same amount of space as the primary already occupies. The same will be true when you mirror lvol2 - as long as there is space to initially allocate the 4GB required, the lvextend command to add the mirror will succeed.


Pete

Pete
Geoff Wild
Honored Contributor

Re: Question on mirroring

LVM knows.

Do a lvdisplay -v /dev/vg01/lvol1 | more after you mirror.

You will see something like:

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c0t6d0 16 16
/dev/dsk/c3t6d0 16 16


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Helen French
Honored Contributor

Re: Question on mirroring

Since you are going to mirror a 4GB LV to another, it will create an exact same size of LV in the other disk. The number of PEs and LEs will be similar and a write() call will simultaneously write the data to both PEs (on both disks).

Now if you have 4GB mirror on a disk, that will leave another 4GB on the disk as free and that can be used for your next mirror. LVM will take care about how it will create and allocate LV space, PEs and LEs.

I think your doubt will be cleared, when you understand that 'LVM mirroring is done on logical volume level and not like disk-to-disk mirror'
Life is a promise, fulfill it!