LCTL(8)

NAME
lctl - Lustre filesystem administrator configuration tool

SYNOPSIS
lctl
lctl --device DEVNO COMMAND [ARGS]
lctl --version
lctl --list-commands

DESCRIPTION
lctl is used to directly control Lustre via an ioctl interface, allowing various configuration, maintenance, and debugging features to be accessed.

lctl can be invoked in interactive mode by issuing lctl command. After that, commands are issued as below. The most common commands in lctl are dl, dk, device, network {up|down}, list_nids, ping nid, help, quit.

To get a complete listing of available commands, type --list-commands at the lctl prompt. To get basic help on the meaning and syntax of a command, type help command Command completion is activated with the TAB key, and command history is available via the up- and down-arrow keys.

For non-interactive use, one uses the second invocation, which runs command after connecting to the device.

  System Configuration
The on-line tool set for backup or removal of Lustre system configuration. For detail, please see:
lctl-lcfg(8)

  Network Configuration

network{up|down}|{tcp|o2ib}
    Start or stop LNET, or select a network type for other lctl LNET commands

list_nids
    Print all Network Identifiers on the local node. LNET must be running.

which_nid NIDLIST
    From a list of nids for a remote node, show which interface communication will take place on.

replace_nids DEVICE_NAME NIDS_LIST
    Replace the LNet NIDs. See lctl-replace_nids(8) for details.

ping NID TIMEOUT
    Check LNET connectivity via an LNET ping. This will use the fabric appropriate to the specified NID. By default lctl will attempt to reach the remote node up to 120 seconds and then timeout. To disable the timeout just specify an negative timeout value.

interface_list
    Print the network interface information for a given network type.

peer_list
    Print the known peers for a given network type.

conn_list
    Print all the connected remote NIDs for a given network type.

route_list
    Print the complete routing table.

  Device Selection

device DEVNAME
    This will select the specified OBD device. All other commands depend on the device being set.

device_list [--target|-t] [ --yaml|-y]
    Show all the local Lustre OBDs. dl is the same command. The -t option additonally will report the server's export NID linked to the local OBD. The -y option will display the OBD device information in YAML format.

  Device Operations

conf_param [-d] DEVICE|FSNAME.PARAMETER=VALUE
    Set a permanent configuration parameter for any device via the MGS. This command must be run on the MGS node.

    The -d option deletes a parameter setting (use the default value at the next restart). A null value for VALUE also deletes the parameter setting. This is useful if an incorrect or obsolete parameter is in the configuration.

    Parameters:
        All of the writable parameters under lctl list_param (e.g. lctl list_param -w osc.*.* or lctl list_param -F osc.*.* | grep = ) can be permanently set using lctl conf_param , but the format is slightly different. For conf_param, the device is specified first, then the obdtype. (See examples below.) Wildcards are not supported.
        Additionally, failover nodes may be added (or removed), and some system-wide parameters may be set as well (sys.at_max, sys.at_min, sys.at_extra, sys.at_early_margin, sys.at_history, sys.timeout, sys.ldlm_timeout.) DEVICE is ignored for system wide parameters.

    Examples:
            # lctl conf_param testfs.sys.at_max=1200
            # lctl conf_param testfs.llite.max_read_ahead_mb=16
            # lctl conf_param testfs-MDT0000.lov.stripesize=2M
            # lctl conf_param lustre-OST0001.osc.active=0
            # lctl conf_param testfs-OST0000.osc.max_dirty_mb=29.15
            # lctl conf_param testfs-OST0000.ost.client_cache_seconds=15
            # lctl conf_param testfs-OST0000.failover.node=1.2.3.4@tcp1
            # lctl conf_param -d testfs-OST0000.bad_param

activate
    Reactivate an import after deactivating, below. This setting is only effective until the next restart (see conf_param).

deactivate
    Deactivate an import, in particular meaning do not assign new file stripes to an OSC. This command should be used on the OSC in the MDT LOV corresponding to a failed OST device, to prevent further attempts at communication with the failed OST.

abort_recovery
    Abort the recovery process on a restarting MDT or OST device

  Changelogs
Changelog user can be registered and deregistered on particular device. Changelog starts logging when any user is registered.

For more details see:

lctl-changelog_register(8)
    Register a new changelog user on specified MDT device with specified parameters.

