old-www/LDP/EVMSUG/html/x4759.html

590 lines
12 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Region operations</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="EVMS User Guide"
HREF="index.html"><LINK
REL="UP"
TITLE="The LVM plug-in"
HREF="appxlvm.html"><LINK
REL="PREVIOUS"
TITLE="Container operations"
HREF="containerops.html"><LINK
REL="NEXT"
TITLE="The LVM2 plug-in"
HREF="appxlvm2.html"></HEAD
><BODY
CLASS="sect1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>EVMS User Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="containerops.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Appendix C. The LVM plug-in</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="appxlvm2.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="AEN4759"
></A
>C.3. Region operations</H1
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN4761"
></A
>C.3.1. Creating LVM regions</H2
><P
>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.</P
><P
>The following options are available for creating LVM regions:</P
><P
></P
><DIV
CLASS="variablelist"
><DL
><DT
>name</DT
><DD
><P
>The name of the new region.</P
></DD
><DT
>extents</DT
><DD
><P
>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 <TT
CLASS="filename"
>extents</TT
> option, the appropriate value
for the size option is automatically calculated. By default, a new region uses all
available extents in the container.</P
></DD
><DT
>size</DT
><DD
><P
>The size of the new region. This size must be a multiple of the
container's PE size. If you use the <TT
CLASS="filename"
>size</TT
> option, the appropriate value for the
extents options is automatically calculated. By default, a new region uses all
available freespace in the container.</P
></DD
><DT
>stripes</DT
><DD
><P
>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.</P
></DD
><DT
>stripe_size</DT
><DD
><P
>The granularity of striping. The default value is 16 KB. Use this option
only if the <TT
CLASS="filename"
>stripes</TT
> option is greater than 1.</P
></DD
><DT
>contiguous</DT
><DD
><P
>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 <TT
CLASS="filename"
>stripes</TT
> option is greater than 1.</P
></DD
><DT
>pv_names</DT
><DD
><P
>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.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN4798"
></A
>C.3.2. Expanding LVM regions</H2
><P
>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.</P
><P
>The following options are available for expanding LVM regions:</P
><P
></P
><DIV
CLASS="variablelist"
><DL
><DT
>add_extents</DT
><DD
><P
>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.</P
></DD
><DT
>add_size</DT
><DD
><P
>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.</P
></DD
><DT
>pv_names</DT
><DD
><P
>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.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN4815"
></A
>C.3.3. Shrinking LVM regions</H2
><P
>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.</P
><P
>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.</P
><P
></P
><DIV
CLASS="variablelist"
><DL
><DT
>remove_extents</DT
><DD
><P
>The number of extents to remove from the region. If you specify this option,
the appropriate value for the <TT
CLASS="filename"
>remove_size</TT
> option is automatically calculated. By
default, one extent is removed from the region.</P
></DD
><DT
>remove_size</DT
><DD
><P
>The amount of space to shrink the region by. If you specify this option,
the appropriate value for the <TT
CLASS="filename"
>remove_extents</TT
> option is automatically calculated.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN4830"
></A
>C.3.4. Deleting LVM regions</H2
><P
>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.</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN4833"
></A
>C.3.5. Moving LVM regions</H2
><P
>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:
<B
CLASS="command"
>move_pv</B
> and <B
CLASS="command"
>move_extent</B
>.</P
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="AEN4838"
></A
>C.3.5.1. move_pv</H3
><P
>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 <B
CLASS="command"
>move_pv</B
> command lets you move PEs to other PVs.
<B
CLASS="command"
>move_pv</B
> is targeted at the LVM container and the desired PV is used as
the selected object. The following options are available:</P
><P
></P
><DIV
CLASS="variablelist"
><DL
><DT
>target_pvs</DT
><DD
><P
>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.</P
></DD
><DT
>maintain_stripes</DT
><DD
><P
>When the target PV contains striped regions, there are three choices
for handling moving extents that belong to those regions:</P
><P
></P
><DIV
CLASS="variablelist"
><DL
><DT
>no</DT
><DD
><P
>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 <B
CLASS="command"
>maintain_stripes</B
> option.</P
></DD
><DT
>loose</DT
><DD
><P
>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.</P
></DD
><DT
>strict</DT
><DD
><P
>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 <B
CLASS="command"
>move_pv</B
> operation from
proceeding (depending on the particular configuration of the container).</P
></DD
></DL
></DIV
><P
>If the target PV has no striped regions, the <B
CLASS="command"
>maintain_stripes</B
> option is ignored.</P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="AEN4869"
></A
>C.3.5.2. move_extent</H3
><P
>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 <B
CLASS="command"
>move_extent</B
> command:</P
><P
></P
><DIV
CLASS="variablelist"
><DL
><DT
>le</DT
><DD
><P
>The number of the logical extent to move. LE numbers start at 0.</P
></DD
><DT
>pv</DT
><DD
><P
>The target object to move the extent to.</P
></DD
><DT
>pe</DT
><DD
><P
>The target physical extent on the target object. PE numbers
also start at 0.</P
></DD
></DL
></DIV
><P
>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:</P
><P
>To view the map of LEs in the region, enter this command:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>query:ei,&#60;region_name&#62;,Extents</PRE
></FONT
></TD
></TR
></TABLE
><P
>To view the list of PVs in the container, enter this command:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>query:ei,&#60;container_name&#62;,Current_PVs</PRE
></FONT
></TD
></TR
></TABLE
><P
>To view the current PE map for the desired target PV, enter this command:</P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="programlisting"
>query:ei,&#60;container_name&#62;,PEMapPV#</PRE
></FONT
></TD
></TR
></TABLE
><P
># is the number of the target PV in the container.</P
><P
>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.</P
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="renamereg"
></A
>C.3.6. Renaming LVM regions</H2
><P
>You can rename an existing LVM region. In the EVMS GUI and text-mode UIs, this
is done using the <B
CLASS="command"
>modify properties</B
> command, which is available through the "Actions"
menu or the context-sensitive pop-up menus. In the EVMS CLI, this is done using the
<B
CLASS="command"
>set</B
> command.</P
><P
>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
<TT
CLASS="filename"
>/etc/fstab</TT
> file if the volume is listed, or the volume won't be mounted properly the next
time the system boots.</P
><P
>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.</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="containerops.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="appxlvm2.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Container operations</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="appxlvm.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>The LVM2 plug-in</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>