Enterprise Volume Management System


Project Page

Mailing Lists

IRC Channel


Screen Shots


Related Projects

Hosted By:
SourceForge Logo

Patching, Configuring, and Building Your Kernel

These instructions are only intended to cover the steps necessary to patch and configure your kernel for use with EVMS. For general instructions on configuring and compiling a Linux kernel, please see the The Kernel HOWTO.

The new Device-Mapper driver with the version-4 ioctl interface is now available. EVMS works with either this new version of Device-Mapper or with version 3 which was used for EVMS 2.1.0 and earlier releases.

If you already have a 2.4 kernel patched with Device-Mapper and an earlier version of EVMS, you can continue to use that same kernel with EVMS 2.5.5, and you can skip to the next section of these instructions. However, we recommend upgrading to the new version of Device-Mapper if possible.

NOTE: Debian users should first read through the file /usr/share/doc/kernel-patch-evms/README.Debian for instructions on automatically patching and building your kernel with make-kpkg.

  1. Base Device-Mapper Driver

    The Device-Mapper driver is already present in the 2.6 kernel. However, the 2.4 kernel does not yet include Device-Mapper, so the full driver must be patched in. The patches are located in the Device-Mapper package downloaded in the previous section.

    • 2.6 kernels

      (Base Device-Mapper driver is already included. Skip to the next step.)

    • 2.4.22 and later kernels

      cd /usr/src/linux-2.4.32
      patch -p1 < /usr/src/device-mapper.1.01.05/patches/linux-2.4.28-pre4-devmapper-ioctl.patch

  2. EVMS Patches

    In addition to the base MD and Device-Mapper support, EVMS requires a few additional patches for certain EVMS features to work correctly with these drivers. These patches are provided in the EVMS package, in the kernel/2.4/ and kernel/2.6/ subdirectories. See the INDEX files in those directories for descriptions of the patches.

    1. Snapshotting.

      If you will be using the Snapshot plugin in EVMS, apply the following patches.

      • 2.6 kernel

        (No extra patches are necessary at this time.)

      • 2.4.22 and later kernels

        patch -p1 < /usr/src/device-mapper.1.01.05/patches/linux-2.4.22-VFS-lock.patch
        patch -p1 < /usr/src/evms-2.5.5/kernel/2.4/dm-snapshot.patch

    2. Bad-Block-Relocation

      If you will be using the BBR plugin in EVMS, apply the following patches.

      • 2.6 kernels

        patch -p1 < /usr/src/evms-2.5.5/kernel/2.6/dm-bbr.patch

      • 2.4 kernels

        patch -p1 < /usr/src/evms-2.5.5/kernel/2.4/dm-bbr.patch

    3. BD-Claim Patch

      The 2.6 kernels now prevent multiple "owners" of a block-device. This means that the stock kernel will not allow you to mount a filesystem on one of the kernel's built-in disk-partitions as well as use EVMS to activate volumes on that disk.

      More specifically, the kernel has its own partitioning code that runs when the kernel boots, and provides the traditional partition devices (e.g. /dev/hda1). When a filesystem mounts one of these partitions, the filesystem "claims" that partition and no one else can claim it. When this happens, the kernel's partitioning code (not the filesystem code) also claims the underlying disk, meaning that disk is only available for use by the kernel's built-in partitions on that disk. Other filesystems may mount other partitions on that disk, but the disk itself is "owned" by the partitioning code.

      However, in order to allow easy management of partitions, EVMS does its own partition detection, and creates devices to represent those partitions using Device-Mapper (not the kernel's built-in partitioning code). When DM creates a device, it also attempts to claim the underlying devices (in this case the disk that holds the partition). But, if the user has already mounted one of the kernel's built-in partitions on that same disk, then the disk will already have been claimed. DM will be unable to claim it, and the DM device activation will fail.

      The end result is that a single disk cannot be used both for EVMS and for mounting the kernel's built-in partitions.

      There are three solutions to this problem.

      This issue does not exist on 2.4 kernels.

    4. Update Patches

      If you downloaded any EVMS update-patches for the kernel, they should be applied now, before configuring and building the kernel. The top of each patch file will contain a description of the patch, why it is necessary, and instructions on how to apply the patch to the kernel source tree.

  3. Configure the Kernel

    After patching the kernel, the next step is configuring it with the required support. To configure the kernel, complete the following steps:

    1. Type the following command:

      make xconfig

      NOTE: You can also use config or menuconfig.

    2. Select the Main Menu->Code Maturity Level Options menu and enable the following option:

      <y>  Prompt for development and/or incomplete code/drivers

    3. To enable MD and DM support, select the Main Menu->Multi-Device Support (RAID and LVM) menu, and select the following options. These drivers can also be built as modules if desired.

      <y>  Multiple devices driver support (RAID and LVM)
      <y>  RAID support
      <y>    RAID-1 (mirroring) mode
      <y>    RAID-4/RAID-5 mode
      <y>  Device mapper support
      <y>    Crypt target support        (only applicable on 2.6 kernels)
      <y>    Multipath target            (only applicable on 2.6 kernels)
      <y>    Snapshot target             (only applicable on 2.6 kernels)
      <y>    Mirror target
      <y>    Zero target                 (only applicable on 2.6 kernels)
      <y>    Flakey target               (only applicable on 2.6 kernels)
      <y>    Bad Block Relocation Device Target

    4. To enable init-ramdisk support, select the Main Menu->Block devices menu, and select the following options.

      <y>  Loopback device support
      <y>  RAM disk support
      (4096)   Default RAM disk size
      <y>    Initial RAM disk (initrd) support

      Loopback can be built as a module. The remaining options cannot be built as modules.

    5. If you wish to use devfs (the kernel device-filesystem), you should also configure your kernel to automatically mount devfs on /dev at boot. This is necessary for the sample init-ramdisk to work properly when activating your root volume (see later sections for more details).

      NOTE: EVMS does not require devfs, and the EVMS team has no specific recommendations about using it or not using it. If you do not wish to use devfs, leave both of these options off.

      In the Main Menu->File Systems menu, select the following options.

      <y>  /dev file system support (EXPERIMENTAL)
      <y>    Automatically mount at boot

    Continue configuring your kernel as required for your system and hardware. When you have finished configuring your kernel, choose Save and Exit to quit the kernel configuration.

  4. Build the Kernel

    Once you have configured the kernel, you will need to build the kernel.

    1. Type the following command:

      • 2.6 kernels

        make modules_install

      • 2.4 kernels

        make dep
        make bzImage
        make modules
        make modules_install

    2. Copy the new kernel to the appropriate location (usually in /boot).

      NOTE: On Intel® machines, use arch/i386/boot/bzImage.

    3. If you use LILO as your boot-loader, add an appropriate entry to your /etc/lilo.conf file and run lilo to install the new kernel image. If you use Grub as your boot-loader, add an appropriate entry to your /boot/grub/grub.conf file.

    4. Re-boot your machine to start the new kernel.

Prev Table of Contents Next