# LVM2 lvcreate issue [solved]

## ReD-BaRoN

I'm not quite sure what I'm doing wrong here. I have 3 physical drives, and therefore I'm trying to create a logical volume with 3 stripes, using a stripe size of 4k. Getting an insufficient extents error returned. Any ideas?

```
# vgdisplay

  --- Volume group ---

  VG Name               vg

  System ID

  Format                lvm2

  Metadata Areas        3

  Metadata Sequence No  3

  VG Access             read/write

  VG Status             resizable

  MAX LV                0

  Cur LV                0

  Open LV               0

  Max PV                0

  Cur PV                3

  Act PV                3

  VG Size               1.00 TiB

  PE Size               4.00 MiB

  Total PE              262326

  Alloc PE / Size       0 / 0

  Free  PE / Size       262326 / 1.00 TiB

  VG UUID               gNTxfR-X0J7-bwYi-XNE2-cGU1-5tKk-h1jKpQ

 

# lvcreate -i3 -I4 -l100%FREE -nlvm vg

  Insufficient suitable allocatable extents for logical volume lvm: 47688 more required

#

```

Last edited by ReD-BaRoN on Thu Jan 07, 2010 8:24 pm; edited 1 time in total

----------

## cach0rr0

how did you invoke the 'vgcreate' ? 

I notice that's a 1TB VG

 *http://www.gentoo.org/doc/en/articles/lvm-p2.xml wrote:*   

> 
> 
> The vgcreate command did a couple of things. In addition to creating the "main" volume group, it also set up /dev/hda5 to use 4 MB extents, the default extent size. This means that any logical volumes I create from this volume group can be expanded and shrunk in 4 MB increments.
> 
> Due to kernel limitations, the extent size determines the maximum size that a logical volume can be. As you can see from the above output, a 4 MB extent size imposes a logical volume size limitation of 256 gigabytes, which is an easily attainable logical volume size if you're adding several high-capacity drives to your volume group. If your volumes could end up being greater than 256 GB apiece, I recommend specifying a larger extent size at vgcreate time. Extents can range anywhere from 8 KB to 512 MB, and must always be a multiple of two. By increasing the extent size above 4 MB, the maximum physical volume size will be scaled accordingly, up to a maximum of 1 petabyte (although the current real-world size limit is 2 terabytes on x86 systems).
> ...

 

I say this not knowing at all what the symptoms would be of using insufficiently large extents, so that's admittedly just an educated guess as to what's wrong.

----------

## ReD-BaRoN

Thanks for pointing that out.

I created the VG using the "default" vgcreate command via http://www.gentoo.org/doc/en/lvm2.xml, which is dated 2/2009.

```
# vgcreate /dev/sda1 /dev/sdb1 /dev/sdc1
```

The link you reference is from 2006, and likely outdated at this point.

This interesting thing is that I am successful at creating a non-stripped LV, as shown below.

```
# lvcreate -l100%FREE -nlvm vg

  Logical volume "lvm" created

# lvdisplay

  --- Logical volume ---

  LV Name                /dev/vg/lvm

  VG Name                vg

  LV UUID                ICvH6I-gjUg-T4PY-9pvw-ye9M-j40G-Epv58g

  LV Write Access        read/write

  LV Status              available

  # open                 0

  LV Size                1.00 TiB

  Current LE             262326

  Segments               3

  Allocation             inherit

  Read ahead sectors     auto

  - currently set to     256

  Block device           254:0

   

# 
```

The problem only seems to appear when trying to stripe.

I'll see if I can figure where to post this issue upstream, since it's likely a LVM issue and not a Gentoo issue.

----------

## ReD-BaRoN

Problem is that the total VG size is not comprised of 3 same size disks, and therefore I can't stripe evenly across the 3 drives using the entire VG size. I'd have to reduce the LV to 3 times the smallest drive to work.

----------

