Operating System - HP-UX
1834456 Members
3002 Online
110067 Solutions
New Discussion

Re: Problem striping 2 lvols

 
SOLVED
Go to solution
Ian Dennison_1
Honored Contributor

Problem striping 2 lvols

I am trying to stripe 2 lvols across 2 separate sets of disks in the same Volume Group. The first lvol fills up most of the first 5 disks, but the next attempt to create a striped lvol across the next 5 disks fails, saying not enough space.

I have looked at the options for lvcreate and vgcreate, and cannot find anything that will lend itself to solving this (short of manually lvextending in round robin fashion).

Any top tips out there? Cheers, Ian
Building a dumber user
11 REPLIES 11
James R. Ferguson
Acclaimed Contributor

Re: Problem striping 2 lvols

Hi Ian:

Are you using extent-based strips or "true" striping?

Either way, you will need an equal amount of space on all disks involved.

Please post your command and 'vgdisplay -v' output.

Regards!

...JRF...
Stefan Farrelly
Honored Contributor

Re: Problem striping 2 lvols


Well, you should be using PVG's and the -D distributed option (as its easier to group disks). If it says not enough space then it sounds like one set of disks is not the same total size as the other (check with lvdisplay/pvdispaly) OR you are trying to create and lvol too big for the disk sets. Aagin - check you arent trying to create a striped lvol too big or you have enough physical space.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Ian Dennison_1
Honored Contributor

Re: Problem striping 2 lvols

OK, have wiped the previous lv config and started allocating 4MB chunks round-robin as it takes ages.

sample code (figures are not exact; no points awarded for nit-picking)

lvcreate -L 32000 -i 5 -I 1024 /dev/vgTEMP

vgdisplay -v /dev/vgTEMP

/dev/dsk/c43t1d1 42 free
/dev/dsk/c43t1d2 42 free
/dev/dsk/c43t1d3 42 free
/dev/dsk/c43t1d4 42 free
/dev/dsk/c43t1d5 42 free
/dev/dsk/c43t1d6 1760 free
/dev/dsk/c43t1d7 1760 free
/dev/dsk/c43t2d0 1760 free
/dev/dsk/c43t2d1 1760 free
/dev/dsk/c43t2d2 1760 free

lvcreate -L 31000 -i 5 -I 1024 /dev/vgTEMP

Second lvcreate fails with an error message saying no space.

Have checked out PVGs but see no method of specifying these in the lvcreate command.

Am thinking the best solutions for 'true' striping is 1 vg per lvol striped set, or striping across every Disk in the VG.

Points for postings so far are coming soon. Ian
Building a dumber user
Stefan Farrelly
Honored Contributor

Re: Problem striping 2 lvols

The problem is when you create a striped lvol it always starts from the first disk in the lvol. So you create the first one only using half the disks (and almost fills them up) so when you try to create a 2nd striped lvol it again starts from the almost full disks (not the empty ones!). The only way to control this is;

1. do the lvextend manually (time consiming and not recommended) - this way you can specify exactly which disk to stripe on.

2. when you add your disks into your VG use the PVG option. Create 2 PVGs' for your VG - one with the disks you want for 1 striped lvol, the 2nd PVG with the other disk you want for the 2nd striped lvol. Then when you do the lvcreate -D command you can specify which PVG set to use for each striped lvol you want (one for each). Works a treat.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Ian Dennison_1
Honored Contributor

Re: Problem striping 2 lvols

James, I originally gave you 4 points for your posting - dang browser! Post something else and I will set it straight.

Ian
Building a dumber user
Ian Dennison_1
Honored Contributor

Re: Problem striping 2 lvols

Stefan,

Looked at the -D option on lvcreate, but it stated in my man page that this option is not support with the -i option, so I dismissed it. I also cannot see in the doco how the PVG is specified manually or selected by the System.

Or do I need to manually adjust the PVGs after the first allocation, to set a different set of disks into PVG 1 (which seems to be the default PVG).

Cheers, Ian

Building a dumber user
Sajid_1
Honored Contributor

Re: Problem striping 2 lvols

hello,

It look like you are trying to create the stripes again on the same disks. what you can do is create two PVGs and specify the names with lvcreate.

Read man lvcreate and read the last session - "Distributed Allocation Policy"
learn unix ..
Ian Dennison_1
Honored Contributor

Re: Problem striping 2 lvols

Sajid,

Distributed Allocation Policy is for striping with mirroring placed on distinctly different disks from the original lvol.

I am trying to stripe 2 different lvols on 2 different sets of disks within the same Volume Group.

Ian
Building a dumber user
James R. Ferguson
Acclaimed Contributor

Re: Problem striping 2 lvols

Hi Ian:

The '-D' option applies to extent-based striping. The granularity of extent-based striping is the size of a physical extent (4MB or larger) but you mimic true striping and you can add mirroring.

As already noted, the easiest way to setup Physical Volume Groups. You can do this *after* volume group creation by manually making the '/etc/lvmpvg' (see 'man 4 lvmpvg').

Distributed extents proceed in a round-robin allocation.

Regards!

...JRF...
Deshpande Prashant
Honored Contributor
Solution

Re: Problem striping 2 lvols

Hi
You can create the /etc/lvmpvg file manually with entries..
##
VG /dev/vg01
PVG PVG0
/dev/dsk/c2t0d0
/dev/dsk/c2t1d0
PVG PVG1
/dev/dsk/c3t0d0
/dev/dsk/c3t1d0
##
Then you can use lvcreate to create extent based stripping.
#lvcreate -D y -s g -L -n /dev/vg01

Thanks.
Prashant.
Take it as it comes.
Rajasekhar Raman
Frequent Advisor

Re: Problem striping 2 lvols

As someone suggested, created two Physical volume groups. You could do it by editing the /etc/lvmpvg file or at the time of creating the volume group or extending it. Check this example out. If there are 4 disks in the VG and you want each logical volume to be striped on two of them, then you would do the following:

vgcreate -g PVG1 /dev/vgxx /dev/dsk/c1t0d0 /dev/dsk/c2t0d0
vgextend -g PVG2 /dev/vgxx /dev/dsk/c1t1d0 /dev/dsk/c2t1d0

lvcreate -L 0 -i 2 -I 64 /dev/vgxx
lvextend -L /dev/vgxx/lvolx PVG1

Do the same for the 2nd logical volume

-Shekar