Whamcloud - gitweb
LUDOC-249 filefrag: update to match current output
[doc/manual.git] / UserUtilities.xml
1 <?xml version='1.0' encoding='UTF-8'?><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">
2   <title xml:id="userutilities.title">User Utilities</title>
3   <para>This chapter describes user utilities and includes the following sections:</para>
4   <itemizedlist>
5     <listitem>
6       <para><xref linkend="dbdoclet.50438206_94597"/></para>
7     </listitem>
8     <listitem>
9       <para><xref linkend="dbdoclet.50438206_42260"/></para>
10     </listitem>
11     <listitem>
12       <para><xref linkend="dbdoclet.50438206_75125"/></para>
13     </listitem>
14     <listitem>
15       <para><xref linkend="dbdoclet.50438206_86244"/></para>
16     </listitem>
17     <listitem>
18       <para><xref linkend="dbdoclet.50438206_56217"/></para>
19     </listitem>
20   </itemizedlist>
21   <section xml:id="dbdoclet.50438206_94597">
22     <title><indexterm><primary>lfs</primary></indexterm>
23       <literal>lfs</literal>
24     </title>
25     <para>The <literal>lfs</literal> utility can be used for user configuration routines and monitoring.</para>
26     <section remap="h5">
27       <title>Synopsis</title>
28       <screen>lfs
29 lfs changelog [--follow] <replaceable>mdt_name</replaceable> [startrec [endrec]]
30 lfs changelog_clear <replaceable>mdt_name id endrec</replaceable>
31 lfs check <replaceable>mds|osts|servers</replaceable>
32 lfs df [-i] [-h] [--pool]-p <replaceable>fsname</replaceable>[.<replaceable>pool</replaceable>] [<replaceable>path</replaceable>] [--lazy]
33 lfs find [[!] --atime|-A [-+]N] [[!] --mtime|-M [-+]N]
34          [[!] --ctime|-C [-+]N] [--maxdepth|-D N] [--name|-n <replaceable>pattern</replaceable>]
35          [--print|-p] [--print0|-P] [[!] --obd|-O <replaceable>ost_name</replaceable>[,<replaceable>ost_name...</replaceable>]]
36          [[!] --size|-S [+-]N[kMGTPE]] --type |-t {bcdflpsD}]
37          [[!] --gid|-g|--group|-G <replaceable>gname|gid</replaceable>]
38          [[!] --uid|-u|--user|-U <replaceable>uname|uid</replaceable>]
39          <replaceable>dirname|filename</replaceable>
40 lfs getname [-h]|[path...]
41 lfs getstripe [--obd|-O <replaceable>ost_name</replaceable>] [--quiet|-q] [--verbose|-v]
42               [--count|-c] [--index|-i | --offset|-o]
43               [--size|-s] [--pool|-p] [--directory|-d]
44               [--recursive|-r] [--raw|-R] [-M] <replaceable>dirname|filename</replaceable> ...
45 lfs setstripe [--size|-s stripe_size] [--count|-c <replaceable>stripe_count</replaceable>]
46               [--index|-i|--offset|-o <replaceable>start_ost_index</replaceable>]
47               [--pool|-p <replaceable>pool</replaceable>]
48               <replaceable>dirname|filename</replaceable>
49 lfs setstripe -d <replaceable>dir</replaceable>
50 lfs osts [path]
51 lfs poollist <replaceable>filesystem</replaceable>[.<replaceable>pool</replaceable>]|<replaceable>pathname</replaceable>
52 lfs quota [-q] [-v] [-h] [-o <replaceable>obd_uuid</replaceable>|-I <replaceable>ost_idx</replaceable>|-i <replaceable>mdt_idx</replaceable>]
53           [-u <replaceable>username|uid|-g</replaceable> <replaceable>group|gid</replaceable>]
54           <replaceable>/mount_point</replaceable>
55 lfs quota -t -u|-g <replaceable>/mount_point</replaceable>
56 lfs quotacheck [-ug] <replaceable>/mount_point</replaceable>
57 lfs quotachown [-i] <replaceable>/mount_point</replaceable>
58 lfs quotainv [-ug] [-f] <replaceable>/mount_point</replaceable>
59 lfs quotaon [-ugf] <replaceable>/mount_point</replaceable>
60 lfs quotaoff [-ug] <replaceable>/mount_point</replaceable>
61 lfs setquota {-u|--user|-g|--group} <replaceable>uname|uid|gname|gid</replaceable>
62              [--block-softlimit <replaceable>block_softlimit</replaceable>]
63              [--block-hardlimit <replaceable>block_hardlimit</replaceable>]
64              [--inode-softlimit <replaceable>inode_softlimit</replaceable>]
65              [--inode-hardlimit <replaceable>inode_hardlimit</replaceable>]
66              <replaceable>/mount_point</replaceable>
67 lfs setquota -u|--user|-g|--group <replaceable>uname|uid|gname|gid</replaceable>
68              [-b <replaceable>block_softlimit</replaceable>] [-B <replaceable>block_hardlimit</replaceable>]
69              [-i <replaceable>inode-softlimit</replaceable>] [-I <replaceable>inode_hardlimit</replaceable>]
70              <replaceable>/mount_point</replaceable>
71 lfs setquota -t -u|-g
72              [--block-grace <replaceable>block_grace</replaceable>]
73              [--inode-grace <replaceable>inode_grace</replaceable>]
74              <replaceable>/mount_point</replaceable>
75 lfs setquota -t -u|-g
76              [-b <replaceable>block_grace</replaceable>] [-i <replaceable>inode_grace</replaceable>]
77              <replaceable>/mount_point</replaceable>
78 lfs help
79 </screen>
80       <note>
81         <para>In the above example, the <literal><replaceable>/mount_point</replaceable></literal> parameter refers to the mount point of the Lustre file system.</para>
82       </note>
83       <note>
84         <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>
85       </note>
86     </section>
87     <section remap="h5">
88       <title>Description</title>
89       <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>
90     </section>
91     <section remap="h5">
92       <title>Options</title>
93       <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>
94       <informaltable frame="all">
95         <tgroup cols="3">
96           <colspec colname="c1" colwidth="20*"/>
97           <colspec colname="c2" colwidth="30*"/>
98           <colspec colname="c3" colwidth="50*"/>
99           <thead>
100             <row>
101               <entry nameend="c2" namest="c1">
102                 <para><emphasis role="bold">Option</emphasis></para>
103               </entry>
104               <entry>
105                 <para><emphasis role="bold">Description</emphasis></para>
106               </entry>
107             </row>
108           </thead>
109           <tbody>
110             <row>
111               <entry nameend="c2" namest="c1">
112                 <para><literal>changelog</literal> </para>
113               </entry>
114               <entry>
115                 <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>
116               </entry>
117             </row>
118             <row>
119               <entry nameend="c2" namest="c1">
120                 <para> <literal>changelog_clear</literal></para>
121               </entry>
122               <entry>
123                 <para>Indicates that changelog records previous to <literal><replaceable>endrec</replaceable></literal> are no longer of interest to a particular consumer <literal><replaceable>id</replaceable></literal>, potentially allowing the MDT to free up disk space. An <literal><replaceable>endrec</replaceable></literal> of 0 indicates the current last record. Changelog consumers must be registered on the MDT node using <literal>lctl</literal>.</para>
124               </entry>
125             </row>
126             <row>
127               <entry nameend="c2" namest="c1">
128                 <literal> check </literal>
129               </entry>
130               <entry>
131                 <para>Displays the status of MDS or OSTs (as specified in the command) or all servers (MDS and OSTs).</para>
132               </entry>
133             </row>
134             <row>
135               <entry nameend="c2" namest="c1">
136                 <literal> df [-i] [-h] [--pool|-p
137                     <replaceable>fsname</replaceable>[.<replaceable>pool</replaceable>]
138                     [<replaceable>path</replaceable>] [--lazy]</literal>
139               </entry>
140               <entry>
141                 <para>Use <literal>-i</literal> to report file system disk space usage or inode
142                   usage of each MDT or OST or, if a pool is specified with the <literal>-p</literal>
143                   option, a subset of OSTs.</para>
144                 <para>By default, the usage of all mounted Lustre file systems is reported. If the
145                     <literal>path</literal> option is included, only the usage for the specified
146                   file system is reported. If the <literal>-h</literal> option is included, the
147                   output is printed in human-readable format, using SI base-2 suffixes for <emphasis
148                     role="bold">M</emphasis>ega-, <emphasis role="bold">G</emphasis>iga-, <emphasis
149                     role="bold">T</emphasis>era-, <emphasis role="bold">P</emphasis>eta-, or
150                     <emphasis role="bold">E</emphasis>xabytes.</para>
151                 <para>If the <literal>--lazy</literal> option is specified, any OST that is
152                   currently disconnected from the client will be skipped. Using the
153                     <literal>--lazy</literal> option prevents the <literal>df</literal> output from
154                   being blocked when  an OST is offline. Only the space on the OSTs that can
155                   currently be accessed are returned. The <literal>llite.*.lazystatfs</literal>
156                   tunable can be enabled to make this the default behaviour for all
157                     <literal>statfs()</literal> operations.</para>
158               </entry>
159             </row>
160             <row>
161               <entry nameend="c2" namest="c1">
162                 <para><literal> find</literal></para>
163               </entry>
164               <entry>
165                 <para>Searches the directory tree rooted at the given directory/filename for files that match the given parameters.</para>
166                 <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>
167               </entry>
168             </row>
169             <row>
170               <entry/>
171               <entry>
172                 <literal> --atime </literal>
173               </entry>
174               <entry>
175                 <para>File was last accessed N*24 hours ago. (There is no guarantee that <literal>atime</literal> is kept coherent across the cluster.)</para>
176                 <para>OSTs store a transient <literal>atime</literal> that is updated when clients
177                   do read requests. Permanent <literal>atime</literal> is written to the MDS when
178                   the file is closed. However, on-disk atime is only updated if it is more than 60
179                   seconds old (<literal>/proc/fs/lustre/mds/*/max_atime_diff</literal>). The Lustre
180                   software considers the latest <literal>atime</literal> from all OSTs. If a
181                     <literal>setattr</literal> is set by user, then it is updated on both the MDS
182                   and OST, allowing the <literal>atime</literal> to go backward.</para>
183               </entry>
184             </row>
185             <row>
186               <entry>
187                 <para> &#160;</para>
188               </entry>
189               <entry>
190                 <para> <literal>--ctime</literal></para>
191               </entry>
192               <entry>
193                 <para>File status was last changed N*24 hours ago.</para>
194               </entry>
195             </row>
196             <row>
197               <entry>
198                 <para> &#160;</para>
199               </entry>
200               <entry>
201                 <para> <literal>--mtime</literal></para>
202               </entry>
203               <entry>
204                 <para>File data was last modified N*24 hours ago.</para>
205               </entry>
206             </row>
207             <row>
208               <entry>
209                 <para> &#160;</para>
210               </entry>
211               <entry>
212                 <para> <literal>--obd</literal></para>
213               </entry>
214               <entry>
215                 <para>File has an object on a specific OST(s).</para>
216               </entry>
217             </row>
218             <row>
219               <entry>
220                 <para> &#160;</para>
221               </entry>
222               <entry>
223                 <para> <literal>--size</literal></para>
224               </entry>
225               <entry>
226                 <para>File has a size in bytes, or kilo-, Mega-, Giga-, Tera-, Peta- or Exabytes if a suffix is given.</para>
227               </entry>
228             </row>
229             <row>
230               <entry>
231                 <para> &#160;</para>
232               </entry>
233               <entry>
234                 <para> <literal>--type</literal></para>
235               </entry>
236               <entry>
237                 <para>File has the type  - block, character, directory, pipe, file, symlink, socket
238                   or door (used in Solaris operating system).</para>
239               </entry>
240             </row>
241             <row>
242               <entry>
243                 <para> &#160;</para>
244               </entry>
245               <entry>
246                 <para> <literal>--uid</literal></para>
247               </entry>
248               <entry>
249                 <para>File has a specific numeric user ID.</para>
250               </entry>
251             </row>
252             <row>
253               <entry>
254                 <para> &#160;</para>
255               </entry>
256               <entry>
257                 <para> <literal>--user</literal></para>
258               </entry>
259               <entry>
260                 <para>File owned by a specific user (numeric user ID allowed).</para>
261               </entry>
262             </row>
263             <row>
264               <entry>
265                 <para> &#160;</para>
266               </entry>
267               <entry>
268                 <para> <literal>--gid</literal></para>
269               </entry>
270               <entry>
271                 <para>File has a specific group ID.</para>
272               </entry>
273             </row>
274             <row>
275               <entry>
276                 <para> &#160;</para>
277               </entry>
278               <entry>
279                 <para> <literal>--group</literal></para>
280               </entry>
281               <entry>
282                 <para>File belongs to a specific group (numeric group ID allowed).</para>
283               </entry>
284             </row>
285             <row>
286               <entry>
287                 <para> &#160;</para>
288               </entry>
289               <entry>
290                 <para> -<literal>-maxdepth</literal></para>
291               </entry>
292               <entry>
293                 <para>Limits find to descend at most N levels of the directory tree.</para>
294               </entry>
295             </row>
296             <row>
297               <entry>
298                 <para> &#160;</para>
299               </entry>
300               <entry>
301                 <para> <literal>--print</literal> / <literal>--print0</literal></para>
302               </entry>
303               <entry>
304                 <para>Prints the full filename, followed by a new line or NULL character correspondingly.</para>
305               </entry>
306             </row>
307             <row>
308               <entry nameend="c2" namest="c1">
309                 <para> <literal>osts [path]</literal></para>
310               </entry>
311               <entry>
312                 <para>Lists all OSTs for the file system. If a path located on a mounted Lustre file
313                   system is specified, then only OSTs belonging to this file system are
314                   displayed.</para>
315               </entry>
316             </row>
317             <row>
318               <entry nameend="c2" namest="c1">
319                 <para> <literal>getname [path...]</literal></para>
320               </entry>
321               <entry>
322                   <para>List each Lustre file system instance associated with each Lustre mount
323                   point. If no path is specified, all Lustre mount points are interrogated. If a
324                   list of paths is provided, the instance of each path is provided. If the path is
325                   not a Lustre instance 'No such device' is returned.</para>
326               </entry>
327             </row>
328             <row>
329               <entry nameend="c2" namest="c1">
330                 <para> <literal>getstripe</literal></para>
331               </entry>
332               <entry>
333                 <para>Lists striping information for a given filename or directory. By default, the stripe count, stripe size and offset are returned.</para>
334                 <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>
335                 <para>If the <literal>--raw</literal> option is specified, the stripe information is
336                   printed without substituting the file system default values for unspecified
337                   fields. If the striping EA is not set, 0, 0, and -1 will be printed for the stripe
338                   count, size, and offset respectively.</para>
339                                 <para condition='l24'>The <literal>-M</literal> prints the index of the MDT for a given directory. See <xref linkend='dbdoclet.rmremotedir'/>.</para>
340               </entry>
341             </row>
342             <row>
343               <entry>
344                 <para> &#160;</para>
345               </entry>
346               <entry>
347                 <para> <literal>--obd <replaceable>ost_name</replaceable></literal></para>
348               </entry>
349               <entry>
350                 <para>Lists files that have an object on a specific OST.</para>
351               </entry>
352             </row>
353             <row>
354               <entry>
355                 <para> &#160;</para>
356               </entry>
357               <entry>
358                 <para> <literal>--quiet</literal></para>
359               </entry>
360               <entry>
361                 <para>Lists details about the file&apos;s object ID information.</para>
362               </entry>
363             </row>
364             <row>
365               <entry>
366                 <para> &#160;</para>
367               </entry>
368               <entry>
369                 <para> <literal>--verbose</literal></para>
370               </entry>
371               <entry>
372                 <para>Prints additional striping information.</para>
373               </entry>
374             </row>
375             <row>
376               <entry>
377                 <para> &#160;</para>
378               </entry>
379               <entry>
380                 <para> <literal>--count</literal></para>
381               </entry>
382               <entry>
383                 <para>Lists the stripe count (how many OSTs to use).</para>
384               </entry>
385             </row>
386             <row>
387               <entry>
388                 <para> &#160;</para>
389               </entry>
390               <entry>
391                 <para> <literal>--index</literal></para>
392               </entry>
393               <entry>
394                 <para>Lists the index for each OST in the file system.</para>
395               </entry>
396             </row>
397             <row>
398               <entry>
399                 <para> &#160;</para>
400               </entry>
401               <entry>
402                 <para> <literal>--offset</literal></para>
403               </entry>
404               <entry>
405                 <para>Lists the OST index on which file striping starts.</para>
406               </entry>
407             </row>
408             <row>
409               <entry>
410                 <para> &#160;</para>
411               </entry>
412               <entry>
413                 <para> <literal>--pool</literal></para>
414               </entry>
415               <entry>
416                 <para>Lists the pools to which a file belongs.</para>
417               </entry>
418             </row>
419             <row>
420               <entry>
421                 <para> &#160;</para>
422               </entry>
423               <entry>
424                 <para> <literal>--size</literal></para>
425               </entry>
426               <entry>
427                 <para>Lists the stripe size (how much data to write to one OST before moving to the next OST).</para>
428               </entry>
429             </row>
430             <row>
431               <entry>
432                 <para> &#160;</para>
433               </entry>
434               <entry>
435                 <para> <literal>--directory</literal></para>
436               </entry>
437               <entry>
438                 <para>Lists entries about a specified directory instead of its contents (in the same manner as <literal>ls -d</literal>).</para>
439               </entry>
440             </row>
441             <row>
442               <entry>
443                 <para> &#160;</para>
444               </entry>
445               <entry>
446                 <para> <literal>--recursive</literal></para>
447               </entry>
448               <entry>
449                 <para>Recurses into all sub-directories.</para>
450               </entry>
451             </row>
452             <row>
453               <entry nameend="c2" namest="c1">
454                 <para> <literal>setstripe</literal></para>
455               </entry>
456               <entry>
457                 <para>Create new files with a specific file layout (stripe pattern) configuration.<footnote>
458                     <para>The file cannot exist prior to using <literal>setstripe</literal>. A directory must exist prior to using <literal>setstripe</literal>.</para>
459                   </footnote></para>
460               </entry>
461             </row>
462             <row>
463               <entry>
464                 <para> &#160;</para>
465               </entry>
466               <entry>
467                 <para> <literal>--count stripe_cnt</literal></para>
468               </entry>
469               <entry>
470                 <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>
471               </entry>
472             </row>
473             <row>
474               <entry>
475                 <para> &#160;</para>
476               </entry>
477               <entry>
478                 <para> <literal>--size stripe_size</literal><footnote>
479                     <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>
480                   </footnote>&#160;</para>
481               </entry>
482               <entry>
483                 <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>
484               </entry>
485             </row>
486             <row>
487               <entry>
488                 <para> &#160;</para>
489               </entry>
490               <entry>
491                 <para> <literal>--index --offset start_ost_index</literal></para>
492               </entry>
493               <entry>
494                 <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>
495               </entry>
496             </row>
497             <row>
498               <entry>
499                 <para> &#160;</para>
500               </entry>
501               <entry>
502                 <para> <literal>--pool <replaceable>pool</replaceable></literal></para>
503               </entry>
504               <entry>
505                 <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>
506               </entry>
507             </row>
508             <row>
509               <entry nameend="c2" namest="c1">
510                 <para> <literal>setstripe -d</literal></para>
511               </entry>
512               <entry>
513                 <para>Deletes default striping on the specified directory.</para>
514               </entry>
515             </row>
516             <row>
517               <entry nameend="c2" namest="c1">
518                 <para> <literal>poollist {filesystem} [.poolname]|{pathname}</literal></para>
519               </entry>
520               <entry>
521                 <para>Lists pools in the file system or pathname, or OSTs in the file system&apos;s pool.</para>
522               </entry>
523             </row>
524             <row>
525               <entry nameend="c2" namest="c1">
526                 <para> <literal>quota [-q] [-v] [-o <replaceable>obd_uuid</replaceable>|-i <replaceable>mdt_idx</replaceable>|-I <replaceable>ost_idx</replaceable>] [-u|-g <replaceable>uname|uid|gname|gid]</replaceable> <replaceable>/mount_point</replaceable></literal></para>
527                 <para>&#160;</para>
528               </entry>
529               <entry>
530                 <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>
531               </entry>
532             </row>
533             <row>
534               <entry nameend="c2" namest="c1">
535                 <para> <literal>quota -t <replaceable>-u|-g</replaceable> <replaceable>/mount_point</replaceable></literal></para>
536               </entry>
537               <entry>
538                 <para>Displays block and inode grace times for user (<literal>-u</literal>) or group (<literal>-g</literal>) quotas.</para>
539               </entry>
540             </row>
541             <row>
542               <entry nameend="c2" namest="c1">
543                 <para> <literal>quotachown</literal></para>
544               </entry>
545               <entry>
546                 <para>Changes the file&apos;s owner and group on OSTs of the specified file system.</para>
547               </entry>
548             </row>
549             <row>
550               <entry nameend="c2" namest="c1">
551                 <para> <literal>quotacheck [-ugf] <replaceable>/mount_point</replaceable></literal></para>
552               </entry>
553               <entry>
554                 <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>
555               </entry>
556             </row>
557             <row>
558               <entry nameend="c2" namest="c1">
559                 <para> <literal>quotaon [-ugf] <replaceable>/mount_point</replaceable></literal></para>
560               </entry>
561               <entry>
562                 <para>Turns on file system quotas. Options specify quota for users (<literal>-u</literal>), groups (<literal>-g</literal>), and force (<literal>-f</literal>).</para>
563               </entry>
564             </row>
565             <row>
566               <entry nameend="c2" namest="c1">
567                 <para> <literal>quotaoff [-ugf] <replaceable>/mount_point</replaceable></literal></para>
568               </entry>
569               <entry>
570                 <para>Turns off file system quotas. Options specify quota for users (<literal>-u</literal>), groups (<literal>-g</literal>), and force (<literal>-f</literal>).</para>
571               </entry>
572             </row>
573             <row>
574               <entry nameend="c2" namest="c1">
575                 <para> <literal>quotainv [-ug] [-f] <replaceable>/mount_point</replaceable></literal></para>
576               </entry>
577               <entry>
578                 <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>
579                 <caution>
580                   <para>Use extreme caution when using this command; its results cannot be undone.</para>
581                 </caution>
582               </entry>
583             </row>
584             <row>
585               <entry nameend="c2" namest="c1">
586                 <para> <literal>setquota -u|-g <replaceable>uname|uid|gname|gid}</replaceable> [--block-softlimit <replaceable>block_softlimit</replaceable>] [--block-hardlimit <replaceable>block_hardlimit</replaceable>] [--inode-softlimit <replaceable>inode_softlimit</replaceable>] [--inode-hardlimit <replaceable>inode_hardlimit</replaceable>] <replaceable>/mount_point</replaceable></literal></para>
587               </entry>
588               <entry>
589                 <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>
590                     <para>The old <literal>setquota</literal> interface is supported, but it may be
591                       removed in a future Lustre software release.</para>
592                   </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>
593               </entry>
594             </row>
595             <row>
596               <entry nameend="c2" namest="c1">
597                 <para><literal> setquota -t -u|-g [--block-grace <replaceable>block_grace</replaceable>] [--inode-grace <replaceable>inode_grace</replaceable>] <replaceable>/mount_point</replaceable></literal></para>
598               </entry>
599               <entry>
600                 <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>
601               </entry>
602             </row>
603             <row>
604               <entry nameend="c2" namest="c1">
605                 <para> <literal>help</literal></para>
606               </entry>
607               <entry>
608                 <para>Provides brief help on various <literal>lfs</literal> arguments.</para>
609               </entry>
610             </row>
611             <row>
612               <entry nameend="c2" namest="c1">
613                 <para> <literal>exit/quit</literal></para>
614               </entry>
615               <entry>
616                 <para>Quits the interactive <literal>lfs</literal> session.</para>
617               </entry>
618             </row>
619           </tbody>
620         </tgroup>
621       </informaltable>
622     </section>
623     <section remap="h5">
624       <title xml:id="dbdoclet.50438206_11903">Examples</title>
625       <para>Creates a file striped on two OSTs with 128 KB on each stripe.</para>
626       <screen>$ lfs setstripe -s 128k -c 2 /mnt/lustre/file1</screen>
627       <para>Deletes a default stripe pattern on a given directory. New files use the default striping pattern.</para>
628       <screen>$ lfs setstripe -d /mnt/lustre/dir</screen>
629       <para>Lists the detailed object allocation of a given file.</para>
630       <screen>$ lfs getstripe -v /mnt/lustre/file1</screen>
631       <para>List all the mounted Lustre file systems and corresponding Lustre instances.</para>
632       <screen>$ lfs getname</screen>
633       <para>Efficiently lists all files in a given directory and its subdirectories.</para>
634       <screen>$ lfs find /mnt/lustre</screen>
635       <para>Recursively lists all regular files in a given directory more than 30 days old.</para>
636       <screen>$ lfs find /mnt/lustre -mtime +30 -type f -print</screen>
637       <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>
638       <screen>$ lfs find --obd OST2-UUID /mnt/lustre/</screen>
639       <para>Lists all OSTs in the file system.</para>
640       <screen>$ lfs osts</screen>
641       <para>Lists space usage per OST and MDT in human-readable format.</para>
642       <screen>$ lfs df -h</screen>
643       <para>Lists inode usage per OST and MDT.</para>
644       <screen>$ lfs df -i</screen>
645       <para>List space or inode usage for a specific OST pool.</para>
646       <screen>$ lfs df --pool <replaceable>filesystem</replaceable>[.<replaceable>pool</replaceable>] | <replaceable>pathname</replaceable></screen>
647       <para>List quotas of user &apos;bob&apos;.</para>
648       <screen>$ lfs quota -u bob /mnt/lustre</screen>
649       <para>Show grace times for user quotas on <literal>/mnt/lustre</literal>.</para>
650       <screen>$ lfs quota -t -u /mnt/lustre</screen>
651       <para>Changes file owner and group.</para>
652       <screen>$ lfs quotachown -i /mnt/lustre</screen>
653       <para>Checks quotas for user and group. Turns on quotas after making the check.</para>
654       <screen>$ lfs quotacheck -ug /mnt/lustre</screen>
655       <para>Turns on quotas of user and group.</para>
656       <screen>$ lfs quotaon -ug /mnt/lustre</screen>
657       <para>Turns off quotas of user and group.</para>
658       <screen>$ lfs quotaoff -ug /mnt/lustre</screen>
659       <para>Sets quotas of user &apos;bob&apos;, with a 1 GB block quota hardlimit and a 2 GB block quota softlimit.</para>
660       <screen>$ lfs setquota -u bob --block-softlimit 2000000 --block-hardlimit 1000000 /mnt/lustre</screen>
661       <para>Sets grace times for user quotas: 1000 seconds for block quotas, 1 week and 4 days for inode quotas.</para>
662       <screen>$ lfs setquota -t -u --block-grace 1000 --inode-grace 1w4d /mnt/lustre</screen>
663       <para>Checks the status of all servers (MDT, OST)</para>
664       <screen>$ lfs check servers</screen>
665       <para>Creates a file striped on two OSTs from the pool <literal>my_pool</literal></para>
666       <screen>$ lfs setstripe --pool my_pool -c 2 /mnt/lustre/file</screen>
667       <para>Lists the pools defined for the mounted Lustre file system <literal>/mnt/lustre</literal></para>
668       <screen>$ lfs poollist /mnt/lustre/</screen>
669       <para>Lists the OSTs which are members of the pool <literal>my_pool</literal> in file system <literal>my_fs</literal></para>
670       <screen>$ lfs poollist my_fs.my_pool</screen>
671       <para>Finds all directories/files associated with <literal>poolA</literal>.</para>
672       <screen>$ lfs find /mnt/lustre --pool poolA</screen>
673       <para>Finds all directories/files not associated with a pool.</para>
674       <screen>$ lfs find /mnt//lustre --pool &quot;&quot;</screen>
675       <para>Finds all directories/files associated with pool.</para>
676       <screen>$ lfs find /mnt/lustre ! --pool &quot;&quot;</screen>
677       <para>Associates a directory with the pool <literal>my_pool</literal>, so all new files and directories are created in the pool.</para>
678       <screen>$ lfs setstripe --pool my_pool /mnt/lustre/dir</screen>
679     </section>
680     <section remap="h5">
681       <title>See Also</title>
682       <para><xref linkend="dbdoclet.50438219_38274"/></para>
683     </section>
684   </section>
685   <section xml:id="dbdoclet.50438206_42260">
686     <title><indexterm><primary>lfs_migrate</primary></indexterm>
687       <literal>lfs_migrate</literal>
688     </title>
689     <para>The <literal>lfs_migrate</literal> utility is a simple tool to migrate files between Lustre OSTs.</para>
690     <section remap="h5">
691       <title>Synopsis</title>
692       <screen>lfs_migrate [-c <replaceable>stripecount</replaceable>] [-h] [-l] [-n] [-q] [-R] [-s] [-y] [file|directory ...]</screen>
693     </section>
694     <section remap="h5">
695       <title>Description</title>
696       <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>
697       <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>
698       <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>
699       <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>
700     </section>
701     <section remap="h5">
702       <title>Options</title>
703       <para>Options supporting <literal>lfs_migrate</literal> are described below.</para>
704       <informaltable frame="all">
705         <tgroup cols="2">
706           <colspec colname="c1" colwidth="50*"/>
707           <colspec colname="c2" colwidth="50*"/>
708           <thead>
709             <row>
710               <entry>
711                 <para><emphasis role="bold">Option</emphasis></para>
712               </entry>
713               <entry>
714                 <para><emphasis role="bold">Description</emphasis></para>
715               </entry>
716             </row>
717           </thead>
718           <tbody>
719             <row>
720               <entry>
721                 <para>
722                   <literal>-c <replaceable>stripecount</replaceable></literal></para>
723               </entry>
724               <entry>
725                 <para>Restripe file using the specified stripe count. This option may not be
726                   specified at the same time as the <literal>-R</literal> option.</para>
727               </entry>
728             </row>
729             <row>
730               <entry>
731                 <para>
732                   <literal>-h</literal></para>
733               </entry>
734               <entry>
735                 <para>Display help information.</para>
736               </entry>
737             </row>
738             <row>
739               <entry>
740                 <literal>-l</literal>
741               </entry>
742               <entry>
743                 <para>Migrate files with hard links (skips, by default). Files with multiple hard
744                   links are split into multiple separate files by <literal>lfs_migrate</literal>, so
745                   they are skipped, by default, to avoid breaking the hard links.</para>
746               </entry>
747             </row>
748             <row>
749               <entry>
750                 <literal>-n</literal>
751               </entry>
752               <entry>
753                 <para>Only print the names of files to be migrated.</para>
754               </entry>
755             </row>
756             <row>
757               <entry>
758                 <para> <literal>-q</literal></para>
759               </entry>
760               <entry>
761                 <para>Run quietly (does not print filenames or status).</para>
762               </entry>
763             </row>
764             <row>
765               <entry><literal>-R</literal></entry>
766               <entry>Restripe file using default directory striping instead of keeping striping.
767                 This option may not be specified at the same time as the <literal>-c</literal>
768                 option.</entry>
769             </row>
770             <row>
771               <entry>
772                 <literal>-s</literal></entry>
773               <entry>Skip file data comparison after migrate. Default is to compare migrated file
774                 against original to verify correctness.</entry>
775             </row>
776             <row>
777               <entry>
778                 <para>
779                   <literal>-y</literal></para>
780               </entry>
781               <entry>
782                 <para>Answer &apos;<literal>y</literal>&apos; to usage warning without prompting
783                   (for scripts, use with caution).</para>
784               </entry>
785             </row>
786           </tbody>
787         </tgroup>
788       </informaltable>
789     </section>
790     <section remap="h5">
791       <title>Examples</title>
792       <para>Rebalances all files in <literal>/mnt/lustre/dir</literal>.</para>
793       <screen>$ lfs_migrate /mnt/lustre/file</screen>
794       <para>Migrates files in /test filesystem on OST004 larger than 4 GB in size.</para>
795       <screen>$ lfs find /test -obd test-OST004 -size +4G | lfs_migrate -y</screen>
796     </section>
797     <section remap="h5">
798       <title>See Also</title>
799       <para><xref linkend="dbdoclet.50438206_94597"/></para>
800     </section>
801   </section>
802   <section xml:id="dbdoclet.50438206_75125">
803     <title><indexterm><primary>filefrag</primary></indexterm>
804       <literal>filefrag</literal>
805     </title>
806     <para>The <literal>e2fsprogs</literal> package contains the <literal>filefrag</literal> tool which reports the extent of file fragmentation.</para>
807     <section remap="h5">
808       <title>Synopsis</title>
809       <screen>filefrag [ -belsv ] [ files...  ]</screen>
810     </section>
811     <section remap="h5">
812       <title>Description</title>
813       <para>The <literal>filefrag</literal> utility reports the extent of fragmentation in a given file.
814       The <literal>filefrag</literal> utility obtains the extent information
815       from Lustre files using the <literal>FIEMAP ioctl</literal>, which is
816       efficient and fast, even for very large files.</para>
817       <para>In default mode <footnote>
818           <para>The default mode is faster than the verbose/extent mode since
819           it only counts the number of extents.</para>
820         </footnote>, <literal>filefrag</literal> prints the number of physically
821         discontiguous extents in the file. In extent or verbose mode, each
822         extent is printed with details such as the blocks allocated on each OST.
823         For a Lustre file system, the extents are printed in device offset order
824         (i.e. all of the extents for one OST first, then the next OST, etc.),
825         not file logical offset order.  If the file logical offset order was
826         used, the Lustre striping would make the output very verbose and
827         difficult to see if there was file fragmentation or not.</para>
828       <note>
829         <para>Note that as long as a file has extent lengths of tens of
830         megabytes or more (i.e. <replaceable>read_bandwidth * seek_time >
831         extent_length</replaceable>), the read performance for the file will
832         not be significantly impacted by fragmentation, since file readahead
833         can fully utilize the disk disk bandwidth even with occasional seeks.
834         </para>
835       </note>
836     </section>
837     <section remap="h5">
838       <title>Options</title>
839       <para>The options and descriptions for the <literal>filefrag</literal> utility are listed below.</para>
840       <informaltable frame="all">
841         <tgroup cols="2">
842           <colspec colname="c1" colwidth="50*"/>
843           <colspec colname="c2" colwidth="50*"/>
844           <thead>
845             <row>
846               <entry>
847                 <para><emphasis role="bold">Option</emphasis></para>
848               </entry>
849               <entry>
850                 <para><emphasis role="bold">Description</emphasis></para>
851               </entry>
852             </row>
853           </thead>
854           <tbody>
855             <row>
856               <entry>
857                 <para> <literal>-b</literal></para>
858               </entry>
859               <entry>
860                 <para>Uses the 1024-byte blocksize for the output. By default, this blocksize is
861                   used by the Lustre file system, since OSTs may use different block sizes.</para>
862               </entry>
863             </row>
864             <row>
865               <entry>
866                 <para> <literal>-e</literal></para>
867               </entry>
868               <entry>
869                 <para>Uses the extent mode when printing the output.  This is
870                 the default for Lustre files in verbose mode.</para>
871               </entry>
872             </row>
873             <row>
874               <entry>
875                 <para> <literal>-l</literal></para>
876               </entry>
877               <entry>
878                 <para>Displays extents in LUN offset order.  This is the only
879                 available mode for Lustre.</para>
880               </entry>
881             </row>
882             <row>
883               <entry>
884                 <para> <literal>-s</literal></para>
885               </entry>
886               <entry>
887                 <para>Synchronizes any unwritten file data to disk before
888                 requesting the mapping.</para>
889               </entry>
890             </row>
891             <row>
892               <entry>
893                 <para> <literal>-v</literal></para>
894               </entry>
895               <entry>
896                 <para>Prints the file's layout in verbose mode when checking
897                 file fragmentation, including the logical to physical mapping
898                 for each extent in the file and the OST index.</para>
899               </entry>
900             </row>
901           </tbody>
902         </tgroup>
903       </informaltable>
904     </section>
905     <section remap="h5">
906       <title>Examples</title>
907       <para>Lists default output.</para>
908       <screen>$ filefrag /mnt/lustre/foo
909 /mnt/lustre/foo: 13 extents found</screen>
910       <para>Lists verbose output in extent format.</para>
911       <screen>$ filefrag -v /mnt/lustre/foo
912 Filesystem type is: bd00bd0
913 File size of /mnt/lustre/foo is 1468297786 (1433888 blocks of 1024 bytes)
914  ext:     device_logical:        physical_offset: length:  dev: flags:
915    0:        0..  122879: 2804679680..2804802559: 122880: 0002: network
916    1:   122880..  245759: 2804817920..2804940799: 122880: 0002: network
917    2:   245760..  278527: 2804948992..2804981759:  32768: 0002: network
918    3:   278528..  360447: 2804982784..2805064703:  81920: 0002: network
919    4:   360448..  483327: 2805080064..2805202943: 122880: 0002: network
920    5:   483328..  606207: 2805211136..2805334015: 122880: 0002: network
921    6:   606208..  729087: 2805342208..2805465087: 122880: 0002: network
922    7:   729088..  851967: 2805473280..2805596159: 122880: 0002: network
923    8:   851968..  974847: 2805604352..2805727231: 122880: 0002: network
924    9:   974848.. 1097727: 2805735424..2805858303: 122880: 0002: network
925   10:  1097728.. 1220607: 2805866496..2805989375: 122880: 0002: network
926   11:  1220608.. 1343487: 2805997568..2806120447: 122880: 0002: network
927   12:  1343488.. 1433599: 2806128640..2806218751:  90112: 0002: network
928 /mnt/lustre/foo: 13 extents found</screen>
929     </section>
930   </section>
931   <section xml:id="dbdoclet.50438206_86244">
932     <title><indexterm><primary>mount</primary></indexterm>
933       <literal>mount</literal>
934     </title>
935     <para>The standard <literal>mount(8)</literal> Linux command is used to mount a Lustre file
936       system. When mounting a Lustre file system, mount(8) executes the
937         <literal>/sbin/mount.lustre</literal> command to complete the mount. The mount command
938       supports these options specific to a Lustre file system:</para>
939     <informaltable frame="all">
940       <tgroup cols="2">
941         <colspec colname="c1" colwidth="50*"/>
942         <colspec colname="c2" colwidth="50*"/>
943         <thead>
944           <row>
945             <entry>
946               <para><emphasis role="bold">Server options</emphasis></para>
947             </entry>
948             <entry>
949               <para><emphasis role="bold">Description</emphasis></para>
950             </entry>
951           </row>
952         </thead>
953         <tbody>
954           <row>
955             <entry>
956               <para> <literal>abort_recov</literal></para>
957             </entry>
958             <entry>
959               <para>Aborts recovery when starting a target</para>
960             </entry>
961           </row>
962           <row>
963             <entry>
964               <para> <literal>nosvc</literal></para>
965             </entry>
966             <entry>
967               <para>Starts only MGS/MGC servers</para>
968             </entry>
969           </row>
970           <row>
971             <entry>
972               <para> <literal>nomgs</literal></para>
973             </entry>
974             <entry>
975               <para>Start a MDT with a co-located MGS without starting the MGS</para>
976             </entry>
977           </row>
978           <row>
979             <entry>
980               <para> <literal>exclude</literal></para>
981             </entry>
982             <entry>
983               <para>Starts with a dead OST</para>
984             </entry>
985           </row>
986           <row>
987             <entry>
988               <para> <literal>md_stripe_cache_size</literal></para>
989             </entry>
990             <entry>
991               <para>Sets the stripe cache size for server side disk with a striped raid configuration</para>
992             </entry>
993           </row>
994         </tbody>
995       </tgroup>
996     </informaltable>
997     <informaltable frame="all">
998       <tgroup cols="2">
999         <colspec colname="c1" colwidth="50*"/>
1000         <colspec colname="c2" colwidth="50*"/>
1001         <thead>
1002           <row>
1003             <entry>
1004               <para><emphasis role="bold">Client options</emphasis></para>
1005             </entry>
1006             <entry>
1007               <para><emphasis role="bold">Description</emphasis></para>
1008             </entry>
1009           </row>
1010         </thead>
1011         <tbody>
1012           <row>
1013             <entry>
1014               <para> <literal>flock/noflock/localflock</literal></para>
1015             </entry>
1016             <entry>
1017               <para>Enables/disables global flock or local flock support</para>
1018             </entry>
1019           </row>
1020           <row>
1021             <entry>
1022               <para> <literal>user_xattr/nouser_xattr</literal></para>
1023             </entry>
1024             <entry>
1025               <para>Enables/disables user-extended attributes</para>
1026             </entry>
1027           </row>
1028           <row>
1029             <entry>
1030               <para> <literal>user_fid2path/nouser_fid2path</literal></para>
1031             </entry>
1032             <entry>
1033               <para condition='l23'>Enables/disables FID to path translation by regular users</para>
1034             </entry>
1035           </row>
1036           <row>
1037             <entry>
1038               <para> <literal>retry=</literal></para>
1039             </entry>
1040             <entry>
1041               <para>Number of times a client will retry to mount the file system</para>
1042             </entry>
1043           </row>
1044         </tbody>
1045       </tgroup>
1046     </informaltable>
1047   </section>
1048   <section xml:id="dbdoclet.50438206_56217">
1049     <title>Handling Timeouts</title>
1050     <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>
1051     <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>
1052     <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>
1053     <screen>LustreError: 26597:(client.c:810:ptlrpc_expire_one_request()) @@@ timeout
1054
1055 req@a2d45200 x5886/t0 o38-&gt;mds_svc_UUID@NID_mds_UUID:12 lens 168/64 ref 1 fl
1056
1057 RPC:/0/0 rc 0</screen>
1058   </section>
1059 </chapter>