# Selectively activating volumes and objects

This chapter discusses selective activation and deactivation of EVMS volumes and objects.

## Initial activation using /etc/evms.conf

There is a section in the EVMS configuration file, `/etc/etc/evms.conf`, named "activate." This section has two entries: "include" and "exclude." The "include" entry lists the volumes and objects that should be activated. The "exclude" entry lists the volumes and objects that should not be activated.

Names in either of the entries can be specified using "*", "?", and "[...]" notation. For example, the following entry will activate all the volumes:

    include = [/dev/evms/*]

The next entry specifies that objects sda5 and sda7 not be activated:

    exclude = [ sda[57] ]

When EVMS is started, it first reads the include entry and builds a list of the volumes and objects that it should activate. It then reads the exclude entry and removes from the list any names found in the exclude list. For example, an activation section that activates all of the volumes except `/dev/evms/temp` looks like this:

    activate {
    	include = [/dev/evms/*]
    	exclude = [/dev/evms/temp]
    }

If `/etc/evms.conf` does not contain an activate section, the default behavior is to activate everything. This behavior is consistent with versions of EVMS prior to 2.4.

Initial activation via `/etc/evms.conf` does not deactivate any volumes or objects. It only determines which ones should be active.

## Activating and deactivating volumes and objects

The EVMS user interfaces offer the ability to activate or deactivate a particular volume or object. The volume or object will be activated or deactivated when the changes are saved.

### Activation

You can activate inactive volumes and objects using the various EVMS user interfaces.

#### Note

EVMS does not currently update the EVMS configuration file (`/etc/evms.conf`) when volumes and objects are activated. If you activate a volume or object that is not initially activated and do not make the corresponding change in `/etc/evms.conf`, the volume or object will not be activated the next time the system is booted and you run `evms_activate` or one of the user interfaces.

#### Using the EVMS GUI

To activate volumes or objects with the GUI, follow these steps:

1. Select Actions Activation Activate...

2. Select the volume(s) and object(s) you want to activate.

3. Click Activate.

4. Click Save to save the changes and activate the volume(s) and object(s).

#### Using the EVMS GUI context-sensitive menu

To activate with the GUI context-sensitive menu, follow these steps:

1. Right click the volume or object you want to activate.

2. Click "Activate."

3. Click Activate.

4. Click Save to save the changes and activate the volume(s) and object(s).

#### Using Ncurses

To activate a volume or object with Ncurses, follow these steps:

1. Select Actions Activation Activate...

2. Select the volume(s) and object(s) you want to activate.

3. Select Activate.

4. Select Actions Save to save the changes and activate the volume(s) and object(s).

#### Using the Ncurses context-sensitive menu

To enable activation on a volume or object with the Ncurses context-sensitive menu, follow these steps:

1. Highlight the volume or object you want to activate and press Enter.

2. Select "Activate."

3. Select Activate.

4. Select Actions Save to save the changes and activate the volume(s) and object(s).

#### Using the CLI

To activate a volume or object with the CLI, issue the following command to the CLI (where "name" is the name of the volume or object you want to activate):

    Activate:name

### Deactivation

You can deactivate active volumes and objects using the various EVMS user interfaces.

#### Note

EVMS does not currently update the EVMS configuration file (`/etc/evms.conf`) when a volume or object is deactivated. If you deactivate a volume or object that is initially activated and do not make the corresponding change in `/etc/evms.conf`, then the volume or object will be activated the next time you run `evms_activate` or one of the user interfaces.

#### Using the EVMS GUI

To deactivate a volume or object with the GUI, follow these steps:

1. Select Actions Activation Deactivate...

2. Select the volume(s) and object(s) you want to deactivate.

3. Click Deactivate.

4. Click Save to save the changes and activate the volume(s) and object(s).

#### Using the EVMS GUI context-sensitive menu

To deactivate a volume or object with the GUI context-sensitive menu, follow these steps:

1. Right click the volume or object you want to deactivate.

2. Click "Deactivate."

3. Click Deactivate.

4. Click Save to save the changes and activate the volume(s) and object(s).

#### Using Ncurses

To deactive a volume or object with Ncurses, follow these steps:

1. Select Actions Activation Deactivate...

2. Select the volume(s) and object(s) you want to deactivate.

3. Select Deactivate.

4. Select Actions Save to save the changes and deactivate the volume(s) and object(s).

#### Using the Ncurses context-sensitive menu

To deactivate a volume or object with the Ncurses context-sensitive menu, follow these steps:

1. Highlight the volume or object you want to deactivate and press Enter.

2. Select "Deactivate."

3. Select Deactivate.

4. Select Actions Save to save the changes and deactivate the volume(s) and object(s).

#### Using the CLI

To deactivate a volume or object with the CLI, issue the following command to the CLI (where "name" is the name of the volume or object you want to deactivate):

    Deactivate:name

### Activation and deactivation dependencies

In order for a volume or object to be active, all of its children must be active. When you activate a volume or object, EVMS will activate all the objects that the volume or object comprises.

Similarly, in order for an object to be inactive, all of its parents cannot be activate. When you deactivate an object, EVMS will deactivate all of the objects and volumes that are built from that object.

#### Dependencies during initial activation

As discussed in , when EVMS starts, it builds an initial list of volumes and objects whose names match the "include" entry in the activation section of `/etc/evms.conf`. Because those volumes and objects cannot be active unless the objects they comprise are active, EVMS then adds to the list all the objects that are comprised by the volumes and objects that were found in the initial match.

EVMS then removes from the list the volumes and objects whose names match the "exclude" entry in the activation section of `/etc/evms.conf`. Because any volumes or objects that are built from the excluded ones cannot be active, EVMS removes them from the list as well.

The enforcement of the dependencies can result in behavior that is not immediately apparent. Let's say, for example, that segment hda7 is made into volume `/dev/evms/home`. and the activation section in `/etc/evms.conf` looks like this:

    activate {
    	include = [*]
    	exclude = [hda*]
    }

When EVMS builds the list of volumes and objects to activate, everything is included. EVMS next removes all objects whose names start with "hda." hda7 will be removed from the list. Next, because volume `/dev/evms/home` is built from hda7, it will also be removed from the list and will not be activated. So, although volume `/dev/evms/home` is not explicitly in the exclude list, it is not activated because it depends on an object that will not be activated.

#### Dependencies for compatibility volumes

Compatibility volumes are made directly from the volume's object. That is, the device node for the volume points directly to the device for the volume's object. Because a compatibility volume is inseparable from its object, a compatibility volume itself cannot be deactivated. To deactivate a compatibility volume you must deactivate the volume's object.

Similarly, if a compatibility volume and its object are not active and you activate the volume's object, the compatibility volume will be active as well.