Striping plus mirror with LVM

 

Striping plus mirror with LVM

Hello!

In a case with two FC10 I want to create striped logical volumes on disks on FC10 "A" and then to mirror that logical volumes on disks on FC10 "B".

For instance:

vgcreate /dev/vgname (disks on FC10 "A")
lvcreate -i X ... (X - number of disks that included in the "vgname")

Next step,
vi /etc/lvmpvg
VG /dev/vgname
PVG FC10A
(list of disks on FC10 "A")
PVG FC10B
(list of disks on FC10 "B")

then

lvextend -m 1 -s g ....

Is it possible? Is it correct?

Thank you.
8 REPLIES 8
Patrick Wallek
Honored Contributor

Re: Striping plus mirror with LVM

No this won't work.

To get striping and mirroring together you have to use the extent-based distributed striping. Have a look at the '-D' option to lvcreate.

'man lvcreate' for more information.
Jeff Schussele
Honored Contributor

Re: Striping plus mirror with LVM

Hi Serhiy,

Nope, sorry.
Patrick's correct.
You'll have to use extent-based striping to utilize mirrors. This has the unfortunate effect of requiring stripe size = extent size. Which is hardly ever optimal. Also requires the use of PVGs (Physical Volume Groups) instead of standard VGs.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Stuart Abramson_2
Honored Contributor

Re: Striping plus mirror with LVM

If what you want to do is mirror from A to B disks, use this example. (Actually you mirror logical volumes not disks, but I think of them as original disk and mirror disk.)

Mirror the cA disks on the cB disks.

cAt6d0 cBt6d0
cAt5d0 cBt5d0

a. cAtTdD disks already exist and lvols already exist.

b. Type commands:

pvcreate /dev/rdsk/cBt6d0 # mirror disks
pvcreate /dev/rdsk/cBt5d0
vgextend vg00 /dev/dsk/cBt6do /dev/dsk/cBt5d0
lvextend -m 1 /dev/vg01/lvol1 /dev/dsk/cBt6d0
lvextend -m 1 /dev/vg01/lvol2 /dev/dsk/cBt6d0
lvextend -m 1 /dev/vg01/lvol3 /dev/dsk/cBt6d0
lvextend -m 1 /dev/vg01/lvol4 /dev/dsk/cBt6d0
lvextend -m 1 /dev/vg01/lvol5 /dev/dsk/cBt6d0
lvextend -m 1 /dev/vg01/lvol6 /dev/dsk/cBt6d0

I NEVER use PVGs. It's just an extra layer of complexity. There may be a reason for them, but I could never figure it out.
Stuart Abramson_2
Honored Contributor

Re: Striping plus mirror with LVM

I mixed up by VG names above, vg00 and vg01, by mistake. I meant them all to be vg01.
Michael Steele_2
Honored Contributor
Patrick Wallek
Honored Contributor

Re: Striping plus mirror with LVM

I'm sorry Michael but you're incorrect. If you go back and re-read the man page for lvcreate, you will see that the man page states that the '-D' option is incompatible with the '-i' option, which in turn means it is also incompatible with the '-I' option because '-i' and '-I' MUST be specified together.

The stripe size with extent based stripes is taken from the PE-SIZE of the VG. The '-D' option takes one PE from the first drive in the PVG, then next extent from the next drive in the PVG, etc.

The only option you have to control the stripe size with extent-based stripes is to recreate the VG with a different PE-Size.

When creating an extent based mirrored LV you would do it like this:

# lvcreate -L 500 -D y -s g -m 1 /dev/vgwhatever

Darren Murray_1
Frequent Advisor

Re: Striping plus mirror with LVM

Hi,

because youve already done most of the setup , I believe you can do the following

1. Create two striped lvols, one on each array.
2. Lvmerge them to create the mirror.


Cheers
Darren
Stefan FLOREA
Occasional Advisor

Re: Striping plus mirror with LVM

Darren,

This is not possible either.
LVM doesn't support raid 1+0, no matter what way you are trying to set it.
It will let you do the lvmerge but data corruption occurs.
by,
Stefan