lctl-changelog_deregister(8)
    Deregister an existing changelog user on the specified MDT.

  NODEMAP
The nodemap feature allows UIDs, GIDs, and PROJIDs from remote systems to be mapped to local sets of UIDs, GIDs, and PROJIDs while retaining POSIX ownership, permissions and quota information. As a result, multiple sites with conflicting user and group identifiers can operate on a single Lustre file system without creating collisions in the UID, GID, or PROJID space.

Nodemap commands must be run on the MGS from where the current nodemap configuration is asynchronously propagated to all server nodes. The nodemap configuration further persists across restarts. An exception represents dynamic nodemaps (see lctl-nodemap-add (8)) which are defined on the local server only and are not persistent.

In addition to assigning client nodes to nodemaps, it is necessary to define a privileged nodemap that covers all Lustre server nodes for ID mapping to work correctly. The privileged nodemap should have both "admin" and "trusted" properties set.

The "default" nodemap is a special nodemap which cannot be removed and represents a fallback nodemap for all nodes that are not assigned to any other nodemap. Because of its special role, only some properties can be set on it, such as "squash_uid". ID mapping is explicitly disabled on the "default" nodemap. Care should be taken when modifying the "admin" and "trusted" properties on the "default" nodemap, especially if Lustre servers are not covered by any other nodemap.

See also:

lctl-nodemap-activate(8)
    Activate/deactivate the nodemap feature.

lctl-nodemap-add(8)
    Add a new nodemap, to which NID ranges, identities, and properties can be added.

lctl-nodemap-add-idmap(8)
    Add a UID or GID mapping to a nodemap.

lctl-nodemap-add-range(8)
    Define a range of NIDs for a nodemap.

lctl-nodemap-add-offset(8)
    Set a UID/GID/PROJID offset value

lctl-nodemap-del(8)
    Delete an existing nodemap.

lctl-nodemap-del-idmap(8)
    Delete an existing UID or GID mapping from a nodemap.

lctl-nodemap-del-range(8)
    Delete an existing NID range from a nodemap.

lctl-nodemap-del-offset(8)
    Remove a UID/GID/PROJID offset from a nodemap.

lctl-nodemap-fileset-add(8)
    Add a primary or alternate fileset to a nodemap.

lctl-nodemap-fileset-del(8)
    Delete a type of fileset from a nodemap.

lctl-nodemap-fileset-modify(8)
    Modify a fileset in a nodemap, changing its path, type, or access mode.

lctl-nodemap-modify(8)
    Modify a nodemap property.

lctl-nodemap-info(8)
    Print nodemap information.

lctl-nodemap-set-cap(8)
    Set user capabilities on a nodemap.

lctl-nodemap-set-sepol(8)
    Set SELinux policy info on a nodemap.

  Configuration logs

clear_conf DEVICE|FSNAME
    This command runs on MGS node having MGS device mounted with -o nosvc. It cleans up configuration files stored in the CONFIGS/ directory of any records marked SKIP. If the device name is given, then the specific logs for that filesystem (e.g. testfs-MDT0000) is processed. Otherwise, if a filesystem name is given then all configuration files for the specified filesystem are cleared.

  LFSCK
An on-line Lustre consistency check and repair tool. It is used for totally replacing the old lfsck tool for kinds of Lustre inconsistency verification, including: corrupted or lost OI mapping, corrupted or lost link EA, corrupted or lost FID in name entry, dangling name entry, multiple referenced name entry, unmatched MDT-object and name entry pairs, orphan MDT-object, incorrect MDT-object links count, corrupted namespace, corrupted or lost LOV EA, lost OST-object, multiple referenced OST-object, unmatched MDT-object and OST-object pairs, orphan OST-object, and so on.

See also:

lctl-lfsck-start(8)
    Start LFSCK on the specified MDT or OST device with specified parameters.

lctl-lfsck-stop(8)
    Stop LFSCK on the specified MDT or OST device.

lctl-lfsck-query(8)
    Get the LFSCK global status via the specified MDT device.

  BARRIER
The tools set for write (modify) barrier on all MDTs. For detail, please see:

lctl-barrier(8)

  SNAPSHOT
ZFS backend based snapshot tools set. The tool loads system configuration from the file /etc/ldev.conf on the MGS, and call related ZFS commands to maintain Lustre snapshot pieces on all targets (MGS/MDT/OST). The configuration file /etc/ldev.conf is not only for snapshot, but also for other purpose.

