Whamcloud - gitweb
LU-4315 doc: split lctl-network.8 man page from lctl.8
[fs/lustre-release.git] / lustre / doc / lctl.8
1 .TH lctl 1 "2016 Sep 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 .BR dl ,
18 .BR dk ,
19 .BR device ,
20 .B network
21 .IR <up/down> ,
22 .BR list_nids ,
23 .B ping
24 .IR nid ,
25 .BR help ,
26 .BR quit .
27
28 To get a complete listing of available commands, type
29 .B help
30 at the lctl prompt.  To get basic help on the meaning and syntax of a
31 command, type
32 .B help
33 .I command
34 .  Command completion is activated with the TAB key, and command history is available via the up- and down-arrow keys.
35
36 For non-interactive use, one uses the second invocation, which runs command after connecting to the device.
37
38 .SS Network Configuration
39 .TP
40 .BR network " <" up / down >|< tcp / o2ib >
41 Start or stop LNET, or select a network type for other
42 .I lctl
43 LNET commands
44 .TP
45 .BI list_nids
46 Print all Network Identifiers on the local node. LNET must be running.
47 .TP
48 .BI which_nid " <nidlist>"
49 From a list of nids for a remote node, show which interface communication
50 will take place on.
51 .TP
52 .BI replace_nids " <devicename> <nid1>[,nid2,nid3 ...]"
53 Replace the LNET Network Identifiers for a given device,
54 as when the server's IP address has changed.
55 This command must be run on the MGS node.
56 Only MGS server should be started (command execution returns error
57 in another cases). To start the MGS service only:
58 mount -t lustre <MDT partition> -o nosvc <mount point>
59 Note the replace_nids command skips any invalidated records in the configuration log.
60 The previous log is backed up with the suffix '.bak'.
61 .TP
62 .BI ping " <nid> "
63 Check LNET connectivity via an LNET ping. This will use the fabric
64 appropriate to the specified NID.
65 .TP
66 .BI interface_list
67 Print the network interface information for a given
68 .B network
69 type.
70 .TP
71 .BI peer_list
72 Print the known peers for a given
73 .B network
74 type.
75 .TP
76 .BI conn_list
77 Print all the connected remote NIDs for a given
78 .B network
79 type.
80 .TP
81 .BI route_list
82 Print the complete routing table.
83 .PP
84 .SS Device Selection
85 .TP
86 .BI device " <devname> "
87 This will select the specified OBD device.  All other commands depend on the device being set.
88 .TP
89 .BI device_list
90 Show all the local Lustre OBDs. AKA
91 .B dl
92 .PP
93 .SS Device Operations
94 .TP
95 .BI list_param " [-F|-R] <param_search ...>"
96 List the Lustre or LNet parameter name
97 .B -F
98 Add '/', '@' or '=' for dirs, symlinks and writeable files, respectively.
99 .br
100 .B -R
101 Recursively list all parameters under the specified parameter search string. If
102 .I param_search
103 is unspecified, all the parameters will be shown.
104 .br
105 .B Examples:
106 .br
107 .B
108 # lctl list_param ost.*
109 .br
110   ost.OSS
111 .br
112   ost.num_refs
113 .br
114 .B
115 # lctl list_param -F ost.* debug
116 .br
117   ost.OSS/
118 .br
119   ost.num_refs
120 .br
121   debug=
122 .br
123 .B
124 # lctl list_param -R mdt
125 .br
126   mdt
127 .br
128   mdt.lustre-MDT0000
129 .br
130   mdt.lustre-MDT0000.capa
131 .br
132   mdt.lustre-MDT0000.capa_count
133 .br
134   mdt.lustre-MDT0000.capa_key_timeout
135 .br
136   mdt.lustre-MDT0000.capa_timeout
137 .br
138   mdt.lustre-MDT0000.commit_on_sharing
139 .br
140   mdt.lustre-MDT0000.evict_client
141 .br
142   ...
143 .TP
144 .BI get_param " [-F|-n|-N|-R] <parameter ...>"
145 Get the value of Lustre or LNET parameter.
146 .br
147 .B -F
148 When -N specified, add '/', '@' or '=' for directories, symlinks and writeable files, respectively.
149 .br
150 .br
151 .B -n
152 Print only the value and not parameter name.
153 .br
154 .B -N
155 Print only matched parameter names and not the values. (Especially useful when using patterns.)
156 .br
157 .B -R
158 Print all of the parameter names below the specified name.
159 .br
160 .B Examples:
161 .br
162 .B
163 # lctl get_param ost.*
164 .br
165   ost.OSS
166 .br
167   ost.num_refs
168 .br
169 .B
170 # lctl get_param -n debug timeout
171 .br
172   super warning dlmtrace error emerg ha rpctrace vfstrace config console
173 .br
174   20
175 .br
176 .B
177 # lctl get_param -N ost.* debug
178 .br
179   ost.OSS
180 .br
181   ost.num_refs
182 .br
183   debug
184 .br
185 lctl "get_param -NF" is equivalent to "list_param -F".
186 .TP
187 .BI set_param " [-n] [-P] [-d] <parameter=value ...>"
188 Set the value of Lustre or LNET parameter.
189 .br
190 .B -n
191 Disable printing of the key name when printing values.
192 .br
193 .B -P
194 Set the parameter permanently, filesystem-wide.
195 This parameters are only visible to 2.5.0 and later clients, older clients will not see these parameters.
196 .br
197 .B -d
198 Remove the permanent setting (only with -P option)
199 .br
200 .B Examples:
201 .br
202 .B
203 # lctl set_param fail_loc=0 timeout=20
204 .br
205   fail_loc=0
206 .br
207   timeout=20
208 .br
209 .B
210 # lctl set_param -n fail_loc=0 timeout=20
211 .br
212   0
213 .br
214   20
215 .br
216 .B
217 # lctl set_param -P osc.*.max_dirty_mb=32
218 .br
219 .TP
220 .BI conf_param " [-d] <device|fsname>.<parameter>=<value>"
221 Set a permanent configuration parameter for any device via the MGS.  This
222 command must be run on the MGS node.
223 .br
224 .B -d <device|fsname>.<parameter>
225 Delete a parameter setting (use the default value at the next restart).  A null value for <value> also deletes the parameter setting.
226 .br
227 .B Parameters:
228 .br
229 All of the writable parameters under
230 .B lctl list_param
231 (e.g.
232 .I lctl list_param -F osc.*.* | grep =
233 ) can be permanently set using
234 .B lctl conf_param
235 , but the format is slightly different.  For conf_param, the device is specified first, then the obdtype. (See examples below.)  Wildcards are not supported.
236 .br
237 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.
238 .br
239 .B Examples:
240 .br
241 # lctl conf_param testfs.sys.at_max=1200
242 .br
243 # lctl conf_param testfs.llite.max_read_ahead_mb=16
244 .br
245 # lctl conf_param testfs-MDT0000.lov.stripesize=2M
246 .br
247 # lctl conf_param lustre-OST0001.osc.active=0
248 .br
249 # lctl conf_param testfs-OST0000.osc.max_dirty_mb=29.15
250 .br
251 # lctl conf_param testfs-OST0000.ost.client_cache_seconds=15
252 .br
253 # lctl conf_param testfs-OST0000.failover.node=1.2.3.4@tcp1
254 .TP
255 .BI activate
256 Reactivate an import after deactivating, below.  This setting is only effective until the next restart (see
257 .B conf_param
258 ).
259 .TP
260 .BI deactivate
261 Deactivate an import, in particular meaning do not assign new file stripes
262 to an OSC.  This command should be used on the OSC in the MDT LOV
263 corresponding to a failed OST device, to prevent further attempts at
264 communication with the failed OST.
265 .TP
266 .BI abort_recovery
267 Abort the recovery process on a restarting MDT or OST device
268 .PP
269 .SS Virtual Block Device Operation
270 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.
271 .TP
272 .BI blockdev_attach " <file name> <device node>"
273 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.
274 .TP
275 .BI blockdev_detach " <device node>"
276 Detach the virtual block device.
277 .TP
278 .BI blockdev_info " <device node>"
279 Acquire which lustre file was attached to the device node.
280 .PP
281 .SS Changelogs
282 .TP
283 .BI changelog_register " [-n]"
284 Register a new changelog user for a particular device.  Changelog entries
285 will not be purged beyond any registered users' set point. (See lfs changelog_clear.)
286 .br
287 .B -n
288 Print only the ID of the newly registered user.
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. It is used for totally
361 replacing the old lfsck tool for kinds of Lustre inconsistency verification,
362 including: corrupted or lost OI mapping, corrupted or lost link EA, corrupted
363 or lost FID in name entry, dangling name entry, multiple referenced name entry,
364 unmatched MDT-object and name entry pairs, orphan MDT-object, incorrect
365 MDT-object links count, corrupted namespace, corrupted or lost lov EA, lost
366 OST-object, multiple referenced OST-object, unmatched MDT-object and OST-object
367 pairs, orphan OST-object, and so on.
368
369 See also:
370
371 .PP
372 \fBlctl-lfsck-start\fR(8)
373 .RS 4
374 Start LFSCK on the specified MDT or OST device with specified parameters.
375 .RE
376 .PP
377 \fBlctl-lfsck-stop\fR(8)
378 .RS 4
379 Stop LFSCK on the specified MDT or OST device.
380 .RE
381 .PP
382 \fBlctl-lfsck-query\fR(8)
383 .RS 4
384 Get the LFSCK global status via the specified MDT device.
385 .RE
386 .SS Debug
387 .TP
388 .BI debug_daemon
389 Start and stop the debug daemon, and control the output filename and size.
390 .TP
391 .BI debug_kernel " [file] [raw]"
392 Dump the kernel debug buffer to stdout or file.
393 .TP
394 .BI debug_file " <input> [output]"
395 Convert kernel-dumped debug log from binary to plain text format.
396 .TP
397 .BI clear
398 Clear the kernel debug buffer.
399 .TP
400 .BI mark " <text>"
401 Insert marker text in the kernel debug buffer.
402 .TP
403 .BI filter " <subsystem id/debug mask>"
404 Filter kernel debug messages by subsystem or mask.
405 .TP
406 .BI show " <subsystem id/debug mask>"
407 Show specific type of messages.
408 .TP
409 .BI debug_list " <subs/types>"
410 List all the subsystem and debug types.
411 .TP
412 .BI modules " <path>"
413 Provide gdb-friendly module information.
414
415 .SH OPTIONS
416 The following options can be used to invoke lctl.
417 .TP
418 .B --device
419 The device to be used for the operation. This can be specified by name or
420 number. See
421 .B device_list
422 .TP
423 .B --ignore_errors | ignore_errors
424 Ignore errors during script processing
425 .TP
426 .B lustre_build_version
427 Output the build version of the Lustre kernel modules
428 .TP
429 .B --version
430 Output the build version of the lctl utility
431 .TP
432 .B help
433 Provides brief help on the various arguments
434 .TP
435 .B exit/quit
436 Quit the interactive lctl session
437
438 .SH EXAMPLES
439 # lctl
440 .br
441 lctl > dl
442   0 UP mgc MGC192.168.0.20@tcp bfbb24e3-7deb-2ffa-eab0-44dffe00f692 5
443   1 UP ost OSS OSS_uuid 3
444   2 UP obdfilter testfs-OST0000 testfs-OST0000_UUID 3
445 .br
446 lctl > dk /tmp/log
447 Debug log: 87 lines, 87 kept, 0 dropped.
448 .br
449 lctl > quit
450
451 .SH AVAILABILITY
452 .B lctl
453 is part of the
454 .BR Lustre (7)
455 filesystem package.
456 .SH SEE ALSO
457 .BR lustre (7),
458 .BR mkfs.lustre (8),
459 .BR mount.lustre (8),
460 .BR lctl (8),
461 .BR lctl-lfsck-start (8),
462 .BR lctl-lfsck-stop (8),
463 .BR lctl-lfsck-query (8),
464 .BR lctl-network (8),
465 .BR lctl-nodemap-activate (8),
466 .BR lctl-nodemap-add-idmap (8),
467 .BR lctl-nodemap-add-range (8),
468 .BR lctl-nodemap-add (8),
469 .BR lctl-nodemap-del-idmap (8),
470 .BR lctl-nodemap-del-range (8),
471 .BR lctl-nodemap-del (8),
472 .BR lctl-nodemap-modify (8),
473 .BR lfs (1)