# Downloading and installing EVMS

This chapter tells how to obtain and install EVMS, and offers guidelines to help you make decisions about your EVMS installation. If you are setting up EVMS to work in a cluster, execute the steps described in this chapter on each of the nodes in the cluster.

## Preparing your system

Before you install EVMS, decide whether to implement certain kernel capabilities and ensure that you have a Linux kernel source tree. EVMS 2.0 is built on top of the already existing components MD and Device Mapper (DM). If you are using Linux kernel 2.5 or later, the MD and DM components are already available, but you need to apply some patches for bug fixes because the 2.5 kernel is still stabilizing. If you are using Linux kernel 2.4, you need to obtain all the DM patches from the Sistina website and then apply the bug fixes. Steps for performing these tasks are included later in this chapter.

### Choosing capabilities

In order to run EVMS, you need to configure the Device Mapper in your kernel either as a module or as a component built directly into the kernel. If you want to use the RAID functions of EVMS, turn on MD and the appropriate RAID personalities in the kernel.

### Obtaining the Device Mapper and a kernel source tree

EVMS 2.0 is built on top of the already existing components MD and Device Mapper. If you are using Linux kernel 2.5 or later, the MD and DM components are already available; however, you need to apply some patches for bug fixes because the 2.5 kernel is still stabilizing. If you are using Linux kernel 2.4, you need to patch the DM in from the Sistina website and then apply the bug fixes. The DM patches for the kernel are included in the EVMS package on the EVMS project website. The current EVMS package contains a patch for both the 2.4 and 2.5 kernel series.

#### NOTE

EVMS does not work with Linux kernels 2.3, 2.2, or earlier.

If you do not have a Linux kernel source tree, you can obtain one from The Linux Kernel Archives . The current recommended kernel is 2.4.20, but earlier 2.4 series kernels might work.

## Downloading EVMS

To install EVMS, download the latest version of EVMS (`evms-2.0.0.tar.gz`) from the EVMS project homepage. This file contains source code patches for the Linux kernel and source code for all necessary user-space administration tools.

After downloading the file, use the `tar` command to extract the files in the appropriate place. In the following example, the files are extracted in `/usr/src`. You can substitute another directory.

    cd /usr/src
    tar xvzf evms-2.0.0.tar.gz

## Patching the kernel

In addition to the base MD and Device Mapper support, EVMS requires a few patches for the EVMS engine to work correctly with these drivers. These patches are provided in the EVMS package, in the `kernel/2.4.20/` subdirectory. See the INDEX files in the `kernel/2.4.20` directory for descriptions of the patches.

### NOTE

If you are currently using the Sistina LVM2 tools, the patches provided here are not compatible with the LVM2 tools. EVMS has made some changes to the kernel ioctl packets so that they work correctly on ppc-64 and sparc-64 architectures. These changes have not yet been accepted by Sistina. Thus, for the time being, you need to use separate kernels for running EVMS and LVM2.

Apply each of the patches for 2.4.20 to your kernel as follows:

    cd /usr/src/linux-2.4.20
    patch -p1 < /src/src/evms-2.0.0/kernel/2.4.20/1-dm-base.patch
    patch -p1 < /src/src/evms-2.0.0/kernel/2.4.20/2-syncio.patch
    patch -p1 < /src/src/evms-2.0.0/kernel/2.4.20/3-dm-bbr.patch
    patch -p1 < /src/src/evms-2.0.0/kernel/2.4.20/4-dm-sparse.patch
    patch -p1 < /src/src/evms-2.0.0/kernel/2.4.20/5-md.c.patc
    patch -p1 < /src/src/evms-2.0.0/kernel/2.4.20/6-vsprintf.c.patch
    patch -p1 < /src/src/evms-2.0.0/kernel/2.4.20/7-vfs-lock.patch

## Configuring the kernel

After patching the kernel, configure it with EVMS support. To configure the kernel, complete the following steps:

1. Type the following command:

       make xconfig

   ### NOTE

   You can also use `config` or `menuconfig` if you don't have an Xwindow system.

   If you are using an Xwindow system, the following window opens.

   ### xconfig Window

   xconfig Window

2. To enable the kernel components that EVMS needs, select Multi-device support (RAID and LVM). The following window opens.

   ### Multi-device Support (RAID and LVM) Window

   MD Support (RAID and LVM) Window

   ### NOTE

   If you are configuring the components as modules, you can click the Help button beside each module to see the name of each kernel module.

3. Select `y` for Multi-device support (RAID and LVM). Select `y` (to build in the kernel) or `m` (to build modules) for Device Mapper support. These options are the minimum required for EVMS. The remaining options add additional capabilities to EVMS.

   ### NOTE

   The options you select in this step are the ones you selected in .

Continue configuring your kernel as required for your system and hardware. For general instructions on configuring and compiling a Linux kernel, please see The Kernel HOWTO.

