# LVM: Physical Extent size (SOLVED)

## luca

Hi All

I would like to use LVM to manage my disk space. There is one option that I don't understand. It is the Physical extent size, which I think can be set with the tool lvcreate; --LogicalExtentsNumber

So, default is 4MB. But I assume it depends on the situation what size one should choose.

Can someone help me out here, and advice me ?

Thanks a lot

LuCaLast edited by luca on Tue Jul 18, 2006 3:36 pm; edited 1 time in total

----------

## Raffi

lvcreate does not have a --LogicalExtentsNumber option. I does have a --extends LogicalExtentsNumber option which is used to specify the size of logical partition in extens. You may find it easier to use the --size option and simply specify the size you want.

----------

## luca

you're right!. But how do I determine the perfect size ?

----------

## Raffi

This is the size of the partition. How big do you want it? What I have done on a 200G drive is set it up so that I have a partition that is about 60% full with my data on it. As it gets close to 100%, I just use lvextend to grow it. I currently have about 24G unallocated that I can use where or when I need it.

----------

## luca

I think what you mean is: -L, --size LogicalVolumeSize 

I need to know the size of PE (physical extents), and as far as I understand this is something different than the LV (Logical Volume) size

LuCa

Update:  definition: A physical volume is divided into a number of basic units called as  Physical Extents (PE)

----------

## Raffi

Two sides of the same coin. You can specify the size of the partition in extens or by bytes. Use the one you are most comfortable with.

----------

## luca

The problem is solved, I understand the meaning of PE:

```
       -s, --physicalextentsize PhysicalExtentSize[kKmMgGtT]

              Sets  the physical extent size on physical volumes of this volume group.  A size suffix (k for kilobytes up to

              t for terabytes) is optional, megabytes is the default if no suffix is present.  Values can be from 8 KB to 16

              GB  in  powers of 2.  The default is 4 MB.  Once this value has been set, it is difficult to change it without

              recreating the volume group which would involve backing up and restoring data on any logical volumes.  If  the

              volume  group  metadata  uses  lvm1  format,  there is a limit of 65534 extents in each logical volume, so the

              default of 4 MB leads to a maximum logical volume size of around 256GB.  If the  volume  group  metadata  uses

              lvm2  format  there is no such restriction, although having a large number of extents will slow down the tools

              but have no impact on I/O performance to the logical volume.  The 2.4 kernel has a limitation of 2TB per block

              device.

```

So the PE size is only important when using LVM1, because a PE of size 4M means you can have a LV with a maximum size of 256GB!!!

Thnx

LuCa

----------

