Operating System - HP-UX
1833772 Members
2588 Online
110063 Solutions
New Discussion

Can i still use mirroring if I use striped LV's?

 
SOLVED
Go to solution
Scott Dunkley
Regular Advisor

Can i still use mirroring if I use striped LV's?

I knopw that there is such a config as RAID 0/1 but I dont understand how you get the striped mirror on a specific set of disks?

So I have a VG with say 10 disks in, the first 5 I want to set up as my primary disks, so the first question is can I specufy a list of PV's to stripe across something like:

lvcreate -i 5 -I 64 -L 200 /dev/vg01 /dev/dsk/c1t20 /dev/dsk/c2t2d0 etc etc

and then specify where I want them mirroed:

lvextend -m 1 /dev/vg01/lvol1 /dev/dsk/c4t2d0 etc etc

Will that create a striped mirror?

Hope that makes sense.
Better to regret something you have done, than something you havn't
11 REPLIES 11
Helen French
Honored Contributor
Solution

Re: Can i still use mirroring if I use striped LV's?

LVM does not support mirroring with striping with the exception of extent-based striping (psuedo striping). You need to install the necessary LVM patches before you implement this. This is an eg:

# lvcreate -D y -s g -m 1 -l 1200 /dev/vgXX

# man lvcreate (for more details)
Life is a promise, fulfill it!
Scott Dunkley
Regular Advisor

Re: Can i still use mirroring if I use striped LV's?

Oh no, can you explain what psuedo striping is and how I can acheive this? Also how does it compare to normal striping?
Better to regret something you have done, than something you havn't
Scott Dunkley
Regular Advisor

Re: Can i still use mirroring if I use striped LV's?

Also as a side thought, how do you achieve disk redundancy if 0/1 is not supported through LVM? striping alone will not give any redundancy as far as I can tell.
Better to regret something you have done, than something you havn't
Jean-Louis Phelix
Honored Contributor

Re: Can i still use mirroring if I use striped LV's?

Hi,

Shiju gave you the command to do it. What he calls pseudo-stripping is distributing PEs across specified disks, ie on 3 disks to simplify :

PE 0 --> disk 0
PE 1 --> disk 1
PE 2 --> disk 2
PE 3 --> disk 0
PE 4 --> disk 1
PE 5 --> disk 3

So instead of 64K, strippe size is 1 PE. In this case you can mirror. You should also perhaps use lvm PVG.

Regards.
It works for me (© Bill McNAMARA ...)
Steven E. Protter
Exalted Contributor

Re: Can i still use mirroring if I use striped LV's?

Your second statment is correct.

LVM supports RAID 1 mirroring, single or doulb copy of the LVM.

The only way to get striping and mirroring is to do part of it on the hardware like an EMC disk array.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Ashwani Kashyap
Honored Contributor

Re: Can i still use mirroring if I use striped LV's?

You cannot use LVM mirroring with LVM BLOCK striping.
BLOCK striping means that you use the -i and -I options with lvcreate .

However, you can use LVM extent striping with LVM mirror.
Extent striping means that you used the -D option with lvcreate
Helen French
Honored Contributor

Re: Can i still use mirroring if I use striped LV's?

Again, when you do normal striping, the stipes are much smaller in KBs (4KB). In extent based striping, the stripe size will be equal to the size of 1 PE (so in MBs). It takes the first stripe from the first available PE from the first disk, then the first available PE from the second disk etc.

Read the lvcreate man pages and check the -D option. Also, read about pseudo striping in docs.hp.com
Life is a promise, fulfill it!
Scott Dunkley
Regular Advisor

Re: Can i still use mirroring if I use striped LV's?

So am I right in saying that if you use distributed allocation you can specify which disks to strip over, then when you are ready use lvextend to create the mirrors on another list of spcified disks. The mirroring will also use extent base stripes as well.

Or is it like the first reply where you have to specify the -m 1 option at the time of creating the LV with -D y? so you cant control where the mirror ends up?
Better to regret something you have done, than something you havn't
Jean-Louis Phelix
Honored Contributor

Re: Can i still use mirroring if I use striped LV's?

That's why I talked about lvm pvg ...

Create a distributed lvol with 5 PEs on you first pvg (containing 5 first disks) using lvcreate -l 5 -D y /dev/vgxx , then mirror it to the second pvg (containing 5 other disks) using lvextend -m 1 /dev/vgxx and finally lvextend it to the required size (lvextend -L xxx /dev/vgxxx). See man lvmpvg.

Regards.
It works for me (© Bill McNAMARA ...)
Helen French
Honored Contributor

Re: Can i still use mirroring if I use striped LV's?

What you need to do is create PVGs and alloacate your disks to different PVGs. When you use the command with -D option, you will use '-s g' also, just to makes sure that the mirror will go to a different set of disks, when doing striping.

# man lvcreate has all details.
Life is a promise, fulfill it!
Bernhard Mueller
Honored Contributor

Re: Can i still use mirroring if I use striped LV's?

Scott,

important thing is that you specify "-s g" for lvcreate to make mirroring "PVG-strict".
and before you need to specify "vgcreate -s 1 ..." for 1MB extent size.

Regarding vgcreate the other thing to consider before you start is that with current disk sizes you are likely to hit the max. extents per VG.

If you create the vg with extent size 1MB you can e.g. mirror 3x18GB disks onto 3x18GB disks 3x18000=54000 (approximate calculation but you need to stay below 65000).
So with 6 disks of 36GB you would have to use 2MB extent size for distributed allocation policy, which in turn somewhat reduces the effect of "striping".

Regards,
Bernhard