<chapterid="expandshrink"><title>Expanding and shrinking volumes</title>
<para>This chapter tells how to expand and shrink EVMS volumes with the EVMS
GUI, Ncurses, and CLI interfaces. Note that you can also expand and shrink compatibility volumes and EVMS objects.</para>
<sect1id="whyexpandshrink"><title>Why expand and shrink volumes?</title>
<para>Expanding and shrinking volumes are common volume operations on most systems. For example, it might be necessary to shrink a particular volume to create
free space for another volume to expand into or to create a new volume.</para>
<para>EVMS simplifies the process for expanding and shrinking volumes, and
protects the integrity of your data, by coordinating expand and shrink
operations with the volume's file system. For example, when shrinking a
volume, EVMS first shrinks the underlying file system appropriately to protect
the data. When expanding a volume, EVMS expands the file system automatically
when new space becomes available.</para>
<para>Not all file system interface modules (FSIM) types supported by EVMS
allow shrink and expand operations, and some only perform the operations when
the file system is mounted ("online"). The following table details the
shrink and expand options available for each type of FSIM.
</para>
<para><table><title>FSIM support for expand and shrink operations</title><tgroupcols="3"><colspeccolnum="1"colname="C1"/><colspeccolnum="2"colname="C2"/><colspeccolnum="3"colname="C3"/>
Alternatively, you can perform some of the steps to shrink the volume with the
context sensitive menu:</para>
<orderedlist>
<listitem><para>From the Volumes view, press <keycap>Enter</keycap> on <filename>/dev/evms/lvm/Sample Container/Sample Region</filename>.</para>
</listitem>
<listitem><para>Activate the <guimenuitem>Shrink</guimenuitem> menu item.</para>
</listitem>
<listitem><para>Continue the operation beginning with step 3 of the Ncurses instructions.</para>
</listitem>
</orderedlist>
</sect2>
<!-- CLI-->
<sect2id="shrinkcli"><title>Using the CLI</title>
<para>The <command>shrink</command> command takes a shrink point followed by an optional name
value pair or an optional shrink object. To find the shrink point, use the <command>query</command> command with the shrink points filter on the object or volume you plan to shrink. For example:</para>
<sect1id="mkfs"><title>Example: expand a volume</title>
<para>This section tells how to expand a volume a compatibility volume by 500 MB.</para>
<blockquote><example><title>Expand a volume</title>
<para>Expand the volume <filename>/dev/evms/lvm/Sample Container/Sample Region</filename>, which is the compatibility volume that was created in the chapter entitled "Creating Volumes," by 500 MB.
</para></example></blockquote>
<sect2id="expandgui"><title>Using the EVMS GUI</title>
<para>Follow these steps to expand the volume with the EVMS GUI:
<para>Alternatively, you can perform some of the steps to shrink the volume with the
context sensitive menu:</para>
<orderedlist>
<listitem><para>From the Volumes view, press <keycap>Enter</keycap> on /<guimenuitem>dev/evms/lvm/Sample Container/Sample Region</guimenuitem>.</para>
</listitem>
<listitem><para>Activate the <guimenuitem>Expand</guimenuitem> menu item.</para>
</listitem>
<listitem><para>Continue the operation beginning with step 3 of the Ncurses instructions.</para>
</listitem>
</orderedlist>
</sect2>
<!-- CLI-->
<sect2id="expandcli"><title>Using the CLI</title>
<para>The <command>expand</command> command takes an expand point followed by an optional name
value pair and an expandable object. To find the expand point, use the <command>query</command> command with the Expand Points filter on the object or volume you plan to expand. For example:</para>
<para>Use a list options filter on the object of the expand point to determine the name-value pair to use, as follows:</para>
<programlisting>query: objects, object="lvm/Sample Container/Sample Region", list options</programlisting><para>The free space in your container is the container name plus <filename>/Freespace</filename>.</para>
<para>With the option information that is returned, you can construct the command, as follows:</para>