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