Simple llmount.sh Single Node Lustre Example

llmount.sh is a Bash script in the Lustre test suite (/lib64/lustre/tests/llmount.sh after installation of lustre-tests package) that sets up a temporary single-node Lustre filesystem using loopback devices for testing. It creates MDT and OST on /tmp loopback files, formats them, loads modules, and mounts at /mnt/lustre by default. Use for quick verification, not production. Based on Lustre 2.17.0 (January 2026). For details, see Lustre wiki or source code.

Prerequisites

Setup

Run as root. The script sources test-framework.sh and cfg/local.sh.

sudo sh /lib64/lustre/tests/llmount.sh

Output: Formats devices, loads modules (lustre, lnet), starts MDS/OSS, mounts on /mnt/lustre by default.

Customize: Export variables before running (e.g., export FSNAME=testfs; export MOUNT=/mnt/lustre, or set in testfs.sh).

To avoid formatting: export NOFORMAT=1 (uses existing devices).

Usage

After setup:

# Check mount
mount | grep lustre
# Example: 127.0.0.1@tcp:/testfs on /mnt/lustre type lustre (rw)

# Disk usage
lfs df -h
# Shows MDT and OSTs with sizes (~250MB MDT, ~400MB OSTs default)

# Cleanup
sudo sh /lib64/lustre/tests/llmountcleanup.sh
# Unmounts, stops services, removes loop devices.

Fun Things to Try

Notes: Script uses /tmp for devices (mds1, ost1, ost2); adjust in testfs.sh for real disks like OSTDEV1=/dev/sdb, .... For multi-node, use custom cfg files. See wiki for advanced testing.