Whamcloud - gitweb
LU-17744 ldiskfs: mballoc stats fixes
[fs/lustre-release.git] / lustre / doc / lctl.8
1 .TH LCTL 8 "2019-06-16" Lustre "configuration utilities"
2 .SH NAME
3 lctl \- Lustre filesystem administrator configuration tool
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 " [--target|-t] [--yaml|-y] "
104 Show all the local Lustre OBDs.
105 .B dl
106 is the same command. The
107 .B -t
108 option additonally will report the server's export NID linked to the local OBD. The
109 .B -y
110 option will display the OBD device information in YAML format.
111 .SS Device Operations
112 .TP
113 .BI conf_param " [-d] <device|fsname>.<parameter>=<value>"
114 Set a permanent configuration parameter for any device via the MGS.  This
115 command must be run on the MGS node.
116 .br
117 .B -d <device|fsname>.<parameter>
118 Delete a parameter setting (use the default value at the next restart).
119 A null value for <value> also deletes the parameter setting.  This is
120 useful if an incorrect or obsolete parameter is in the configuration.
121 .br
122 .B Parameters:
123 .br
124 All of the writable parameters under
125 .B lctl list_param
126 (e.g.
127 .I lctl list_param -F osc.*.* | grep =
128 ) can be permanently set using
129 .B lctl conf_param
130 , but the format is slightly different.  For conf_param, the device is specified first, then the obdtype. (See examples below.)  Wildcards are not supported.
131 .br
132 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.
133 .br
134 .B Examples:
135 .br
136 # lctl conf_param testfs.sys.at_max=1200
137 .br
138 # lctl conf_param testfs.llite.max_read_ahead_mb=16
139 .br
140 # lctl conf_param testfs-MDT0000.lov.stripesize=2M
141 .br
142 # lctl conf_param lustre-OST0001.osc.active=0
143 .br
144 # lctl conf_param testfs-OST0000.osc.max_dirty_mb=29.15
145 .br
146 # lctl conf_param testfs-OST0000.ost.client_cache_seconds=15
147 .br
148 # lctl conf_param testfs-OST0000.failover.node=1.2.3.4@tcp1
149 .br
150 # lctl conf_param -d testfs-OST0000.bad_param
151 .TP
152 .BI activate
153 Reactivate an import after deactivating, below.  This setting is only effective until the next restart (see
154 .B conf_param
155 ).
156 .TP
157 .BI deactivate
158 Deactivate an import, in particular meaning do not assign new file stripes
159 to an OSC.  This command should be used on the OSC in the MDT LOV
160 corresponding to a failed OST device, to prevent further attempts at
161 communication with the failed OST.
162 .TP
163 .BI abort_recovery
164 Abort the recovery process on a restarting MDT or OST device
165 .PP
166 .SS Changelogs
167 Changelog user can be registered and deregistered on particular device.
168 Changelog starts logging when any user is registered.
169
170 For more details see:
171
172 .PP
173 \fBlctl-changelog_register\fR(8)
174 .RS 4
175 Register a new changelog user on specified MDT device with specified parameters.
176 .RE
177 .PP
178 \fBlctl-changelog_deregister\fR(8)
179 .RS 4
180 Deregister an existing changelog user on the specified MDT.
181
182 .PP
183 .SS Nodemap
184 An identity mapping feature that facilitates mapping of client UIDs and GIDs to
185 local file system UIDs and GIDs, while maintaining POSIX ownership, permissions,
186 and quota.
187
188 While the nodemap feature is enabled, all client file system access is subject
189 to the nodemap identity mapping policy, which consists of the 'default' catchall
190 nodemap, and any user-defined nodemaps. The 'default' nodemap maps all client
191 identities to 99:99 (nobody:nobody). Administrators can define nodemaps for a
192 range of client NIDs which map identities, and these nodemaps can be flagged as
193  'trusted' so identities are accepted without translation, as well as flagged
194 as 'admin' meaning that root is not squashed for these nodes.
195
196 Note: In the current phase of implementation, to use the nodemap functionality
197 you only need to enable and define nodemaps on the MDS. The MDSes must also be
198 in a nodemap with the admin and trusted flags set. To use quotas with nodemaps,
199 you must also use set_param to enable and define nodemaps on the OSS (matching
200 what is defined on the MDS). Nodemaps do not currently persist, unless you
201 define them with set_param and use the -P flag. Note that there is a hard limit
202 to the number of changes you can persist over the lifetime of the file system.
203
204 See also:
205
206 .PP
207 \fBlctl-nodemap-activate\fR(8)
208 .RS 4
209 Activate/deactivate the nodemap feature.
210 .RE
211 .PP
212 \fBlctl-nodemap-add\fR(8)
213 .RS 4
214 Add a new nodemap, to which NID ranges, identities, and properties can be added.
215 .RE
216 .PP
217 \fBlctl-nodemap-del\fR(8)
218 .RS 4
219 Delete an existing nodemap.
220 .RE
221 .PP
222 \fBlctl-nodemap-add-range\fR(8)
223 .RS 4
224 Define a range of NIDs for a nodemap.
225 .RE
226 .PP
227 \fBlctl-nodemap-del-range\fR(8)
228 .RS 4
229 Delete an existing NID range from a nodemap.
230 .RE
231 .PP
232 \fBlctl-nodemap-add-idmap\fR(8)
233 .RS 4
234 Add a UID or GID mapping to a nodemap.
235 .RE
236 .PP
237 \fBlctl-nodemap-del-idmap\fR(8)
238 .RS 4
239 Delete an existing UID or GID mapping from a nodemap.
240 .RE
241 .PP
242 \fBlctl-nodemap-modify\fR(8)
243 .RS 4
244 Modify a nodemap property.
245 .RE
246 .PP
247 \fBlctl-nodemap-set-fileset\fR(8)
248 .RS 4
249 Add a fileset to a nodemap.
250 .RE
251 .PP
252 \fBlctl-nodemap-set-sepol\fR(8)
253 .RS 4
254 Set SELinux policy info on a nodemap.
255 .RE
256 .SS Configuration logs
257 .TP
258 .BI clear_conf " <device|fsname>"
259 This command runs on MGS node having MGS device mounted with -o
260 nosvc. It cleans up configuration files stored in the CONFIGS/ directory
261 of any records marked SKIP. If the device name is given, then the
262 specific logs for that filesystem (e.g. testfs-MDT0000) is processed.
263 Otherwise, if a filesystem name is given then all configuration files for the
264 specified filesystem are cleared.
265 .PP
266 .SS LFSCK
267 An on-line Lustre consistency check and repair tool. It is used for totally
268 replacing the old lfsck tool for kinds of Lustre inconsistency verification,
269 including: corrupted or lost OI mapping, corrupted or lost link EA, corrupted
270 or lost FID in name entry, dangling name entry, multiple referenced name entry,
271 unmatched MDT-object and name entry pairs, orphan MDT-object, incorrect
272 MDT-object links count, corrupted namespace, corrupted or lost lov EA, lost
273 OST-object, multiple referenced OST-object, unmatched MDT-object and OST-object
274 pairs, orphan OST-object, and so on.
275
276 See also:
277
278 .PP
279 \fBlctl-lfsck-start\fR(8)
280 .RS 4
281 Start LFSCK on the specified MDT or OST device with specified parameters.
282 .RE
283 .PP
284 \fBlctl-lfsck-stop\fR(8)
285 .RS 4
286 Stop LFSCK on the specified MDT or OST device.
287 .RE
288 .PP
289 \fBlctl-lfsck-query\fR(8)
290 .RS 4
291 Get the LFSCK global status via the specified MDT device.
292 .RE
293
294 .SS BARRIER
295 The tools set for write (modify) barrier on all MDTs. For detail, please see:
296 .PP
297 \fBlctl-barrier\fR(8)
298 .RS 4
299
300 .SS SNAPSHOT
301 ZFS backend based snapshot tools set. The tool loads system configuration
302 from the file
303 .B /etc/ldev.conf
304 on the MGS, and call related ZFS commands to
305 maintain Lustre snapshot pieces on all targets (MGS/MDT/OST).
306 The configuration file
307 .B /etc/ldev.conf
308 is not only for snapshot, but also
309 for other purpose. The format is:
310   <host> foreign/- <label> <device> [journal-path]/- [raidtab]
311
312 The format of
313 .I <label>
314 is:
315   fsname-<role><index> or <role><index>
316
317 The format of
318 .I <device>
319 is:
320   [md|zfs:][pool_dir/]<pool>/<filesystem>
321
322 Snapshot only uses the fields <host>, <label> and <device>.
323
324 .br
325 .B Example:
326 .br
327 .B
328 # cat /etc/ldev.conf
329 .br
330  host-mdt1 - myfs-MDT0000 zfs:/tmp/myfs-mdt1/mdt1
331  host-mdt2 - myfs-MDT0001 zfs:myfs-mdt2/mdt2
332  host-ost1 - OST0000 zfs:/tmp/myfs-ost1/ost1
333  host-ost2 - OST0001 zfs:myfs-ost2/ost2
334
335 See also:
336
337 .PP
338 \fBlctl-snapshot-create\fR(8)
339 .RS 4
340 Create snapshot with the given name.
341 .RE
342 .PP
343 \fBlctl-snapshot-destroy\fR(8)
344 .RS 4
345 Destroy the specified snapshot.
346 .RE
347 .PP
348 \fBlctl-snapshot-modify\fR(8)
349 .RS 4
350 Modify the specified snapshot.
351 .RE
352 .PP
353 \fBlctl-snapshot-list\fR(8)
354 .RS 4
355 Query the snapshot information.
356 .RE
357 .PP
358 \fBlctl-snapshot-mount\fR(8)
359 .RS 4
360 Mount the specified snapshot.
361 .RE
362 .PP
363 \fBlctl-snapshot-umount\fR(8)
364 .RS 4
365 Umount the specified snapshot.
366 .RE
367
368 .SS Debug
369 .TP
370 .BI debug_daemon
371 Start and stop the debug daemon, and control the output filename and size.
372 .TP
373 .BI debug_kernel " [file] [raw]"
374 Dump the kernel debug buffer to stdout or file.
375 .TP
376 .BI debug_file " <input> [output]"
377 Convert kernel-dumped debug log from binary to plain text format.
378 .TP
379 .BI clear
380 Clear the kernel debug buffer.
381 .TP
382 .BI mark " <text>"
383 Insert marker text in the kernel debug buffer.
384 .TP
385 .BI filter " <subsystem id/debug mask>"
386 Filter kernel debug messages by subsystem or mask.
387 .TP
388 .BI show " <subsystem id/debug mask>"
389 Show specific type of messages.
390 .TP
391 .BI debug_list " <subs/types>"
392 List all the subsystem and debug types.
393 .TP
394 .BI modules " <path>"
395 Provide gdb-friendly module information.
396
397 .SH OPTIONS
398 The following options can be used to invoke lctl.
399 .TP
400 .B --device
401 The device to be used for the operation. This can be specified by name or
402 number. See
403 .B device_list
404 .TP
405 .B --ignore_errors | ignore_errors
406 Ignore errors during script processing
407 .TP
408 .B lustre_build_version
409 Output the build version of the Lustre kernel modules
410 .TP
411 .B --version
412 Output the build version of the lctl utility
413 .TP
414 .B --list-commands
415 Output a list of the commands supported by the lctl utility
416 .TP
417 .B help
418 Provides brief help on the various arguments
419 .TP
420 .B exit/quit
421 Quit the interactive lctl session
422
423 .SH EXAMPLES
424 # lctl
425 .br
426 lctl > dl
427   0 UP mgc MGC192.168.0.20@tcp bfbb24e3-7deb-2ffa-eab0-44dffe00f692 5
428   1 UP ost OSS OSS_uuid 3
429   2 UP obdfilter testfs-OST0000 testfs-OST0000_UUID 3
430 .br
431 lctl > dk /tmp/log
432 Debug log: 87 lines, 87 kept, 0 dropped.
433 .br
434 lctl > quit
435
436 .SH AVAILABILITY
437 .B lctl
438 is part of the
439 .BR lustre (7)
440 filesystem package.
441 .SH SEE ALSO
442 .BR lfs (1)
443 .BR lustre (7),
444 .BR lctl (8),
445 .BR lctl-barrier (8),
446 .BR lctl-changelog_deregister (8),
447 .BR lctl-changelog_register (8),
448 .BR lctl-get_param (8),
449 .BR lctl-lcfg (8),
450 .BR lctl-lfsck-start (8),
451 .BR lctl-lfsck-stop (8),
452 .BR lctl-lfsck-query (8),
453 .BR lctl-list_param (8),
454 .BR lctl-set_param (8),
455 .BR lctl-snapshot-create (8),
456 .BR lctl-snapshot-destroy (8),
457 .BR lctl-snapshot-modify (8),
458 .BR lctl-snapshot-list (8),
459 .BR lctl-snapshot-mount (8),
460 .BR lctl-snapshot-umount (8),
461 .BR lctl-llog_catlist (8),
462 .BR lctl-llog_info (8),
463 .BR lctl-llog_print (8),
464 .BR lctl-network (8),
465 .BR lctl-nodemap-activate (8),
466 .BR lctl-nodemap-add (8),
467 .BR lctl-nodemap-add-idmap (8),
468 .BR lctl-nodemap-add-range (8),
469 .BR lctl-nodemap-del (8),
470 .BR lctl-nodemap-del-idmap (8),
471 .BR lctl-nodemap-del-range (8),
472 .BR lctl-nodemap-modify (8),
473 .BR lctl-pcc (8),
474 .BR mkfs.lustre (8),
475 .BR mount.lustre (8),