Whamcloud - gitweb
LUDOC-29 increase maximum stripe count from 160 to 2000
[doc/manual.git] / UserUtilities.xml
1 <?xml version='1.0' encoding='UTF-8'?>
2 <!-- This document was created with Syntext Serna Free. --><chapter xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US" xml:id="userutilities">
3   <title xml:id="userutilities.title">User Utilities</title>
4   <para>This chapter describes user utilities and includes the following sections:</para>
5   <itemizedlist>
6     <listitem>
7       <para><xref linkend="dbdoclet.50438206_94597"/></para>
8     </listitem>
9     <listitem>
10       <para><xref linkend="dbdoclet.50438206_42260"/></para>
11     </listitem>
12     <listitem>
13       <para><xref linkend="dbdoclet.50438206_91700"/></para>
14     </listitem>
15     <listitem>
16       <para><xref linkend="dbdoclet.50438206_75125"/></para>
17     </listitem>
18     <listitem>
19       <para><xref linkend="dbdoclet.50438206_86244"/></para>
20     </listitem>
21     <listitem>
22       <para><xref linkend="dbdoclet.50438206_56217"/></para>
23     </listitem>
24   </itemizedlist>
25   <section xml:id="dbdoclet.50438206_94597">
26     <title><indexterm><primary>lfs</primary></indexterm>
27       <literal>lfs</literal>
28     </title>
29     <para>The <literal>lfs</literal> utility can be used for user configuration routines and monitoring.</para>
30     <section remap="h5">
31       <title>Synopsis</title>
32       <screen>lfs
33 lfs changelog [--follow] &lt;mdtname&gt; [startrec [endrec]]
34 lfs changelog_clear &lt;mdtname&gt; &lt;id&gt; &lt;endrec&gt;
35 lfs check &lt;mds|osts|servers&gt;
36 lfs df [-i] [-h] [--pool]-p &lt;fsname&gt;[.&lt;pool&gt;] [path]
37 lfs find [[!] --atime|-A [-+]N] [[!] --mtime|-M [-+]N] 
38    [[!] --ctime|-C [-+]N] [--maxdepth|-D N] [--name|-n &lt;pattern&gt;]
39    [--print|-p] [--print0|-P] [[!] --obd|-O &lt;uuid[s]&gt;] 
40    [[!] --size|-S [+-]N[kMGTPE]] --type |-t {bcdflpsD}]
41    [[!] --gid|-g|--group|-G &lt;gname&gt;|&lt;gid&gt;]
42    [[!] --uid|-u|--user|-U &lt;uname&gt;|&lt;uid&gt;]
43    &lt;dirname|filename&gt;
44 lfs osts [path]
45 lfs getstripe [--obd|-O &lt;uuid&gt;] [--quiet|-q] [--verbose|-v]
46                    [--count|-c] [--index|-i | --offset|-o]
47                    [--size|-s] [--pool|-p] [--directory|-d]
48                    [--recursive|-r] &lt;dirname|filename&gt; ...
49 lfs setstripe              [--size|-s stripe_size] [--count|-c stripe_cnt] 
50            [--index|-i|--offset|-o start_ost_index] 
51            [--pool|-p &lt;pool&gt;]
52            &lt;dirname|filename&gt;
53 lfs setstripe -d &lt;dir&gt;
54 lfs poollist &lt;filesystem&gt;[.&lt;pool&gt;]|&lt;pathname&gt;
55 lfs quota [-q] [-v] [-o obd_uuid|-I ost_idx|-i mdt_idx] [-u &lt;uname&gt;| -u &lt;uid&gt;|-g &lt;gname&gt;| -g &lt;gid&gt;] &lt;filesystem&gt;
56 lfs quota -t &lt;-u|-g&gt; &lt;filesystem&gt;
57 lfs quotacheck [-ug] &lt;filesystem&gt;
58 lfs quotachown [-i] &lt;filesystem&gt;
59 lfs quotaon [-ugf] &lt;filesystem&gt;
60 lfs quotaoff [-ug] &lt;filesystem&gt;
61 lfs quotainv [-ug] [-f] &lt;filesystem&gt;
62 lfs setquota               &lt;-u|--user|-g|--group&gt; &lt;uname|uid|gname|gid&gt;
63                    [--block-softlimit &lt;block-softlimit&gt;]
64                    [--block-hardlimit &lt;block-hardlimit&gt;]
65                    [--inode-softlimit &lt;inode-softlimit&gt;]
66                    [--inode-hardlimit &lt;inode-hardlimit&gt;]
67                    &lt;filesystem&gt;
68 lfs setquota &lt;-u|--user|-g|--group&gt; &lt;uname|uid|gname|gid&gt;
69            [-b &lt;block-softlimit&gt;] [-B &lt;block-hardlimit&gt;]
70            [-i &lt;inode-softlimit&gt;] [-I &lt;inode-hardlimit&gt;] 
71            &lt;filesystem&gt;
72 lfs setquota -t &lt;-u|-g&gt;
73            [--block-grace &lt;block-grace&gt;]
74            [--inode-grace &lt;inode-grace&gt;]
75            &lt;filesystem&gt;
76 lfs setquota -t &lt;-u|-g&gt;
77            [-b &lt;block-grace&gt;] [-i &lt;inode-grace&gt;]
78            &lt;filesystem&gt;
79 lfs help
80 </screen>
81       <note>
82         <para>In the above example, the <literal>&lt;filesystem&gt;</literal> parameter refers to the mount point of the Lustre file system. The default mount point is <literal>/mnt/lustre</literal></para>
83       </note>
84       <note>
85         <para>The old lfs quota output was very detailed and contained cluster-wide quota statistics (including cluster-wide limits for a user/group and cluster-wide usage for a user/group), as well as statistics for each MDS/OST. Now, <literal>lfs quota</literal> has been updated to provide only cluster-wide statistics, by default. To obtain the full report of cluster-wide limits, usage and statistics, use the <literal>-v</literal> option with <literal>lfs quota</literal>.</para>
86       </note>
87     </section>
88     <section remap="h5">
89       <title>Description</title>
90       <para>The <literal>lfs</literal> utility is used to create a new file with a specific striping pattern, determine the default striping pattern, gather the extended attributes (object numbers and location) for a specific file, find files with specific attributes, list OST information or set quota limits. It can be invoked interactively without any arguments or in a non-interactive mode with one of the supported arguments.</para>
91     </section>
92     <section remap="h5">
93       <title>Options</title>
94       <para>The various <literal>lfs</literal> options are listed and described below. For a complete list of available options, type help at the <literal>lf</literal>s prompt.</para>
95       <informaltable frame="all">
96         <tgroup cols="3">
97           <colspec colname="c1" colwidth="33*"/>
98           <colspec colname="c2" colwidth="33*"/>
99           <colspec colname="c3" colwidth="33*"/>
100           <thead>
101             <row>
102               <entry nameend="c2" namest="c1">
103                 <para><emphasis role="bold">Option</emphasis></para>
104               </entry>
105               <entry>
106                 <para><emphasis role="bold">Description</emphasis></para>
107               </entry>
108             </row>
109           </thead>
110           <tbody>
111             <row>
112               <entry nameend="c2" namest="c1">
113                 <para><literal>changelog</literal> </para>
114               </entry>
115               <entry>
116                 <para>Shows the metadata changes on an MDT. Start and end points are optional. The <literal>--follow </literal>option blocks on new changes; this option is only valid when run directly on the MDT node.</para>
117               </entry>
118             </row>
119             <row>
120               <entry nameend="c2" namest="c1">
121                 <para> <literal>changelog_clear</literal></para>
122               </entry>
123               <entry>
124                 <para>Indicates that changelog records previous to <literal>&lt;endrec&gt;</literal> are no longer of interest to a particular consumer <literal>&lt;id&gt;</literal>, potentially allowing the MDT to free up disk space. An <literal>&lt;endrec&gt;</literal> of 0 indicates the current last record. Changelog consumers must be registered on the MDT node using <literal>lctl</literal>.</para>
125               </entry>
126             </row>
127             <row>
128               <entry nameend="c2" namest="c1">
129                 <literal> check </literal>
130               </entry>
131               <entry>
132                 <para>Displays the status of MDS or OSTs (as specified in the command) or all servers (MDS and OSTs).</para>
133               </entry>
134             </row>
135             <row>
136               <entry nameend="c2" namest="c1">
137                 <literal> df [-i] [-h] [--pool|-p &lt;fsname&gt;[.&lt;pool&gt;] [path] </literal>
138               </entry>
139               <entry>
140                 <para>Report file system disk space usage or inode usage (with <literal>-i</literal>) of each MDT/OST or a subset of OSTs if a pool is specified with <literal>-p</literal>. By default, prints the usage of all mounted Lustre file systems. Otherwise, if path is specified, prints only the usage of that file system. If <literal>-h</literal> is given, the output is printed in human-readable format, using SI base-2 suffixes for <emphasis role="bold">M</emphasis>ega-, <emphasis role="bold">G</emphasis>iga-, <emphasis role="bold">T</emphasis>era-, <emphasis role="bold">P</emphasis>eta-, or <emphasis role="bold">E</emphasis>xabytes.</para>
141               </entry>
142             </row>
143             <row>
144               <entry nameend="c2" namest="c1">
145                 <para><literal> find</literal></para>
146               </entry>
147               <entry>
148                 <para>Searches the directory tree rooted at the given directory/filename for files that match the given parameters.</para>
149                 <para>Using <literal>!</literal> before an option negates its meaning (files NOT matching the parameter). Using <literal>+</literal> before a numeric value means files with the parameter OR MORE. Using <literal>-</literal> before a numeric value means files with the parameter OR LESS.</para>
150               </entry>
151             </row>
152             <row>
153               <entry/>
154               <entry>
155                 <literal> --atime </literal>
156               </entry>
157               <entry>
158                 <para>File was last accessed N*24 hours ago. (There is no guarantee that <literal>atime</literal> is kept coherent across the cluster.)</para>
159                 <para>OSTs store a transient <literal>atime</literal> that is updated when clients do read requests. Permanent <literal>atime</literal> is written to the MDS when the file is closed. However, on-disk atime is only updated if it is more than 60 seconds old (<literal>/proc/fs/lustre/mds/*/max_atime_diff</literal>). Lustre considers the latest <literal>atime</literal> from all OSTs. If a <literal>setattr</literal> is set by user, then it is updated on both the MDS and OST, allowing the <literal>atime</literal> to go backward.</para>
160               </entry>
161             </row>
162             <row>
163               <entry>
164                 <para> &#160;</para>
165               </entry>
166               <entry>
167                 <para> <literal>--ctime</literal></para>
168               </entry>
169               <entry>
170                 <para>File status was last changed N*24 hours ago.</para>
171               </entry>
172             </row>
173             <row>
174               <entry>
175                 <para> &#160;</para>
176               </entry>
177               <entry>
178                 <para> <literal>--mtime</literal></para>
179               </entry>
180               <entry>
181                 <para>File data was last modified N*24 hours ago.</para>
182               </entry>
183             </row>
184             <row>
185               <entry>
186                 <para> &#160;</para>
187               </entry>
188               <entry>
189                 <para> <literal>--obd</literal></para>
190               </entry>
191               <entry>
192                 <para>File has an object on a specific OST(s).</para>
193               </entry>
194             </row>
195             <row>
196               <entry>
197                 <para> &#160;</para>
198               </entry>
199               <entry>
200                 <para> <literal>--size</literal></para>
201               </entry>
202               <entry>
203                 <para>File has a size in bytes, or kilo-, Mega-, Giga-, Tera-, Peta- or Exabytes if a suffix is given.</para>
204               </entry>
205             </row>
206             <row>
207               <entry>
208                 <para> &#160;</para>
209               </entry>
210               <entry>
211                 <para> <literal>--type</literal></para>
212               </entry>
213               <entry>
214                 <para>File has the type (block, character, directory, pipe, file, symlink, socket or Door [Solaris]).</para>
215               </entry>
216             </row>
217             <row>
218               <entry>
219                 <para> &#160;</para>
220               </entry>
221               <entry>
222                 <para> <literal>--uid</literal></para>
223               </entry>
224               <entry>
225                 <para>File has a specific numeric user ID.</para>
226               </entry>
227             </row>
228             <row>
229               <entry>
230                 <para> &#160;</para>
231               </entry>
232               <entry>
233                 <para> <literal>--user</literal></para>
234               </entry>
235               <entry>
236                 <para>File owned by a specific user (numeric user ID allowed).</para>
237               </entry>
238             </row>
239             <row>
240               <entry>
241                 <para> &#160;</para>
242               </entry>
243               <entry>
244                 <para> <literal>--gid</literal></para>
245               </entry>
246               <entry>
247                 <para>File has a specific group ID.</para>
248               </entry>
249             </row>
250             <row>
251               <entry>
252                 <para> &#160;</para>
253               </entry>
254               <entry>
255                 <para> <literal>--group</literal></para>
256               </entry>
257               <entry>
258                 <para>File belongs to a specific group (numeric group ID allowed).</para>
259               </entry>
260             </row>
261             <row>
262               <entry>
263                 <para> &#160;</para>
264               </entry>
265               <entry>
266                 <para> -<literal>-maxdepth</literal></para>
267               </entry>
268               <entry>
269                 <para>Limits find to descend at most N levels of the directory tree.</para>
270               </entry>
271             </row>
272             <row>
273               <entry>
274                 <para> &#160;</para>
275               </entry>
276               <entry>
277                 <para> <literal>--print</literal> / <literal>--print0</literal></para>
278               </entry>
279               <entry>
280                 <para>Prints the full filename, followed by a new line or NULL character correspondingly.</para>
281               </entry>
282             </row>
283             <row>
284               <entry nameend="c2" namest="c1">
285                 <para> <literal>osts [path]</literal></para>
286               </entry>
287               <entry>
288                 <para>Lists all OSTs for the file system. If a path located on a Lustre-mounted file system is specified, then only OSTs belonging to this file system are displayed.</para>
289               </entry>
290             </row>
291             <row>
292               <entry nameend="c2" namest="c1">
293                 <para> <literal>getstripe</literal></para>
294               </entry>
295               <entry>
296                 <para>Lists striping information for a given filename or directory. By default, the stripe count, stripe size and offset are returned.</para>
297                 <para>If you only want specific striping information, then the options of <literal>--count</literal>,<literal>--size</literal>,<literal>--index</literal> or <literal>--offset</literal> plus various combinations of these options can be used to retrieve specific information.</para>
298               </entry>
299             </row>
300             <row>
301               <entry>
302                 <para> &#160;</para>
303               </entry>
304               <entry>
305                 <para> <literal>--obd &lt;uuid&gt;</literal></para>
306               </entry>
307               <entry>
308                 <para>Lists files that have an object on a specific OST.</para>
309               </entry>
310             </row>
311             <row>
312               <entry>
313                 <para> &#160;</para>
314               </entry>
315               <entry>
316                 <para> <literal>--quiet</literal></para>
317               </entry>
318               <entry>
319                 <para>Lists details about the file&apos;s object ID information.</para>
320               </entry>
321             </row>
322             <row>
323               <entry>
324                 <para> &#160;</para>
325               </entry>
326               <entry>
327                 <para> <literal>--verbose</literal></para>
328               </entry>
329               <entry>
330                 <para>Prints additional striping information.</para>
331               </entry>
332             </row>
333             <row>
334               <entry>
335                 <para> &#160;</para>
336               </entry>
337               <entry>
338                 <para> <literal>--count</literal></para>
339               </entry>
340               <entry>
341                 <para>Lists the stripe count (how many OSTs to use).</para>
342               </entry>
343             </row>
344             <row>
345               <entry>
346                 <para> &#160;</para>
347               </entry>
348               <entry>
349                 <para> <literal>--index</literal></para>
350               </entry>
351               <entry>
352                 <para>Lists the index for each OST in the file system.</para>
353               </entry>
354             </row>
355             <row>
356               <entry>
357                 <para> &#160;</para>
358               </entry>
359               <entry>
360                 <para> <literal>--offset</literal></para>
361               </entry>
362               <entry>
363                 <para>Lists the OST index on which file striping starts.</para>
364               </entry>
365             </row>
366             <row>
367               <entry>
368                 <para> &#160;</para>
369               </entry>
370               <entry>
371                 <para> <literal>--pool</literal></para>
372               </entry>
373               <entry>
374                 <para>Lists the pools to which a file belongs.</para>
375               </entry>
376             </row>
377             <row>
378               <entry>
379                 <para> &#160;</para>
380               </entry>
381               <entry>
382                 <para> <literal>--size</literal></para>
383               </entry>
384               <entry>
385                 <para>Lists the stripe size (how much data to write to one OST before moving to the next OST).</para>
386               </entry>
387             </row>
388             <row>
389               <entry>
390                 <para> &#160;</para>
391               </entry>
392               <entry>
393                 <para> <literal>--directory</literal></para>
394               </entry>
395               <entry>
396                 <para>Lists entries about a specified directory instead of its contents (in the same manner as <literal>ls -d</literal>).</para>
397               </entry>
398             </row>
399             <row>
400               <entry>
401                 <para> &#160;</para>
402               </entry>
403               <entry>
404                 <para> <literal>--recursive</literal></para>
405               </entry>
406               <entry>
407                 <para>Recurses into all sub-directories.</para>
408               </entry>
409             </row>
410             <row>
411               <entry nameend="c2" namest="c1">
412                 <para> <literal>setstripe</literal></para>
413               </entry>
414               <entry>
415                 <para>Create new files with a specific file layout (stripe pattern) configuration.<footnote>
416                     <para>The file cannot exist prior to using <literal>setstripe</literal>. A directory must exist prior to using <literal>setstripe</literal>.</para>
417                   </footnote></para>
418               </entry>
419             </row>
420             <row>
421               <entry>
422                 <para> &#160;</para>
423               </entry>
424               <entry>
425                 <para> <literal>--count stripe_cnt</literal></para>
426               </entry>
427               <entry>
428                 <para>Number of OSTs over which to stripe a file. A <literal>stripe_cnt</literal> of 0 uses the file system-wide default stripe count (default is 1). A <literal>stripe_cnt</literal> of -1 stripes over all available OSTs.</para>
429               </entry>
430             </row>
431             <row>
432               <entry>
433                 <para> &#160;</para>
434               </entry>
435               <entry>
436                 <para> <literal>--size stripe_size</literal><footnote>
437                     <para>The default stripe-size is 0. The default start-ost is -1. Do NOT confuse them! If you set start-ost to 0, all new file creations occur on OST 0 (seldom a good idea).</para>
438                   </footnote>&#160;</para>
439               </entry>
440               <entry>
441                 <para>Number of bytes to store on an OST before moving to the next OST. A stripe_size of 0 uses the file system&apos;s default stripe size, (default is 1 MB). Can be specified with <emphasis role="bold">k</emphasis> (KB), <emphasis role="bold">m</emphasis> (MB), or <emphasis role="bold">g</emphasis> (GB), respectively.</para>
442               </entry>
443             </row>
444             <row>
445               <entry>
446                 <para> &#160;</para>
447               </entry>
448               <entry>
449                 <para> <literal>--index --offset start_ost_index</literal></para>
450               </entry>
451               <entry>
452                 <para>The OST index (base 10, starting at 0) on which to start striping for this file. A start_ost_index value of -1 allows the MDS to choose the starting index. This is the default value, and it means that the MDS selects the starting OST as it wants. We strongly recommend selecting this default, as it allows space and load balancing to be done by the MDS as needed. The <literal>start_ost_index</literal> value has no relevance on whether the MDS will use round-robin or QoS weighted allocation for the remaining stripes in the file.</para>
453               </entry>
454             </row>
455             <row>
456               <entry>
457                 <para> &#160;</para>
458               </entry>
459               <entry>
460                 <para> <literal>--pool &lt;pool&gt;</literal></para>
461               </entry>
462               <entry>
463                 <para>Name of the pre-defined pool of OSTs (see <xref linkend="dbdoclet.50438219_38274"/>) that will be used for striping. The <literal>stripe_cnt</literal>, <literal>stripe_size</literal> and <literal>start_ost</literal> values are used as well. The start-ost value must be part of the pool or an error is returned.</para>
464               </entry>
465             </row>
466             <row>
467               <entry nameend="c2" namest="c1">
468                 <para> <literal>setstripe -d</literal></para>
469               </entry>
470               <entry>
471                 <para>Deletes default striping on the specified directory.</para>
472               </entry>
473             </row>
474             <row>
475               <entry nameend="c2" namest="c1">
476                 <para> <literal>poollist {filesystem} [.poolname]|{pathname}</literal></para>
477               </entry>
478               <entry>
479                 <para>Lists pools in the file system or pathname, or OSTs in the file system&apos;s pool.</para>
480               </entry>
481             </row>
482             <row>
483               <entry nameend="c2" namest="c1">
484                 <para> <literal>quota [-q] [-v] [-o obd_uuid|-i mdt_idx|-I ost_idx] [-u|-g &lt;uname&gt;|&lt;uid&gt;|&lt;gname&gt;|&lt;gid&gt;] &lt;filesystem&gt;</literal></para>
485                 <para>&#160;</para>
486               </entry>
487               <entry>
488                 <para>Displays disk usage and limits, either for the full file system or for objects on a specific OBD. A user or group name or an ID can be specified. If both user and group are omitted, quotas for the current UID/GID are shown. The <literal>-q</literal> option disables printing of additional descriptions (including column titles). It fills in blank spaces in the &apos;&apos;grace&apos;&apos; column with zeros (when there is no grace period set), to ensure that the number of columns is consistent. The <literal>-v</literal> option provides more verbose (per-OBD statistics) output.</para>
489               </entry>
490             </row>
491             <row>
492               <entry nameend="c2" namest="c1">
493                 <para> <literal>quota -t &lt;-u|-g&gt; &lt;filesystem&gt;</literal></para>
494               </entry>
495               <entry>
496                 <para>Displays block and inode grace times for user (<literal>-u</literal>) or group (<literal>-g</literal>) quotas.</para>
497               </entry>
498             </row>
499             <row>
500               <entry nameend="c2" namest="c1">
501                 <para> <literal>quotachown</literal></para>
502               </entry>
503               <entry>
504                 <para>Changes the file&apos;s owner and group on OSTs of the specified file system.</para>
505               </entry>
506             </row>
507             <row>
508               <entry nameend="c2" namest="c1">
509                 <para> <literal>quotacheck [-ugf] &lt;filesystem&gt;</literal></para>
510               </entry>
511               <entry>
512                 <para>Scans the specified file system for disk usage, and creates or updates quota files. Options specify quota for users (<literal>-u</literal>), groups (<literal>-g</literal>), and force (<literal>-f</literal>).</para>
513               </entry>
514             </row>
515             <row>
516               <entry nameend="c2" namest="c1">
517                 <para> <literal>quotaon [-ugf] &lt;filesystem&gt;</literal></para>
518               </entry>
519               <entry>
520                 <para>Turns on file system quotas. Options specify quota for users (<literal>-u</literal>), groups (<literal>-g</literal>), and force (<literal>-f</literal>).</para>
521               </entry>
522             </row>
523             <row>
524               <entry nameend="c2" namest="c1">
525                 <para> <literal>quotaoff [-ugf] &lt;filesystem&gt;</literal></para>
526               </entry>
527               <entry>
528                 <para>Turns off file system quotas. Options specify quota for users (<literal>-u</literal>), groups (<literal>-g</literal>), and force (<literal>-f</literal>).</para>
529               </entry>
530             </row>
531             <row>
532               <entry nameend="c2" namest="c1">
533                 <para> <literal>quotainv [-ug] [-f] &lt;filesystem&gt;</literal></para>
534               </entry>
535               <entry>
536                 <para> Clears quota files (administrative quota files if used without <literal>-f</literal>, operational quota files otherwise), all of their quota entries for users (<literal>-u</literal>) or groups (<literal>-g</literal>). After running <literal>quotainv</literal>, you must run <literal>quotacheck</literal> before using quotas.</para>
537                 <caution>
538                   <para>Use extreme caution when using this command; its results cannot be undone.</para>
539                 </caution>
540               </entry>
541             </row>
542             <row>
543               <entry nameend="c2" namest="c1">
544                 <para> <literal>setquota &lt;-u|-g&gt; &lt;uname&gt;|&lt;uid&gt;|&lt;gname&gt;|&lt;gid&gt; [--block-softlimit &lt;block-softlimit&gt;] [--block-hardlimit &lt;block-hardlimit&gt;] [--inode-softlimit &lt;inode-softlimit&gt;] [--inode-hardlimit &lt;inode-hardlimit&gt;] &lt;filesystem&gt;</literal></para>
545               </entry>
546               <entry>
547                 <para>Sets file system quotas for users or groups. Limits can be specified with <literal>--{block|inode}-{softlimit|hardlimit}</literal> or their short equivalents <literal>-b</literal>, <literal>-B</literal>, <literal>-i</literal>, <literal>-I</literal>. Users can set 1, 2, 3 or 4 limits.<footnote>
548                     <para>The old <literal>setquota</literal> interface is supported, but it may be removed in a future Lustre release.</para>
549                   </footnote>Also, limits can be specified with special suffixes, -b, -k, -m, -g, -t, and -p to indicate units of 1, 2^10, 2^20, 2^30, 2^40 and 2^50, respectively. By default, the block limits unit is 1 kilobyte (1,024), and block limits are always kilobyte-grained (even if specified in bytes). See <xref linkend="dbdoclet.50438206_11903"/>.</para>
550               </entry>
551             </row>
552             <row>
553               <entry nameend="c2" namest="c1">
554                 <para><literal> setquota -t &lt;-u|-g&gt; [--block-grace &lt;block-grace&gt;] [--inode-grace &lt;inode-grace&gt;] &lt;filesystem&gt;</literal></para>
555               </entry>
556               <entry>
557                 <para>Sets the file system quota grace times for users or groups. Grace time is specified in &apos;<literal>XXwXXdXXhXXmXXs</literal>&apos; format or as an integer seconds value. See <xref linkend="dbdoclet.50438206_11903"/>.</para>
558               </entry>
559             </row>
560             <row>
561               <entry nameend="c2" namest="c1">
562                 <para> <literal>help</literal></para>
563               </entry>
564               <entry>
565                 <para>Provides brief help on various <literal>lfs</literal> arguments.</para>
566               </entry>
567             </row>
568             <row>
569               <entry nameend="c2" namest="c1">
570                 <para> <literal>exit/quit</literal></para>
571               </entry>
572               <entry>
573                 <para>Quits the interactive <literal>lfs</literal> session.</para>
574               </entry>
575             </row>
576           </tbody>
577         </tgroup>
578       </informaltable>
579     </section>
580     <section remap="h5">
581       <title xml:id="dbdoclet.50438206_11903">Examples</title>
582       <para>Creates a file striped on two OSTs with 128 KB on each stripe.</para>
583       <screen>$ lfs setstripe -s 128k -c 2 /mnt/lustre/file1</screen>
584       <para>Deletes a default stripe pattern on a given directory. New files use the default striping pattern.</para>
585       <screen>$ lfs setstripe -d /mnt/lustre/dir</screen>
586       <para>Lists the detailed object allocation of a given file.</para>
587       <screen>$ lfs getstripe -v /mnt/lustre/file1</screen>
588       <para>Efficiently lists all files in a given directory and its subdirectories.</para>
589       <screen>$ lfs find /mnt/lustre</screen>
590       <para>Recursively lists all regular files in a given directory more than 30 days old.</para>
591       <screen>$ lfs find /mnt/lustre -mtime +30 -type f -print</screen>
592       <para>Recursively lists all files in a given directory that have objects on OST2-UUID. The lfs check servers command checks the status of all servers (MDT and OSTs).</para>
593       <screen>$ lfs find --obd OST2-UUID /mnt/lustre/</screen>
594       <para>Lists all OSTs in the file system.</para>
595       <screen>$ lfs osts</screen>
596       <para>Lists space usage per OST and MDT in human-readable format.</para>
597       <screen>$ lfs df -h</screen>
598       <para>Lists inode usage per OST and MDT.</para>
599       <screen>$ lfs df -i</screen>
600       <para>List space or inode usage for a specific OST pool.</para>
601       <screen>$ lfs df --pool &lt;filesystem&gt;[.&lt;pool&gt;] | &lt;pathname&gt;</screen>
602       <para>List quotas of user &apos;bob&apos;.</para>
603       <screen>$ lfs quota -u bob /mnt/lustre</screen>
604       <para>Show grace times for user quotas on /mnt/lustre.</para>
605       <screen>$ lfs quota -t -u /mnt/lustre</screen>
606       <para>Changes file owner and group.</para>
607       <screen>$ lfs quotachown -i /mnt/lustre</screen>
608       <para>Checks quotas for user and group. Turns on quotas after making the check.</para>
609       <screen>$ lfs quotacheck -ug /mnt/lustre</screen>
610       <para>Turns on quotas of user and group.</para>
611       <screen>$ lfs quotaon -ug /mnt/lustre</screen>
612       <para>Turns off quotas of user and group.</para>
613       <screen>$ lfs quotaoff -ug /mnt/lustre</screen>
614       <para>Sets quotas of user &apos;bob&apos;, with a 1 GB block quota hardlimit and a 2 GB block quota softlimit.</para>
615       <screen>$ lfs setquota -u bob --block-softlimit 2000000 --block-hardlimit 1000000 /mnt/lustre</screen>
616       <para>Sets grace times for user quotas: 1000 seconds for block quotas, 1 week and 4 days for inode quotas.</para>
617       <screen>$ lfs setquota -t -u --block-grace 1000 --inode-grace 1w4d /mnt/lustre</screen>
618       <para>Checks the status of all servers (MDT, OST)</para>
619       <screen>$ lfs check servers</screen>
620       <para>Creates a file striped on two OSTs from the pool <literal>my_pool</literal></para>
621       <screen>$ lfs setstripe --pool my_pool -c 2 /mnt/lustre/file</screen>
622       <para>Lists the pools defined for the mounted Lustre file system <literal>/mnt/lustre</literal></para>
623       <screen>$ lfs poollist /mnt/lustre/</screen>
624       <para>Lists the OSTs which are members of the pool <literal>my_pool</literal> in file system <literal>my_fs</literal></para>
625       <screen>$ lfs poollist my_fs.my_pool</screen>
626       <para>Finds all directories/files associated with <literal>poolA</literal>.</para>
627       <screen>$ lfs find /mnt/lustre --pool poolA</screen>
628       <para>Finds all directories/files not associated with a pool.</para>
629       <screen>$ lfs find /mnt//lustre --pool &quot;&quot;</screen>
630       <para>Finds all directories/files associated with pool.</para>
631       <screen>$ lfs find /mnt/lustre ! --pool &quot;&quot;</screen>
632       <para>Associates a directory with the pool <literal>my_pool</literal>, so all new files and directories are created in the pool.</para>
633       <screen>$ lfs setstripe --pool my_pool /mnt/lustre/dir</screen>
634     </section>
635     <section remap="h5">
636       <title>See Also</title>
637       <para><xref linkend="dbdoclet.50438219_38274"/></para>
638     </section>
639   </section>
640   <section xml:id="dbdoclet.50438206_42260">
641     <title><indexterm><primary>lfs_migrate</primary></indexterm>
642       <literal>lfs_migrate</literal>
643     </title>
644     <para>The <literal>lfs_migrate</literal> utility is a simple tool to migrate files between Lustre OSTs.</para>
645     <section remap="h5">
646       <title>Synopsis</title>
647       <screen>lfs_migrate [-c|-s] [-h] [-l] [-n] [-y] [file|directory ...]</screen>
648     </section>
649     <section remap="h5">
650       <title>Description</title>
651       <para>The <literal>lfs_migrate</literal> utility is a simple tool to assist migration of files between Lustre OSTs. The utility copies each specified file to a new file, verifies the file contents have not changed, and then renames the new file to the original filename. This allows balanced space usage between OSTs, moving files of OSTs that are starting to show hardware problems (though are still functional) or OSTs that will be discontinued.</para>
652       <para>Because <literal>lfs_migrate</literal> is not closely integrated with the MDS, it cannot determine whether a file is currently open and/or in-use by other applications or nodes. This makes it UNSAFE for use on files that might be modified by other applications, since the migrated file is only a copy of the current file. This results in the old file becoming an open-unlinked file and any modifications to that file are lost.</para>
653       <para>Files to be migrated can be specified as command-line arguments. If a directory is specified on the command-line then all files within the directory are migrated. If no files are specified on the command-line, then a list of files is read from the standard input, making <literal>lfs_migrate</literal> suitable for use with <literal>lfs</literal> find to locate files on specific OSTs and/or matching other file attributes.</para>
654       <para>The current file allocation policies on the MDS dictate where the new files are placed, taking into account whether specific OSTs have been disabled on the MDS via <literal>lctl</literal> (preventing new files from being allocated there), whether some OSTs are overly full (reducing the number of files placed on those OSTs), or if there is a specific default file striping for the target directory (potentially changing the stripe count, stripe size, OST pool, or OST index of a new file).</para>
655     </section>
656     <section remap="h5">
657       <title>Options</title>
658       <para>Options supporting <literal>lfs_migrate</literal> are described below.</para>
659       <informaltable frame="all">
660         <tgroup cols="2">
661           <colspec colname="c1" colwidth="50*"/>
662           <colspec colname="c2" colwidth="50*"/>
663           <thead>
664             <row>
665               <entry>
666                 <para><emphasis role="bold">Option</emphasis></para>
667               </entry>
668               <entry>
669                 <para><emphasis role="bold">Description</emphasis></para>
670               </entry>
671             </row>
672           </thead>
673           <tbody>
674             <row>
675               <entry>
676                 <para> <literal>-c</literal></para>
677               </entry>
678               <entry>
679                 <para>Compares file data after migrate (default value, use <literal>-s</literal> to disable).</para>
680               </entry>
681             </row>
682             <row>
683               <entry>
684                 <para> <literal>-s</literal></para>
685               </entry>
686               <entry>
687                 <para>Skips file data comparison after migrate (use <literal>-c</literal> to enable).</para>
688               </entry>
689             </row>
690             <row>
691               <entry>
692                 <para> <literal>-h</literal></para>
693               </entry>
694               <entry>
695                 <para>Displays help information.</para>
696               </entry>
697             </row>
698             <row>
699               <entry>
700                 <literal>-l</literal>
701               </entry>
702               <entry>
703                 <para>Migrates files with hard links (skips, by default). Files with multiple hard links are split into multiple separate files by <literal>lfs_migrate</literal>, so they are skipped, by default, to avoid breaking the hard links.</para>
704               </entry>
705             </row>
706             <row>
707               <entry>
708                 <literal>-n</literal>
709               </entry>
710               <entry>
711                 <para>Only prints the names of files to be migrated.</para>
712               </entry>
713             </row>
714             <row>
715               <entry>
716                 <para> <literal>-q</literal></para>
717               </entry>
718               <entry>
719                 <para>Runs quietly (does not print filenames or status).</para>
720               </entry>
721             </row>
722             <row>
723               <entry>
724                 <para> <literal>--y</literal></para>
725               </entry>
726               <entry>
727                 <para>Answers &apos;<literal>y</literal>&apos; to usage warning without prompting (for scripts).</para>
728               </entry>
729             </row>
730           </tbody>
731         </tgroup>
732       </informaltable>
733     </section>
734     <section remap="h5">
735       <title>Examples</title>
736       <para>Rebalances all files in <literal>/mnt/lustre/dir</literal>.</para>
737       <screen>$ lfs_migrate /mnt/lustre/file</screen>
738       <para>Migrates files in /test filesystem on OST004 larger than 4 GB in size.</para>
739       <screen>$ lfs find /test -obd test-OST004 -size +4G | lfs_migrate -y</screen>
740     </section>
741     <section remap="h5">
742       <title>See Also</title>
743       <para><xref linkend="dbdoclet.50438206_94597"/></para>
744     </section>
745   </section>
746   <section xml:id="dbdoclet.50438206_91700">
747     <title><indexterm><primary>lfsck</primary></indexterm>
748        <literal>lfsck</literal>
749     </title>
750     <para><literal>lfsck</literal> ensures that objects are not referenced by multiple MDS files, that there are no orphan objects on the OSTs (objects that do not have any file on the MDS which references them), and that all of the objects referenced by the MDS exist. Under normal circumstances, Lustre maintains such coherency by distributed logging mechanisms, but under exceptional circumstances that may fail (e.g. disk failure, file system corruption leading to e2fsck repair). To avoid lengthy downtime, you can also run <literal>lfsck</literal> once Lustre is already started.</para>
751     <para>The <literal>e2fsck</literal> utility is run on each of the local MDS and OST device file systems and verifies that the underlying <literal>ldiskfs</literal> is consistent. After <literal>e2fsck</literal> is run, <literal>lfsck</literal> does distributed coherency checking for the Lustre file system. In most cases, <literal>e2fsck</literal> is sufficient to repair any file system issues and <literal>lfsck</literal> is not required.</para>
752     <section remap="h5">
753       <title>Synopsis</title>
754       <screen>lfsck [-c|--create] [-d|--delete] [-f|--force] [-h|--help] [-l|--lostfound] [-n|--nofix] [-v|--verbose] --mdsdb mds_database_file --ostdb ost1_database_file [ost2_database_file...] &lt;filesystem&gt;
755 </screen>
756       <note>
757         <para>As shown, the <literal>&lt;filesystem&gt;</literal> parameter refers to the Lustre file system mount point. The default mount point is <literal>/mnt/lustre</literal>.</para>
758       </note>
759       <note>
760         <para>For <literal>lfsck</literal>, database filenames must be provided as absolute pathnames. Relative paths do not work, the databases cannot be properly opened.</para>
761       </note>
762     </section>
763     <section remap="h5">
764       <title>Options</title>
765       <para>The options and descriptions for the <literal>lfsck</literal> command are listed below.</para>
766       <informaltable frame="all">
767         <tgroup cols="2">
768           <colspec colname="c1" colwidth="50*"/>
769           <colspec colname="c2" colwidth="50*"/>
770           <thead>
771             <row>
772               <entry>
773                 <para><emphasis role="bold">Option</emphasis></para>
774               </entry>
775               <entry>
776                 <para><emphasis role="bold">Description</emphasis></para>
777               </entry>
778             </row>
779           </thead>
780           <tbody>
781             <row>
782               <entry>
783                 <para> <literal>-c</literal></para>
784               </entry>
785               <entry>
786                 <para>Creates (empty) missing OST objects referenced by MDS inodes.</para>
787               </entry>
788             </row>
789             <row>
790               <entry>
791                 <para> <literal>-d</literal></para>
792               </entry>
793               <entry>
794                 <para>Deletes orphaned objects from the file system. Since objects on the OST are often only one of several stripes of a file, it can be difficult to compile multiple objects together in a single, usable file.</para>
795               </entry>
796             </row>
797             <row>
798               <entry>
799                 <para> <literal>-h</literal></para>
800               </entry>
801               <entry>
802                 <para>Prints a brief help message.</para>
803               </entry>
804             </row>
805             <row>
806               <entry>
807                 <para> <literal>-l</literal></para>
808               </entry>
809               <entry>
810                 <para>Puts orphaned objects into a <literal>lost+found</literal> directory in the root of the file system.</para>
811               </entry>
812             </row>
813             <row>
814               <entry>
815                 <para> <literal>-n</literal></para>
816               </entry>
817               <entry>
818                 <para>Does not repair the file system, just performs a read-only check (default).</para>
819               </entry>
820             </row>
821             <row>
822               <entry>
823                 <para> <literal>-v</literal></para>
824               </entry>
825               <entry>
826                 <para>Verbose operation - more verbosity by specifying the option multiple times.</para>
827               </entry>
828             </row>
829             <row>
830               <entry>
831                 <para> <literal>--mdsdb</literal></para>
832                 <para><literal>mds_database_file</literal></para>
833               </entry>
834               <entry>
835                 <para>MDS database file created by running <literal>e2fsck</literal> <literal>--mdsdb</literal> <literal>mds_database_file</literal> <literal>&lt;device&gt;</literal> on the MDS backing device. This is required.</para>
836               </entry>
837             </row>
838             <row>
839               <entry>
840                 <para> <literal>--ostdb ost1_database_file</literal></para>
841                 <para><literal>[ost2_database_file...]</literal></para>
842               </entry>
843               <entry>
844                 <para>OST database files created by running <literal>e2fsck</literal> <literal>--ostdb ost_database_file &lt;device&gt;</literal> on each of the OST backing devices. These are required unless an OST is unavailable, in which case all objects thereon are considered missing.</para>
845               </entry>
846             </row>
847           </tbody>
848         </tgroup>
849       </informaltable>
850     </section>
851     <section remap="h5">
852       <title>Description</title>
853       <para>The <literal>lfsck</literal> utility is used to check and repair the distributed coherency of a Lustre file system. If an MDS or an OST becomes corrupt, run a distributed check on the file system to determine what sort of problems exist. Use lfsck to correct any defects found.</para>
854       <para>For more information on using <literal>e2fsck</literal> and <literal>lfsck</literal>, including examples, see <xref linkend="dbdoclet.50438268_83826"/> (Commit on Share). For information on resolving orphaned objects, see <xref linkend="dbdoclet.50438225_13916"/> (Working with Orphaned Objects).</para>
855     </section>
856   </section>
857   <section xml:id="dbdoclet.50438206_75125">
858     <title><indexterm><primary>filefrag</primary></indexterm>
859       <literal>filefrag</literal>
860     </title>
861     <para>The <literal>e2fsprogs</literal> package contains the <literal>filefrag</literal> tool which reports the extent of file fragmentation.</para>
862     <section remap="h5">
863       <title>Synopsis</title>
864       <screen>filefrag [ -belsv ] [ files...  ]</screen>
865     </section>
866     <section remap="h5">
867       <title>Description</title>
868       <para>The <literal>filefrag</literal> utility reports the extent of fragmentation in a given file. Initially, <literal>filefrag</literal> attempts to obtain extent information using <literal>FIEMAP ioctl</literal>, which is efficient and fast. If <literal>FIEMAP</literal> is not supported, then <literal>filefrag</literal> uses <literal>FIBMAP</literal>.</para>
869       <note>
870         <para>Lustre only supports <literal>FIEMAP ioctl</literal>. <literal>FIBMAP ioctl</literal> is not supported.</para>
871       </note>
872       <para>In default mode <footnote>
873           <para>The default mode is faster than the verbose/extent mode.</para>
874         </footnote>, <literal>filefrag</literal> returns the number of physically discontiguous extents in the file. In extent or verbose mode, each extent is printed with details. For Lustre, the extents are printed in device offset order, not logical offset order.</para>
875     </section>
876     <section remap="h5">
877       <title>Options</title>
878       <para>The options and descriptions for the <literal>filefrag</literal> utility are listed below.</para>
879       <informaltable frame="all">
880         <tgroup cols="2">
881           <colspec colname="c1" colwidth="50*"/>
882           <colspec colname="c2" colwidth="50*"/>
883           <thead>
884             <row>
885               <entry>
886                 <para><emphasis role="bold">Option</emphasis></para>
887               </entry>
888               <entry>
889                 <para><emphasis role="bold">Description</emphasis></para>
890               </entry>
891             </row>
892           </thead>
893           <tbody>
894             <row>
895               <entry>
896                 <para> <literal>-b</literal></para>
897               </entry>
898               <entry>
899                 <para>Uses the 1024-byte blocksize for the output. By default, this blocksize is used by Lustre, since OSTs may use different block sizes.</para>
900               </entry>
901             </row>
902             <row>
903               <entry>
904                 <para> <literal>-e</literal></para>
905               </entry>
906               <entry>
907                 <para>Uses the extent mode when printing the output.</para>
908               </entry>
909             </row>
910             <row>
911               <entry>
912                 <para> <literal>-l</literal></para>
913               </entry>
914               <entry>
915                 <para>Displays extents in LUN offset order.</para>
916               </entry>
917             </row>
918             <row>
919               <entry>
920                 <para> <literal>-s</literal></para>
921               </entry>
922               <entry>
923                 <para>Synchronizes the file before requesting the mapping.</para>
924               </entry>
925             </row>
926             <row>
927               <entry>
928                 <para> <literal>-v</literal></para>
929               </entry>
930               <entry>
931                 <para>Uses the verbose mode when checking file fragmentation.</para>
932               </entry>
933             </row>
934           </tbody>
935         </tgroup>
936       </informaltable>
937     </section>
938     <section remap="h5">
939       <title>Examples</title>
940       <para>Lists default output.</para>
941       <screen>$ filefrag /mnt/lustre/foo
942 /mnt/lustre/foo: 6 extents found</screen>
943       <para>Lists verbose output in extent format.</para>
944       <screen>$ filefrag  -ve /mnt/lustre/foo 
945 Checking /mnt/lustre/foo
946 Filesystem type is: bd00bd0
947 Filesystem cylinder groups is approximately 5
948 File size of /mnt/lustre/foo is 157286400 (153600 blocks)
949 ext:       device_logical:         start..end              physical:               start..end:             length:         device:         flags:
950 0: 0..                     49151:                  212992..                262144:                 49152:          0:              remote
951 1: 49152..                 73727:                  270336..                294912:                 24576:          0:              remote
952 2: 73728..                 76799:                  24576..                 27648:                  3072:           0:              remote
953 3: 0..                     57343:                  196608..                253952:                 57344:          1:              remote
954 4: 57344..                 65535:                  139264..                147456:                 8192:           1:              remote
955 5: 65536..                 76799:                  163840..                175104:                 11264:          1:              remote
956 /mnt/lustre/foo: 6 extents found</screen>
957     </section>
958   </section>
959   <section xml:id="dbdoclet.50438206_86244">
960     <title><indexterm><primary>mount</primary></indexterm>
961       <literal>mount</literal>
962     </title>
963     <para>Lustre uses the standard <literal>mount(8)</literal> Linux command. When mounting a Lustre file system, mount(8) executes the <literal>/sbin/mount.lustre</literal> command to complete the mount. The mount command supports these Lustre-specific options:</para>
964     <informaltable frame="all">
965       <tgroup cols="2">
966         <colspec colname="c1" colwidth="50*"/>
967         <colspec colname="c2" colwidth="50*"/>
968         <thead>
969           <row>
970             <entry>
971               <para><emphasis role="bold">Server options</emphasis></para>
972             </entry>
973             <entry>
974               <para><emphasis role="bold">Description</emphasis></para>
975             </entry>
976           </row>
977         </thead>
978         <tbody>
979           <row>
980             <entry>
981               <para> <literal>abort_recov</literal></para>
982             </entry>
983             <entry>
984               <para>Aborts recovery when starting a target</para>
985             </entry>
986           </row>
987           <row>
988             <entry>
989               <para> <literal>nosvc</literal></para>
990             </entry>
991             <entry>
992               <para>Starts only MGS/MGC servers</para>
993             </entry>
994           </row>
995           <row>
996             <entry>
997               <para> <literal>exclude</literal></para>
998             </entry>
999             <entry>
1000               <para>Starts with a dead OST</para>
1001             </entry>
1002           </row>
1003         </tbody>
1004       </tgroup>
1005     </informaltable>
1006     <informaltable frame="all">
1007       <tgroup cols="2">
1008         <colspec colname="c1" colwidth="50*"/>
1009         <colspec colname="c2" colwidth="50*"/>
1010         <thead>
1011           <row>
1012             <entry>
1013               <para><emphasis role="bold">Client options</emphasis></para>
1014             </entry>
1015             <entry>
1016               <para><emphasis role="bold">Description</emphasis></para>
1017             </entry>
1018           </row>
1019         </thead>
1020         <tbody>
1021           <row>
1022             <entry>
1023               <para> <literal>flock</literal></para>
1024             </entry>
1025             <entry>
1026               <para>Enables/disables flock support</para>
1027             </entry>
1028           </row>
1029           <row>
1030             <entry>
1031               <para> <literal>user_xattr/nouser_xattr</literal></para>
1032             </entry>
1033             <entry>
1034               <para>Enables/disables user-extended attributes</para>
1035             </entry>
1036           </row>
1037           <row>
1038             <entry>
1039               <para> <literal>retry=</literal></para>
1040             </entry>
1041             <entry>
1042               <para>Number of times a client will retry to mount the file system</para>
1043             </entry>
1044           </row>
1045         </tbody>
1046       </tgroup>
1047     </informaltable>
1048   </section>
1049   <section xml:id="dbdoclet.50438206_56217">
1050     <title>Handling Timeouts</title>
1051     <para>Timeouts are the most common cause of hung applications. After a timeout involving an MDS or failover OST, applications attempting to access the disconnected resource wait until the connection gets established.</para>
1052     <para>When a client performs any remote operation, it gives the server a reasonable amount of time to respond. If a server does not reply either due to a down network, hung server, or any other reason, a timeout occurs which requires a recovery.</para>
1053     <para>If a timeout occurs, a message (similar to this one), appears on the console of the client, and in <literal>/var/log/messages</literal>:</para>
1054     <screen>LustreError: 26597:(client.c:810:ptlrpc_expire_one_request()) @@@ timeout
1055  
1056 req@a2d45200 x5886/t0 o38-&gt;mds_svc_UUID@NID_mds_UUID:12 lens 168/64 ref 1 fl
1057  
1058 RPC:/0/0 rc 0</screen>
1059   </section>
1060 </chapter>