When you have finished configuring your kernel, choose Save and Exit to quit the kernel configuration.

## Building and installing the new kernel

After you have configured the kernel, build and install a new kernel image. There are slight variations for different architectures, but the general steps are the same. For example, on Intel® machines you might run `lilo` to install the new kernel image. On S/390 machines, you might run `zipl` to install the new kernel image. The following instructions are based on an installation using an Intel machine.

1. Build the kernel:

       make dep clean bzImage modules modules_install

2. Copy the new kernel to the `/boot` directory.

       cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-evms

   ### NOTE

   The previous command assumes the file to be named `vmlinuz-evms`, you can substitute another name.

3. Open the file for the boot loader. The LILO boot loader information is in `/etc/lilo.conf`. The GRUB boot loader information is in `/boot/menu.list`.

4. Update the boot loader information as follows:

       image=/boot/vmlinuz-evms
       	label=EVMS

   ### NOTE

   Currently, LILO does not support placing the `/boot` filesystem on a Device Mapper device. Thus, `/boot` must be mounted through the traditional partition device.

5. Run your boot loader to install the new kernel image.

   ### NOTE

   If you installed your kernel as modules, skip to .

6. Reboot your machine and choose the new kernel image to run with EVMS support.

## Installing the cluster manager

Skip this section if you do not require high-availability features.

EVMS currently supports the Linux-HA cluster manager, commonly known as Heartbeat. You can download the latest version of the Linux-HA software from http://www.linux-ha.org/download/. EVMS works with Heartbeat V1.0.1 and later. For instructions on setting up a two-node cluster, see http://www.linux-ha.org/download/GettingStarted.html. For additional information and a list of frequently asked questions, see http://www.linux-ha.org/download/faqntips.html.

Linux-HA provides the following sub-packages:

- heartbeat-xxx.arch.rpm

- heartbeat-stonith-xxx.arch.rpm

- heartbeat-pils-xxx.arch.rpm

- heartbeat-ldirectord-xxx.arch.rpm

"xxx" is the version of heartbeat; "arch" is the architecture of the target nodes.

You do not need to install `heartbeat-ldirectord-xxx.arch.rpm` because EVMS does not depend on its service.

### NOTE

The download page also contains tarballs and source rpms.

To install the package, execute the following command on each cluster node:

    rpm -i heartbeat-pils-xxx.arch.rpm heartbeat-stonith-xxx.rpm \
    heartbeat-xxx.arch.rpm

### NOTE

It is highly recommended that you configure the STONITH package on a two-node cluster because data integrity on shared disks is at risk if STONITH is not configured. Although EVMS operates even when STONITH is not configured (EVMS is not restricted to a two-node cluster), EVMS's failover capability is limited by the support provided by the native cluster manager.

Refer to the STONITH device manual for instructions on how to configure the STONITH device.

## Installing the Engine

The EVMS Engine consists of the user-space plug-ins and interfaces as well as a stand-alone library, dlist, that the Engine uses for linked-list management.

### Installing from source

1. To build and install the Engine from source, first type the following command to change to the `/usr/src/evms-2.0.0` directory:

       cd /usr/src/evms-2.0.0

2. Select the appropriate options for your configuration.

   #### NOTE

   A list of options can be found by typing:

       ./configure -h

3. Configure your engine:

       ./configure [--options]

4. Type the following commands:

       make
       make install
       ldconfig

   Unless you specified other directories when you configured the engine, the following list describes where files will be installed on your system:

   - The core Engine library is installed in `/lib`.

   - The core dlist library is installed in `/lib`.

   - All plug-in libraries is installed in `/lib/evms`.

   - All user interface binaries are installed in `/sbin`.

   - All header files are installed in `/usr/include/evms`.

   - All manual pages are installed in `/usr/man`.

   - Add the Engine library path to your `LD_LIBRARY_PATH` environment variable, or to your `/etc/ld.so.conf` file. Do not add the plug-in library path because the Engine dynamically loads these libraries directly.

5. Examine the EVMS configuration file (`evms.conf`). This file contains settings to control how EVMS operates. For example, the logging level, the location of the engine log, and the list of disk devices to examine can all be controlled through settings in the configuration file. The sample file is well commented and advises you of appropriate values for each setting.

   The `evms.conf` file is normally installed in `/etc/evms.conf`. However, if you already have a configuration file, it is installed as `/etc/evms.conf.sample`. Examine the new sample to see if your existing file should be updated.

You can now begin using EVMS by typing `evmsgui` to start the GUI, `evmsn` to start the Ncurses UI, or `evms` to start the command line interpreter.

### Installing the EVMS Debian packages

Debian packages of EVMS are maintained by Matt Zimmerman at the Debian website. You can download these packages for the Woody (testing) release, or for the Sid (unstable) release.

For the Debian package, patch and recompile your kernel in order to use EVMS. Debian has a packaged version of the EVMS kernel patches that includes instructions for patching and building your kernel.

