Whamcloud - gitweb
LU-2740 utils: Add support for --version option
[fs/lustre-release.git] / lustre / doc / lctl.8
index 1e112dd..4cd0e09 100644 (file)
@@ -7,301 +7,453 @@ lctl \- Low level Lustre filesystem configuration utility
 .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.
-.TP 
-name2dev 
-This command can be used to determine a device number for the given device name.
+.SS Device Selection
 .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. 
+.SS Device Operations
 .TP 
-cleanup 
-Cleanup a previously setup device.
+.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
+.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
+.BI set_param " [-n] [-P] [-d] <parameter=value ...>"
+Set the value of Lustre or LNET parameter.
+.br
+.B -n
+Disable printing of the key name when printing values.
+.br
+.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
+.B -d
+Remove the permanent setting (only with -P option)
+.br
+.B Examples:
+.br
+.B
+# lctl set_param fail_loc=0 timeout=20
+.br
+  fail_loc=0
+.br
+  timeout=20
+.br
+.B
+# lctl set_param -n fail_loc=0 timeout=20
+.br
+  0
+.br
+  20
+.br
+.B
+# lctl set_param -P osc.*.max_dirty_mb=32
+.br
+.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
+.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
+.B Parameters:
+.br
+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
+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
+.B Examples:
+.br 
+# lctl conf_param testfs.sys.at_max=1200
+.br
+# lctl conf_param testfs.llite.max_read_ahead_mb=16 
+.br
+# lctl conf_param testfs-MDT0000.lov.stripesize=2M
+.br
+# lctl conf_param lustre-OST0001.osc.active=0 
+.br
+# lctl conf_param testfs-OST0000.osc.max_dirty_mb=29.15 
+.br
+# lctl conf_param testfs-OST0000.ost.client_cache_seconds=15 
+.br
+# lctl conf_param testfs-OST0000.failover.node=1.2.3.4@tcp1
 .TP 
-detach 
-Remove driver (and name and UUID) from the current device.
+.BI activate 
+Reactivate an import after deactivating, below.  This setting is only effective until the next restart (see 
+.B conf_param
+).
 .TP 
-lov_setconfig lov-uuid stripe-count default-stripe-size offset pattern UUID1 [UUID2...] 
-Write LOV configuration to an MDS device.
+.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 
-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.
+.BI abort_recovery 
+Abort the recovery process on a restarting MDT or OST device
 .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>.
-.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.
+.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
-.B Debug
+.SS LFSCK
+An on-line Lustre consistency check and repair tool.
+.TP
+.B lfsck_start \fR<-M | --device [MDT,OST]_device>
+     \fR[-A | --all] [-c | --create_ostobj [on | off]]
+     \fR[-e | --error <continue | abort>] [-h | --help]
+     \fR[-n | --dryrun [on | off]] [-o | --orphan]
+     \fR[-r | --reset] [-s | --speed speed_limit]
+     \fR[-t | --type lfsck_type[,lfsck_type...]]
+     \fR[-w | --window_size size]
+.br
+Start LFSCK on the specified MDT or OST device with specified parameters.
+.TP
+  -M, --device <MDT,OST_device>
+The MDT or OST device to start LFSCK/scrub on.
+.TP
+  -A, --all
+Start LFSCK on all available MDT devices.
+.TP
+  -c, --create_ostobj [on | off]
+Create the lost OST-object for dangling LOV EA: 'off' (default) or 'on'. Under
+default mode, when the LFSCK find some MDT-object with dangling reference, it
+will report the inconsistency but will not repair it.  If 'on' is given, then
+LFSCK will re-create the missed OST-object.
+.TP
+  -e, --error <error_handle>
+With error_handle as 'abort' then if a repair is impossible LFSCK will save
+the current position stop with an error.  Otherwise the default behavior is
+to 'continue' if a repair is impossible.
+.TP
+  -h, --help
+Show the usage message.
+.TP
+  -n, --dryrun [on | off]
+Perform a trial run with no changes made, if 'on' or no argument is given.
+Default is 'off', meaning that any inconsistencies found will be repaired.
+.TP
+  -o, --orphan
+Handle orphan objects, such as orphan OST-objects for layout LFSCK by
+linking them under the .../.lustre/lost+found directory.
+.TP
+  -r, --reset
+Set the current position of object iteration to the beginning of the specified
+device. The non-specified parameters will also be reset to the default. By
+default the iterator will resume the scanning from the last saved checkpoint
+position, and other unspecified parameters will be the same as the prior
+incomplete run.
+.TP
+  -s, --speed <speed_limit>
+Set the upper limit of LFSCK processing in objects per second to reduce load
+on the servers and storage. If no value is specified the saved value is used
+(if resuming from a checkpoint). Otherwise the default value of 0 is used,
+which means check the filesystem as quickly as possible.
+.TP
+  -t, --type <lfsck_type[,lfsck_type...]>
+The type of LFSCK checking/repair to execute. If no type is given and the
+previous run was incomplete or internal consistency checks detected an error,
+then the same types are used for the next run.  Otherwise, the default is to
+check all types of consistency.  Any time LFSCK is triggered on an ldiskfs
+MDT or OST then OI Scrub is run.  Valid types are a comma-separated list of one or more of
+.B scrub
+to run only the local OI Scrub on ldiskfs targets,
+.B namespace
+for FID-in-dirent and linkEA checking on the MDT(s),
+.B layout
+for MDT-OST cross-reference consistency, and
+.B all
+to run all of the available check types.
+.TP
+  -w, --window_size <size>
+Specifies the maximum number of in-flight request being processed at
+one time.  This controls the load placed on remote OSTs when running
+.B layout
+checks.  By default there are at most 1024 outstanding requests.
+.TP
+.B lfsck_stop  \fR<-M | --device [MDT,OST]_device> [-A | --all] [-h | --help]
+Stop LFSCK on the specified MDT or OST device.
+.TP
+  -M, --device <[MDT,OST]_device>
+The MDT or OST device to stop LFSCK/scrub on.
+.TP
+  -A, --all
+Stop LFSCK on all devices.
+.TP
+  -h, --help
+Show this help.
+.SS Debug
 .TP 
