1 <?xml version="1.0" encoding="UTF-8"?>
2 <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>
8 <xref linkend="dbdoclet.50438206_94597"/>
13 <xref linkend="dbdoclet.50438206_42260"/>
18 <xref linkend="dbdoclet.50438206_75125"/>
23 <xref linkend="dbdoclet.50438206_86244"/>
28 <xref linkend="dbdoclet.50438206_56217"/>
32 <section xml:id="dbdoclet.50438206_94597">
35 <primary>lfs</primary>
37 <literal>lfs</literal>
39 <para>The <literal>lfs</literal> utility can be used for user configuration routines and monitoring.</para>
41 <title>Synopsis</title>
43 lfs changelog [--follow] <replaceable>mdt_name</replaceable> [startrec [endrec]]
44 lfs changelog_clear <replaceable>mdt_name id endrec</replaceable>
45 lfs check <replaceable>mds|osts|servers</replaceable>
46 lfs df [-i] [-h] [--pool]-p <replaceable>fsname</replaceable>[.<replaceable>pool</replaceable>] [<replaceable>path</replaceable>] [--lazy]
47 lfs find [[!] --atime|-A [-+]N] [[!] --mtime|-M [-+]N]
48 [[!] --ctime|-C [-+]N] [--maxdepth|-D N] [--name|-n <replaceable>pattern</replaceable>]
49 [--print|-p] [--print0|-P] [[!] --obd|-O <replaceable>ost_name</replaceable>[,<replaceable>ost_name...</replaceable>]]
50 [[!] --size|-S [+-]N[kMGTPE]] --type |-t {bcdflpsD}]
51 [[!] --gid|-g|--group|-G <replaceable>gname|gid</replaceable>]
52 [[!] --uid|-u|--user|-U <replaceable>uname|uid</replaceable>]
53 <replaceable>dirname|filename</replaceable>
54 lfs getname [-h]|[path...]
55 lfs getstripe [--obd|-O <replaceable>ost_name</replaceable>] [--quiet|-q] [--verbose|-v]
56 [--count|-c] [--index|-i | --offset|-o]
57 [--size|-s] [--pool|-p] [--directory|-d]
58 [--recursive|-r] [--raw|-R] [-M] <replaceable>dirname|filename</replaceable> ...
59 lfs setstripe [--size|-s stripe_size] [--count|-c <replaceable>stripe_count</replaceable>]
60 [--index|-i|--offset|-o <replaceable>start_ost_index</replaceable>]
61 [--pool|-p <replaceable>pool</replaceable>]
62 <replaceable>dirname|filename</replaceable>
63 lfs setstripe -d <replaceable>dir</replaceable>
65 lfs poollist <replaceable>filesystem</replaceable>[.<replaceable>pool</replaceable>]|<replaceable>pathname</replaceable>
66 lfs quota [-q] [-v] [-h] [-o <replaceable>obd_uuid</replaceable>|-I <replaceable>ost_idx</replaceable>|-i <replaceable>mdt_idx</replaceable>]
67 [-u <replaceable>username|uid|-g</replaceable> <replaceable>group|gid</replaceable>]
68 <replaceable>/mount_point</replaceable>
69 lfs quota -t -u|-g <replaceable>/mount_point</replaceable>
70 lfs quotacheck [-ug] <replaceable>/mount_point</replaceable>
71 lfs quotachown [-i] <replaceable>/mount_point</replaceable>
72 lfs quotainv [-ug] [-f] <replaceable>/mount_point</replaceable>
73 lfs quotaon [-ugf] <replaceable>/mount_point</replaceable>
74 lfs quotaoff [-ug] <replaceable>/mount_point</replaceable>
75 lfs setquota {-u|--user|-g|--group} <replaceable>uname|uid|gname|gid</replaceable>
76 [--block-softlimit <replaceable>block_softlimit</replaceable>]
77 [--block-hardlimit <replaceable>block_hardlimit</replaceable>]
78 [--inode-softlimit <replaceable>inode_softlimit</replaceable>]
79 [--inode-hardlimit <replaceable>inode_hardlimit</replaceable>]
80 <replaceable>/mount_point</replaceable>
81 lfs setquota -u|--user|-g|--group <replaceable>uname|uid|gname|gid</replaceable>
82 [-b <replaceable>block_softlimit</replaceable>] [-B <replaceable>block_hardlimit</replaceable>]
83 [-i <replaceable>inode-softlimit</replaceable>] [-I <replaceable>inode_hardlimit</replaceable>]
84 <replaceable>/mount_point</replaceable>
86 [--block-grace <replaceable>block_grace</replaceable>]
87 [--inode-grace <replaceable>inode_grace</replaceable>]
88 <replaceable>/mount_point</replaceable>
90 [-b <replaceable>block_grace</replaceable>] [-i <replaceable>inode_grace</replaceable>]
91 <replaceable>/mount_point</replaceable>
95 <para>In the above example, the <literal><replaceable>/mount_point</replaceable></literal> parameter refers to the mount point of the Lustre file system.</para>
98 <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>
102 <title>Description</title>
103 <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>
106 <title>Options</title>
107 <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>
108 <informaltable frame="all">
110 <colspec colname="c1" colwidth="20*"/>
111 <colspec colname="c2" colwidth="30*"/>
112 <colspec colname="c3" colwidth="50*"/>
115 <entry nameend="c2" namest="c1">
117 <emphasis role="bold">Option</emphasis>
122 <emphasis role="bold">Description</emphasis>
129 <entry nameend="c2" namest="c1">
131 <literal>changelog</literal>
135 <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>
139 <entry nameend="c2" namest="c1">
141 <literal>changelog_clear</literal>
145 <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>
149 <entry nameend="c2" namest="c1">
150 <literal> check </literal>
153 <para>Displays the status of MDS or OSTs (as specified in the command) or all servers (MDS and OSTs).</para>
157 <entry nameend="c2" namest="c1">
158 <literal> df [-i] [-h] [--pool|-p
159 <replaceable>fsname</replaceable>[.<replaceable>pool</replaceable>]
160 [<replaceable>path</replaceable>] [--lazy]</literal>
163 <para>Use <literal>-i</literal> to report file system disk space usage or inode
164 usage of each MDT or OST or, if a pool is specified with the <literal>-p</literal>
165 option, a subset of OSTs.</para>
166 <para>By default, the usage of all mounted Lustre file systems is reported. If the
167 <literal>path</literal> option is included, only the usage for the specified
168 file system is reported. If the <literal>-h</literal> option is included, the
169 output is printed in human-readable format, using SI base-2 suffixes for
170 <emphasis role="bold">M</emphasis>ega-,
171 <emphasis role="bold">G</emphasis>iga-,
172 <emphasis role="bold">T</emphasis>era-,
173 <emphasis role="bold">P</emphasis>eta-, or
174 <emphasis role="bold">E</emphasis>xabytes.</para>
175 <para>If the <literal>--lazy</literal> option is specified, any OST that is
176 currently disconnected from the client will be skipped. Using the
177 <literal>--lazy</literal> option prevents the <literal>df</literal> output from
178 being blocked when an OST is offline. Only the space on the OSTs that can
179 currently be accessed are returned. The <literal>llite.*.lazystatfs</literal>
180 tunable can be enabled to make this the default behaviour for all
181 <literal>statfs()</literal> operations.</para>
185 <entry nameend="c2" namest="c1">
187 <literal> find</literal>
191 <para>Searches the directory tree rooted at the given directory/filename for files that match the given parameters.</para>
192 <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>
198 <literal> --atime </literal>
201 <para>File was last accessed N*24 hours ago. (There is no guarantee that <literal>atime</literal> is kept coherent across the cluster.)</para>
202 <para>OSTs store a transient <literal>atime</literal> that is updated when clients
203 do read requests. Permanent <literal>atime</literal> is written to the MDS when
204 the file is closed. However, on-disk atime is only updated if it is more than 60
205 seconds old (<literal>/proc/fs/lustre/mds/*/max_atime_diff</literal>). The Lustre
206 software considers the latest <literal>atime</literal> from all OSTs. If a
207 <literal>setattr</literal> is set by user, then it is updated on both the MDS
208 and OST, allowing the <literal>atime</literal> to go backward.</para>
217 <literal>--ctime</literal>
221 <para>File status was last changed N*24 hours ago.</para>
230 <literal>--mtime</literal>
234 <para>File data was last modified N*24 hours ago.</para>
243 <literal>--obd</literal>
247 <para>File has an object on a specific OST(s).</para>
256 <literal>--size</literal>
260 <para>File has a size in bytes, or kilo-, Mega-, Giga-, Tera-, Peta- or Exabytes if a suffix is given.</para>
269 <literal>--type</literal>
273 <para>File has the type - block, character, directory, pipe, file, symlink, socket
274 or door (used in Solaris operating system).</para>
283 <literal>--uid</literal>
287 <para>File has a specific numeric user ID.</para>
296 <literal>--user</literal>
300 <para>File owned by a specific user (numeric user ID allowed).</para>
309 <literal>--gid</literal>
313 <para>File has a specific group ID.</para>
322 <literal>--group</literal>
326 <para>File belongs to a specific group (numeric group ID allowed).</para>
334 <para> -<literal>-maxdepth</literal></para>
337 <para>Limits find to descend at most N levels of the directory tree.</para>
345 <para><literal>--print</literal> / <literal>--print0</literal></para>
348 <para>Prints the full filename, followed by a new line or NULL character correspondingly.</para>
352 <entry nameend="c2" namest="c1">
354 <literal>osts [path]</literal>
358 <para>Lists all OSTs for the file system. If a path located on a mounted Lustre file
359 system is specified, then only OSTs belonging to this file system are
364 <entry nameend="c2" namest="c1">
366 <literal>getname [path...]</literal>
370 <para>List each Lustre file system instance associated with each Lustre mount
371 point. If no path is specified, all Lustre mount points are interrogated. If a
372 list of paths is provided, the instance of each path is provided. If the path is
373 not a Lustre instance 'No such device' is returned.</para>
377 <entry nameend="c2" namest="c1">
379 <literal>getstripe</literal>
383 <para>Lists striping information for a given filename or directory. By default, the stripe count, stripe size and offset are returned.</para>
384 <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>
385 <para>If the <literal>--raw</literal> option is specified, the stripe information is
386 printed without substituting the file system default values for unspecified
387 fields. If the striping EA is not set, 0, 0, and -1 will be printed for the stripe
388 count, size, and offset respectively.</para>
389 <para condition="l24">The <literal>-M</literal> prints the index of the MDT for a given directory. See <xref linkend="dbdoclet.rmremotedir"/>.</para>
398 <literal>--obd <replaceable>ost_name</replaceable></literal>
402 <para>Lists files that have an object on a specific OST.</para>
411 <literal>--quiet</literal>
415 <para>Lists details about the file's object ID information.</para>
424 <literal>--verbose</literal>
428 <para>Prints additional striping information.</para>
437 <literal>--count</literal>
441 <para>Lists the stripe count (how many OSTs to use).</para>
450 <literal>--index</literal>
454 <para>Lists the index for each OST in the file system.</para>
463 <literal>--offset</literal>
467 <para>Lists the OST index on which file striping starts.</para>
476 <literal>--pool</literal>
480 <para>Lists the pools to which a file belongs.</para>
489 <literal>--size</literal>
493 <para>Lists the stripe size (how much data to write to one OST before moving to the next OST).</para>
502 <literal>--directory</literal>
506 <para>Lists entries about a specified directory instead of its contents (in the same manner as <literal>ls -d</literal>).</para>
515 <literal>--recursive</literal>
519 <para>Recurses into all sub-directories.</para>
523 <entry nameend="c2" namest="c1">
525 <literal>setstripe</literal>
529 <para>Create new files with a specific file layout (stripe
530 pattern) configuration.<footnote><para>The file cannot exist prior to using
531 <literal>setstripe</literal>. A directory must exist prior to using
532 <literal>setstripe</literal>.</para></footnote></para>
541 <literal>--count stripe_cnt</literal>
545 <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>
553 <para><literal>--size stripe_size</literal><footnote><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></footnote>Â </para>
556 <para>Number of bytes to store on an OST before moving to the next OST. A stripe_size of 0 uses the file system'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>
565 <literal>--index --offset start_ost_index</literal>
569 <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>
578 <literal>--pool <replaceable>pool</replaceable></literal>
582 <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>
586 <entry nameend="c2" namest="c1">
588 <literal>setstripe -d</literal>
592 <para>Deletes default striping on the specified directory.</para>
596 <entry nameend="c2" namest="c1">
598 <literal>poollist {filesystem} [.poolname]|{pathname}</literal>
602 <para>Lists pools in the file system or pathname, or OSTs in the file system's pool.</para>
606 <entry nameend="c2" namest="c1">
608 <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>
613 <para>Displays disk usage and limits, either for the full file
614 system or for objects on a specific OBD. A user or group name or an ID can be
615 specified. If both user and group are omitted, quotas for the current UID/GID
616 are shown. The <literal>-q</literal> option disables printing of additional
617 descriptions (including column titles). It fills in blank spaces in the
618 <literal>grace</literal> column with zeros (when there is no grace period set),
619 to ensure that the number of columns is consistent. The <literal>-v</literal>
620 option provides more verbose (per-OBD statistics) output.</para>
624 <entry nameend="c2" namest="c1">
626 <literal>quota -t <replaceable>-u|-g</replaceable> <replaceable>/mount_point</replaceable></literal>
630 <para>Displays block and inode grace times for user (<literal>-u</literal>) or group (<literal>-g</literal>) quotas.</para>
634 <entry nameend="c2" namest="c1">
636 <literal>quotachown</literal>
640 <para>Changes the file's owner and group on OSTs of the specified file system.</para>
644 <entry nameend="c2" namest="c1">
646 <literal>quotacheck [-ugf] <replaceable>/mount_point</replaceable></literal>
650 <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>
654 <entry nameend="c2" namest="c1">
656 <literal>quotaon [-ugf] <replaceable>/mount_point</replaceable></literal>
660 <para>Turns on file system quotas. Options specify quota for users (<literal>-u</literal>), groups (<literal>-g</literal>), and force (<literal>-f</literal>).</para>
664 <entry nameend="c2" namest="c1">
666 <literal>quotaoff [-ugf] <replaceable>/mount_point</replaceable></literal>
670 <para>Turns off file system quotas. Options specify quota for users (<literal>-u</literal>), groups (<literal>-g</literal>), and force (<literal>-f</literal>).</para>
674 <entry nameend="c2" namest="c1">
676 <literal>quotainv [-ug] [-f] <replaceable>/mount_point</replaceable></literal>
680 <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>
682 <para>Use extreme caution when using this command; its results cannot be undone.</para>
687 <entry nameend="c2" namest="c1">
689 <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>
693 <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><para>The old <literal>setquota</literal> interface is supported, but it may be
694 removed in a future Lustre software release.</para></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>
698 <entry nameend="c2" namest="c1">
700 <literal> setquota -t -u|-g [--block-grace <replaceable>block_grace</replaceable>] [--inode-grace <replaceable>inode_grace</replaceable>] <replaceable>/mount_point</replaceable></literal>
704 <para>Sets the file system quota grace times for users or groups. Grace time is specified in '<literal>XXwXXdXXhXXmXXs</literal>' format or as an integer seconds value. See <xref linkend="dbdoclet.50438206_11903"/>.</para>
708 <entry nameend="c2" namest="c1">
710 <literal>help</literal>
714 <para>Provides brief help on various <literal>lfs</literal> arguments.</para>
718 <entry nameend="c2" namest="c1">
720 <literal>exit/quit</literal>
724 <para>Quits the interactive <literal>lfs</literal> session.</para>
732 <title xml:id="dbdoclet.50438206_11903">Examples</title>
733 <para>Creates a file striped on two OSTs with 128 KB on each stripe.</para>
734 <screen>$ lfs setstripe -s 128k -c 2 /mnt/lustre/file1</screen>
735 <para>Deletes a default stripe pattern on a given directory. New files use the default striping pattern.</para>
736 <screen>$ lfs setstripe -d /mnt/lustre/dir</screen>
737 <para>Lists the detailed object allocation of a given file.</para>
738 <screen>$ lfs getstripe -v /mnt/lustre/file1</screen>
739 <para>List all the mounted Lustre file systems and corresponding Lustre instances.</para>
740 <screen>$ lfs getname</screen>
741 <para>Efficiently lists all files in a given directory and its subdirectories.</para>
742 <screen>$ lfs find /mnt/lustre</screen>
743 <para>Recursively lists all regular files in a given directory more than 30 days old.</para>
744 <screen>$ lfs find /mnt/lustre -mtime +30 -type f -print</screen>
745 <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>
746 <screen>$ lfs find --obd OST2-UUID /mnt/lustre/</screen>
747 <para>Lists all OSTs in the file system.</para>
748 <screen>$ lfs osts</screen>
749 <para>Lists space usage per OST and MDT in human-readable format.</para>
750 <screen>$ lfs df -h</screen>
751 <para>Lists inode usage per OST and MDT.</para>
752 <screen>$ lfs df -i</screen>
753 <para>List space or inode usage for a specific OST pool.</para>
754 <screen>$ lfs df --pool <replaceable>filesystem</replaceable>[.<replaceable>pool</replaceable>] | <replaceable>pathname</replaceable></screen>
755 <para>List quotas of user 'bob'.</para>
756 <screen>$ lfs quota -u bob /mnt/lustre</screen>
757 <para>Show grace times for user quotas on <literal>/mnt/lustre</literal>.</para>
758 <screen>$ lfs quota -t -u /mnt/lustre</screen>
759 <para>Changes file owner and group.</para>
760 <screen>$ lfs quotachown -i /mnt/lustre</screen>
761 <para>Checks quotas for user and group. Turns on quotas after making the check.</para>
762 <screen>$ lfs quotacheck -ug /mnt/lustre</screen>
763 <para>Turns on quotas of user and group.</para>
764 <screen>$ lfs quotaon -ug /mnt/lustre</screen>
765 <para>Turns off quotas of user and group.</para>
766 <screen>$ lfs quotaoff -ug /mnt/lustre</screen>
767 <para>Sets quotas of user 'bob', with a 1 GB block quota hardlimit and a 2 GB block quota softlimit.</para>
768 <screen>$ lfs setquota -u bob --block-softlimit 2000000 --block-hardlimit 1000000 /mnt/lustre</screen>
769 <para>Sets grace times for user quotas: 1000 seconds for block quotas, 1 week and 4 days for inode quotas.</para>
770 <screen>$ lfs setquota -t -u --block-grace 1000 --inode-grace 1w4d /mnt/lustre</screen>
771 <para>Checks the status of all servers (MDT, OST)</para>
772 <screen>$ lfs check servers</screen>
773 <para>Creates a file striped on two OSTs from the pool <literal>my_pool</literal></para>
774 <screen>$ lfs setstripe --pool my_pool -c 2 /mnt/lustre/file</screen>
775 <para>Lists the pools defined for the mounted Lustre file system <literal>/mnt/lustre</literal></para>
776 <screen>$ lfs poollist /mnt/lustre/</screen>
777 <para>Lists the OSTs which are members of the pool <literal>my_pool</literal> in file system <literal>my_fs</literal></para>
778 <screen>$ lfs poollist my_fs.my_pool</screen>
779 <para>Finds all directories/files associated with <literal>poolA</literal>.</para>
780 <screen>$ lfs find /mnt/lustre --pool poolA</screen>
781 <para>Finds all directories/files not associated with a pool.</para>
782 <screen>$ lfs find /mnt//lustre --pool ""</screen>
783 <para>Finds all directories/files associated with pool.</para>
784 <screen>$ lfs find /mnt/lustre ! --pool ""</screen>
785 <para>Associates a directory with the pool <literal>my_pool</literal>, so all new files and directories are created in the pool.</para>
786 <screen>$ lfs setstripe --pool my_pool /mnt/lustre/dir</screen>
789 <title>See Also</title>
791 <xref linkend="dbdoclet.50438219_38274"/>
795 <section xml:id="dbdoclet.50438206_42260">
798 <primary>lfs_migrate</primary>
800 <literal>lfs_migrate</literal>
802 <para>The <literal>lfs_migrate</literal> utility is a simple tool to migrate files between Lustre OSTs.</para>
804 <title>Synopsis</title>
805 <screen>lfs_migrate [-c <replaceable>stripecount</replaceable>] [-h] [-l] [-n] [-q] [-R] [-s] [-y] [file|directory ...]</screen>
808 <title>Description</title>
809 <para>The <literal>lfs_migrate</literal> utility is a simple tool to
810 assist migration of files between Lustre OSTs. The utility copies each
811 specified file to a new file, verifies the file contents have not changed, and
812 then renames the new file to the original filename. This allows balanced space
813 usage between OSTs, moving files off OSTs that are starting to show hardware
814 problems (though are still functional) or OSTs that will be
817 <para>For versions of Lustre before 2.5, <literal>lfs_migrate</literal> is not
818 closely integrated with the MDS, it cannot determine whether a file is
819 currently open and/or in-use by other applications or nodes. This makes it
820 UNSAFE for use on files that might be modified by other applications, since the
821 migrated file is only a copy of the current file. This results in the old file
822 becoming an open-unlinked file and any modifications to that file are
825 <para>Files to be migrated can be specified as command-line arguments. If a
826 directory is specified on the command-line then all files within the directory
827 are migrated. If no files are specified on the command-line, then a list of
828 files is read from the standard input, making <literal>lfs_migrate</literal>
829 suitable for use with <literal>lfs</literal> find to locate files on specific
830 OSTs and/or matching other file attributes.</para>
831 <para>The current file allocation policies on the MDS dictate where the new
832 files are placed, taking into account whether specific OSTs have been disabled
833 on the MDS via <literal>lctl</literal> (preventing new files from being
834 allocated there), whether some OSTs are overly full (reducing the number of
835 files placed on those OSTs), or if there is a specific default file striping
836 for the target directory (potentially changing the stripe count, stripe size,
837 OST pool, or OST index of a new file).</para>
839 <para>The <literal>lfs_migrate</literal> utility can also be used in some cases
841 <indexterm><primary>fragmentation</primary></indexterm>fragmentation. File
842 fragmentation will typically reduce Lustre file system performance. File
843 fragmentation may be observed on an aged file system and will commonly occur if
844 the file was written by many threads. Provided there is sufficient free space
845 (or if it was written when the file system was nearly full)
846 that is less fragmented than the file being copied, re-writing a file with
847 <literal>lfs_migrate</literal> will result in a migrated file with reduced
848 fragmentation. The tool <literal>filefrag</literal> can be used to report file
849 fragmentation. See <xref linkend="dbdoclet.50438206_75125"/></para>
852 <para>As long as a file has extent lengths of tens of megabytes
853 (<replaceable>read_bandwidth * seek_time</replaceable>) or more, the read
854 performance for the file will not be significantly impacted by fragmentation,
855 since the read pipeline can be filled by large reads from disk even with an
856 occasional disk seek.</para>
860 <title>Options</title>
861 <para>Options supporting <literal>lfs_migrate</literal> are described below.</para>
862 <informaltable frame="all">
864 <colspec colname="c1" colwidth="50*"/>
865 <colspec colname="c2" colwidth="50*"/>
870 <emphasis role="bold">Option</emphasis>
875 <emphasis role="bold">Description</emphasis>
884 <literal>-c <replaceable>stripecount</replaceable></literal>
888 <para>Restripe file using the specified stripe count. This option may not be
889 specified at the same time as the <literal>-R</literal> option.</para>
895 <literal>-h</literal>
899 <para>Display help information.</para>
904 <literal>-l</literal>
907 <para>Migrate files with hard links (skips, by default). Files with multiple hard
908 links are split into multiple separate files by <literal>lfs_migrate</literal>, so
909 they are skipped, by default, to avoid breaking the hard links.</para>
914 <literal>-n</literal>
917 <para>Only print the names of files to be migrated.</para>
923 <literal>-q</literal>
927 <para>Run quietly (does not print filenames or status).</para>
932 <literal>-R</literal>
934 <entry>Restripe file using default directory striping instead of keeping striping.
935 This option may not be specified at the same time as the <literal>-c</literal>
940 <literal>-s</literal>
942 <entry>Skip file data comparison after migrate. Default is to compare migrated file
943 against original to verify correctness.</entry>
948 <literal>-y</literal>
952 <para>Answer '<literal>y</literal>' to usage warning without prompting
953 (for scripts, use with caution).</para>
961 <title>Examples</title>
962 <para>Rebalances all files in <literal>/mnt/lustre/dir</literal>.</para>
963 <screen>$ lfs_migrate /mnt/lustre/file</screen>
964 <para>Migrates files in /test filesystem on OST004 larger than 4 GB in size.</para>
965 <screen>$ lfs find /test -obd test-OST004 -size +4G | lfs_migrate -y</screen>
968 <title>See Also</title>
970 <xref linkend="dbdoclet.50438206_94597"/>
974 <section xml:id="dbdoclet.50438206_75125">
977 <primary>filefrag</primary>
979 <literal>filefrag</literal>
981 <para>The <literal>e2fsprogs</literal> package contains the <literal>filefrag</literal> tool which reports the extent of file fragmentation.</para>
983 <title>Synopsis</title>
984 <screen>filefrag [ -belsv ] [ files... ]</screen>
987 <title>Description</title>
988 <para>The <literal>filefrag</literal> utility reports the extent of fragmentation in a given file.
989 The <literal>filefrag</literal> utility obtains the extent information
990 from Lustre files using the <literal>FIEMAP ioctl</literal>, which is
991 efficient and fast, even for very large files.</para>
992 <para>In default mode <footnote>
993 <para>The default mode is faster than the verbose/extent mode since
994 it only counts the number of extents.</para>
995 </footnote>, <literal>filefrag</literal> prints the number of physically
996 discontiguous extents in the file. In extent or verbose mode, each
997 extent is printed with details such as the blocks allocated on each OST.
998 For a Lustre file system, the extents are printed in device offset order
999 (i.e. all of the extents for one OST first, then the next OST, etc.),
1000 not file logical offset order. If the file logical offset order was
1001 used, the Lustre striping would make the output very verbose and
1002 difficult to see if there was file fragmentation or not.</para>
1004 <para>Note that as long as a file has extent lengths of tens of
1005 megabytes or more (i.e. <replaceable>read_bandwidth * seek_time >
1006 extent_length</replaceable>), the read performance for the file will
1007 not be significantly impacted by fragmentation, since file readahead
1008 can fully utilize the disk disk bandwidth even with occasional seeks.
1011 <para>In default mode <footnote><para>The default mode is faster than the
1012 verbose/extent mode.</para></footnote>, <literal>filefrag</literal> returns the
1013 number of physically discontiguous extents in the file. In extent or verbose
1014 mode, each extent is printed with details. For a Lustre file system, the
1015 extents are printed in device offset order, not logical offset order.</para>
1017 <section remap="h5">
1018 <title>Options</title>
1019 <para>The options and descriptions for the <literal>filefrag</literal> utility are listed below.</para>
1020 <informaltable frame="all">
1022 <colspec colname="c1" colwidth="50*"/>
1023 <colspec colname="c2" colwidth="50*"/>
1028 <emphasis role="bold">Option</emphasis>
1033 <emphasis role="bold">Description</emphasis>
1042 <literal>-b</literal>
1046 <para>Uses the 1024-byte blocksize for the output. By default, this blocksize is
1047 used by the Lustre file system, since OSTs may use different block sizes.</para>
1053 <literal>-e</literal>
1057 <para>Uses the extent mode when printing the output. This is
1058 the default for Lustre files in verbose mode.</para>
1064 <literal>-l</literal>
1068 <para>Displays extents in LUN offset order. This is the only
1069 available mode for Lustre.</para>
1075 <literal>-s</literal>
1079 <para>Synchronizes any unwritten file data to disk before
1080 requesting the mapping.</para>
1086 <literal>-v</literal>
1090 <para>Prints the file's layout in verbose mode when checking
1091 file fragmentation, including the logical to physical mapping
1092 for each extent in the file and the OST index.</para>
1099 <section remap="h5">
1100 <title>Examples</title>
1101 <para>Lists default output.</para>
1102 <screen>$ filefrag /mnt/lustre/foo
1103 /mnt/lustre/foo: 13 extents found</screen>
1104 <para>Lists verbose output in extent format.</para>
1105 <screen>$ filefrag -v /mnt/lustre/foo
1106 Filesystem type is: bd00bd0
1107 File size of /mnt/lustre/foo is 1468297786 (1433888 blocks of 1024 bytes)
1108 ext: device_logical: physical_offset: length: dev: flags:
1109 0: 0.. 122879: 2804679680..2804802559: 122880: 0002: network
1110 1: 122880.. 245759: 2804817920..2804940799: 122880: 0002: network
1111 2: 245760.. 278527: 2804948992..2804981759: 32768: 0002: network
1112 3: 278528.. 360447: 2804982784..2805064703: 81920: 0002: network
1113 4: 360448.. 483327: 2805080064..2805202943: 122880: 0002: network
1114 5: 483328.. 606207: 2805211136..2805334015: 122880: 0002: network
1115 6: 606208.. 729087: 2805342208..2805465087: 122880: 0002: network
1116 7: 729088.. 851967: 2805473280..2805596159: 122880: 0002: network
1117 8: 851968.. 974847: 2805604352..2805727231: 122880: 0002: network
1118 9: 974848.. 1097727: 2805735424..2805858303: 122880: 0002: network
1119 10: 1097728.. 1220607: 2805866496..2805989375: 122880: 0002: network
1120 11: 1220608.. 1343487: 2805997568..2806120447: 122880: 0002: network
1121 12: 1343488.. 1433599: 2806128640..2806218751: 90112: 0002: network
1122 /mnt/lustre/foo: 13 extents found</screen>
1125 <section xml:id="dbdoclet.50438206_86244">
1128 <primary>mount</primary>
1130 <literal>mount</literal>
1132 <para>The standard <literal>mount(8)</literal> Linux command is used to mount a Lustre file
1133 system. When mounting a Lustre file system, mount(8) executes the
1134 <literal>/sbin/mount.lustre</literal> command to complete the mount. The mount command
1135 supports these options specific to a Lustre file system:</para>
1136 <informaltable frame="all">
1138 <colspec colname="c1" colwidth="50*"/>
1139 <colspec colname="c2" colwidth="50*"/>
1144 <emphasis role="bold">Server options</emphasis>
1149 <emphasis role="bold">Description</emphasis>
1158 <literal>abort_recov</literal>
1162 <para>Aborts recovery when starting a target</para>
1168 <literal>nosvc</literal>
1172 <para>Starts only MGS/MGC servers</para>
1178 <literal>nomgs</literal>
1182 <para>Start a MDT with a co-located MGS without starting the MGS</para>
1188 <literal>exclude</literal>
1192 <para>Starts with a dead OST</para>
1198 <literal>md_stripe_cache_size</literal>
1202 <para>Sets the stripe cache size for server side disk with a striped raid configuration</para>
1208 <informaltable frame="all">
1210 <colspec colname="c1" colwidth="50*"/>
1211 <colspec colname="c2" colwidth="50*"/>
1216 <emphasis role="bold">Client options</emphasis>
1221 <emphasis role="bold">Description</emphasis>
1230 <literal>flock/noflock/localflock</literal>
1234 <para>Enables/disables global flock or local flock support</para>
1240 <literal>user_xattr/nouser_xattr</literal>
1244 <para>Enables/disables user-extended attributes</para>
1250 <literal>user_fid2path/nouser_fid2path</literal>
1254 <para condition="l23">Enables/disables FID to path translation by regular users</para>
1260 <literal>retry=</literal>
1264 <para>Number of times a client will retry to mount the file system</para>
1271 <section xml:id="dbdoclet.50438206_56217">
1272 <title>Handling Timeouts</title>
1273 <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>
1274 <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>
1275 <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>
1276 <screen>LustreError: 26597:(client.c:810:ptlrpc_expire_one_request()) @@@ timeout
1278 req@a2d45200 x5886/t0 o38->mds_svc_UUID@NID_mds_UUID:12 lens 168/64 ref 1 fl
1280 RPC:/0/0 rc 0</screen>