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 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 <devicename> <nid1>[,nid2,nid3:nid4,nid5:nid6 ...]
    Replace the LNET Network Identifiers for a given device, as when the server's IP address has changed. This command must be run on the MGS node. Only MGS server should be started (command execution returns error in another cases). To start the MGS service only: mount -t lustre <MDT partition> -o nosvc <mount point> Note the replace_nids command skips any invalidated records in the configuration log. The previous log is backed up with the suffix '.bak'. Failover nids must be passed after ':' symbol. More then one failover can be set (every failover nids after ':' symbol).

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.
    -d <device|fsname>.<parameter> Delete 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 -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
An identity mapping feature that facilitates mapping of client UIDs and GIDs to local file system UIDs and GIDs, while maintaining POSIX ownership, permissions, and quota. While the nodemap feature is enabled, all client file system access is subject to the nodemap identity mapping policy, which consists of the 'default' catchall nodemap, and any user-defined nodemaps. The 'default' nodemap maps all client identities to 99:99 (nobody:nobody). Administrators can define nodemaps for a range of client NIDs which map identities, and these nodemaps can be flagged as
 'trusted' so identities are accepted without translation, as well as flagged as 'admin' meaning that root is not squashed for these nodes. Note: In the current phase of implementation, to use the nodemap functionality you only need to enable and define nodemaps on the MDS. The MDSes must also be in a nodemap with the admin and trusted flags set. To use quotas with nodemaps, you must also use set_param to enable and define nodemaps on the OSS (matching what is defined on the MDS). Nodemaps do not currently persist, unless you define them with set_param and use the -P flag. Note that there is a hard limit to the number of changes you can persist over the lifetime of the file system. 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-del(8)
    Delete an existing nodemap.

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

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

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

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

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

lctl-nodemap-set-fileset(8)
    Add a fileset to 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>.
Example:
# 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.

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-start(8), lctl-lfsck-stop(8), lctl-lfsck-query(8), lctl-list_param(8), lctl-set_param(8), lctl-snapshot-create(8), lctl-snapshot-destroy(8), lctl-snapshot-modify(8), lctl-snapshot-list(8), lctl-snapshot-mount(8), lctl-snapshot-umount(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-range(8), lctl-nodemap-del(8), lctl-nodemap-del-idmap(8), lctl-nodemap-del-range(8), lctl-nodemap-modify(8), lctl-pcc(8), mkfs.lustre(8), mount.lustre(8),