-debug_daemon 
-Debug daemon control and dump to a file
+.BI debug_daemon 
+Start and stop the debug daemon, and control the output filename and size.
 .TP 
-debug_kernel [file] [raw] 
-Get debug buffer and dump to a fileusage.
+.BI debug_kernel " [file] [raw]" 
+Dump the kernel debug buffer to stdout or file.
 .TP 
-debug_file <input> [output] [raw] 
-Read debug buffer from input and dump to outputusage.
+.BI debug_file " <input> [output]"
+Convert kernel-dumped debug log from binary to plain text format.
 .TP 
-clear 
-Clear kernel debug buffer.
+.BI clear 
+Clear the kernel debug buffer.
 .TP 
-mark <text> 
-Insert marker text in kernel debug buffer.
+.BI mark " <text>" 
+Insert marker text in the kernel debug buffer.
 .TP 
-filter <subsystem id/debug mask> 
-Filter message type from the kernel debug buffer.
+.BI filter " <subsystem id/debug mask>" 
+Filter kernel debug messages by subsystem or mask.
 .TP 
-show <subsystem id/debug mask> 
+.BI show " <subsystem id/debug mask>" 
 Show specific type of messages.
 .TP 
-debug_list <subs/types> 
+.BI 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.
+.TP
+.BI modules " <path>" 
+Provide gdb-friendly module information.
 
 .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.
+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
 .TP
-.B dump 
-Save ioctls to a file 
-.SH EXAMPLES
-.B attach
+.B lustre_build_version
+Output the build version of the Lustre kernel modules
+.TP
+.B --version
+Output the build version of the lctl utility
+.TP
+.B help
+Provides brief help on the various arguments
+.TP
+.B exit/quit
+Quit the interactive lctl session
 
+.SH EXAMPLES
 # lctl
 .br
-lctl > newdev
+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 > attach obdfilter OBDDEV OBDUUID
-
-.B connect
-
-lctl > name2dev OSCDEV 2 
-.br
-lctl > device 2
-.br
-lctl > connect
-
-.B getattr
-
-lctl > getattr 12
-.br
-id: 12
-.br
-grp: 0
-.br
-atime: 1002663714
-.br
-mtime: 1002663535
-.br
-ctime: 1002663535
-.br
-size: 10
-.br
-blocks: 8
-.br
-blksize: 4096
-.br
-mode: 100644
-.br
-uid: 0
-.br
-gid: 0
-.br
-flags: 0
-.br
-obdflags: 0
-.br
-nlink: 1
-.br
-valid: ffffffff
-.br
-inline:
-.br
-obdmd:
-.br
-lctl > disconnect 
-.br
-Finished (success)
-
-.B setup 
-
-lctl > setup /dev/loop0 extN
+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)