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
- Lustre installed (client and server packages; see Testing HOWTO).
- Root access; sufficient /tmp space (default ~500MB).
- Disable SELinux/firewall for testing.
- Optional: Set environment variables in cfg/local.sh (e.g., NETTYPE=tcp for TCP-only).
- Optional: Create a local configuration file in cfg/testfs.sh and set NAME=testfs environment variable to use instead of cfg/local.sh.
- Optional: Create a local configuration file in cfg/testfs.sh and set NAME=testfs environment variable to use instead of cfg/local.sh.
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
- Create Files:
dd if=/dev/zero of=/mnt/lustre/testfile bs=1M count=100(fills space); check withlfs df -h. - Striping:
lfs setstripe -c 2 /mnt/lustre/stripedfile(stripes over 2 OSTs); verifylfs getstripe /mnt/lustre/stripedfile. - Metadata Ops:
mkdir /mnt/lustre/dir; touch /mnt/lustre/dir/{1..1000}; time it for performance. - Run Tests: From /lib64/lustre/tests:
./sanity.sh --only 0a(basic test); or full./sanity.sh. - Debug: Export DEBUG_SIZE=1024 before llmount.sh; then
lctl dk > debug.logfor logs. - TCP-only: Edit cfg/testfs: NETTYPE=tcp; rerun llmount.sh.
- Quota: Enable
lctl conf_param lustre.quota.ost=ug; setlfs setquota -u user 100M /mnt/lustre; test limits. - HSM Sim: Setup simple HSM with copytool sim; archive/restore files.
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.