OS Manuals

ldev(8)

ldev - lustre device utility

LDEV(8) Lustre Configuration Utilities LDEV(8)

ldev - lustre device utility

ldev [OPTIONS]

ldev can be used to query information about lustre devices configured in /etc/ldev.conf. It is used by the lustre init script.

ldev accepts the following options:

Display help message.
Set path to config file.
Use NAME instead of local hostname for queries.
Print hostname of failover partner.
Print labels for local devices.
Print labels for foreign devices.
Print labels for local and foreign devices.
Print labels for file system NAME.
Sanity check config on this node. If any expected local or foreign devices are not present, print an error. If devices do not contain the expected labels, print an error.
Print storage device of label.
Print journal device corresponding to label if defined.
Print Linux software raid configuration file or ZFS cache file associated with LABEL, if any. Using non-default names for these files may help prevent arrays from being automatically started by the system. This is important in failover configurations where the timing of device initialization must be strictly controlled.
Print device type of LABEL, i.e. "zfs" or "md".
Print zpool containing LABEL.
Filter output based on role, i.e. mdt, ost, mgs.
Run one instance of CMD [ARGS] for each label in parallel. Only the local labels are used by default, but foreign, all, or file system labels may be selected by adding the --foreign, --all, or --filesys options. The following substitutions are made: %f=fsname, %d=device, %j=journal, %i=index, %I=hex-index, %t=type, %l=label, %n=nid, %N=failnid, %m=mgsnid, %H=hostname, %b=backing-fs. On failure of any child processes, ldev will return a non-zero exit code.

It is an error if %n, %N, or %m is used in a command and /etc/nids does not contain appropriate host to NID mappings.

/etc/ldev.conf
/etc/nids

To run a preen check on all devices in a cluster in parallel:

pdsh -S -g ost ldev fsck.ldiskfs -p %d

To re-format an entire file system:

#!/usr/bin/bash -xe
export FANOUT=64
# MDTs
# pdsh -S -g mds service lustre stop
# pdsh -S -g mds ldev yes \| mkfs.ldiskfs -q -b4096 -Ojournal_dev %j
# pdsh -S -g mds ldev dd if=/dev/zero of=%d count=8
# pdsh -S -g mds ldev mkfs.lustre --mdt --mgs --fsname=%f \
        --index=%i --mkfsoptions=-Jdevice=%j --mkfsoptions=-i2048 \
        --mountfsoptions=errors=panic,iopen_nopriv,user_xattr,\
                         maxdirsize=20000000 %d
# pdsh -S -g mds ldev tune.ldiskfs -i0 -m0 -c0 %d
# OSTs
mgs=172.16.2.200@tcp0
# pdsh -S -g ost service heartbeat stop
# pdsh -S -g ost service lustre stop
# pdsh -S -g ost ldev dd if=/dev/zero of=%d count=8
# pdsh -S -g ost ldev mkfs.lustre --ost --mgsnode=$mgs --fsname=%f \
        --index=%i --param=lov.stripecount=2 --failnode=%N \
        --mountfsoptions=errors=panic,extents,mballoc %d
# pdsh -S -g ost ldev tune.ldiskfs -epanic -i0 -m0 -c0 %d

ldev is part of the lustre(7) filesystem package since release 0.8.0

ldev.conf(5), nids(5)

2024-08-29 Lustre

lustre 2.17.59-r2 · enterprise-packages · ingested 2026-10-11