0

in LVM1 there was a limit of 65k extends. So size of extent had to been chosen carefully between wasted space on partitions (to big extent) and maximal possible size of logical volume (too small extent). in lvm2 (according to http://docstore.mik.ua/manuals/hp-ux/en/5992-4589/apa.html) the limit is ~16 million extents. so the default size of 4mb gives ~60TB of LV size.

so is there any point in making the extent larger than 4-16mb on a desktop? is there any performance degradation or other costs of having big number of extents?

0

From the vgcreate(8) man page:

If the volume group metadata uses lvm1 format, extents can vary in size from 8KiB to 16GiB and there is a limit of 65534 extents in each logical volume. The default of 4 MiB leads to a maximum logical volume size of around 256GiB.

If the volume group metadata uses lvm2 format those restrictions do not apply, but having a large number of extents will slow down the tools but have no impact on I/O performance to the logical volume. The smallest PE is 1KiB.

So there's no performance degradation for I/O if you have many extents. Reading or writing take the same time independent of the extents size. Though it should probably be at least 4KiB so there are no issues with hard-disks using Advanced Format.

On the other hand tools like pvmove will have to deal with more extents so there might be tiny slowdown. Though for a home user, a delay of probably 5 seconds shouldn't be a big deal.

A reason for using large extents might be that they make the logical volumes less prone to fragmentation in time after moving and resizing them several times. For example if the PE is small, a PV containing LVs o and x could look this:

xoooxxooxooxxxxxxxxxxxxoxxxxoxxxxxxoxooxxoxxoxxxxooxxxooxxoo

But if the PE is large, it could look more like this:

ooooxxxxxxxxxxxxxxxxxxxxxxxxooooxxxxxxxxooooooooxxxxxxxxoooo

Of course there's nothing stopping you from choosing manually what PEs are allocated to what LVs, but I think a lot of people prefer using LVM's default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.