1834108 Members
2219 Online
110063 Solutions
New Discussion

Mirror ask?

 
SOLVED
Go to solution
castro_2
Regular Advisor

Mirror ask?

I have several logical volumes in 2 disk

How can I do the mirror
LV Name /dev/vg00/lvol7
VG Name /dev/vg00
--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c9t5d0 160 160
/dev/dsk/c9t9d0 140 140

When I do the lvextend -m 1
what disk is?
Thnaks

6 REPLIES 6
Pete Randall
Outstanding Contributor

Re: Mirror ask?

Without specifying anything, the lvextend command will allocate space where it sees fit, maintaining the allocation policy (default policy will not allow the mirror copy to be on the same disk as the original).

lvextend -m 1 /dev/vg01/lvol5

If you wish to, you can also specify which physical disk you want to allocate the mirror copy on.

lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c0t3d0

Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: Mirror ask?

Hi Castro:

When you do the 'lvextend -m...' *all* extents of the logical volume on *all* physical volumes on which it resides are extended. Remember that mirroring is at the *logical volume* level. You can limit the mirror to a particular physical volume(s) by specifying the pv_path(es). Otherwise, all physical volumes are candidates for the mirror extents, within the constraints of the 'strict' allocation policy (which by default, prevents allocating mirror extents on the same physical volume as corresponding extents already exist).

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

Regards!

...JRF...
Pete Randall
Outstanding Contributor
Solution

Re: Mirror ask?

Actually, to phrase it more simply, it doesn't matter where the source is or how it's laid out. The logical volume (lvol7) will be mirrored, in it's entirety, on either the volume you specify or whatever volume is available if you don't specify.

Hope that helps,

Pete

Pete
S.K. Chan
Honored Contributor

Re: Mirror ask?

You can mirror to a specific disk (say c1t2d0) by running ..
# lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c1t2d0
otherwise (without specifying the disk) it'll mirror to any available PV extents which are not on the same PV.
To establish a "clean mirror" it's best of you can setup PVG and enable the PVG-strict allocation. I usually do that if I have more than 2 disks in my vg00.
Anil C. Sedha
Trusted Contributor

Re: Mirror ask?

Castro,

I am considering that you have multiple logical volumes spread over these two disks listed above.

You will need two different disks to mirror your logical volumes to.

lvextend -m1 /dev/vg00/lvol7 /dev/dsk/newdisk

See attache doc

-Anil
If you need to learn, now is the best opportunity
Anil C. Sedha
Trusted Contributor

Re: Mirror ask?

Castro,

I am considering that you have multiple logical volumes spread over these two disks listed above.

You will need two different disks to mirror your logical volumes to.

lvextend -m1 /dev/vg00/lvol7 /dev/dsk/newdisk

See attached doc

-Anil
If you need to learn, now is the best opportunity