LDP/LDP/guide/docbook/EVMSUG/appx-lvm2.xml

257 lines
12 KiB
XML

<appendix id="appxlvm2"><title>The LVM2 plug-in</title>
<para>The LVM2 plug-in provides compatibility with the new volume format
introduced by the LVM2 tools from Red Hat (previously Sistina).
This plug-in is very similar in functionality to the LVM plug-in. The primary
difference is the new, improved metadata format.
LVM2 is still based on the concept of volume groups (VGs), which are constructed
from physical volumes (PVs) and produce logical volumes (LVs).</para>
<para>Just like the LVM plug-in, the LVM2 plug-in represents volume groups as EVMS containers
and represents logical volumes as EVMS regions.
LVM2 containers combine storage objects (disks, segments, or other regions) to
create a pool of freespace. Regions are then created from this freespace, with a variety
of mappings to the consumed objects.</para>
<sect1 id="contops"><title>Container operations</title>
<sect2><title>Creating LVM2 containers</title>
<para>Containers are created with an initial set of objects.
These objects can be disks, segments, or regions. There are two options
available when creating an LVM2 container:</para>
<para><variablelist>
<varlistentry><term>name</term>
<listitem><para>The name of the new container.
</para></listitem>
</varlistentry>
<varlistentry><term>extent_size</term>
<listitem><para>The physical-extent (PE) size, which is the granularity with which regions
can be created. The default is 32 MB. Unlike the LVM1 plug-in, there is no
limitation to the number of extents that can be allocated to an LVM2 region.
</para></listitem>
</varlistentry>
</variablelist></para>
</sect2>
<sect2><title>Adding objects to LVM2 containers</title>
<para>You can add objects to existing LVM containers in order to increase
the pool of storage that is available for creating regions.
Because the name and extent-size are set when the container is created,
no options are available when you add new objects to a container.
Each object must be large enough to hold at least one physical extent.
If an object is not large enough to satisfy this requirement, the LVM2 plug-in
will not allow the object to be added to the container.</para>
</sect2>
<sect2><title>Removing objects from LVM2 containers</title>
<para>You can remove a consumed object from its container as long as no regions
are mapped to that object.
The LVM2 plug-in does not allow objects that are in use to be removed from their
container. If an object must be removed, you can delete or shrink regions, or
move extents, in order to free the object from use.</para>
<para>No options are available for removing objects from LVM containers.</para>
</sect2>
<sect2><title>Expanding consumed objects in LVM2 containers</title>
<para>In addition to adding new objects to an LVM2 container, you can also expand
the space in a container by expanding one of the existing consumed objects (PVs).
For example, if a PV is a disk-segment with freespace immediately following it on
the disk, you can expand that segment, which will increase the amount of freespace
in the container. Likewise, if a PV is a RAID-0 or RAID-5 region, you can expand
that region by adding additional objects, which in turn increases the freespace in the
container.</para>
<para>When using the GUI or text-mode UIs, PV-expand is performed by expanding
the container. If any of the existing PVs are expandable, they will appear in the
expand-points list. Choose the PV to expand, and then the options for expanding
that object. After the PV has expanded, the container's freespace will reflect the
additional space available on that PV.</para>
<para>When using the CLI, PV-expand is performed by expanding the appropriate object
directly. The CLI and the EVMS engine will route the necessary commands so the
container is expanded at the same time.</para>
<para>The options for expanding a PV are dependent on the plug-in that owns that PV object.
Please see the appropriate plug-in's appendix for more details on options for that object.</para>
</sect2>
<sect2><title>Shrinking consumed objects in LVM2 containers</title>
<para>
In addition to removing existing objects from an LVM2 container, you can
also reduce the size of a container by shrinking one of the existing
consumed objects (PVs). This is only allowed if the consumed object
has physical extents (PEs) at the end of the object that are not allocated
to any LVM2 regions. In this case, LVM2 will allow the object to
shrink by the number of unused PEs at the end of that object.
</para>
<para>
For example, if a PV is a desk-segment, you can shrink that segment,
which will decrease the amount of freespace in the container. Likewise,
if a PV is a RAID-0 or RAID-5 region, you can shrink that region by
removing one of the objects, which in turn decreases the freespace in
the container.
</para>
<para>
When using the GUI or text-mode UIs, PV-shrink is performed by shrinking
the container. If any of the existing PVs are shrinkable, they will
appear in the shrink-points list. Choose the PV to shrink, and then the
options for shrinking that object. After the PV has shrunk, the container's
freespace will reflect the reduced space available on that PV.
</para>
<para>
When using the CLI, PV-shrink is performed by shrinking the appropriate
object directly. The CLI and the EVMS engine will route the necessary
commands so the container is shrunk at the same time.
</para>
<para>
The options for shrinking a PV are dependent on the plug-in that owns
that PV object. Please see the appropriate plug-in's appendix for more
details on options for that object.
</para>
</sect2>
<sect2><title>Deleting LVM2 containers</title>
<para>You can delete a container as long as the container does not have any produced
regions.
The LVM2 plug-in does not allow containers to be deleted if they have any regions.
No options are available for deleting LVM2 containers.</para>
</sect2>
<sect2><title>Renaming LVM2 containers</title>
<para>You can rename an existing LVM2 container.
When renaming an LVM2 container,
all of the regions produced from that container will automatically have their names changed as
well, because the region names include the container name.
In the EVMS GUI and text-mode UIs, this is done using the
<command>modify properties</command> command,
which is available through the &quot;Actions&quot; menu or the context-sensitive pop-up menus.
In the EVMS CLI, this is done using the <command>set </command>command.</para>
<para>See <xref linkend="renamereg2"></xref> for more information about the effects of renaming the regions.</para>
</sect2>
</sect1>
<sect1 id="regionops"><title>Region operations</title>
<sect2><title>Creating LVM2 regions</title>
<para>You create LVM2 regions from the freespace in LVM2 containers.
If there is at least one extent of freespace in the container, you can create a new region.</para>
<para>The following options are available for creating LVM2 regions:</para>
<variablelist>
<varlistentry><term>name</term>
<listitem>
<para>The name of the new region.</para>
</listitem>
</varlistentry>
<varlistentry><term>size</term>
<listitem>
<para>The size of the new region. This size must be a multiple of the
container's extent-size. If it isn't, the size will be rounded down as appropriate.
By default, all of the available freespace in the container will be used for the new region.</para>
</listitem>
</varlistentry>
<varlistentry><term>stripes</term>
<listitem>
<para>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. 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.</para>
</listitem>
</varlistentry>
<varlistentry><term>stripe_size</term>
<listitem>
<para>The granularity of striping. The default value is 64 KB. Use this option only if the
stripes option is greater than 1.</para>
</listitem>
</varlistentry>
<varlistentry><term>pvs</term>
<listitem>
<para>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.</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
<sect2><title>Expanding LVM2 regions</title>
<para>You can expand an existing LVM region if there are any unused extents in the
container. The following options are available for expanding LVM regions.</para>
<variablelist>
<varlistentry><term>size</term>
<listitem><para>The amount of space to add to the region. This is a delta-size,
not the new absolute size of the region. As with creating new regions,
this size must be a multiple of the container's extent-size, and will be rounded
down if necessary.</para>
</listitem>
</varlistentry>
<varlistentry><term>stripes</term>
<listitem><para>The number of objects to stripe this new portion of the region across.
This value can be different than the number of stripes in the existing region.
For example, if the region was created originally with three stripes, but now only
two objects are available, then the new portion of the region could be striped
across just those two objects. The number of stripes for the last mapping in the
region will be used as the default.</para>
</listitem>
</varlistentry>
<varlistentry><term>stripe_size</term>
<listitem><para>The granularity of striping. As with the number of stripes, this value
can be different than the stripe-size for the existing region. By default, the
stripe-size of the last mapping in the region is used.</para>
</listitem>
</varlistentry>
<varlistentry><term>pvs</term>
<listitem><para>A list of names of the objects the region should be expanded onto.
By default, this list is empty, which means all available objects will be used to
allocate additional space for the region.</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
<sect2><title>Shrinking LVM2 regions</title>
<para>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.</para>
<para>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.</para>
<variablelist>
<varlistentry><term>size</term>
<listitem><para>The amount of space to remove from the region.
This is a delta-size, not the new absolute size of the region.
As with creating and expanding regions, this size must be a multiple of
the container's extent-size, and will be rounded down if necessary.</para>
</listitem></varlistentry>
</variablelist>
</sect2>
<sect2><title>Deleting LVM2 regions</title>
<para>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.</para>
</sect2>
<sect2 id="renamereg2"><title>Renaming LVM2 regions</title>
<para>You can rename an existing LVM2 region. In the EVMS GUI and text-mode UIs, this
is done using the <command>modify properties</command> command, which is available through the &quot;Actions&quot;
menu or the context-sensitive pop-up menus. In the EVMS CLI, this is done using the
<command>set</command> command.</para>
<para>If the renamed LVM2 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
<filename>/etc/fstab</filename> file if the volume is listed, or the volume won't be mounted properly the next
time the system boots.</para>
<para>If the renamed LVM2 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.</para>
</sect2>
</sect1>
</appendix>