Building and Installing Lustre from Source Code

If you are using a Linux kernel that is unsupported by Lustre, you will need to build and install Lustre from source code. This involves several steps:
 * Patching the core kernel
 * Configuring the kernel to work with Lustre
 * Creating Lustre and kernel RPMs from source code.

If you are installing Lustre on a supported Linux kernel, you will find it easier to install Lustre from packaged binaries (RPMs). For more information about this installation method, see Installing Lustre from Downloaded RPMs.

Caution: Lustre contains kernel modifications which interact with storage devices and may introduce security issues and data loss if not installed, configured and administered correctly. Before installing Lustre, be cautious and back up ALL data.

Note: When using third-party network hardware with Lustre, the third-party modules (typically, the drivers) must be linked against the Linux kernel. The LNET modules in Lustre also need these references. To meet these requirements, a specific process must be followed to install and recompile Lustre. See "Installing Lustre with a Third-Party Network Stack" in the Lustre Operations Manual for an example showing how to install Lustre 1.6.6 using the Myricom MX 1.2.7 driver. The same process can be used for other third party network stacks.

Patching the Kernel
If you are using non-standard hardware, plan to apply a Lustre patch, or have another reason not to use packaged Lustre binaries, you have to apply several Lustre patches to the core kernel and run the Lustre configure script against the kernel.

Introducing the Quilt Utility
To simplify the process of applying Lustre patches to the kernel, we recommend that you use the Quilt utility.

Quilt manages a stack of patches on a single source tree. A series file lists the patch files and the order in which they are applied. Patches are applied, incrementally, on the base tree and all preceding patches. You can:
 * Apply patches from the stack (quilt push)
 * Remove patches from the stack (quilt pop)
 * Query the contents of the series file (quilt series), the contents of the stack (quilt applied, quilt previous, quilt top), and the patches that are not applied at a particular moment (quilt next, quilt unapplied).
 * Edit and refresh (update) patches with Quilt, as well as revert inadvertent changes, and fork or clone patches and show the diffs before and after work.

A variety of Quilt packages (RPMs, SRPMs and tarballs) are available from various sources. Use the most recent version you can find. Quilt depends on several other utilities, e.g., the coreutils RPM available only in RedHat 9. For other RedHat kernels, you have to get the required packages to successfully install Quilt. If you cannot locate a Quilt package or fulfill its dependencies, you can build Quilt from a tarball, available at.

For additional information on using Quilt, including its commands, see the Introduction to Quilt and the quilt(1) man page.

Get the Lustre Source and Unpatched Kernel
The Lustre Group supports several Linux unpatched kernels for use with Lustre and provides a series of patches for each one. The Lustre patches are maintained in the kernel_patch directory bundled with th \e Lustre source code. The unpatched kernels are also available for download.

To obtain the Lustre source and unpatched kernel:

1. Verify that all of the Lustre installation requirements have been met. For more information on these prerequisites, see Preparing to Install Lustre.

2. Get the Lustre source code. On the Lustre download site, select the Lustre version you want and then select Source as the platform. The files required to install Lustre from source code (unpatched kernels, Lustre source and e2fsprogs) are listed.

3. Download the Lustre source code (lustre- .tar.gz).

4. Download the unpatched kernel you want to use. If you do not know the kernel’s filename, check the which_patch file.


 * a. In the Lustre source file, navigate to the which_patch file (lustre/kernel_patches/which_patch) and get the filename of the kernel you want to use. The which_patch file lists the kernels supported in this release.


 * b. Download the selected kernel from the location where you downloaded the Lustre source in Step 2.

5. To save time later, download the e2fsprogs tarball (e2fsprogs- tar.gz).

Patch the Kernel
This procedure describes how to use Quilt to apply the Lustre patches to the kernel. To illustrate the steps in this procedure, a RHEL 5 kernel is patched for Lustre 1.6.5.1.

1. Unpack the Lustre source and kernel to separate source trees. Lustre source and the unpatched kernel were previously downloaded in Get the Lustre Source and Unpatched Kernel.


 * a. Unpack the Lustre source. For this procedure, we assume that the resulting source tree is in /tmp/lustre-1.6.5.1.


 * b. Unpack the kernel. For this procedure, we assume that the resulting source tree (also known as the destination tree) is in /tmp/kernels/linux-2.6.18.

2. Select a config file for your kernel, located in the kernel_configs directory (lustre/kernel_patches/kernel_config). The kernel_config directory contains the .config files, which are named to indicate the kernel and architecture with which they are associated. For example, the configuration file for the 2.6.18 kernel shipped with RHEL 5 (suitable for i686 SMP systems) is kernel-2.6.18-2.6-rhel5-i686-smp.config.