### Installing from CVS

If you would like to use the most recently developed version of EVMS, you can get the code directly from the CVS tree.

1. To download the code, type the following commands:

       mkdir /usr/src/evms_cvs
       cd /usr/src/evms_cvs
       cvs -d:pserver:anonymous@cvs.evms.sf.net:/cvsroot/evms login
               (press Enter when prompted for a password)
       cvs -z3 -d:pserver:anonymous@cvs.evms.sf.net:/cvsroot/evms co engine2

2. Alternatively, if you already have a copy of the CVS code checked out, you can update to the latest code with the following commands:

       cd /usr/src/evms_cvs/engine2
       cvs update -d -P

3. The EVMS Engine can be built directly into the CVS tree. To start, change directory to `/usr/src/evms_cvs/engine2`:

       cd /usr/src/evms_cvs/engine2
       autoconf

   #### NOTE

   The `autoconf` command is necessary only for code taken directly from CVS.

4. Select the appropriate options for your configuration.

   #### NOTE

   You can find the list of options by typing:

       ./configure -h

5. Configure your engine:

       ./configure [--options]

6. Type the following commands:

       make
       make install
       ldconfig

   Unless you specified other directories in Step 5, the following list describes where files are installed on your system:

   - The core Engine library is installed in `/lib`.

   - The core dlist library is installed in `/lib`.

   - All plug-in libraries is installed in `/lib/evms`.

   - All user interface binaries are installed in `/sbin`.

   - All header files are installed in `/usr/include/evms`.

   - All manual pages are installed in `/usr/man`.

7. Add the Engine library path to your `LD_LIBRARY_PATH` environment variable, or to your `/etc/ld.so.conf` file. Do not add the plug-in library path because the Engine dynamically loads these libraries directly.

## Activating EVMS volumes

In the previous EVMS design (releases 1.2.1 and earlier), volume discovery was performed in the kernel, and all volumes were immediately activated at boot time. With the current EVMS design, volume discovery is performed in user-space, and volumes are activated by communicating with the kernel. Thus, in order to activate your volumes, you must open one of the EVMS user interfaces and perform a save, which will activate all inactive volumes.

For example, start the GUI by running `evmsgui`. You should see all empty checkboxes in the "Active" column. Press Save, which activates all of the volumes and fills in each of the checkboxes.

In addition to manually starting one of the EVMS user interfaces, there is a new utility called `evms_activate`. The `evms_activate` utility simply opens the EVMS Engine and tells the Engine to save the changes. You might want to add a call to `evms_activate` to your boot scripts in order to automatically activate your volumes at boot time. If you have volumes listed in your `/etc/fstab` file, you need to call `evms_activate` before the `fstab` is processed.

### NOTE

EVMS requires `/proc` to be mounted in order to find the Device Mapper driver. If you run `evms_activate` before processing the `fstab` file, you might need to manually mount and unmount `/proc` around the call to `evms_activate`.

After the volumes are activated, you can mount them in the normal way with the dev-nodes in the `/dev/evms` directory.

## The root filesystem on an EVMS volume

After volume discovery and activation are done in user space, there is an issue with having your system's root file system on an EVMS volume. In order for the root file system's volume to be activated, the EVMS tools must run. However, in order to get to the EVMS tools, the root file system must be mounted. The solution to this dilemma is to use an initial ramdisk (`initrd`). An initial ramdisk is a ram-based device that acts as a temporary root file system at boot time. The initial ramdisk lets EVMS run programs and load modules that are necessary to activate the true root file system.

For instructions on building an init-ramdisk for use with EVMS, see .

## Setting up clustered EVMS

The following steps show how to set up EVMS clustering. Perform these steps on each cluster node:

1. Because EVMS depends on the CCM services offered by Heartbeat, the Linux-HA CCM service must be configured on the system. Execute the following line to configure CCM:

       echo 'respawn haclient /usr/lib/heartbeat/ccm' >> /etc/ha.d/ha.cf

2. Because Linux-HA expects its consumers to set up a private communication channel, create the following fifo with administrative privileges:

       mkfifo /var/lib/heartbeat/api/evms.req
       mkfifo /var/lib/heartbeat/api/evms.rsp
       chgrp haclient /var/lib/heartbeat/api/evms.req
       chgrp haclient /var/lib/heartbeat/api/evms.rsp
       chmod 200 /var/lib/heartbeat/api/evms.req
       chmod 600 /var/lib/heartbeat/api/evms.rsp

3. To ensure that clustered EVMS is activated whenever Linux-HA starts, execute the following line:

       echo 'respawn root /sbin/evmsd' >> /etc/ha.d/ha.cf

   This step assumes that the `evmsd` daemon is installed in `/sbin/evmsd`. If the `evmsd` daemon is not installed in `/sbin/evmsd`, change `/sbin/evmsd` to the correct location when executing the command.

See for information about clustering operations.