.br
.B lctl --device <devno> <command [args]>
.br
-.B lctl --threads <numthreads> <verbose> <devno> <command [args]>
-.br
.SH DESCRIPTION
.B 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 (in matching pairs)
+is used to directly control Lustre via an ioctl interface, allowing
+various configuration, maintenance, and debugging features to be accessed.
+
+.B 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
+.B dl
+,
+.B dk
+,
.B device
-and
-.B attach
-,
-.B detach
-and
-.B setup
,
-.B cleanup
-and
-.B connect
+.B network
+.I <up/down>
+,
+.B list_nids
+,
+.B ping
+.I nid
,
-.B disconnect
-and
.B help
-, and
+,
.B quit.
-To get a complete listing of available commands, type help 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.
+To get a complete listing of available commands, type
+.B help
+at the lctl prompt. To get basic help on the meaning and syntax of a
+command, type
+.B help
+.I command
+. Command completion is activated with the TAB key, and command history is available via the up- and down-arrow keys.
-For non-interactive single-threaded use, one uses the second invocation, which runs command after connecting to the device.
+For non-interactive use, one uses the second invocation, which runs command after connecting to the device.
-.B Network Configuration
-.TP
-network <tcp/elans/myrinet>
-Indicate what kind of network applies for the configuration commands that follow.
-.TP
-connect [[<hostname> <port>] | <elan id>]
-This will establish a connection to a remote network network id given by the hostname/port combination, or the elan id.
-.TP
-disconnect <nid>
-Disconnect from a remote nid.
-.TP
-mynid [nid]
-Informs the socknal of the local nid. It defaults to hostname for tcp networks and is automatically setup for elan/myrinet networks.
-.TP
-add_uuid <uuid> <nid>
-Associate a given UUID with an nid.
-.TP
-close_uuid <uuid>
-Disconnect a UUID.
-.TP
-del_uuid <uuid>
-Delete a UUID association.
-.TP
-add_route <gateway> <target> [target]
-Add an entry to the routing table for the given target.
-.TP
-del_route <target>
-Delete an entry for the target from the routing table.
+.SS Network Configuration
+.TP
+.BI network " <up/down>|<tcp/elan/myrinet>"
+Start or stop LNET, or select a network type for other
+.I lctl
+LNET commands
+.TP
+.BI list_nids
+Print all Network Identifiers on the local node. LNET must be running.
+.TP
+.BI which_nid " <nidlist>"
+From a list of nids for a remote node, show which interface communication
+will take place on.
+.TP
+.BI replace_nids " <devicename> <nid1>[,nid2,nid3 ...]"
+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'.
+.TP
+.BI ping " <nid> "
+Check LNET connectivity via an LNET ping. This will use the fabric
+appropriate to the specified NID.
+.TP
+.BI interface_list
+Print the network interface information for a given
+.B network
+type.
+.TP
+.BI peer_list
+Print the known peers for a given
+.B network
+type.
+.TP
+.BI conn_list
+Print all the connected remote NIDs for a given
+.B network
+type.
+.TP
+.BI active_tx
+This command should print active transmits, and it is only used for elan network type.
.TP
-route_list
+.BI route_list
Print the complete routing table.
-.TP
-recv_mem [size]
-Set the socket receive buffer size; if the size is omitted, the default size for the buffer is printed.
-.TP
-send_mem [size]
-Set send buffer size for the socket; if size is omitted, the default size for the buffer is printed.
-.TP
-nagle [on/off]
-Enable/disable nagle; omitting the argument will cause the default value to be printed.
-.TP
-fail nid|all [count]
-Fail/restore communications. Ommiting tha count implies fail indefinitely, count of zero indicates that communication should be restored. A non-zero count indicates the number of portals messages to be dropped after which the communication is restored.
.PP
-.B Device Selection
-.TP
-newdev
-Create a new device.
+.SS Device Selection
.TP
-name2dev
-This command can be used to determine a device number for the given device name.
-.TP
-device
+.BI device " <devname> "
This will select the specified OBD device. All other commands depend on the device being set.
.TP
-device_list
-Show all the devices.
-.TP
-lustre_build_version
-Print the Lustre build version.
+.BI device_list
+Show all the local Lustre OBDs. AKA
+.B dl
.PP
-.B Device Configuration
-.TP
-attach type [name [uuid]]
-Attach a type to the current device (which you need to set using the device command) and give that device a name and UUID. This allows us to identify the device for use later, and also tells us what type of device we will have.
-.TP
-setup <args...>
-Type specific device setup commands. For obdfilter, a setup command tells the driver which block device it should use for storage and what type of filesystem is on that device.
-.TP
-cleanup
-Cleanup a previously setup device.
-.TP
-detach
-Remove driver (and name and UUID) from the current device.
-.TP
-lov_setconfig lov-uuid stripe-count default-stripe-size offset pattern UUID1 [UUID2...]
-Write LOV configuration to an MDS device.
-.TP
-lov_getconfig lov-uuid
-Read LOV configuration from an MDS device. Returns default-stripe-count, default-stripe-size, offset, pattern, and a list of OST UUID's.
-.PP
-.B Device Operations
-.TP
-probe [timeout]
-Build a connection handle to a device. This command is used to suspend configuration until the lctl command has ensured that the MDS and OSC services are available. This is to avoid mount failures in a rebooting cluster.
-.TP
-close
-Close the connection handle
-.TP
-getattr <objid>
-Get attributes for an OST object <objid> .
-.TP
-setattr <objid> <mode>
-Set mode attribute for OST object <objid>.
+.SS Device Operations
.TP
-create [num [mode [verbose]]]
-Create the specified number <num> of OST objects with the given <mode>.
-.TP
-destroy <num>
-Starting at <objid>, destroy <num> number of objects starting from the object with object id <objid>.
-.TP
-test_getattr <num> [verbose [[t]objid]]
-Do <num> getattrs on OST object <objid> (objectid+1 on each thread).
-.TP
-test_brw [t]<num> [write [verbose [npages [[t]objid]]]]
-Do <num> bulk read/writes on OST object <objid> (<npages> per I/O).
-.TP
-test_ldlm
-Perform lock manager test.
-.TP
-ldlm_regress_start %s [numthreads [refheld [numres [numext]]]]
-Start lock manager stress test.
-.TP
-ldlm_regress_stop
-Stop lock manager stress test.
-.TP
-dump_ldlm
-Dump all lock manager state, this is very useful for debugging
-.TP
-activate
-Activate an import
-.TP
-deacttivate
-De-activate an import
-.TP
-recover <connection UUID>
-.TP
-lookup <directory> <file>
-.TP
-notransno
-Disable sending of committed transnumber updates
-.TP
-readonly
-Disable writes to the underlying device
-.TP
-abort_recovery
-Abort recovery on MDS device
-.TP
-mount_option
-Dump mount options to a file
-.TP
-get_stripe
-Show stripe info for an echo client object.
-.TP
-set_stripe <objid>[ width!count[@offset] [:id:id....]
-Set stripe info for an echo client
-.TP
-unset_stripe <objid>
-Unset stripe info for an echo client object.
-.PP
-.B Debug
-.TP
-debug_daemon
-Debug daemon control and dump to a file
-.TP
-debug_kernel [file] [raw]
-Get debug buffer and dump to a fileusage.
-.TP
-debug_file <input> [output] [raw]
-Read debug buffer from input and dump to outputusage.
-.TP
-clear
-Clear kernel debug buffer.
-.TP
-mark <text>
-Insert marker text in kernel debug buffer.
-.TP
-filter <subsystem id/debug mask>
-Filter message type from the kernel debug buffer.
-.TP
-show <subsystem id/debug mask>
-Show specific type of messages.
-.TP
-debug_list <subs/types>
-List all the subsystem and debug types.
-.TP
-panic
-Force the kernel to panic.
-.PP
-.B Control
-.TP
-help
-Show a complete list of commands; help <command name> can be used to get help on specific command.
-.TP
-exit
-Close the lctl session.
-.TP
-quit
-Close the lctl session.
-
-.SH OPTIONS
-The following options can be used to invoke lctl.
-.TP
-.B --device
-The device number to be used for the operation. The value of devno is an integer, normally found by calling lctl name2dev on a device name.
-.TP
-.B --threads
-How many threads should be forked doing the command specified. The numthreads variable is a strictly positive integer indicating how many threads should be started. The devno option is used as above.
+.BI list_param " [-F|-R] <param_search ...>"
+List the Lustre or LNet parameter name
+.B -F
+Add '/', '@' or '=' for dirs, symlinks and writeable files, respectively.
+.br
+.B -R
+Recursively list all parameters under the specified parameter search string. If
+.I param_search
+is unspecified, all the parameters will be shown.
+.br
+.B Examples:
+.br
+.B
+# lctl list_param ost.*
+.br
+ ost.OSS
+.br
+ ost.num_refs
+.br
+.B
+# lctl list_param -F ost.* debug
+.br
+ ost.OSS/
+.br
+ ost.num_refs
+.br
+ debug=
+.br
+.B
+# lctl list_param -R mdt
+.br
+ mdt
+.br
+ mdt.lustre-MDT0000
+.br
+ mdt.lustre-MDT0000.capa
+.br
+ mdt.lustre-MDT0000.capa_count
+.br
+ mdt.lustre-MDT0000.capa_key_timeout
+.br
+ mdt.lustre-MDT0000.capa_timeout
+.br
+ mdt.lustre-MDT0000.commit_on_sharing
+.br
+ mdt.lustre-MDT0000.evict_client
+.br
+ ...
.TP
-.B --ignore_errors | ignore_errors
-Ignore errors during script processing
+.BI get_param " [-n|-N|-F] <parameter ...>"
+Get the value of Lustre or LNET parameter.
+.br
+.B -n
+Print only the value and not parameter name.
+.br
+.B -N
+Print only matched parameter names and not the values. (Especially useful when using patterns.)
+.br
+.B -F
+When -N specified, add '/', '@' or '=' for directories, symlinks and writeable files, respectively.
+.br
+.B Examples:
+.br
+.B
+# lctl get_param ost.*
+.br
+ ost.OSS
+.br
+ ost.num_refs
+.br
+.B
+# lctl get_param -n debug timeout
+.br
+ super warning dlmtrace error emerg ha rpctrace vfstrace config console
+.br
+ 20
+.br
+.B
+# lctl get_param -N ost.* debug
+.br
+ ost.OSS
+.br
+ ost.num_refs
+.br
+ debug
+.br
+lctl "get_param -NF" is equivalent to "list_param -F".
.TP
-.B dump
-Save ioctls to a file
-.SH EXAMPLES
-.B attach
-
-# lctl
+.BI set_param " [-n] [-P] [-d] <parameter=value ...>"
+Set the value of Lustre or LNET parameter.
.br
-lctl > newdev
+.B -n
+Disable printing of the key name when printing values.
.br
-lctl > attach obdfilter OBDDEV OBDUUID
-
-.B connect
-
-lctl > name2dev OSCDEV 2
+.B -P
+Set the parameter permanently, filesystem-wide.
+This parameters are only visible to 2.5.0 and later clients, older clients will not see these parameters.
.br
-lctl > device 2
+.B -d
+Remove the permanent setting (only with -P option)
.br
-lctl > connect
-
-.B getattr
-
-lctl > getattr 12
+.B Examples:
.br
-id: 12
+.B
+# lctl set_param fail_loc=0 timeout=20
.br
-grp: 0
+ fail_loc=0
.br
-atime: 1002663714
+ timeout=20
.br
-mtime: 1002663535
+.B
+# lctl set_param -n fail_loc=0 timeout=20
.br
-ctime: 1002663535
+ 0
.br
-size: 10
+ 20
.br
-blocks: 8
+.B
+# lctl set_param -P osc.*.max_dirty_mb=32
.br
-blksize: 4096
+.TP
+.BI 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.
.br
-mode: 100644
+.B -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.
.br
-uid: 0
+.B Parameters:
.br
-gid: 0
+All of the writable parameters under
+.B lctl list_param
+(e.g.
+.I lctl list_param -F osc.*.* | grep =
+) can be permanently set using
+.B 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.
.br
-flags: 0
+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.
.br
-obdflags: 0
+.B Examples:
+.br
+# lctl conf_param testfs.sys.at_max=1200
.br
-nlink: 1
+# lctl conf_param testfs.llite.max_read_ahead_mb=16
.br
-valid: ffffffff
+# lctl conf_param testfs-MDT0000.lov.stripesize=2M
.br
-inline:
+# lctl conf_param lustre-OST0001.osc.active=0
.br
-obdmd:
+# lctl conf_param testfs-OST0000.osc.max_dirty_mb=29.15
.br
-lctl > disconnect
+# lctl conf_param testfs-OST0000.ost.client_cache_seconds=15
.br
-Finished (success)
+# lctl conf_param testfs-OST0000.failover.node=1.2.3.4@tcp1
+.TP
+.BI activate
+Reactivate an import after deactivating, below. This setting is only effective until the next restart (see
+.B conf_param
+).
+.TP
+.BI 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.
+.TP
+.BI abort_recovery
+Abort the recovery process on a restarting MDT or OST device
+.PP
+.SS Virtual Block Device Operation
+Lustre is able to emulate a virtual block device upon regular file. It is necessary to be used when you are trying to setup a swap space via file.
+.TP
+.BI blockdev_attach " <file name> <device node>"
+Attach the lustre regular file to a block device. If the device node is not existent, lctl will create it \- it is recommended to create it by lctl since the emulator uses a dynamical major number.
+.TP
+.BI blockdev_detach " <device node>"
+Detach the virtual block device.
+.TP
+.BI blockdev_info " <device node>"
+Acquire which lustre file was attached to the device node.
+.PP
+.SS Changelogs
+.TP
+.BI changelog_register
+Register a new changelog user for a particular device. Changelog entries
+will not be purged beyond any registered users' set point. (See lfs changelog_clear.)
+.TP
+.BI changelog_deregister " <id>"
+Unregister an existing changelog user. If the user's "clear" record number
+is the minimum for the device, changelog records will be purged until the
+next minimum.
+.PP
+.SS LFSCK
+An on-line Lustre consistency check and repair tool.
+.TP
+.B lfsck_start \fR<-M | --device MDT_device>
+ \fR[-e | --error <error_handle>]
+ \fR[-h | --help]
+ \fR[-n | --dryrun <switch>]
+ \fR[-r | --reset]
+ \fR[-s | --speed <speed_limit>]
+ \fR[-t | --type <lfsck_type[,lfsck_type...]>]
+.br
+Start LFSCK on the specified MDT device with specified parameters.
+.TP
+ -M, --device <MDT_device>
+The MDT device to check.
+.TP
+ -e, --error <error_handle>
+With error_handle as 'abort' LFSCK will stop if a repair is impossible. If no
+value is specified, the saved value will be used if resuming from a checkpoint.
+Otherwise the default behavior is to 'continue' if a rapair is impossible.
+.TP
+ -h, --help
+Show this help.
+.TP
+ -n, --dryrun <on|off>
+Perform a trial run with no changes made.
+.TP
+ -r, --reset
+Set the current position of LFSCK progress to the beginning of the specified
+MDT.
+.TP
+ -s, --speed <speed_limit>
+Set the upper limit of LFSCK processing in objects per second. If no value is
+specified the saved value is used (if resuming from a check point). Otherwise
+the default value of 0 is used. 0 means run as fast as possible.
+.TP
+ -t, --type <lfsck_type[,lfsck_type...]>
+Specify the type of LFSCK to execute. By default, OI Scrub is executed.
+Alternative types include FID-in-dirent and linkEA (namespace).
+.TP
+.B lfsck_stop \fR<-M | --device MDT_device> [-h | --help]
+Stop LFSCK on the specified MDT device.
+.TP
+ -M, --device <MDT_device>
+The MDT device.
+.TP
+ -h, --help
+Show this help.
+.SS Debug
+.TP
+.BI debug_daemon
+Start and stop the debug daemon, and control the output filename and size.
+.TP
+.BI debug_kernel " [file] [raw]"
+Dump the kernel debug buffer to stdout or file.
+.TP
+.BI debug_file " <input> [output]"
+Convert kernel-dumped debug log from binary to plain text format.
+.TP
+.BI clear
+Clear the kernel debug buffer.
+.TP
+.BI mark " <text>"
+Insert marker text in the kernel debug buffer.
+.TP
+.BI filter " <subsystem id/debug mask>"
+Filter kernel debug messages by subsystem or mask.
+.TP
+.BI show " <subsystem id/debug mask>"
+Show specific type of messages.
+.TP
+.BI debug_list " <subs/types>"
+List all the subsystem and debug types.
+.TP
+.BI modules " <path>"
+Provide gdb-friendly module information.
-.B setup
+.SH OPTIONS
+The following options can be used to invoke lctl.
+.TP
+.B --device
+The device to be used for the operation. This can be specified by name or
+number. See
+.B device_list
+.TP
+.B --ignore_errors | ignore_errors
+Ignore errors during script processing
-lctl > setup /dev/loop0 extN
+.SH EXAMPLES
+# lctl
+.br
+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
+.br
+lctl > dk /tmp/log
+Debug log: 87 lines, 87 kept, 0 dropped.
.br
lctl > quit
-.SH BUGS
-None are known.
+.SH AVAILABILITY
+.B lctl
+is part of the
+.BR Lustre (7)
+filesystem package.
+.SH SEE ALSO
+.BR Lustre (7),
+.BR mkfs.lustre (8),
+.BR mount.lustre (8),
+.BR lctl (8),
+.BR lfs (1)