2. Example: perform a delete recursive operation

The following example shows how to destroy a volume and the objects below it with the EVMS GUI, Ncurses, and CLI interfaces.

Example 21.1. Destroy a volume and the region and container below it

This example uses the delete recursive operation to destroy volume /dev/evms/Sample Volume and the region and container below it. Volume /dev/evms/Sample Volume is the volume that was created in earlier. Although we could also use the delete option on each of the objects, the delete recursive option takes fewer steps. Note that because we intend to delete the container as well as the volume, the operation needs to be performed in two steps: one to delete the volume and its contents, and one to delete the container and its contents.


2.1. Using the EVMS GUI

Follow these steps to delete the volume and the container with the EVMS GUI:

  1. Select ActionsDeleteVolume.

  2. Select volume /dev/evms/Sample Volume from the list.

  3. Click Recursive Delete. This step deletes the volume and the region lvm/Sample Container/Sample Region. If you want to keep the underlying pieces or want to delete each piece separately, you would click Delete instead of Delete Recursive.

  4. Assuming you chose Delete Recursive (if not, delete the region before continuing with these steps), select ActionsDeleteContainer.

  5. Select container lvm/Sample Container from the list.

  6. Click Recursive Delete to destroy the container and anything under it. Alternatively, click Delete to destroy only the container (if you built the container on disks as in the example, either command has the same effect).

Alternatively, you can perform some of the volume deletion steps with the GUI context sensitive menu:

  1. From the Volumes tab, right click /dev/evms/Sample Volume.

  2. Click Delete...

  3. Continue with the operation beginning with step 3 of the GUI instructions.

2.2. Using Ncurses

Follow these steps to delete the volume and the container with Ncurses:

  1. Select ActionsDeleteVolume.

  2. Select volume /dev/evms/Sample Volume from the list.

  3. Activate Delete Volume Recursively. This step deletes the volume and the region lvm/Sample Container/Sample Region. If you want to keep the underlying pieces or want to delete each piece separately, activate Delete instead of Delete Recursive.

  4. Assuming you chose Delete Volume Recursively (if not, delete the region before continuing with these steps), select ActionsDeleteContainer.

  5. Select container lvm/Sample Container from the list.

  6. Click Recursive Delete to destroy the container and everything under it. Alternatively, activate Delete to delete only the container (if you built the container on disks as in the example, either command has the same effect).

  7. Press Enter.

Alternatively, you can perform some of the volume deletion steps with the context sensitive menu:

  1. From the Volumes view, press Enter on /dev/evms/Sample Volume.

  2. Activate Delete.

  3. Continue with the operation beginning with step 3 of the Ncurses instructions.

2.3. Using the CLI

Use the delete and delete recursive commands to destroy EVMS objects. Specify the command name followed by a colon, and then specify the volume, object, or container name. For example:

  1. Enter this command to perform the delete recursive operation:

    delete recursive: "/dev/evms/Sample Volume"

    This step deletes the volume and the region /lvm/Sample Container/Sample Region. If you wanted to keep the underlying pieces or wanted to delete each piece separately, use the delete command, as follows:

    delete: "/dev/evms/Sample Volume"
  2. Assuming you chose Delete Volume Recursively (if not, delete the region before continuing with these steps) enter the following to destroy the container and everything under it:

    delete recursive: "lvm/Sample Container"

    To destroy only the container, enter the following:

    delete: "lvm/Sample Container"