Whamcloud - gitweb
LU-5710 all: second batch of corrected typos and grammar errors
[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 route_list 
89 Print the complete routing table.
90 .PP
91 .SS Device Selection
92 .TP 
93 .BI device " <devname> " 
94 This will select the specified OBD device.  All other commands depend on the device being set. 
95 .TP 
96 .BI device_list 
97 Show all the local Lustre OBDs. AKA 
98 .B dl
99 .PP
100 .SS Device Operations
101 .TP 
102 .BI list_param " [-F|-R] <param_search ...>"
103 List the Lustre or LNet parameter name
104 .B -F
105 Add '/', '@' or '=' for dirs, symlinks and writeable files, respectively.
106 .br
107 .B -R
108 Recursively list all parameters under the specified parameter search string. If
109 .I param_search
110 is unspecified, all the parameters will be shown.
111 .br
112 .B Examples:
113 .br
114 .B
115 # lctl list_param ost.*
116 .br
117   ost.OSS
118 .br
119   ost.num_refs
120 .br
121 .B
122 # lctl list_param -F ost.* debug
123 .br
124   ost.OSS/
125 .br
126   ost.num_refs
127 .br
128   debug=
129 .br
130 .B
131 # lctl list_param -R mdt
132 .br
133   mdt
134 .br
135   mdt.lustre-MDT0000
136 .br
137   mdt.lustre-MDT0000.capa
138 .br
139   mdt.lustre-MDT0000.capa_count
140 .br
141   mdt.lustre-MDT0000.capa_key_timeout
142 .br
143   mdt.lustre-MDT0000.capa_timeout
144 .br
145   mdt.lustre-MDT0000.commit_on_sharing
146 .br
147   mdt.lustre-MDT0000.evict_client
148 .br
149   ...
150 .TP
151 .BI get_param " [-n|-N|-F] <parameter ...>"
152 Get the value of Lustre or LNET parameter.
153 .br
154 .B -n
155 Print only the value and not parameter name.
156 .br
157 .B -N
158 Print only matched parameter names and not the values. (Especially useful when using patterns.)
159 .br
160 .B -F
161 When -N specified, add '/', '@' or '=' for directories, symlinks and writeable files, respectively.
162 .br
163 .B Examples:
164 .br
165 .B
166 # lctl get_param ost.*
167 .br
168   ost.OSS
169 .br
170   ost.num_refs
171 .br
172 .B
173 # lctl get_param -n debug timeout
174 .br
175   super warning dlmtrace error emerg ha rpctrace vfstrace config console
176 .br
177   20
178 .br
179 .B
180 # lctl get_param -N ost.* debug
181 .br
182   ost.OSS
183 .br
184   ost.num_refs
185 .br
186   debug
187 .br
188 lctl "get_param -NF" is equivalent to "list_param -F".
189 .TP
190 .BI set_param " [-n] [-P] [-d] <parameter=value ...>"
191 Set the value of Lustre or LNET parameter.
192 .br
193 .B -n
194 Disable printing of the key name when printing values.
195 .br
196 .B -P
197 Set the parameter permanently, filesystem-wide.
198 This parameters are only visible to 2.5.0 and later clients, older clients will not see these parameters.
199 .br
200 .B -d
201 Remove the permanent setting (only with -P option)
202 .br
203 .B Examples:
204 .br
205 .B
206 # lctl set_param fail_loc=0 timeout=20
207 .br
208   fail_loc=0
209 .br
210   timeout=20
211 .br
212 .B
213 # lctl set_param -n fail_loc=0 timeout=20
214 .br
215   0
216 .br
217   20
218 .br
219 .B
220 # lctl set_param -P osc.*.max_dirty_mb=32
221 .br
222 .TP
223 .BI conf_param " [-d] <device|fsname>.<parameter>=<value>"
224 Set a permanent configuration parameter for any device via the MGS.  This
225 command must be run on the MGS node.
226 .br
227 .B -d <device|fsname>.<parameter>
228 Delete a parameter setting (use the default value at the next restart).  A null value for <value> also deletes the parameter setting.
229 .br
230 .B Parameters:
231 .br
232 All of the writable parameters under 
233 .B lctl list_param
234 (e.g. 
235 .I lctl list_param -F osc.*.* | grep =
236 ) can be permanently set using
237 .B lctl conf_param
238 , but the format is slightly different.  For conf_param, the device is specified first, then the obdtype. (See examples below.)  Wildcards are not supported.
239 .br
240 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.
241 .br
242 .B Examples:
243 .br 
244 # lctl conf_param testfs.sys.at_max=1200
245 .br
246 # lctl conf_param testfs.llite.max_read_ahead_mb=16 
247 .br
248 # lctl conf_param testfs-MDT0000.lov.stripesize=2M
249 .br
250 # lctl conf_param lustre-OST0001.osc.active=0 
251 .br
252 # lctl conf_param testfs-OST0000.osc.max_dirty_mb=29.15 
253 .br
254 # lctl conf_param testfs-OST0000.ost.client_cache_seconds=15 
255 .br
256 # lctl conf_param testfs-OST0000.failover.node=1.2.3.4@tcp1
257 .TP 
258 .BI activate 
259 Reactivate an import after deactivating, below.  This setting is only effective until the next restart (see 
260 .B conf_param
261 ).
262 .TP 
263 .BI deactivate 
264 Deactivate an import, in particular meaning do not assign new file stripes
265 to an OSC.  This command should be used on the OSC in the MDT LOV
266 corresponding to a failed OST device, to prevent further attempts at
267 communication with the failed OST.
268 .TP 
269 .BI abort_recovery 
270 Abort the recovery process on a restarting MDT or OST device
271 .PP
272 .SS Virtual Block Device Operation
273 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.
274 .TP
275 .BI blockdev_attach " <file name> <device node>"
276 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.
277 .TP
278 .BI blockdev_detach " <device node>"
279 Detach the virtual block device.
280 .TP
281 .BI blockdev_info " <device node>"
282 Acquire which lustre file was attached to the device node.
283 .PP
284 .SS Changelogs
285 .TP
286 .BI changelog_register
287 Register a new changelog user for a particular device.  Changelog entries
288 will not be purged beyond any registered users' set point. (See lfs changelog_clear.)
289 .TP
290 .BI changelog_deregister " <id>"
291 Unregister an existing changelog user.  If the user's "clear" record number
292 is the minimum for the device, changelog records will be purged until the
293 next minimum.
294 .PP
295 .SS Nodemap
296 An identity mapping feature that facilitates mapping of client UIDs and GIDs to
297 local file system UIDs and GIDs, while maintaining POSIX ownership, permissions,
298 and quota.
299
300 While the nodemap feature is enabled, all client file system access is subject
301 to the nodemap identity mapping policy, which consists of the 'default' catchall
302 nodemap, and any user-defined nodemaps. The 'default' nodemap maps all client
303 identities to 99:99 (nobody:nobody). Administrators can define nodemaps for a
304 range of client NIDs which map identities, and these nodemaps can be flagged as
305  'trusted' so identities are accepted without translation, as well as flagged
306 as 'admin' meaning that root is not squashed for these nodes.
307
308 Note: In the current phase of implementation, to use the nodemap functionality
309 you only need to enable and define nodemaps on the MDS. The MDSes must also be
310 in a nodemap with the admin and trusted flags set. To use quotas with nodemaps,
311 you must also use set_param to enable and define nodemaps on the OSS (matching
312 what is defined on the MDS). Nodemaps do not currently persist, unless you
313 define them with set_param and use the -P flag. Note that there is a hard limit
314 to the number of changes you can persist over the lifetime of the file system.
315
316 See also:
317
318 .PP
319 \fBlctl-nodemap-activate\fR(8)
320 .RS 4
321 Activate/deactivate the nodemap feature.
322 .RE
323 .PP
324 \fBlctl-nodemap-add\fR(8)
325 .RS 4
326 Add a new nodemap, to which NID ranges, identities, and properties can be added.
327 .RE
328 .PP
329 \fBlctl-nodemap-del\fR(8)
330 .RS 4
331 Delete an existing nodemap.
332 .RE
333 .PP
334 \fBlctl-nodemap-add-range\fR(8)
335 .RS 4
336 Define a range of NIDs for a nodemap.
337 .RE
338 .PP
339 \fBlctl-nodemap-del-range\fR(8)
340 .RS 4
341 Delete an existing NID range from a nodemap.
342 .RE
343 .PP
344 \fBlctl-nodemap-add-idmap\fR(8)
345 .RS 4
346 Add a UID or GID mapping to a nodemap.
347 .RE
348 .PP
349 \fBlctl-nodemap-del-idmap\fR(8)
350 .RS 4
351 Delete an existing UID or GID mapping from a nodemap.
352 .RE
353 .PP
354 \fBlctl-nodemap-modify\fR(8)
355 .RS 4
356 Modify a nodemap property.
357 .RE
358
359 .SS LFSCK
360 An on-line Lustre consistency check and repair tool.
361 .TP
362 .B lfsck_start \fR<-M | --device [MDT,OST]_device>
363      \fR[-A | --all] [-c | --create_ostobj [on | off]]
364      \fR[-e | --error <continue | abort>] [-h | --help]
365      \fR[-n | --dryrun [on | off]] [-o | --orphan]
366      \fR[-r | --reset] [-s | --speed speed_limit]
367      \fR[-t | --type lfsck_type[,lfsck_type...]]
368      \fR[-w | --window_size size]
369 .br
370 Start LFSCK on the specified MDT or OST device with specified parameters.
371 .TP
372   -M, --device <MDT,OST_device>
373 The MDT or OST device to start LFSCK/scrub on.
374 .TP
375   -A, --all
376 Start LFSCK on all available MDT devices.
377 .TP
378   -c, --create_ostobj [on | off]
379 Create the lost OST-object for dangling LOV EA: 'off' (default) or 'on'. Under
380 default mode, when the LFSCK find some MDT-object with dangling reference, it
381 will report the inconsistency but will not repair it.  If 'on' is given, then
382 LFSCK will re-create the missed OST-object.
383 .TP
384   -e, --error <error_handle>
385 With error_handle as 'abort' then if a repair is impossible LFSCK will save
386 the current position stop with an error.  Otherwise the default behavior is
387 to 'continue' if a repair is impossible.
388 .TP
389   -h, --help
390 Show the usage message.
391 .TP
392   -n, --dryrun [on | off]
393 Perform a trial run with no changes made, if 'on' or no argument is given.
394 Default is 'off', meaning that any inconsistencies found will be repaired.
395 .TP
396   -o, --orphan
397 Handle orphan objects, such as orphan OST-objects for layout LFSCK by
398 linking them under the .../.lustre/lost+found directory.
399 .TP
400   -r, --reset
401 Set the current position of object iteration to the beginning of the specified
402 device. The non-specified parameters will also be reset to the default. By
403 default the iterator will resume the scanning from the last saved checkpoint
404 position, and other unspecified parameters will be the same as the prior
405 incomplete run.
406 .TP
407   -s, --speed <speed_limit>
408 Set the upper limit of LFSCK processing in objects per second to reduce load
409 on the servers and storage. If no value is specified the saved value is used
410 (if resuming from a checkpoint). Otherwise the default value of 0 is used,
411 which means check the filesystem as quickly as possible.
412 .TP
413   -t, --type <lfsck_type[,lfsck_type...]>
414 The type of LFSCK checking/repair to execute. If no type is given and the
415 previous run was incomplete or internal consistency checks detected an error,
416 then the same types are used for the next run.  Otherwise, the default is to
417 check all types of consistency.  Any time LFSCK is triggered on an ldiskfs
418 MDT or OST then OI Scrub is run.  Valid types are a comma-separated list of one or more of
419 .B scrub
420 to run only the local OI Scrub on ldiskfs targets,
421 .B namespace
422 for FID-in-dirent and linkEA checking on the MDT(s),
423 .B layout
424 for MDT-OST cross-reference consistency, and
425 .B all
426 to run all of the available check types.
427 .TP
428   -w, --window_size <size>
429 Specifies the maximum number of in-flight request being processed at
430 one time.  This controls the load placed on remote OSTs when running
431 .B layout
432 checks.  By default there are at most 1024 outstanding requests.
433 .TP
434 .B lfsck_stop  \fR<-M | --device [MDT,OST]_device> [-A | --all] [-h | --help]
435 Stop LFSCK on the specified MDT or OST device.
436 .TP
437   -M, --device <[MDT,OST]_device>
438 The MDT or OST device to stop LFSCK/scrub on.
439 .TP
440   -A, --all
441 Stop LFSCK on all devices.
442 .TP
443   -h, --help
444 Show this help.
445 .SS Debug
446 .TP 
447 .BI debug_daemon 
448 Start and stop the debug daemon, and control the output filename and size.
449 .TP 
450 .BI debug_kernel " [file] [raw]" 
451 Dump the kernel debug buffer to stdout or file.
452 .TP 
453 .BI debug_file " <input> [output]"
454 Convert kernel-dumped debug log from binary to plain text format.
455 .TP 
456 .BI clear 
457 Clear the kernel debug buffer.
458 .TP 
459 .BI mark " <text>" 
460 Insert marker text in the kernel debug buffer.
461 .TP 
462 .BI filter " <subsystem id/debug mask>" 
463 Filter kernel debug messages by subsystem or mask.
464 .TP 
465 .BI show " <subsystem id/debug mask>" 
466 Show specific type of messages.
467 .TP 
468 .BI debug_list " <subs/types>" 
469 List all the subsystem and debug types.
470 .TP
471 .BI modules " <path>" 
472 Provide gdb-friendly module information.
473
474 .SH OPTIONS
475 The following options can be used to invoke lctl. 
476 .TP
477 .B --device 
478 The device to be used for the operation. This can be specified by name or
479 number. See 
480 .B device_list
481 .TP
482 .B --ignore_errors | ignore_errors 
483 Ignore errors during script processing
484 .TP
485 .B lustre_build_version
486 Output the build version of the Lustre kernel modules
487 .TP
488 .B --version
489 Output the build version of the lctl utility
490 .TP
491 .B help
492 Provides brief help on the various arguments
493 .TP
494 .B exit/quit
495 Quit the interactive lctl session
496
497 .SH EXAMPLES
498 # lctl
499 .br
500 lctl > dl
501   0 UP mgc MGC192.168.0.20@tcp bfbb24e3-7deb-2ffa-eab0-44dffe00f692 5
502   1 UP ost OSS OSS_uuid 3
503   2 UP obdfilter testfs-OST0000 testfs-OST0000_UUID 3
504 .br
505 lctl > dk /tmp/log
506 Debug log: 87 lines, 87 kept, 0 dropped.
507 .br
508 lctl > quit
509
510 .SH AVAILABILITY
511 .B lctl
512 is part of the 
513 .BR Lustre (7) 
514 filesystem package.
515 .SH SEE ALSO
516 .BR lustre (7),
517 .BR mkfs.lustre (8),
518 .BR mount.lustre (8),
519 .BR lctl (8),
520 .BR lfs (1)