Whamcloud - gitweb
LU-5666 llapi: LLAPI helpers for group lock.
[fs/lustre-release.git] / lustre / doc / lctl.8
1 .TH lctl 1 "2003 Oct 8" Lustre "configuration utilities"
2 .SH NAME
3 lctl \- Low level Lustre filesystem configuration utility
4 .SH SYNOPSIS
5 .br
6 .B lctl
7 .br
8 .B lctl --device <devno> <command [args]>
9 .br
10 .SH DESCRIPTION
11 .B lctl
12 is used to directly control Lustre via an ioctl interface, allowing
13 various configuration, maintenance, and debugging features to be accessed.
14  
15 .B lctl
16 can be invoked in interactive mode by issuing lctl command. After that, commands are issued as below. The most common commands in lctl are
17 .B dl
18 ,
19 .B dk
20 ,
21 .B device 
22 ,
23 .B network 
24 .I <up/down>
25 ,
26 .B list_nids
27 ,
28 .B ping
29 .I nid
30 ,
31 .B help
32 ,
33 .B quit.
34
35 To get a complete listing of available commands, type
36 .B help
37 at the lctl prompt.  To get basic help on the meaning and syntax of a
38 command, type 
39 .B help 
40 .I command
41 .  Command completion is activated with the TAB key, and command history is available via the up- and down-arrow keys. 
42
43 For non-interactive use, one uses the second invocation, which runs command after connecting to the device. 
44
45 .SS Network Configuration
46 .TP
47 .BI network " <up/down>|<tcp/elan/myrinet>"
48 Start or stop LNET, or select a network type for other
49 .I lctl
50 LNET commands
51 .TP
52 .BI list_nids
53 Print all Network Identifiers on the local node. LNET must be running.
54 .TP
55 .BI which_nid " <nidlist>"
56 From a list of nids for a remote node, show which interface communication
57 will take place on.
58 .TP
59 .BI replace_nids " <devicename> <nid1>[,nid2,nid3 ...]"
60 Replace the LNET Network Identifiers for a given device,
61 as when the server's IP address has changed.
62 This command must be run on the MGS node.
63 Only MGS server should be started (command execution returns error
64 in another cases). To start the MGS service only:
65 mount -t lustre <MDT partition> -o nosvc <mount point>
66 Note the replace_nids command skips any invalidated records in the configuration log.
67 The previous log is backed up with the suffix '.bak'.
68 .TP
69 .BI ping " <nid> "
70 Check LNET connectivity via an LNET ping. This will use the fabric
71 appropriate to the specified NID.
72 .TP
73 .BI interface_list 
74 Print the network interface information for a given 
75 .B network
76 type.
77 .TP
78 .BI peer_list 
79 Print the known peers for a given 
80 .B network
81 type.
82 .TP
83 .BI conn_list 
84 Print all the connected remote NIDs for a given
85 .B network
86 type.
87 .TP
88 .BI active_tx 
89 This command should print active transmits, and it is only used for elan network type.
90 .TP 
91 .BI route_list 
92 Print the complete routing table.
93 .PP
94 .SS Device Selection
95 .TP 
96 .BI device " <devname> " 
97 This will select the specified OBD device.  All other commands depend on the device being set. 
98 .TP 
99 .BI device_list 
100 Show all the local Lustre OBDs. AKA 
101 .B dl
102 .PP
103 .SS Device Operations
104 .TP 
105 .BI list_param " [-F|-R] <param_search ...>"
106 List the Lustre or LNet parameter name
107 .B -F
108 Add '/', '@' or '=' for dirs, symlinks and writeable files, respectively.
109 .br
110 .B -R
111 Recursively list all parameters under the specified parameter search string. If
112 .I param_search
113 is unspecified, all the parameters will be shown.
114 .br
115 .B Examples:
116 .br
117 .B
118 # lctl list_param ost.*
119 .br
120   ost.OSS
121 .br
122   ost.num_refs
123 .br
124 .B
125 # lctl list_param -F ost.* debug
126 .br
127   ost.OSS/
128 .br
129   ost.num_refs
130 .br
131   debug=
132 .br
133 .B
134 # lctl list_param -R mdt
135 .br
136   mdt
137 .br
138   mdt.lustre-MDT0000
139 .br
140   mdt.lustre-MDT0000.capa
141 .br
142   mdt.lustre-MDT0000.capa_count
143 .br
144   mdt.lustre-MDT0000.capa_key_timeout
145 .br
146   mdt.lustre-MDT0000.capa_timeout
147 .br
148   mdt.lustre-MDT0000.commit_on_sharing
149 .br
150   mdt.lustre-MDT0000.evict_client
151 .br
152   ...
153 .TP
154 .BI get_param " [-n|-N|-F] <parameter ...>"
155 Get the value of Lustre or LNET parameter.
156 .br
157 .B -n
158 Print only the value and not parameter name.
159 .br
160 .B -N
161 Print only matched parameter names and not the values. (Especially useful when using patterns.)
162 .br
163 .B -F
164 When -N specified, add '/', '@' or '=' for directories, symlinks and writeable files, respectively.
165 .br
166 .B Examples:
167 .br
168 .B
169 # lctl get_param ost.*
170 .br
171   ost.OSS
172 .br
173   ost.num_refs
174 .br
175 .B
176 # lctl get_param -n debug timeout
177 .br
178   super warning dlmtrace error emerg ha rpctrace vfstrace config console
179 .br
180   20
181 .br
182 .B
183 # lctl get_param -N ost.* debug
184 .br
185   ost.OSS
186 .br
187   ost.num_refs
188 .br
189   debug
190 .br
191 lctl "get_param -NF" is equivalent to "list_param -F".
192 .TP
193 .BI set_param " [-n] [-P] [-d] <parameter=value ...>"
194 Set the value of Lustre or LNET parameter.
195 .br
196 .B -n
197 Disable printing of the key name when printing values.
198 .br
199 .B -P
200 Set the parameter permanently, filesystem-wide.
201 This parameters are only visible to 2.5.0 and later clients, older clients will not see these parameters.
202 .br
203 .B -d
204 Remove the permanent setting (only with -P option)
205 .br
206 .B Examples:
207 .br
208 .B
209 # lctl set_param fail_loc=0 timeout=20
210 .br
211   fail_loc=0
212 .br
213   timeout=20
214 .br
215 .B
216 # lctl set_param -n fail_loc=0 timeout=20
217 .br
218   0
219 .br
220   20
221 .br
222 .B
223 # lctl set_param -P osc.*.max_dirty_mb=32
224 .br
225 .TP
226 .BI conf_param " [-d] <device|fsname>.<parameter>=<value>"
227 Set a permanent configuration parameter for any device via the MGS.  This
228 command must be run on the MGS node.
229 .br
230 .B -d <device|fsname>.<parameter>
231 Delete a parameter setting (use the default value at the next restart).  A null value for <value> also deletes the parameter setting.
232 .br
233 .B Parameters:
234 .br
235 All of the writable parameters under 
236 .B lctl list_param
237 (e.g. 
238 .I lctl list_param -F osc.*.* | grep =
239 ) can be permanently set using
240 .B lctl conf_param
241 , but the format is slightly different.  For conf_param, the device is specified first, then the obdtype. (See examples below.)  Wildcards are not supported.
242 .br
243 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.
244 .br
245 .B Examples:
246 .br 
247 # lctl conf_param testfs.sys.at_max=1200
248 .br
249 # lctl conf_param testfs.llite.max_read_ahead_mb=16 
250 .br
251 # lctl conf_param testfs-MDT0000.lov.stripesize=2M
252 .br
253 # lctl conf_param lustre-OST0001.osc.active=0 
254 .br
255 # lctl conf_param testfs-OST0000.osc.max_dirty_mb=29.15 
256 .br
257 # lctl conf_param testfs-OST0000.ost.client_cache_seconds=15 
258 .br
259 # lctl conf_param testfs-OST0000.failover.node=1.2.3.4@tcp1
260 .TP 
261 .BI activate 
262 Reactivate an import after deactivating, below.  This setting is only effective until the next restart (see 
263 .B conf_param
264 ).
265 .TP 
266 .BI deactivate 
267 Deactivate an import, in particular meaning do not assign new file stripes
268 to an OSC.  This command should be used on the OSC in the MDT LOV
269 corresponding to a failed OST device, to prevent further attempts at
270 communication with the failed OST.
271 .TP 
272 .BI abort_recovery 
273 Abort the recovery process on a restarting MDT or OST device
274 .PP
275 .SS Virtual Block Device Operation
276 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.
277 .TP
278 .BI blockdev_attach " <file name> <device node>"
279 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.
280 .TP
281 .BI blockdev_detach " <device node>"
282 Detach the virtual block device.
283 .TP
284 .BI blockdev_info " <device node>"
285 Acquire which lustre file was attached to the device node.
286 .PP
287 .SS Changelogs
288 .TP
289 .BI changelog_register
290 Register a new changelog user for a particular device.  Changelog entries
291 will not be purged beyond any registered users' set point. (See lfs changelog_clear.)
292 .TP
293 .BI changelog_deregister " <id>"
294 Unregister an existing changelog user.  If the user's "clear" record number
295 is the minimum for the device, changelog records will be purged until the
296 next minimum.
297 .PP
298 .SS LFSCK
299 An on-line Lustre consistency check and repair tool.
300 .TP
301 .B lfsck_start \fR<-M | --device [MDT,OST]_device>
302      \fR[-A | --all] [-c | --create_ostobj [on | off]]
303      \fR[-e | --error <continue | abort>] [-h | --help]
304      \fR[-n | --dryrun [on | off]] [-o | --orphan]
305      \fR[-r | --reset] [-s | --speed speed_limit]
306      \fR[-t | --type lfsck_type[,lfsck_type...]]
307      \fR[-w | --window_size size]
308 .br
309 Start LFSCK on the specified MDT or OST device with specified parameters.
310 .TP
311   -M, --device <MDT,OST_device>
312 The MDT or OST device to start LFSCK/scrub on.
313 .TP
314   -A, --all
315 Start LFSCK on all available MDT devices.
316 .TP
317   -c, --create_ostobj [on | off]
318 Create the lost OST-object for dangling LOV EA: 'off' (default) or 'on'. Under
319 default mode, when the LFSCK find some MDT-object with dangling reference, it
320 will report the inconsistency but will not repair it.  If 'on' is given, then
321 LFSCK will re-create the missed OST-object.
322 .TP
323   -e, --error <error_handle>
324 With error_handle as 'abort' then if a repair is impossible LFSCK will save
325 the current position stop with an error.  Otherwise the default behavior is
326 to 'continue' if a repair is impossible.
327 .TP
328   -h, --help
329 Show the usage message.
330 .TP
331   -n, --dryrun [on | off]
332 Perform a trial run with no changes made, if 'on' or no argument is given.
333 Default is 'off', meaning that any inconsistencies found will be repaired.
334 .TP
335   -o, --orphan
336 Handle orphan objects, such as orphan OST-objects for layout LFSCK by
337 linking them under the .../.lustre/lost+found directory.
338 .TP
339   -r, --reset
340 Set the current position of object iteration to the beginning of the specified
341 device. The non-specified parameters will also be reset to the default. By
342 default the iterator will resume the scanning from the last saved checkpoint
343 position, and other unspecified parameters will be the same as the prior
344 incomplete run.
345 .TP
346   -s, --speed <speed_limit>
347 Set the upper limit of LFSCK processing in objects per second to reduce load
348 on the servers and storage. If no value is specified the saved value is used
349 (if resuming from a checkpoint). Otherwise the default value of 0 is used,
350 which means check the filesystem as quickly as possible.
351 .TP
352   -t, --type <lfsck_type[,lfsck_type...]>
353 The type of LFSCK checking/repair to execute. If no type is given and the
354 previous run was incomplete or internal consistency checks detected an error,
355 then the same types are used for the next run.  Otherwise, the default is to
356 check all types of consistency.  Any time LFSCK is triggered on an ldiskfs
357 MDT or OST then OI Scrub is run.  Valid types are a comma-separated list of one or more of
358 .B scrub
359 to run only the local OI Scrub on ldiskfs targets,
360 .B namespace
361 for FID-in-dirent and linkEA checking on the MDT(s),
362 .B layout
363 for MDT-OST cross-reference consistency, and
364 .B all
365 to run all of the available check types.
366 .TP
367   -w, --window_size <size>
368 Specifies the maximum number of in-flight request being processed at
369 one time.  This controls the load placed on remote OSTs when running
370 .B layout
371 checks.  By default there are at most 1024 outstanding requests.
372 .TP
373 .B lfsck_stop  \fR<-M | --device [MDT,OST]_device> [-A | --all] [-h | --help]
374 Stop LFSCK on the specified MDT or OST device.
375 .TP
376   -M, --device <[MDT,OST]_device>
377 The MDT or OST device to stop LFSCK/scrub on.
378 .TP
379   -A, --all
380 Stop LFSCK on all devices.
381 .TP
382   -h, --help
383 Show this help.
384 .SS Debug
385 .TP 
386 .BI debug_daemon 
387 Start and stop the debug daemon, and control the output filename and size.
388 .TP 
389 .BI debug_kernel " [file] [raw]" 
390 Dump the kernel debug buffer to stdout or file.
391 .TP 
392 .BI debug_file " <input> [output]"
393 Convert kernel-dumped debug log from binary to plain text format.
394 .TP 
395 .BI clear 
396 Clear the kernel debug buffer.
397 .TP 
398 .BI mark " <text>" 
399 Insert marker text in the kernel debug buffer.
400 .TP 
401 .BI filter " <subsystem id/debug mask>" 
402 Filter kernel debug messages by subsystem or mask.
403 .TP 
404 .BI show " <subsystem id/debug mask>" 
405 Show specific type of messages.
406 .TP 
407 .BI debug_list " <subs/types>" 
408 List all the subsystem and debug types.
409 .TP
410 .BI modules " <path>" 
411 Provide gdb-friendly module information.
412
413 .SH OPTIONS
414 The following options can be used to invoke lctl. 
415 .TP
416 .B --device 
417 The device to be used for the operation. This can be specified by name or
418 number. See 
419 .B device_list
420 .TP
421 .B --ignore_errors | ignore_errors 
422 Ignore errors during script processing
423 .TP
424 .B lustre_build_version
425 Output the build version of the Lustre kernel modules
426 .TP
427 .B --version
428 Output the build version of the lctl utility
429 .TP
430 .B help
431 Provides brief help on the various arguments
432 .TP
433 .B exit/quit
434 Quit the interactive lctl session
435
436 .SH EXAMPLES
437 # lctl
438 .br
439 lctl > dl
440   0 UP mgc MGC192.168.0.20@tcp bfbb24e3-7deb-2ffa-eab0-44dffe00f692 5
441   1 UP ost OSS OSS_uuid 3
442   2 UP obdfilter testfs-OST0000 testfs-OST0000_UUID 3
443 .br
444 lctl > dk /tmp/log
445 Debug log: 87 lines, 87 kept, 0 dropped.
446 .br
447 lctl > quit
448
449 .SH AVAILABILITY
450 .B lctl
451 is part of the 
452 .BR Lustre (7) 
453 filesystem package.
454 .SH SEE ALSO
455 .BR Lustre (7),
456 .BR mkfs.lustre (8),
457 .BR mount.lustre (8),
458 .BR lctl (8),
459 .BR lfs (1)