7

Today in class we are learning about logical volume management and I'm trying to find out what the actual purpose of physical extents are.

I know what they are defined as and I understand how to do the simple math in order to set them up according to specifications.

What I'd like to understand is for what purpose are physical extents set at different sizes? What is the benefit of having an 4MiB physical extent in the volume group versus a 14MiB?

Are there types of files that require larger or smaller physical extent size and if so why?

Thank you for any insight!

Melody
  • 223

2 Answers2

5

A single physical extent is the smallest unit of disk space that can be individually managed by LVM. So the extent size will determine the "granularity" of your disk space allocation.

The extent size is set when you create a VG, and all the physical volumes in a single VG will use the same extent size. Changing the extent size once the VG is in use will be difficult, so you should think about any special requirements the VG might have regarding the extent size at VG creation time.

If the available disk space is equal, using smaller extents will allow more fine-grained allocation if you need it, but conversely you may need more space for the metadata required to manage those extents. With basic LVs this is usually a non-issue, but might be important if you use LVM snapshots, thin volumes or other advanced functionality.

If you plan to have a multi-terabyte logical volume, you're unlikely to need to micromanage its size in increments of 1 Mb, so using a larger extent size can be beneficial as e.g. the snapshot metadata can be smaller.

If your disks have data alignment requirements, the PE size should ideally be an exact multiple of whatever the alignment requirement is, so you won't need to worry about performance issues caused by misalignment. Since the PE sizes are power-of-2 values anyway (just like common alignment requirements are), this is not usually an issue, unless you have e.g. SSDs with an unusual erase block size.

telcoM
  • 96,466
-1

Following is just some basic info.

Size of PE defines the size of PV because in LVM 1.0, maximum number of PE per PV is only 65535. It is increased to 16777216 in LVM 2.0/2.1

Let's use LVM 1.0 as an example, if you specify PE size of 1Mb then the maximum size of PV is only 64Gb (the maximum size of a PE is 256Mb).

Size of PE also defines the minimum size changes of a PV, if PE is 4Mb then you can't increase/reduce a PV by 2Mb, well what happens is that LVM will round up to the size of PE.

here is a list of LVM limitations http://docstore.mik.ua/manuals/hp-ux/en/5992-4589/apa.html

Thanks