Whamcloud - gitweb
LU-12635 build: Support for gcc -Wimplicit-fallthrough
[fs/lustre-release.git] / lustre / doc / lctl.8
1 .TH lctl 8 "2017 Jan 12" 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 .B lctl --version
11 .br
12 .B lctl --list-commands
13 .br
14 .SH DESCRIPTION
15 .B lctl
16 is used to directly control Lustre via an ioctl interface, allowing
17 various configuration, maintenance, and debugging features to be accessed.
18
19 .B lctl
20 can be invoked in interactive mode by issuing lctl command. After that, commands are issued as below. The most common commands in lctl are
21 .BR dl ,
22 .BR dk ,
23 .BR device ,
24 .B network
25 .IR <up/down> ,
26 .BR list_nids ,
27 .B ping
28 .IR nid ,
29 .BR help ,
30 .BR quit .
31
32 To get a complete listing of available commands, type
33 .B --list-commands
34 at the lctl prompt.  To get basic help on the meaning and syntax of a
35 command, type
36 .B help
37 .I command
38 .  Command completion is activated with the TAB key, and command history is available via the up- and down-arrow keys.
39
40 For non-interactive use, one uses the second invocation, which runs command after connecting to the device.
41
42 .SS System Configuration
43 The on-line tool set for backup or removal of Lustre system configuration. For detail, please see:
44 .PP
45 \fBlctl-lcfg\fR(8)
46 .RS 4
47
48 .SS Network Configuration
49 .TP
50 .BR network " <" up / down >|< tcp / o2ib >
51 Start or stop LNET, or select a network type for other
52 .I lctl
53 LNET commands
54 .TP
55 .BI list_nids
56 Print all Network Identifiers on the local node. LNET must be running.
57 .TP
58 .BI which_nid " <nidlist>"
59 From a list of nids for a remote node, show which interface communication
60 will take place on.
61 .TP
62 .BI replace_nids " <devicename> <nid1>[,nid2,nid3:nid4,nid5:nid6 ...]"
63 Replace the LNET Network Identifiers for a given device,
64 as when the server's IP address has changed.
65 This command must be run on the MGS node.
66 Only MGS server should be started (command execution returns error
67 in another cases). To start the MGS service only:
68 mount -t lustre <MDT partition> -o nosvc <mount point>
69 Note the replace_nids command skips any invalidated records in the configuration log.
70 The previous log is backed up with the suffix '.bak'.
71 Failover nids must be passed after ':' symbol. More then
72 one failover can be set (every failover nids after ':' symbol).
73 .TP
74 .BI ping " <nid> timeout"
75 Check LNET connectivity via an LNET ping. This will use the fabric
76 appropriate to the specified NID. By default lctl will attempt to
77 reach the remote node up to 120 seconds and then timeout. To disable
78 the timeout just specify an negative timeout value.
79 .TP
80 .BI interface_list
81 Print the network interface information for a given
82 .B network
83 type.
84 .TP
85 .BI peer_list
86 Print the known peers for a given
87 .B network
88 type.
89 .TP
90 .BI conn_list
91 Print all the connected remote NIDs for a given
92 .B network
93 type.
94 .TP
95 .BI route_list
96 Print the complete routing table.
97 .PP
98 .SS Device Selection
99 .TP
100 .BI device " <devname> "
101 This will select the specified OBD device.  All other commands depend on the device being set.
102 .TP
103 .BI device_list
104 Show all the local Lustre OBDs. AKA
105 .B dl
106 .PP
107 .SS Device Operations
108 .TP
109 .BI list_param " [-F|-R] <param_search ...>"
110 List the Lustre or LNet parameter name
111 .B -F
112 Add '/', '@' or '=' for dirs, symlinks and writeable files, respectively.
113 .br
114 .B -R
115 Recursively list all parameters under the specified parameter search string. If
116 .I param_search
117 is unspecified, all the parameters will be shown.
118 .br
119 .B Examples:
120 .br
121 .B
122 # lctl list_param ost.*
123 .br
124   ost.OSS
125 .br
126   ost.num_refs
127 .br
128 .B
129 # lctl list_param -F ost.* debug
130 .br
131   ost.OSS/
132 .br
133   ost.num_refs
134 .br
135   debug=
136 .br
137 .B
138 # lctl list_param -R mdt
139 .br
140   mdt
141 .br
142   mdt.lustre-MDT0000
143 .br
144   mdt.lustre-MDT0000.capa
145 .br
146   mdt.lustre-MDT0000.capa_count
147 .br
148   mdt.lustre-MDT0000.capa_key_timeout
149 .br
150   mdt.lustre-MDT0000.capa_timeout
151 .br
152   mdt.lustre-MDT0000.commit_on_sharing
153 .br
154   mdt.lustre-MDT0000.evict_client
155 .br
156   ...
157 .TP
158 .BI get_param " [-F|-n|-N|-R] <parameter ...>"
159 Get the value of Lustre or LNET parameter.
160 .br
161 .B -F
162 When -N specified, add '/', '@' or '=' for directories, symlinks and writeable files, respectively.
163 .br
164 .br
165 .B -n
166 Print only the value and not parameter name.
167 .br
168 .B -N
169 Print only matched parameter names and not the values. (Especially useful when using patterns.)
170 .br
171 .B -R
172 Print all of the parameter names below the specified name.
173 .br
174 .B Examples:
175 .br
176 .B
177 # lctl get_param ost.*
178 .br
179   ost.OSS
180 .br
181   ost.num_refs
182 .br
183 .B
184 # lctl get_param -n debug timeout
185 .br
186   super warning dlmtrace error emerg ha rpctrace vfstrace config console
187 .br
188   20
189 .br
190 .B
191 # lctl get_param -N ost.* debug
192 .br
193   ost.OSS
194 .br
195   ost.num_refs
196 .br
197   debug
198 .br
199 lctl "get_param -NF" is equivalent to "list_param -F".
200 .TP
201 .BI set_param " [-n] [-P] [-d] <parameter=value ...>"
202 Set the value of Lustre or LNET parameter.
203 .br
204 .B -n
205 Disable printing of the key name when printing values.
206 .br
207 .B -P
208 Set the parameter permanently, filesystem-wide.
209 This parameters are only visible to 2.5.0 and later clients, older clients will not see these parameters.
210 .br
211 .B -d
212 Remove the permanent setting (only with -P option)
213 .br
214 .B Examples:
215 .br
216 .B
217 # lctl set_param fail_loc=0 timeout=20
218 .br
219   fail_loc=0
220 .br
221   timeout=20
222 .br
223 .B
224 # lctl set_param -n fail_loc=0 timeout=20
225 .br
226   0
227 .br
228   20
229 .br
230 .B
231 # lctl set_param -P osc.*.max_dirty_mb=32
232 .br
233 .TP
234 .BI "set_param -F " <filename>
235 .br
236 Apply configuration file specified by <filename>
237 .br
238 File is in YAML format, created as an output from
239 \fBlctl --device MGS llog_print <fsname>-client\fR or any other valid
240 llog_file from the output of \fBlctl --device MGS llog_catlist\fR
241 .br
242 .TP
243 .BI conf_param " [-d] <device|fsname>.<parameter>=<value>"
244 Set a permanent configuration parameter for any device via the MGS.  This
245 command must be run on the MGS node.
246 .br
247 .B -d <device|fsname>.<parameter>
248 Delete a parameter setting (use the default value at the next restart).
249 A null value for <value> also deletes the parameter setting.  This is
250 useful if an incorrect or obsolete parameter is in the configuration.
251 .br
252 .B Parameters:
253 .br
254 All of the writable parameters under
255 .B lctl list_param
256 (e.g.
257 .I lctl list_param -F osc.*.* | grep =
258 ) can be permanently set using
259 .B lctl conf_param
260 , but the format is slightly different.  For conf_param, the device is specified first, then the obdtype. (See examples below.)  Wildcards are not supported.
261 .br
262 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.
263 .br
264 .B Examples:
265 .br
266 # lctl conf_param testfs.sys.at_max=1200
267 .br
268 # lctl conf_param testfs.llite.max_read_ahead_mb=16
269 .br
270 # lctl conf_param testfs-MDT0000.lov.stripesize=2M
271 .br
272 # lctl conf_param lustre-OST0001.osc.active=0
273 .br
274 # lctl conf_param testfs-OST0000.osc.max_dirty_mb=29.15
275 .br
276 # lctl conf_param testfs-OST0000.ost.client_cache_seconds=15
277 .br
278 # lctl conf_param testfs-OST0000.failover.node=1.2.3.4@tcp1
279 .br
280 # lctl conf_param -d testfs-OST0000.bad_param
281 .TP
282 .BI activate
283 Reactivate an import after deactivating, below.  This setting is only effective until the next restart (see
284 .B conf_param
285 ).
286 .TP
287 .BI deactivate
288 Deactivate an import, in particular meaning do not assign new file stripes
289 to an OSC.  This command should be used on the OSC in the MDT LOV
290 corresponding to a failed OST device, to prevent further attempts at
291 communication with the failed OST.
292 .TP
293 .BI abort_recovery
294 Abort the recovery process on a restarting MDT or OST device
295 .PP
296 .SS Changelogs
297 .TP
298 .BI changelog_register " [-n]"
299 Register a new changelog user for a particular device.  Changelog entries
300 will not be purged beyond any registered users' set point. (See lfs changelog_clear.)
301 .br
302 .B -n
303 Print only the ID of the newly registered user.
304 .TP
305 .BI changelog_deregister " <id>"
306 Unregister an existing changelog user.  If the user's "clear" record number
307 is the minimum for the device, changelog records will be purged until the
308 next minimum.
309 .PP
310 .SS Nodemap
311 An identity mapping feature that facilitates mapping of client UIDs and GIDs to
312 local file system UIDs and GIDs, while maintaining POSIX ownership, permissions,
313 and quota.
314
315 While the nodemap feature is enabled, all client file system access is subject
316 to the nodemap identity mapping policy, which consists of the 'default' catchall
317 nodemap, and any user-defined nodemaps. The 'default' nodemap maps all client
318 identities to 99:99 (nobody:nobody). Administrators can define nodemaps for a
319 range of client NIDs which map identities, and these nodemaps can be flagged as
320  'trusted' so identities are accepted without translation, as well as flagged
321 as 'admin' meaning that root is not squashed for these nodes.
322
323 Note: In the current phase of implementation, to use the nodemap functionality
324 you only need to enable and define nodemaps on the MDS. The MDSes must also be
325 in a nodemap with the admin and trusted flags set. To use quotas with nodemaps,
326 you must also use set_param to enable and define nodemaps on the OSS (matching
327 what is defined on the MDS). Nodemaps do not currently persist, unless you
328 define them with set_param and use the -P flag. Note that there is a hard limit
329 to the number of changes you can persist over the lifetime of the file system.
330
331 See also:
332
333 .PP
334 \fBlctl-nodemap-activate\fR(8)
335 .RS 4
336 Activate/deactivate the nodemap feature.
337 .RE
338 .PP
339 \fBlctl-nodemap-add\fR(8)
340 .RS 4
341 Add a new nodemap, to which NID ranges, identities, and properties can be added.
342 .RE
343 .PP
344 \fBlctl-nodemap-del\fR(8)
345 .RS 4
346 Delete an existing nodemap.
347 .RE
348 .PP
349 \fBlctl-nodemap-add-range\fR(8)
350 .RS 4
351 Define a range of NIDs for a nodemap.
352 .RE
353 .PP
354 \fBlctl-nodemap-del-range\fR(8)
355 .RS 4
356 Delete an existing NID range from a nodemap.
357 .RE
358 .PP
359 \fBlctl-nodemap-add-idmap\fR(8)
360 .RS 4
361 Add a UID or GID mapping to a nodemap.
362 .RE
363 .PP
364 \fBlctl-nodemap-del-idmap\fR(8)
365 .RS 4
366 Delete an existing UID or GID mapping from a nodemap.
367 .RE
368 .PP
369 \fBlctl-nodemap-modify\fR(8)
370 .RS 4
371 Modify a nodemap property.
372 .RE
373 .PP
374 \fBlctl-nodemap-set-fileset\fR(8)
375 .RS 4
376 Add a fileset to a nodemap.
377 .RE
378 .PP
379 \fBlctl-nodemap-set-sepol\fR(8)
380 .RS 4
381 Set SELinux policy info on a nodemap.
382 .RE
383 .SS Configuration logs
384 .TP
385 .BI clear_conf " <device|fsname>"
386 This command runs on MGS node having MGS device mounted with -o
387 nosvc. It cleans up configuration files stored in the CONFIGS/ directory
388 of any records marked SKIP. If the device name is given, then the
389 specific logs for that filesystem (e.g. testfs-MDT0000) is processed.
390 Otherwise, if a filesystem name is given then all configuration files for the
391 specified filesystem are cleared.
392 .PP
393 .SS LFSCK
394 An on-line Lustre consistency check and repair tool. It is used for totally
395 replacing the old lfsck tool for kinds of Lustre inconsistency verification,
396 including: corrupted or lost OI mapping, corrupted or lost link EA, corrupted
397 or lost FID in name entry, dangling name entry, multiple referenced name entry,
398 unmatched MDT-object and name entry pairs, orphan MDT-object, incorrect
399 MDT-object links count, corrupted namespace, corrupted or lost lov EA, lost
400 OST-object, multiple referenced OST-object, unmatched MDT-object and OST-object
401 pairs, orphan OST-object, and so on.
402
403 See also:
404
405 .PP
406 \fBlctl-lfsck-start\fR(8)
407 .RS 4
408 Start LFSCK on the specified MDT or OST device with specified parameters.
409 .RE
410 .PP
411 \fBlctl-lfsck-stop\fR(8)
412 .RS 4
413 Stop LFSCK on the specified MDT or OST device.
414 .RE
415 .PP
416 \fBlctl-lfsck-query\fR(8)
417 .RS 4
418 Get the LFSCK global status via the specified MDT device.
419 .RE
420
421 .SS BARRIER
422 The tools set for write (modify) barrier on all MDTs. For detail, please see:
423 .PP
424 \fBlctl-barrier\fR(8)
425 .RS 4
426
427 .SS SNAPSHOT
428 ZFS backend based snapshot tools set. The tool loads system configuration
429 from the file
430 .B /etc/ldev.conf
431 on the MGS, and call related ZFS commands to
432 maintain Lustre snapshot pieces on all targets (MGS/MDT/OST).
433 The configuration file
434 .B /etc/ldev.conf
435 is not only for snapshot, but also
436 for other purpose. The format is:
437   <host> foreign/- <label> <device> [journal-path]/- [raidtab]
438
439 The format of
440 .I <label>
441 is:
442   fsname-<role><index> or <role><index>
443
444 The format of
445 .I <device>
446 is:
447   [md|zfs:][pool_dir/]<pool>/<filesystem>
448
449 Snapshot only uses the fields <host>, <label> and <device>.
450
451 .br
452 .B Example:
453 .br
454 .B
455 # cat /etc/ldev.conf
456 .br
457  host-mdt1 - myfs-MDT0000 zfs:/tmp/myfs-mdt1/mdt1
458  host-mdt2 - myfs-MDT0001 zfs:myfs-mdt2/mdt2
459  host-ost1 - OST0000 zfs:/tmp/myfs-ost1/ost1
460  host-ost2 - OST0001 zfs:myfs-ost2/ost2
461
462 See also:
463
464 .PP
465 \fBlctl-snapshot-create\fR(8)
466 .RS 4
467 Create snapshot with the given name.
468 .RE
469 .PP
470 \fBlctl-snapshot-destroy\fR(8)
471 .RS 4
472 Destroy the specified snapshot.
473 .RE
474 .PP
475 \fBlctl-snapshot-modify\fR(8)
476 .RS 4
477 Modify the specified snapshot.
478 .RE
479 .PP
480 \fBlctl-snapshot-list\fR(8)
481 .RS 4
482 Query the snapshot information.
483 .RE
484 .PP
485 \fBlctl-snapshot-mount\fR(8)
486 .RS 4
487 Mount the specified snapshot.
488 .RE
489 .PP
490 \fBlctl-snapshot-umount\fR(8)
491 .RS 4
492 Umount the specified snapshot.
493 .RE
494
495 .SS Debug
496 .TP
497 .BI debug_daemon
498 Start and stop the debug daemon, and control the output filename and size.
499 .TP
500 .BI debug_kernel " [file] [raw]"
501 Dump the kernel debug buffer to stdout or file.
502 .TP
503 .BI debug_file " <input> [output]"
504 Convert kernel-dumped debug log from binary to plain text format.
505 .TP
506 .BI clear
507 Clear the kernel debug buffer.
508 .TP
509 .BI mark " <text>"
510 Insert marker text in the kernel debug buffer.
511 .TP
512 .BI filter " <subsystem id/debug mask>"
513 Filter kernel debug messages by subsystem or mask.
514 .TP
515 .BI show " <subsystem id/debug mask>"
516 Show specific type of messages.
517 .TP
518 .BI debug_list " <subs/types>"
519 List all the subsystem and debug types.
520 .TP
521 .BI modules " <path>"
522 Provide gdb-friendly module information.
523
524 .SH OPTIONS
525 The following options can be used to invoke lctl.
526 .TP
527 .B --device
528 The device to be used for the operation. This can be specified by name or
529 number. See
530 .B device_list
531 .TP
532 .B --ignore_errors | ignore_errors
533 Ignore errors during script processing
534 .TP
535 .B lustre_build_version
536 Output the build version of the Lustre kernel modules
537 .TP
538 .B --version
539 Output the build version of the lctl utility
540 .TP
541 .B --list-commands
542 Output a list of the commands supported by the lctl utility
543 .TP
544 .B help
545 Provides brief help on the various arguments
546 .TP
547 .B exit/quit
548 Quit the interactive lctl session
549
550 .SH EXAMPLES
551 # lctl
552 .br
553 lctl > dl
554   0 UP mgc MGC192.168.0.20@tcp bfbb24e3-7deb-2ffa-eab0-44dffe00f692 5
555   1 UP ost OSS OSS_uuid 3
556   2 UP obdfilter testfs-OST0000 testfs-OST0000_UUID 3
557 .br
558 lctl > dk /tmp/log
559 Debug log: 87 lines, 87 kept, 0 dropped.
560 .br
561 lctl > quit
562
563 .SH AVAILABILITY
564 .B lctl
565 is part of the
566 .BR lustre (7)
567 filesystem package.
568 .SH SEE ALSO
569 .BR lustre (7),
570 .BR mkfs.lustre (8),
571 .BR mount.lustre (8),
572 .BR lctl (8),
573 .BR lctl-lfsck-start (8),
574 .BR lctl-lfsck-stop (8),
575 .BR lctl-lfsck-query (8),
576 .BR lctl-lcfg (8),
577 .BR lctl-barrier (8),
578 .BR lctl-snapshot-create (8),
579 .BR lctl-snapshot-destroy (8),
580 .BR lctl-snapshot-modify (8),
581 .BR lctl-snapshot-list (8),
582 .BR lctl-snapshot-mount (8),
583 .BR lctl-snapshot-umount (8),
584 .BR lctl-llog_catlist (8),
585 .BR lctl-llog_info (8),
586 .BR lctl-llog_print (8),
587 .BR lctl-network (8),
588 .BR lctl-nodemap-activate (8),
589 .BR lctl-nodemap-add-idmap (8),
590 .BR lctl-nodemap-add-range (8),
591 .BR lctl-nodemap-add (8),
592 .BR lctl-nodemap-del-idmap (8),
593 .BR lctl-nodemap-del-range (8),
594 .BR lctl-nodemap-del (8),
595 .BR lctl-nodemap-modify (8),
596 .BR lctl-pcc (8),
597 .BR lfs (1)