Operating System - HP-UX
1830730 Members
2408 Online
110015 Solutions
New Discussion

Lvcreate Striping VS. Volume Groups

 
SOLVED
Go to solution
Bob Ferro
Regular Advisor

Lvcreate Striping VS. Volume Groups

Here's a simple question. Let's say that a volume group is made of of 3 physical volumes. When I create a logical volume, it will be allocated across the 3 volumes. Then why is lvcreate -i -I needed to strip if it seems to already be strip just by creating the VG with 3 PVs.
15 REPLIES 15
Pete Randall
Outstanding Contributor
Solution

Re: Lvcreate Striping VS. Volume Groups

From the lvcreate man page:

"If you omit the -l and -L options, the logical volume is created with zero length. This permits you to choose its physical volume location when you allocate logical extents with the lvextend command"

Even with 3 physical volumes, you can place your LV wherever you want within them.

That's why.


Pete

Pete
Bob Ferro
Regular Advisor

Re: Lvcreate Striping VS. Volume Groups

Let's say, I have 3 PV in one VG. I create a LV with a size of 1GB and I don't use the -i -I. Does the LV get allocated across the 3 PVs or just on the 1st PV starting at the beginning?
Steven E. Protter
Exalted Contributor

Re: Lvcreate Striping VS. Volume Groups

Shalom,

lvcreate without the space indicator creates an empty logical volume. lvextend is used to add space.

You may want to look into creating a distributed logical volume, lvcreate -D

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
Pete Randall
Outstanding Contributor

Re: Lvcreate Striping VS. Volume Groups

I believe you would have to use the -D switch to turn on distributed allocation.


Pete

Pete
Pete Randall
Outstanding Contributor

Re: Lvcreate Striping VS. Volume Groups

To expand on that, the extents will be allocated, up until the amount requested, from the first physical volume before going on to the next.


Pete

Pete
Court Campbell
Honored Contributor

Re: Lvcreate Striping VS. Volume Groups

Bob,

When you create and lvol that doesn't stripe extents you are basically creating a concatenated volume. So even though you have 3 disks you are not striping. You will basically write to the first disk until it's full, then the second, and so on. Creating an lvol that stripes extents will essentially write the data across all the disk in the volume group (That is somewhat misleading in that you choose how many disks). Anyway I hope that answers your question. Also volume groups do not stripe, they are more like a named container, ie, here is vg00 and it contains 3 disks.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Court Campbell
Honored Contributor

Re: Lvcreate Striping VS. Volume Groups

In reference to where the 1GB lvol would go. It would be created on the first pv defined in the volume. You could see this from doing a strings on /etc/lvmtab. But you could tell lvcreate which pv to create the lvol on.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Bob Ferro
Regular Advisor

Re: Lvcreate Striping VS. Volume Groups

To summarize:

If there are 3 PVs in 1 VG and you create a LV without the -i -I and specify a size (-L), then the LV is created on the 1st PV, then 2nd PV,etc.

If you use the -i -I, LVM manages the stripes across the 3 PVs.

If you don't use -i -I and don't specify a size, then use lvextend -L, then you control the stripes across the 3 PVs.

Court Campbell
Honored Contributor

Re: Lvcreate Striping VS. Volume Groups

> If you don't use -i -I and don't specify a size, then use lvextend -L, then you control the stripes across the 3 PVs.

To be blunt, that is not correct. If you do not use the -i during the lvcreate, you will not stripe extents. To put it simply if you want to stripe you have to use the -i option. You may want to read the man page for lvcreate. I will also mention that you have to supply a number for the -i option which tels how many disks to stripe across. So you could end up creating a stripe across only two of the disks in the volume group.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Bob Ferro
Regular Advisor

Re: Lvcreate Striping VS. Volume Groups

OK, I got it now. But this works when you have individual PVs created. Now let's say I'm using a VA7410 with a LUN of 20GB that is make up of 5 PVs. Then I create a VG of 20GB from this LUN. When I create the LV, do I need to specify the -i -I and what benefit does this give me?

P.S. THis is the best forum. I learn so much from you guys.
TTr
Honored Contributor

Re: Lvcreate Striping VS. Volume Groups

> VA7410 with a LUN of 20GB
The server sees ONE disk device (dual path-ed) and that is the LUN device. The server does not see the 5 array disks (don't call them PVs). The "-i -I" do not apply here, the array takes care of the striping.
Court Campbell
Honored Contributor

Re: Lvcreate Striping VS. Volume Groups

You are confusing disks in a disk array with pv's on hpux. When you create a lun of 5 disks, that is actually a single pv to hpux. So you may have striping on the disk array, but you are not striping extents across mutliple pv's. Here is a scenario where you stripe extents. Lets say you create 3 - 20GB luns on the VA. Even though they are made of multiple disks on the array they are actually just 3 seperate 20GB disks to HPUX. It knows nothing about the striping going on in the array. Now you create a vg that contains those 3 pv's. Now you want to stripe extents so you create an lvol using the switches -L 60000M -i 3 -I 32768. SO know you have an lvol that is roughly 60GB in size that is striping extents accross 3 disks and using a stripe size of 32Kb.

I also want to not that extent striping does not provide fault tolerance. It's the mechanisms in the VA that provide that.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Bob Ferro
Regular Advisor

Re: Lvcreate Striping VS. Volume Groups

So if I create 1 LUN device from any number of disk, I don't need to use -i -I on the lvcreate. What if I do use the -i -I, what happens?
Patrick Wallek
Honored Contributor

Re: Lvcreate Striping VS. Volume Groups

>>So if I create 1 LUN device from any number
>>of disk, I don't need to use -i -I on the
>>lvcreate. What if I do use the -i -I, what
>>happens?

You can't use '-i' and '-I' with a single disk / LUN. It won't do anything, and lcreate may not let you do it.

As said above, when you create a LUN on a disk array your HP-UX system sees only the LUN that was presented. HP-UX has absolutely NO IDEA how many disks make up the LUN. It doesn't need to know.

There is a situation where striping can come in handy.

Let's say you have a server with 2 fibre cards connected to a disk array. You can create 2 equally sized LUNs on the array. When you create the VG with those LUNs you have LUNa use fibre card A as its primary path and LUNb use fibre card B as its primary path.

Then when you create the LV you can stripe across both devices and have a poor mans load balancing.

Bob Ferro
Regular Advisor

Re: Lvcreate Striping VS. Volume Groups

Thanks a lot everyone. I now have a very deep understanding. You guys are the best.