Whamcloud - gitweb
land v0.9.1 on HEAD, in preparation for a 1.0.x branch
[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 .B lctl --threads <numthreads> <verbose> <devno> <command [args]>
11 .br
12 .SH DESCRIPTION
13 .B lctl
14 can be invoked in interactive mode by issuing lctl command. After that, commands are issued as below. The most common commands in lctl are (in matching pairs) 
15 .B device 
16 and 
17 .B attach
18
19 .B detach 
20 and 
21 .B setup
22 ,
23 .B cleanup 
24 and
25 .B connect
26 ,
27 .B disconnect 
28 and
29 .B help
30 , and
31 .B quit.
32
33 To get a complete listing of available commands, type help at the lctl prompt.  To get basic help on the meaning and syntax of a command, type help command.  Command completion is activated with the TAB key, and command history is available via the up- and down-arrow keys. 
34
35 For non-interactive single-threaded use, one uses the second invocation, which runs command after connecting to the device. 
36
37 .B Network Configuration
38 .TP 
39 network <tcp/elans/myrinet> 
40 Indicate what kind of network applies for the configuration commands that follow.
41 .TP 
42 connect [[<hostname> <port>] | <elan id>] 
43 This will establish a connection to a remote network network id given by the hostname/port combination, or the elan id.
44 .TP 
45 disconnect <nid> 
46 Disconnect from a remote nid.
47 .TP 
48 mynid [nid] 
49 Informs the socknal of the local nid. It defaults to hostname for tcp networks and is automatically setup for elan/myrinet networks.
50 .TP 
51 add_uuid <uuid> <nid> 
52 Associate a given UUID with an nid.
53 .TP 
54 close_uuid <uuid> 
55 Disconnect a UUID.
56 .TP 
57 del_uuid <uuid> 
58 Delete a UUID association.
59 .TP 
60 add_route <gateway> <target> [target] 
61 Add an entry to the routing table for the given target.
62 .TP 
63 del_route <target> 
64 Delete an entry for the target from the routing table.
65 .TP 
66 route_list 
67 Print the complete routing table.
68 .TP 
69 recv_mem [size] 
70 Set the socket receive buffer size; if the size is omitted, the default size for the buffer is printed.
71 .TP 
72 send_mem [size] 
73 Set send buffer size for the socket; if size is omitted, the default size for the buffer is printed.
74 .TP 
75 nagle [on/off] 
76 Enable/disable nagle; omitting the argument will cause the default value to be printed.
77 .TP 
78 fail nid|all [count] 
79 Fail/restore communications. Ommiting tha count implies fail indefinitely, count of zero indicates that communication should be restored. A non-zero count indicates the number of portals messages to be dropped after which the communication is restored.
80 .PP
81 .B Device Selection
82 .TP 
83 newdev 
84 Create a new device.
85 .TP 
86 name2dev 
87 This command can be used to determine a device number for the given device name.
88 .TP 
89 device 
90 This will select the specified OBD device.  All other commands depend on the device being set. 
91 .TP 
92 device_list 
93 Show all the devices.
94 .TP 
95 lustre_build_version 
96 Print the Lustre build version.
97 .PP
98 .B Device Configuration
99 .TP 
100 attach type [name [uuid]] 
101 Attach a type to the current device (which you need to set using the device command) and give that device a name and UUID.  This allows us to identify the device for use later, and also tells us what type of device we will have.
102 .TP 
103 setup <args...> 
104 Type specific device setup commands. For obdfilter, a setup command tells the driver which block device it should use for storage and what type of filesystem is on that device. 
105 .TP 
106 cleanup 
107 Cleanup a previously setup device.
108 .TP 
109 detach 
110 Remove driver (and name and UUID) from the current device.
111 .TP 
112 lov_setconfig lov-uuid stripe-count default-stripe-size offset pattern UUID1 [UUID2...] 
113 Write LOV configuration to an MDS device.
114 .TP 
115 lov_getconfig lov-uuid 
116 Read LOV configuration from an MDS device. Returns default-stripe-count, default-stripe-size, offset, pattern, and a list of OST UUID's.
117 .PP
118 .B Device Operations
119 .TP 
120 probe [timeout] 
121 Build a connection handle to a device. This command is used to suspend configuration until the lctl command has ensured that the MDS and OSC services are available. This is to avoid mount failures in a rebooting cluster.
122 .TP 
123 close 
124 Close the connection handle
125 .TP 
126 getattr <objid> 
127 Get attributes for an OST object <objid> .
128 .TP 
129 setattr <objid> <mode> 
130 Set mode attribute for OST object <objid>.
131 .TP 
132 create [num [mode [verbose]]] 
133 Create the specified number <num> of OST objects with the given <mode>.
134 .TP 
135 destroy <num> 
136 Starting at <objid>, destroy <num> number of objects starting from the object with object id <objid>.
137 .TP 
138 test_getattr <num> [verbose [[t]objid]] 
139 Do <num> getattrs on OST object <objid> (objectid+1 on each thread).
140 .TP 
141 test_brw [t]<num> [write [verbose [npages [[t]objid]]]] 
142 Do <num> bulk read/writes on OST object <objid> (<npages> per I/O).
143 .TP 
144 test_ldlm 
145 Perform lock manager test.
146 .TP 
147 ldlm_regress_start %s [numthreads [refheld [numres [numext]]]] 
148 Start lock manager stress test.
149 .TP 
150 ldlm_regress_stop 
151 Stop lock manager stress test.
152 .TP 
153 dump_ldlm 
154 Dump all lock manager state, this is very useful for debugging
155 .TP 
156 activate 
157 Activate an import
158 .TP 
159 deacttivate 
160 De-activate an import
161 .TP 
162 recover <connection UUID> 
163 .TP 
164 lookup <directory> <file>
165 .TP 
166 notransno 
167 Disable sending of committed transnumber updates
168 .TP 
169 readonly 
170 Disable writes to the underlying device
171 .TP 
172 abort_recovery 
173 Abort recovery on MDS device
174 .TP 
175 mount_option 
176 Dump mount options to a file
177 .TP 
178 get_stripe 
179 Show stripe info for an echo client object.
180 .TP 
181 set_stripe <objid>[ width!count[@offset] [:id:id....] 
182 Set stripe info for an echo client
183 .TP 
184 unset_stripe <objid> 
185 Unset stripe info for an echo client object.
186 .PP
187 .B Debug
188 .TP 
189 debug_daemon 
190 Debug daemon control and dump to a file
191 .TP 
192 debug_kernel [file] [raw] 
193 Get debug buffer and dump to a fileusage.
194 .TP 
195 debug_file <input> [output] [raw] 
196 Read debug buffer from input and dump to outputusage.
197 .TP 
198 clear 
199 Clear kernel debug buffer.
200 .TP 
201 mark <text> 
202 Insert marker text in kernel debug buffer.
203 .TP 
204 filter <subsystem id/debug mask> 
205 Filter message type from the kernel debug buffer.
206 .TP 
207 show <subsystem id/debug mask> 
208 Show specific type of messages.
209 .TP 
210 debug_list <subs/types> 
211 List all the subsystem and debug types.
212 .TP 
213 panic 
214 Force the kernel to panic.
215 .PP
216 .B Control
217 .TP 
218 help 
219 Show a complete list of commands; help <command name> can be used to get help on specific command.
220 .TP 
221 exit 
222 Close the lctl session.
223 .TP 
224 quit 
225 Close the lctl session.
226
227 .SH OPTIONS
228 The following options can be used to invoke lctl. 
229 .TP
230 .B --device 
231 The device number to be used for the operation. The value of devno is an integer, normally found by calling lctl name2dev on a device name. 
232 .TP
233 .B --threads 
234 How many threads should be forked doing the command specified. The numthreads variable is a strictly positive integer indicating how many threads should be started. The devno option is used as above.
235 .TP
236 .B --ignore_errors | ignore_errors 
237 Ignore errors during script processing
238 .TP
239 .B dump 
240 Save ioctls to a file 
241 .SH EXAMPLES
242 .B attach
243
244 # lctl
245 .br
246 lctl > newdev
247 .br
248 lctl > attach obdfilter OBDDEV OBDUUID
249
250 .B connect
251
252 lctl > name2dev OSCDEV 2 
253 .br
254 lctl > device 2
255 .br
256 lctl > connect
257
258 .B getattr
259
260 lctl > getattr 12
261 .br
262 id: 12
263 .br
264 grp: 0
265 .br
266 atime: 1002663714
267 .br
268 mtime: 1002663535
269 .br
270 ctime: 1002663535
271 .br
272 size: 10
273 .br
274 blocks: 8
275 .br
276 blksize: 4096
277 .br
278 mode: 100644
279 .br
280 uid: 0
281 .br
282 gid: 0
283 .br
284 flags: 0
285 .br
286 obdflags: 0
287 .br
288 nlink: 1
289 .br
290 valid: ffffffff
291 .br
292 inline:
293 .br
294 obdmd:
295 .br
296 lctl > disconnect 
297 .br
298 Finished (success)
299
300 .B setup 
301
302 lctl > setup /dev/loop0 extN
303 .br
304 lctl > quit
305
306 .SH BUGS
307 None are known.