Expanding and shrinking volumes 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. Why expand and shrink volumes? 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. 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. 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. FSIM support for expand and shrink operations FSIM type Shrinks Expands JFS No Online only XFS No Online only ReiserFS Offline only Offline and online ext2/3 Offline only Offline only SWAPFS Offline only Offline only OpenGFS No Online only NTFS Offline only Offline only
You can perform all of the supported shrink and expand operations with each of the EVMS user interfaces.
Example: shrink a volume This section tells how to shrink a compatibility volume by 500 MB.
Shrink a volume Shrink the volume /dev/evms/lvm/Sample Container/Sample Region, which is the compatibility volume that was created in the chapter entitled "Creating Volumes," by 500 MB.
Using the EVMS GUI Follow these steps to shrink the volume with the EVMS GUI: Select ActionsShrinkVolume... Select /dev/evms/lvm/Sample Container/Sample Region from the list of volumes. Click Next. Select /lvm/Sample Container/Sample Region from the list of volumes. Click Next. Enter 500MB in the "Shrink by Size" field. Click Shrink. Alternatively, you can perform some of the steps to shrink the volume with the GUI context sensitive menu: From the Volumes tab, right click /dev/evms/lvm/Sample Container/Sample Region Click Shrink... Continue the operation beginning with step 3 of the GUI instructions. Using Ncurses Follow these steps to shrink a volume with Ncurses: Select ActionsShrink Volume. Select /dev/evms/lvm/Sample Container/Sample Region from the list of volumes. Activate Next. Select lvm/Sample Container/Sample Region from the shrink point selection list. Activate Next. Scroll down using the down arrow until Shrink by Size is highlighted. Press spacebar. Press Enter. At the "::" prompt enter 500MB. Press Enter. Activate Shrink. Alternatively, you can perform some of the steps to shrink the volume with the context sensitive menu: From the Volumes view, press Enter on /dev/evms/lvm/Sample Container/Sample Region. Activate the Shrink menu item. Continue the operation beginning with step 3 of the Ncurses instructions. Using the CLI The shrink command takes a shrink point followed by an optional name value pair or an optional shrink object. To find the shrink point, use the query command with the shrink points filter on the object or volume you plan to shrink. For example: query: shrink points, "/dev/evms/lvm/Sample Container/Sample Region" Use a list options filter on the object of the shrink point to determine the name-value pair to use, as follows: query: objects, object="lvm/Sample Container/Sample Region", list options With the option information that is returned, you can construct the command, as follows: shrink: "lvm/Sample Container/Sample Region", remove_size=500MB
Example: expand a volume This section tells how to expand a volume a compatibility volume by 500 MB.
Expand a volume Expand the volume /dev/evms/lvm/Sample Container/Sample Region, which is the compatibility volume that was created in the chapter entitled "Creating Volumes," by 500 MB.
Using the EVMS GUI Follow these steps to expand the volume with the EVMS GUI: Select ActionsExpand Volume... Select /dev/evms/lvm/Sample Container/Sample Region from the list of volumes. Click Next. Select lvm/Sample Container/Sample Region from the list as the expand point. Click Next. Enter 500MB in the "Additional Size" field. Click Expand. Alternatively, you can perform some of the steps to expand the volume with the GUI context sensitive menu: From the Volumes tab, right click /dev/evms/lvm/Sample Container/Sample Region. Click Expand... Continue the operation to expand the volume beginning with step 3 of the GUI instructions. Using Ncurses Follow these steps to expand a volume with Ncurses: Select ActionsExpandVolume. Select /dev/evms/lvm/Sample Container/Sample Region from the list of volumes. Activate Next. Select lvm/Sample Container/Sample Region from the list of expand points. Activate Next. Press spacebar on the Additional Size field. At the "::" prompt enter 500MB. Press Enter. Activate Expand. Alternatively, you can perform some of the steps to shrink the volume with the context sensitive menu: From the Volumes view, press Enter on /dev/evms/lvm/Sample Container/Sample Region. Activate the Expand menu item. Continue the operation beginning with step 3 of the Ncurses instructions. Using the CLI The expand command takes an expand point followed by an optional name value pair and an expandable object. To find the expand point, use the query command with the Expand Points filter on the object or volume you plan to expand. For example: query: expand points, "/dev/evms/lvm/Sample Container/Sample Region" Use a list options filter on the object of the expand point to determine the name-value pair to use, as follows: query: objects, object="lvm/Sample Container/Sample Region", list optionsThe free space in your container is the container name plus /Freespace. With the option information that is returned, you can construct the command, as follows: expand: "lvm/Sample Container/Sample Region", add_size=500MB, "lvm/Sample Container/Freespace"