The format is:
    HOST foreign/-LABEL DEVICE
    [JOURNAL_PATH]
    /-
    [RAIDTAB]

The format of LABEL is:
    FSNAME-
    {ROLE}{INDEX} or {ROLE}{INDEX}

The format of DEVICE is:
    [md|zfs:]
    [POOL_DIR
    /]
    POOL/FILESYSTEM

Snapshot only uses the fields HOST, LABEL and DEVICE.

# cat /etc/ldev.conf
     host-mdt1 - myfs-MDT0000 zfs:/tmp/myfs-mdt1/mdt1
     host-mdt2 - myfs-MDT0001 zfs:myfs-mdt2/mdt2
     host-ost1 - OST0000 zfs:/tmp/myfs-ost1/ost1
     host-ost2 - OST0001 zfs:myfs-ost2/ost2

See also:

lctl-snapshot-create(8)
    Create snapshot with the given name.

lctl-snapshot-destroy(8)
    Destroy the specified snapshot.

lctl-snapshot-modify(8)
    Modify the specified snapshot.

lctl-snapshot-list(8)
    Query the snapshot information.

lctl-snapshot-mount(8)
    Mount the specified snapshot.

lctl-snapshot-umount(8)
    Umount the specified snapshot.

  Debug

debug_daemon
    Start and stop the debug daemon, and control the output filename and size.

debug_kernel [FILE] [RAW]
    Dump the kernel debug buffer to stdout or file.

debug_file INPUT [OUTPUT]
    Convert kernel-dumped debug log from binary to plain text format.

clear
    Clear the kernel debug buffer.

mark TEXT
    Insert marker text in the kernel debug buffer.

filter SUBSYSTEM_ID|DEBUG_MASK
    Filter kernel debug messages by subsystem or mask.

show SUBSYSTEM_ID|DEBUG_MASK
    Show specific type of messages.

debug_list SUBS|TYPES
    List all the subsystem and debug types.

modules PATH
    Provide gdb-friendly module information.

OPTIONS
The following options can be used to invoke lctl.

--device
    The device to be used for the operation. This can be specified by name or number. See device_list

--ignore_errors, ignore_errors
    Ignore errors during script processing

lustre_build_version
    Output the build version of the Lustre kernel modules

--version
    Output the build version of the lctl utility

--list-commands
    Output a list of the commands supported by the lctl utility

help
    Provides brief help on the various arguments

exit, quit
    Quit the interactive lctl session

EXAMPLES
# lctl
lctl > dl
  0 UP mgc MGC192.168.0.20@tcp bfbb24e3-7deb-2ffa-eab0-44dffe00f692 5
  1 UP ost OSS OSS_uuid 3
  2 UP obdfilter testfs-OST0000 testfs-OST0000_UUID 3
lctl > dk /tmp/log
Debug log: 87 lines, 87 kept, 0 dropped.
lctl > quit

AVAILABILITY
lctl is part of the lustre(7) filesystem package since release 0.5.0

SEE ALSO
lfs(1), lustre(7), lctl(8), lctl-barrier(8), lctl-changelog_deregister(8), lctl-changelog_register(8), lctl-get_param(8), lctl-lcfg(8), lctl-lfsck-query(8), lctl-lfsck-start(8), lctl-lfsck-stop(8), lctl-list_param(8), lctl-llog_catlist(8), lctl-llog_info(8), lctl-llog_print(8), lctl-network(8), lctl-nodemap-activate(8), lctl-nodemap-add(8), lctl-nodemap-add-idmap(8), lctl-nodemap-add-offset(8), lctl-nodemap-add-range(8), lctl-nodemap-del(8), lctl-nodemap-del-idmap(8), lctl-nodemap-del-offset(8), lctl-nodemap-del-range(8), lctl-nodemap-modify(8), lctl-nodemap-set-capabilities(8), lctl-pcc(8), lctl-replace-nids(8), lctl-set_param(8), lctl-snapshot-create(8), lctl-snapshot-destroy(8), lctl-snapshot-list(8), lctl-snapshot-modify(8), lctl-snapshot-mount(8), lctl-snapshot-umount(8), mkfs.lustre(8), mount.lustre(8)