ldev(8)

NAME
ldev - lustre device utility

SYNOPSIS
ldev [OPTIONS]

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

OPTIONS
ldev accepts the following options:

-h, --help
    Display help message.

-c, --config FILE
    Set path to config file.

-H, --hostname NAME
    Use NAME instead of local hostname for queries.

-p, --partner
    Print hostname of failover partner.

-l, --local
    Print labels for local devices.

-f, --foreign
    Print labels for foreign devices.

-a, --all
    Print labels for local and foreign devices.

-F, --filesys NAME
    Print labels for file system NAME.

-s, --sanity
    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.

-d, --device LABEL
    Print storage device of label.

-j, --journal LABEL
    Print journal device corresponding to label if defined.

-r, --raidtab LABEL
    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.

-t, --type LABEL
    Print device type of LABEL, i.e. "zfs" or "md".

-z, --zpool LABEL
    Print zpool containing LABEL.

-R, --role ROLE
    Filter output based on role, i.e. mdt, ost, mgs.

CMD [ARGS...]
    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.

EXAMPLES
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:

    #!/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

FILES
/etc/ldev.conf
/etc/nids

SEE ALSO
ldev.conf(5) nids(5)