Operating System - HP-UX
1827451 Members
4235 Online
109965 Solutions
New Discussion

Re: How to stripe a raw lvol - not mirrored

 
SOLVED
Go to solution
ConnieK
Regular Advisor

How to stripe a raw lvol - not mirrored

I am getting confused from the man pages and reviewing this site about how to stripe an unmirrored raw lvol.
I need to create a number of 8gb raw lvols across 4 EMC Clariion SAN disks.

I have already created the PV's and the VG's

Is the following sequence of steps correct?

1. vgextend /dev/vg_ora /dev/dsk/c3t3d0 /dev/dsk/c3t3d1 /dev/dsk/c3t3d2 /dev/dsk/c3t3d3

2. lvcreate -C y -n lvol1 -r N /dev/vg_ora

3. lvextend -L 8192 /dev/vg_ora/lvol1 /dev/dsk/c3t3d0 /dev/dsk/c3t3d1 /dev/dsk/c3t3d2 /dev/dsk/c3t3d3

Do these steps create the striped lvol across these 4 disks or must I change a flag somewhere in the lvcreate command?

Thanks for your help!
Independent by nature
15 REPLIES 15
Pete Randall
Outstanding Contributor

Re: How to stripe a raw lvol - not mirrored

Won't the EMC automatically stripe whatever is put on it?


Pete

Pete
Patrick Wallek
Honored Contributor

Re: How to stripe a raw lvol - not mirrored

To create a stripe you must use the '-i' and '-I' options to lvcreate.

I would combine steps 2 and 3.

lvcreate -C y -n lvol1 -r n -i 4 -I 128 /dev/vg_ora

The '-i' is the number of disks to stripe across, in your case 4. The '-I' is the size of the stripes. See the 'lvcreate' man page for more information on those options.

Torsten.
Acclaimed Contributor
Solution

Re: How to stripe a raw lvol - not mirrored

From the lvcreate man page:

Example-

Create a logical volume of size 90 MB striped across 3 disks with a stripe size of 64 KB:

lvcreate -L 90 -i 3 -I 64 /dev/vg03


-C contiguous

will not work with stripes.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Torsten.
Acclaimed Contributor

Re: How to stripe a raw lvol - not mirrored

same man page:

"The enforcement of a contiguous allocation policy using the -C y option is not supported on a striped logical volume."

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
ConnieK
Regular Advisor

Re: How to stripe a raw lvol - not mirrored

Pete - I assumed the EMC would do its own striping/distribution (at least that's my experience on an EVA and an XP), but these are my directions in this build.

So Patrick & Torsten - here'se the revised command:

lvextend -n lvol1 -r N -i 4 -l 128 /dev/vg_ora /dev/dsk/c3t3d0 /dev/dsk/c3t3d1 /dev/dsk/c3t3d2 /dev/dsk/c3t3d3.

This okay?

By the way... how do you determine the size of the stripe?
Independent by nature
Torsten.
Acclaimed Contributor

Re: How to stripe a raw lvol - not mirrored

Not okay:

lvextend â increase space, increase mirrors for LVM logical volume

SYNOPSIS

/usr/sbin/lvextend [-A autobackup] {-l le_number | -L lv_size | -m mirror_copies [-s]} lv_path [pv_path ... | pvg_name ...]


use lvcreate!

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Torsten.
Acclaimed Contributor

Re: How to stripe a raw lvol - not mirrored

Regarding the stripe size: please read the man page or at least the example I posted.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
ConnieK
Regular Advisor

Re: How to stripe a raw lvol - not mirrored

Torsten - You're right - meant to typ lvcreate with the rest of the stuff, but messed up. So, here is the correct one:

lvcreate -n lvol1 -r N -i 4 -l 128 /dev/vg_ora.

Then do the lvextend stuff.
Independent by nature
ConnieK
Regular Advisor

Re: How to stripe a raw lvol - not mirrored

I did read the man page for lvcreate - here's what it says:

-I stripe_size Set the size in kilobytes of the stripe. stripe_size should be a power of 2 in the range of 4 to 32768. -i and -I must be specified together.

This does not tell me how to determine the correct or best stripe size.

Sorry I'm ignorant.
Independent by nature
Torsten.
Acclaimed Contributor

Re: How to stripe a raw lvol - not mirrored

The lvextend stuff:

lvextend -L 8192 /dev/vg_ora/lvol1

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Torsten.
Acclaimed Contributor

Re: How to stripe a raw lvol - not mirrored

The man page tell you a correct formula for a correct stripe size, but it doesn't know what is the best size for you ... ;-))

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Ganesan R
Honored Contributor

Re: How to stripe a raw lvol - not mirrored

Hi All,

There are two types of striping available on HP-UX. One is Block based striping. For Block based striping you need to specify the no of slices/disks by using -i and the stripe size using -I along with -C. Use lvcreate and lvextend commands to create Block based striping. But note that Block based striping is not supported in conjunction with LVM mirroring.

The other one is extend based striping popularly known as Distributed allocation policy. It is supported with LVM mirroring. If you need to mirror then you also need to create physical volume groups(PVG). Use -D option to create extend based striping.

Hope this helps.

Best wishes,

Ganesh.
Patrick Wallek
Honored Contributor

Re: How to stripe a raw lvol - not mirrored

I see no reason to do your lvcreate and lvextend separately. You get no real benefit of doing them separately.

lvcreate -L 8192 -n lvol1 -r N -i 4 -l 128 /dev/vg_ora

(I forgot to put the '-L' in my earlier lvcreate).


The stripe size is entirely up to you and whatever is best for your environment. This is where testing before putting things into production comes into play.
Ganesan R
Honored Contributor

Re: How to stripe a raw lvol - not mirrored

I explain why we need to use lvcreate first then lvextend.

If you use lvcreate directly it will create the LV on first available disks on that VG.

Whereas if you want to create the LV on specific disks, then you will have to create the LV with 0 size using lvcreate and then extend it on specific disks by using lvextend.
Best wishes,

Ganesh.
ConnieK
Regular Advisor

Re: How to stripe a raw lvol - not mirrored

I thank all of you for your valuable input. Patrick had the first correct answer, I was looking for the -i and -I flags. Even though there was another question raised about the stripe size, which I don't think can be thoroughly answered other than "It depends on your environment", I was successful in creating all the raw volumes I needed. I am not sure that they are perfect in every way (meaning stripe size, distribution and efficiency), but at least they are done.
Independent by nature