3. Select the series file for your kernel, located in the series directory (lustre/kernel_patches/series). The series file contains the patches that need to be applied to the kernel.

4. Set up the necessary symlinks between the kernel patches and the Lustre source. This example assumes that the Lustre source files are unpacked under /tmp/lustre-1.6.5.1 and you have chosen the 2.6-rhel5.series file). Run:

$ cd /tmp/kernels/linux-2.6.18 $ rm -f patches series $ ln -s /tmp/lustre-1.6.5.1/lustre/kernel_patches/series/2.6-\ rhel5.series ./series $ ln -s /tmp/lustre-1.6.5.1/lustre/kernel_patches/patches.

5. Use Quilt to apply the patches in the selected series file to the unpatched kernel. Run:

$ cd /tmp/kernels/linux-2.6.18 $ quilt push -av

The patched destination tree acts as a base Linux source tree for Lustre.

Create and Install the Lustre Packages
After patching the kernel, configure it to work with Lustre, create the Lustre packages (RPMs) and install them.

1. Configure the patched kernel to run with Lustre. Run:

$ cd $ cp /boot/config-‘uname -r‘ .config $ make oldconfig || make menuconfig $ make include/asm $ make include/linux/version.h $ make SUBDIRS=scripts $ make include/linux/utsrelease.h

2. Run the Lustre configure script against the patched kernel and create the Lustre packages.

$ cd  $ ./configure --with-linux= $ make rpms

This creates a set of .rpms in /usr/src/redhat/RPMS/  with an appended date-stamp. The SuSE path is /usr/src/packages.

Note: You do not need to run the Lustre configure script against an unpatched kernel.

Example set of RPMs:

lustre-1.6.5.1-\ 2.6.18_53.xx.xx.el5_lustre.1.6.5.1.custom_20081021.i686.rpm lustre-debuginfo-1.6.5.1-\ 2.6.18_53.xx.xx.el5_lustre.1.6.5.1.custom_20081021.i686.rpm lustre-modules-1.6.5.1-\ 2.6.18_53.xx.xxel5_lustre.1.6.5.1.custom_20081021.i686.rpm lustre-source-1.6.5.1-\ 2.6.18_53.xx.xx.el5_lustre.1.6.5.1.custom_20081021.i686.rpm

Note: If the steps to create the RPMs fail, contact Lustre Support by opening a bug in Bugzilla.

Note: Lustre supports several features and packages that extend the core functionality of Lustre. These features/packages can be enabled at the build time by issuing appropriate arguments to the configure command. For a list of supported features and packages, run ./configure –help in the Lustre source tree. The configs/ directory of the kernel source contains the config files matching each the kernel version. Copy one to .config at the root of the kernel tree.

3. Create the kernel package. Navigate to the kernel source directory and run:

$ make rpm

Example result:

kernel-2.6.95.0.3.EL_lustre.1.6.5.1custom-1.i686.rpm

Note: Step 3 is only valid for RedHat and SuSE kernels. If you are using a stock Linux kernel, you need to get a script to create the kernel RPM.

4. Install the Lustre packages. Some Lustre packages are installed on servers (MDS and OSSs), and others are installed on Lustre clients. For guidance on where to install specific packages, see Lustre Packages.

Note: Running the patched server kernel on the clients is optional. It is not necessary unless the clients will be used for multiple purposes, for example, to run as a client and an OST.

Lustre packages should be installed in this order:


 * a. Install the kernel, modules and ldiskfs packages. Navigate to the directory where the RPMs are stored, and use the rpm -ivh command to install the kernel, module and ldiskfs packages.


 * $ rpm -ivh kernel-lustre-smp- \


 * kernel-ib- \
 * lustre-modules- \
 * lustre-ldiskfs-


 * b. Install the utilities/userspace packages. Use the rpm -ivh command to install the utilities packages. For example:


 * $ rpm -ivh lustre-


 * c. Install the e2fsprogs package. Make sure the e2fsprogs package downloaded in Step 5 is unpacked, and use the rpm -i command to install it. For example:


 * $ rpm -i e2fsprogs-

If you want to add any optional packages to your Lustre file system, install them now.

5. Verify that the boot loader (grub.conf or lilo.conf) has been updated to load the patched kernel.

6. Reboot the patched clients and the servers.


 * a. If you applied the patched kernel to any clients, reboot them. Unpatched clients do not need to be rebooted.
 * b. Reboot the servers. Once all the machines have rebooted, the next steps are to configure Lustre Networking (LNET) and the Lustre file system. See Configuring the Lustre File System.