C.3. Region operations

C.3.1. Creating LVM regions

You create LVM regions from the freespace in LVM containers. If there is at least one extent of freespace in the container, you can create a new region.

The following options are available for creating LVM regions:

name

The name of the new region.

extents

The number of extents to allocate to the new region. A new region must have at least one extent and no more than the total available free extents in the container, or 65534 (whichever is smaller). If you use the extents option, the appropriate value for the size option is automatically calculated. By default, a new region uses all available extents in the container.

size

The size of the new region. This size must be a multiple of the container's PE size. If you use the size option, the appropriate value for the extents options is automatically calculated. By default, a new region uses all available freespace in the container.

stripes

If the container consumes two or more objects, and each object has unallocated extents, then the new region can be striped across multiple objects. This is similar to RAID-0 striping and achieves an increased amount of I/O throughput across multiple objects. This option specifies how many objects the new region should be striped across. By default, new regions are not striped, and this value is set to 1.

stripe_size

The granularity of striping. The default value is 16 KB. Use this option only if the stripes option is greater than 1.

contiguous

This option specifies that the new region must be allocated on a single object, and that the extents on that object must be physically contiguous. By default, this is set to false, which allows regions to span objects. This option cannot be used if the stripes option is greater than 1.

pv_names

A list of names of the objects the new region should map to. By default, this list is empty, which means all available objects will be used to allocate space to the new region.

C.3.2. Expanding LVM regions

You can expand an existing LVM region if there are unused extents in the container. If a region is striped, you can expand it only by using free space on the objects it is striped across. If a region was created with the contiguous option, you can only expand it if there is physically contiguous space following the currently allocated space.

The following options are available for expanding LVM regions:

add_extents

The number of extents to add to the region. If you specify this option, the appropriate value for the add_size option is automatically calculated. By default, the region will expand to use all free extents in the container.

add_size

The amount of space to add to the region. If you specify this option, the appropriate value for the add_extents option is automatically calculated. By default, the region will expand to use all freespace in the container.

pv_names

A list of names of the objects to allocate the additional space from. By default, this list is empty, which means all available objects will be used to allocate new space to the region.

C.3.3. Shrinking LVM regions

You can shrink an existing LVM region by removing extents from the end of the region. Regions must have at least one extent, so regions cannot be shrunk to zero.

The following options are available when shrinking LVM regions. Because regions are always shrunk by removing space from the end of the region, a list of objects cannot be specified in this command.

remove_extents

The number of extents to remove from the region. If you specify this option, the appropriate value for the remove_size option is automatically calculated. By default, one extent is removed from the region.

remove_size

The amount of space to shrink the region by. If you specify this option, the appropriate value for the remove_extents option is automatically calculated.

C.3.4. Deleting LVM regions

You can delete an existing LVM region as long as it is not currently a compatibility volume, an EVMS volume, or consumed by another EVMS plug-in. No options are available for deleting LVM regions.

C.3.5. Moving LVM regions

The LVM plug-in lets you change the logical-to-physical mapping for an LVM region and move the necessary data in the process. This capability is most useful if a PV needs to be removed from a container. There are currently two LVM plug-in functions for moving regions: move_pv and move_extent.

C.3.5.1. move_pv

When a PV needs to be removed from a container, all PEs on that PV that are allocated to regions must be moved to other PVs. The move_pv command lets you move PEs to other PVs. move_pv is targeted at the LVM container and the desired PV is used as the selected object. The following options are available:

target_pvs

By default, all remaining PVs in the container are used to find available extents to move the PEs. You can specify a subset of the PVs with this option.

maintain_stripes

When the target PV contains striped regions, there are three choices for handling moving extents that belong to those regions:

no

Don't bother to maintain true striping. This choice allows extents to be moved to PVs that the region already uses for other stripes. This means that the performance will not be as optimal as it is with true striping, but allows the most flexibility in performing the move operation. This choice is the default for the maintain_stripes option.

loose

Ensure that moved extents do not end up on any PVs that the striped region already uses. However, this does not ensure that all moved extents end up on the same PV. For example, a region with three stripes may end up mapping to four or more PVs.

strict

Ensure that all moved extents end up on the same PV, thus ensuring true striping with the same number of PVs that the striped region originally used. This is the most restricted choice, and may prevent the move_pv operation from proceeding (depending on the particular configuration of the container).

If the target PV has no striped regions, the maintain_stripes option is ignored.

C.3.5.2. move_extent

In addition to moving all the extents from one PV, the LVM plug-in provides the ability to move single extents. This allows a fine-grain tuning of the allocation of extents. This command is targeted at the region owning the extent to move. There are three required options for the move_extent command:

le

The number of the logical extent to move. LE numbers start at 0.

pv

The target object to move the extent to.

pe

The target physical extent on the target object. PE numbers also start at 0.

To determine the source LE and target PE, it is often helpful to view the extended information about the region and container in question. The following are command-line options that can be used to gather this information:

To view the map of LEs in the region, enter this command:

query:ei,<region_name>,Extents

To view the list of PVs in the container, enter this command:

query:ei,<container_name>,Current_PVs

To view the current PE map for the desired target PV, enter this command:

query:ei,<container_name>,PEMapPV#

# is the number of the target PV in the container.

This information is also easily obtainable in the GUI and Text-Mode UIs by using the "Display Details" item in the context-popup menus for the desired region and container.

C.3.6. Renaming LVM regions

You can rename an existing LVM region. In the EVMS GUI and text-mode UIs, this is done using the modify properties command, which is available through the "Actions" menu or the context-sensitive pop-up menus. In the EVMS CLI, this is done using the set command.

If the renamed LVM region has a compatibility volume on it, then the name of that compatibility volume will also change. In order for this to work correctly, that volume must be unmounted before the name is changed. Also, be sure to update your /etc/fstab file if the volume is listed, or the volume won't be mounted properly the next time the system boots.

If the renamed LVM region has an EVMS volume or another storage object built on it, then the region's name change will be transparent to the upper layers. In this case, the rename can be done while the volume is mounted.