LVM extent size

Hi guys.

What is the LVM default extent size? is it changeable? is it different between distributions?:confused:

From the man page of vgcreate:

       -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.  The default is 4 MB and it must  be
              at least 1 KB and a power of 2.

              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.  However, if no extents need moving for  the  new  value  to
              apply, it can be altered using vgchange -s.
...

It can not even only be different on distributions but even for Volume Groups on the same machine, if people used different values.

All of that could be learned by reading the documentation. Default extent size is 4M, it's changeable, although with some caveats, and some distributions use other default values when creating a volume group in the installer.

Thank you very much.

The LVM docs haven't been fully updated from LVM1 to LVM2.

According to the official LVM howto, the default extent size is now 32M.

I can't post URLs yet, so here's a quote, search on it (in quotes) to get a confirmation:

>> You can also specify the extent size with this command if the default of 32MB is not suitable for you with the '-s' switch. In addition you can put some limits on the number of physical or logical volumes the volume can have.

Yes, one caveat to really concern yourself is the largest lv size allowable by your extent size.

And the maximum allowable pv size...

The information both of you are probably referring to is also no longer relevant for LVM2, lots of misinformation out there.

Again, sorry I can't enter URLs, but this is from IBM in 2007. Google on the literal phrase in quotes to confirm.

>With LVM2, there's no limit on the maximum numbers of extents per PV/LV.

<snip>

> there is no I/O performance penalty for smaller/bigger extent size. LVM tools usage, however, can suffer from high extent count, so using bigger extents can keep the extent count low.

---------

Note this source also gives the default as 4MB, which I believe is no longer true, as per my previous quote.

In some cases, I've seen people talk about multiple-GB-sized extents.

Personally I plan to use 1GB: 4096*256=1048576

This makes it easy to use extents directly as units in allocating space. Even 10 GB would only be 2% of the smallest drive I'm using, so wouldn't hamper flexibility, but IMO this seems a bit "out there".

==================

My main point in all this is that an "rtfm" response is inappropriate for this topic area; I have been unable to find canonical docs that directly address these issues, and there is a lot of conflicting information from what appears to be authoritative sources, even relatively recent ones.

It would be great if someone with access to some big drives would do some hands-on testing to check and post back here. Next time I have the chance I'll try to remember to do so. . .

---------- Post updated at 04:31 PM ---------- Previous update was at 07:36 AM ----------

I've posted to the linux-LVM mailing list, frequented by Neil Brown and the other LVM maintainers, in order to get more "canonical" information on these issues

Here's my attempt to bypass the URL blocking feature of this board:

http - fossplanet.com

f13/%5Blinux-lvm%5D-configuring-extent-size-83253/

If that doesn't work for you, google on

"apparently authoritative but conflicting information"

If given multiple list archive servers, I recommend fossplanet.com

The subject header is: [linux-lvm] Configuring extent size