1834593 Members
4195 Online
110069 Solutions
New Discussion

lvm and striping

 
Brian_161
Occasional Advisor

lvm and striping

Hi,
I come from a Sun background and I am very familiar with VxVM. In Volum Manager I can tell it what disks I want my stripe to be made from.

I would like to know how I can use LVM to create a stripe across 4 specific pv's. I don't see any option that actually allows me to pick the disks I want to lay my stripe across.

Any help would be appreciated.

Thanks in advance,

Brian
8 REPLIES 8
James R. Ferguson
Acclaimed Contributor

Re: lvm and striping

Hi Brian:

Striping and mirroring are not supported with LVM. You must use 'extent-based mirror stripes'. See the man pages for 'lvcreate' for more information.

Regards!

...JRF...
Sridhar Bhaskarla
Honored Contributor

Re: lvm and striping

Hi Brian,

-i for number of stripes
-I stripe size

You can use disks with lvextend command to stripe a logical volume.

Example:

#lvcreate -n mylvol -i 4 -I 128 vg01
#lvextend -L 500 /dev/vg01/mylvol /dev/dsk/c1t0d0 /dev/dsk/c1t0d1 /dev/dsk/c1t0d2 /dev/dsk/c1t0d3
#newfs -F vxfs /dev/vg01/rmyvol

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: lvm and striping

Hi (Again),

I would have added...

The above will create an lvol "mylvol" in the volume group "vg01" with a stripe size of 128K spanning across four disks viz., c1t0d0, c1t0d1, c1t0d2 and c1t0d3.

-Sri

PS: Welcome to forums.
You may be disappointed if you fail, but you are doomed if you don't try
James R. Ferguson
Acclaimed Contributor

Re: lvm and striping

Hi (again) Brian:

I read the question as *striping and mirroring* and hence my answer that LVM doesnt't support that combination except in the form of 'extent-based=stripes'. VxVM does, of course.

Sri's answer is the one you want.

Regards!

...JRF...
Helen French
Honored Contributor

Re: lvm and striping

You can use the -i and -I options with lvcreate to do this task. The striped LVs will be allocated using strict or PVG strict policy. You cannot have both mirroring and striping at the same time in LVM (I think that's what JRF meant above).

Refer chapter 8 in this document for more detail:
http://www.docs.hp.com/hpux/onlinedocs/B2355-90672/B2355-90672.html
Life is a promise, fulfill it!
Brian_161
Occasional Advisor

Re: lvm and striping

Wow,

Thanks for the quick/great responses.

I have another question regarding sri's answer:

So the initial lvcreate just creates a structure but doesn't actually allocate any storage and the extend allocates the storage for the stripe? Or does it do the stripe any way it wants and then I extend it with the pv's that are specified on the lvextend command?

Sorry for my confusion...

Brian
Sridhar Bhaskarla
Honored Contributor

Re: lvm and striping

Hi Brian,

It creates a logical volume of 0 size with all the properties we mentioned. Before extending it if you do a "lvdisplay /dev/vg01/mylvol", you would see the output.

It will not touch any disks until you extend it.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
James R. Ferguson
Acclaimed Contributor

Re: lvm and striping

Hi Brian:

If you look at the 'lvcreaete' syntax there is no provision for specifying the pv_path(s).

Hence, Sri created a zero-size logical volume with 'lvcreate' and then leveraged the ability of 'lvextend' to increase the size (from zero), *and* specify the pv_paths he wanted.

Regards!

...JRF...