1 <?xml version="1.0" encoding="utf-8"?>
2 <chapter xmlns="http://docbook.org/ns/docbook"
3 xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US"
5 xmlns:xi="http://www.w3.org/2001/XInclude">
6 <title xml:id="userutilities.title">User Utilities</title>
7 <para>This chapter describes user utilities.</para>
8 <section xml:id="dbdoclet.50438206_94597">
11 <primary>lfs</primary>
13 <literal>lfs</literal>
16 <literal>lfs</literal> utility can be used for user configuration routines
17 and monitoring.</para>
19 <title>Synopsis</title>
22 lfs changelog [--follow] <replaceable>mdt_name</replaceable> [startrec [endrec]]
23 lfs changelog_clear <replaceable>mdt_name id endrec</replaceable>
24 lfs check <replaceable>mds|osts|servers</replaceable>
25 lfs df [-i] [-h] [--pool]-p <replaceable>fsname</replaceable>[.<replaceable>pool</replaceable>] [<replaceable>path</replaceable>] [--lazy]
26 lfs find [[!] --atime|-A [-+]N] [[!] --mtime|-M [-+]N]
27 [[!] --ctime|-C [-+]N] [--maxdepth|-D N] [--name|-n <replaceable>pattern</replaceable>]
28 [--print|-p] [--print0|-P] [[!] --obd|-O <replaceable>ost_name</replaceable>[,<replaceable>ost_name...</replaceable>]]
29 [[!] --size|-S [+-]N[kMGTPE]] --type |-t {bcdflpsD}]
30 [[!] --gid|-g|--group|-G <replaceable>gname|gid</replaceable>]
31 [[!] --uid|-u|--user|-U <replaceable>uname|uid</replaceable>]
32 <replaceable>dirname|filename</replaceable>
33 lfs getname [-h]|[path...]
34 lfs getstripe [--obd|-O <replaceable>ost_name</replaceable>] [--quiet|-q] [--verbose|-v]
35 [--count|-c] [--index|-i | --offset|-o]
36 [--size|-s] [--pool|-p] [--directory|-d]
37 [--recursive|-r] [--raw|-R] [-M]
38 <replaceable>dirname|filename</replaceable> ...
39 lfs setstripe [--size|-s stripe_size] [--count|-c <replaceable>stripe_count</replaceable>]
40 [--stripe-index|-i <replaceable>start_ost_index</replaceable>]
41 [--ost-list|-o <replaceable>ost_indicies</replaceable>]
42 [--pool|-p <replaceable>pool</replaceable>]
43 <replaceable>dirname|filename</replaceable>
44 lfs setstripe -d <replaceable>dir</replaceable>
46 lfs poollist <replaceable>filesystem</replaceable>[.<replaceable>pool</replaceable>]| <replaceable>pathname</replaceable>
47 lfs quota [-q] [-v] [-h] [-o <replaceable>obd_uuid</replaceable>|-I <replaceable>ost_idx</replaceable>|-i <replaceable>mdt_idx</replaceable>]
48 [-u <replaceable>username|uid|-g</replaceable> <replaceable>group|gid</replaceable>] <replaceable>/mount_point</replaceable>
49 lfs quota -t -u|-g <replaceable>/mount_point</replaceable>
50 lfs quotacheck [-ug] <replaceable>/mount_point</replaceable>
51 lfs quotachown [-i] <replaceable>/mount_point</replaceable>
52 lfs quotainv [-ug] [-f] <replaceable>/mount_point</replaceable>
53 lfs quotaon [-ugf] <replaceable>/mount_point</replaceable>
54 lfs quotaoff [-ug] <replaceable>/mount_point</replaceable>
55 lfs setquota {-u|--user|-g|--group} <replaceable>uname|uid|gname|gid</replaceable>
56 [--block-softlimit <replaceable>block_softlimit</replaceable>]
57 [--block-hardlimit <replaceable>block_hardlimit</replaceable>]
58 [--inode-softlimit <replaceable>inode_softlimit</replaceable>]
59 [--inode-hardlimit <replaceable>inode_hardlimit</replaceable>]
60 <replaceable>/mount_point</replaceable>
61 lfs setquota -u|--user|-g|--group <replaceable>uname|uid|gname|gid</replaceable>
62 [-b <replaceable>block_softlimit</replaceable>] [-B <replaceable>block_hardlimit</replaceable>]
63 [-i <replaceable>inode-softlimit</replaceable>] [-I <replaceable>inode_hardlimit</replaceable>]
64 <replaceable>/mount_point</replaceable>
65 lfs setquota -t -u|-g [--block-grace <replaceable>block_grace</replaceable>]
66 [--inode-grace <replaceable>inode_grace</replaceable>]
67 <replaceable>/mount_point</replaceable>
68 lfs setquota -t -u|-g [-b <replaceable>block_grace</replaceable>] [-i <replaceable>inode_grace</replaceable>]
69 <replaceable>/mount_point</replaceable>
73 <para>In the above example, the
75 <replaceable>/mount_point</replaceable>
76 </literal> parameter refers to the mount point of the Lustre file
80 <para>The old lfs quota output was very detailed and contained
81 cluster-wide quota statistics (including cluster-wide limits for a
82 user/group and cluster-wide usage for a user/group), as well as
83 statistics for each MDS/OST. Now,
84 <literal>lfs quota</literal> has been updated to provide only
85 cluster-wide statistics, by default. To obtain the full report of
86 cluster-wide limits, usage and statistics, use the
87 <literal>-v</literal> option with
88 <literal>lfs quota</literal>.</para>
92 <title>Description</title>
94 <literal>lfs</literal> utility is used to create a new file with a
95 specific striping pattern, determine the default striping pattern, gather
96 the extended attributes (object numbers and location) for a specific
97 file, find files with specific attributes, list OST information or set
98 quota limits. It can be invoked interactively without any arguments or in
99 a non-interactive mode with one of the supported arguments.</para>
102 <title>Options</title>
104 <literal>lfs</literal> options are listed and described below. For a
105 complete list of available options, type help at the
106 <literal>lfs</literal> prompt.</para>
107 <informaltable frame="all">
109 <colspec colname="c1" colwidth="20*" />
110 <colspec colname="c2" colwidth="30*" />
111 <colspec colname="c3" colwidth="50*" />
114 <entry nameend="c2" namest="c1">
116 <emphasis role="bold">Option</emphasis>
121 <emphasis role="bold">Description</emphasis>
128 <entry nameend="c2" namest="c1">
130 <literal>changelog</literal>
134 <para>Shows the metadata changes on an MDT. Start and end
135 points are optional. The
136 <literal>--follow</literal> option blocks on new changes; this
137 option is only valid when run directly on the MDT node.</para>
141 <entry nameend="c2" namest="c1">
143 <literal>changelog_clear</literal>
147 <para>Indicates that changelog records previous to
149 <replaceable>endrec</replaceable>
150 </literal> are no longer of interest to a particular consumer
152 <replaceable>id</replaceable>
153 </literal>, potentially allowing the MDT to free up disk space.
156 <replaceable>endrec</replaceable>
157 </literal> of 0 indicates the current last record. Changelog
158 consumers must be registered on the MDT node using
159 <literal>lctl</literal>.</para>
163 <entry nameend="c2" namest="c1">
164 <literal>check</literal>
167 <para>Displays the status of MDS or OSTs (as specified in the
168 command) or all servers (MDS and OSTs).</para>
172 <entry nameend="c2" namest="c1">
173 <literal>df [-i] [-h] [--pool|-p
174 <replaceable>fsname</replaceable>[.
175 <replaceable>pool</replaceable>] [
176 <replaceable>path</replaceable>] [--lazy]</literal>
180 <literal>-i</literal> to report file system disk space usage or
181 inode usage of each MDT or OST or, if a pool is specified with
183 <literal>-p</literal> option, a subset of OSTs.</para>
184 <para>By default, the usage of all mounted Lustre file systems
186 <literal>path</literal> option is included, only the usage for
187 the specified file system is reported. If the
188 <literal>-h</literal> option is included, the output is printed
189 in human-readable format, using SI base-2 suffixes for
190 <emphasis role="bold">M</emphasis>ega-,
191 <emphasis role="bold">G</emphasis>iga-,
192 <emphasis role="bold">T</emphasis>era-,
193 <emphasis role="bold">P</emphasis>eta-, or
194 <emphasis role="bold">E</emphasis>xabytes.</para>
196 <literal>--lazy</literal> option is specified, any OST that is
197 currently disconnected from the client will be skipped. Using
199 <literal>--lazy</literal> option prevents the
200 <literal>df</literal> output from being blocked when an OST is
201 offline. Only the space on the OSTs that can currently be
202 accessed are returned. The
203 <literal>llite.*.lazystatfs</literal> tunable can be enabled to
204 make this the default behaviour for all
205 <literal>statfs()</literal> operations.</para>
209 <entry nameend="c2" namest="c1">
211 <literal>find</literal>
215 <para>Searches the directory tree rooted at the given
216 directory/filename for files that match the given
219 <literal>!</literal> before an option negates its meaning (files
220 NOT matching the parameter). Using
221 <literal>+</literal> before a numeric value means files with the
222 parameter OR MORE. Using
223 <literal>-</literal> before a numeric value means files with the
224 parameter OR LESS.</para>
230 <literal>--atime</literal>
233 <para>File was last accessed N*24 hours ago. (There is no
235 <literal>atime</literal> is kept coherent across the
237 <para>OSTs store a transient
238 <literal>atime</literal> that is updated when clients do read
240 <literal>atime</literal> is written to the MDS when the file is
241 closed. However, on-disk atime is only updated if it is more
242 than 60 seconds old (
243 <literal>/proc/fs/lustre/mds/*/max_atime_diff</literal>). The
244 Lustre software considers the latest
245 <literal>atime</literal> from all OSTs. If a
246 <literal>setattr</literal> is set by user, then it is updated on
247 both the MDS and OST, allowing the
248 <literal>atime</literal> to go backward.</para>
257 <literal>--ctime</literal>
261 <para>File status was last changed N*24 hours ago.</para>
270 <literal>--mtime</literal>
274 <para>File data was last modified N*24 hours ago.</para>
283 <literal>--obd</literal>
287 <para>File has an object on a specific OST(s).</para>
296 <literal>--size</literal>
300 <para>File has a size in bytes, or kilo-, Mega-, Giga-, Tera-,
301 Peta- or Exabytes if a suffix is given.</para>
310 <literal>--type</literal>
314 <para>File has the type - block, character, directory, pipe,
315 file, symlink, socket or door (used in Solaris operating
325 <literal>--uid</literal>
329 <para>File has a specific numeric user ID.</para>
338 <literal>--user</literal>
342 <para>File owned by a specific user (numeric user ID
352 <literal>--gid</literal>
356 <para>File has a specific group ID.</para>
365 <literal>--group</literal>
369 <para>File belongs to a specific group (numeric group ID
379 <literal>-maxdepth</literal></para>
382 <para>Limits find to descend at most N levels of the directory
392 <literal>--print</literal>/
393 <literal>--print0</literal></para>
396 <para>Prints the full filename, followed by a new line or NULL
397 character correspondingly.</para>
401 <entry nameend="c2" namest="c1">
403 <literal>osts [path]</literal>
407 <para>Lists all OSTs for the file system. If a path located on
408 a mounted Lustre file system is specified, then only OSTs
409 belonging to this file system are displayed.</para>
413 <entry nameend="c2" namest="c1">
415 <literal>getname [path...]</literal>
419 <para>List each Lustre file system instance associated with
420 each Lustre mount point. If no path is specified, all Lustre
421 mount points are interrogated. If a list of paths is provided,
422 the instance of each path is provided. If the path is not a
423 Lustre instance 'No such device' is returned.</para>
427 <entry nameend="c2" namest="c1">
429 <literal>getstripe</literal>
433 <para>Lists striping information for a given filename or
434 directory. By default, the stripe count, stripe size and offset
436 <para>If you only want specific striping information, then the
438 <literal>--count</literal>,
439 <literal>--size</literal>,
440 <literal>--index</literal> or
441 <literal>--offset</literal> plus various combinations of these
442 options can be used to retrieve specific information.</para>
444 <literal>--raw</literal> option is specified, the stripe
445 information is printed without substituting the file system
446 default values for unspecified fields. If the striping EA is
447 not set, 0, 0, and -1 will be printed for the stripe count,
448 size, and offset respectively.</para>
449 <para condition="l24">The
450 <literal>-M</literal> prints the index of the MDT for a given
452 <xref linkend="dbdoclet.rmremotedir" />.</para>
462 <replaceable>ost_name</replaceable></literal>
466 <para>Lists files that have an object on a specific OST.</para>
475 <literal>--quiet</literal>
479 <para>Lists details about the file's object ID
489 <literal>--verbose</literal>
493 <para>Prints additional striping information.</para>
502 <literal>--count</literal>
506 <para>Lists the stripe count (how many OSTs to use).</para>
515 <literal>--index</literal>
519 <para>Lists the index for each OST in the file system.</para>
528 <literal>--offset</literal>
532 <para>Lists the OST index on which file striping starts.</para>
541 <literal>--pool</literal>
545 <para>Lists the pools to which a file belongs.</para>
554 <literal>--size</literal>
558 <para>Lists the stripe size (how much data to write to one OST
559 before moving to the next OST).</para>
568 <literal>--directory</literal>
572 <para>Lists entries about a specified directory instead of its
573 contents (in the same manner as
574 <literal>ls -d</literal>).</para>
583 <literal>--recursive</literal>
587 <para>Recurses into all sub-directories.</para>
591 <entry nameend="c2" namest="c1">
593 <literal>setstripe</literal>
597 <para>Create new files with a specific file layout (stripe
598 pattern) configuration.
600 <para>The file cannot exist prior to using
601 <literal>setstripe</literal>. A directory must exist prior to
603 <literal>setstripe</literal>.</para>
613 <literal>--count stripe_cnt</literal>
617 <para>Number of OSTs over which to stripe a file. A
618 <literal>stripe_cnt</literal> of 0 uses the file system-wide
619 default stripe count (default is 1). A
620 <literal>stripe_cnt</literal> of -1 stripes over all available
630 <literal>--size stripe_size</literal>
632 <para>The default stripe-size is 0. The default start-ost is
633 -1. Do NOT confuse them! If you set start-ost to 0, all new
634 file creations occur on OST 0 (seldom a good idea).</para>
635 </footnote> </para>
638 <para>Number of bytes to store on an OST before moving to the
639 next OST. A stripe_size of 0 uses the file system's default
640 stripe size, (default is 1 MB). Can be specified with
641 <emphasis role="bold">k</emphasis>(KB),
642 <emphasis role="bold">m</emphasis>(MB), or
643 <emphasis role="bold">g</emphasis>(GB), respectively.</para>
652 <literal>--stripe-index start_ost_index</literal>
656 <para>The OST index (base 10, starting at 0) on which to start
657 striping for this file. A start_ost_index value of -1 allows
658 the MDS to choose the starting index. This is the default
659 value, and it means that the MDS selects the starting OST as it
660 wants. We strongly recommend selecting this default, as it
661 allows space and load balancing to be done by the MDS as
663 <literal>start_ost_index</literal> value has no relevance on
664 whether the MDS will use round-robin or QoS weighted allocation
665 for the remaining stripes in the file.</para>
674 <literal>--ost-index ost_indices</literal>
678 <para>This option is used to specify the exact stripe
679 layout on the the file system. <literal>ost_indices</literal>
680 is a list of OSTs referenced by their indices and index ranges
681 separated by commas, e.g. <literal>1,2-4,7</literal>.</para>
691 <replaceable>pool</replaceable></literal>
695 <para>Name of the pre-defined pool of OSTs (see
696 <xref linkend="dbdoclet.50438219_38274" />) that will be used
698 <literal>stripe_cnt</literal>,
699 <literal>stripe_size</literal> and
700 <literal>start_ost</literal> values are used as well. The
701 start-ost value must be part of the pool or an error is
706 <entry nameend="c2" namest="c1">
708 <literal>setstripe -d</literal>
712 <para>Deletes default striping on the specified
717 <entry nameend="c2" namest="c1">
719 <literal>poollist {filesystem}
720 [.poolname]|{pathname}</literal>
724 <para>Lists pools in the file system or pathname, or OSTs in
725 the file system's pool.</para>
729 <entry nameend="c2" namest="c1">
731 <literal>quota [-q] [-v] [-o
732 <replaceable>obd_uuid</replaceable>|-i
733 <replaceable>mdt_idx</replaceable>|-I
734 <replaceable>ost_idx</replaceable>] [-u|-g
735 <replaceable>uname|uid|gname|gid]</replaceable>
736 <replaceable>/mount_point</replaceable></literal>
741 <para>Displays disk usage and limits, either for the full file
742 system or for objects on a specific OBD. A user or group name
743 or an ID can be specified. If both user and group are omitted,
744 quotas for the current UID/GID are shown. The
745 <literal>-q</literal> option disables printing of additional
746 descriptions (including column titles). It fills in blank
748 <literal>grace</literal> column with zeros (when there is no
749 grace period set), to ensure that the number of columns is
751 <literal>-v</literal> option provides more verbose (per-OBD
752 statistics) output.</para>
756 <entry nameend="c2" namest="c1">
759 <replaceable>-u|-g</replaceable>
760 <replaceable>/mount_point</replaceable></literal>
764 <para>Displays block and inode grace times for user (
765 <literal>-u</literal>) or group (
766 <literal>-g</literal>) quotas.</para>
770 <entry nameend="c2" namest="c1">
772 <literal>quotachown</literal>
776 <para>Changes the file's owner and group on OSTs of the
777 specified file system.</para>
781 <entry nameend="c2" namest="c1">
783 <literal>quotacheck [-ugf]
784 <replaceable>/mount_point</replaceable></literal>
788 <para>Scans the specified file system for disk usage, and
789 creates or updates quota files. Options specify quota for users
791 <literal>-u</literal>), groups (
792 <literal>-g</literal>), and force (
793 <literal>-f</literal>).</para>
797 <entry nameend="c2" namest="c1">
799 <literal>quotaon [-ugf]
800 <replaceable>/mount_point</replaceable></literal>
804 <para>Turns on file system quotas. Options specify quota for
806 <literal>-u</literal>), groups (
807 <literal>-g</literal>), and force (
808 <literal>-f</literal>).</para>
812 <entry nameend="c2" namest="c1">
814 <literal>quotaoff [-ugf]
815 <replaceable>/mount_point</replaceable></literal>
819 <para>Turns off file system quotas. Options specify quota for
821 <literal>-u</literal>), groups (
822 <literal>-g</literal>), and force (
823 <literal>-f</literal>).</para>
827 <entry nameend="c2" namest="c1">
829 <literal>quotainv [-ug] [-f]
830 <replaceable>/mount_point</replaceable></literal>
834 <para>Clears quota files (administrative quota files if used
836 <literal>-f</literal>, operational quota files otherwise), all
837 of their quota entries for users (
838 <literal>-u</literal>) or groups (
839 <literal>-g</literal>). After running
840 <literal>quotainv</literal>, you must run
841 <literal>quotacheck</literal> before using quotas.</para>
843 <para>Use extreme caution when using this command; its
844 results cannot be undone.</para>
849 <entry nameend="c2" namest="c1">
851 <literal>setquota -u|-g
853 uname|uid|gname|gid}</replaceable>[--block-softlimit
854 <replaceable>block_softlimit</replaceable>]
856 <replaceable>block_hardlimit</replaceable>]
858 <replaceable>inode_softlimit</replaceable>]
860 <replaceable>inode_hardlimit</replaceable>]
861 <replaceable>/mount_point</replaceable></literal>
865 <para>Sets file system quotas for users or groups. Limits can
867 <literal>--{block|inode}-{softlimit|hardlimit}</literal> or
868 their short equivalents
869 <literal>-b</literal>,
870 <literal>-B</literal>,
871 <literal>-i</literal>,
872 <literal>-I</literal>. Users can set 1, 2, 3 or 4 limits.
875 <literal>setquota</literal> interface is supported, but it may
876 be removed in a future Lustre software release.</para>
877 </footnote>Also, limits can be specified with special suffixes,
878 -b, -k, -m, -g, -t, and -p to indicate units of 1, 2^10, 2^20,
879 2^30, 2^40 and 2^50, respectively. By default, the block limits
880 unit is 1 kilobyte (1,024), and block limits are always
881 kilobyte-grained (even if specified in bytes). See
882 <xref linkend="dbdoclet.50438206_11903" />.</para>
886 <entry nameend="c2" namest="c1">
888 <literal>setquota -t -u|-g [--block-grace
889 <replaceable>block_grace</replaceable>] [--inode-grace
890 <replaceable>inode_grace</replaceable>]
891 <replaceable>/mount_point</replaceable></literal>
895 <para>Sets the file system quota grace times for users or
896 groups. Grace time is specified in '
897 <literal>XXwXXdXXhXXmXXs</literal>' format or as an integer
899 <xref linkend="dbdoclet.50438206_11903" />.</para>
903 <entry nameend="c2" namest="c1">
905 <literal>help</literal>
909 <para>Provides brief help on various
910 <literal>lfs</literal> arguments.</para>
914 <entry nameend="c2" namest="c1">
916 <literal>exit/quit</literal>
920 <para>Quits the interactive
921 <literal>lfs</literal> session.</para>
929 <title xml:id="dbdoclet.50438206_11903">Examples</title>
930 <para>Creates a file striped on two OSTs with 128 KB on each
933 $ lfs setstripe -s 128k -c 2 /mnt/lustre/file1
935 <para>Deletes a default stripe pattern on a given directory. New files
936 use the default striping pattern.</para>
938 $ lfs setstripe -d /mnt/lustre/dir
940 <para>Lists the detailed object allocation of a given file.</para>
942 $ lfs getstripe -v /mnt/lustre/file1
944 <para>List all the mounted Lustre file systems and corresponding Lustre
949 <para>Efficiently lists all files in a given directory and its
950 subdirectories.</para>
952 $ lfs find /mnt/lustre
954 <para>Recursively lists all regular files in a given directory more than
957 $ lfs find /mnt/lustre -mtime +30 -type f -print
959 <para>Recursively lists all files in a given directory that have objects
960 on OST2-UUID. The lfs check servers command checks the status of all
961 servers (MDT and OSTs).</para>
963 $ lfs find --obd OST2-UUID /mnt/lustre/
965 <para>Lists all OSTs in the file system.</para>
969 <para>Lists space usage per OST and MDT in human-readable format.</para>
973 <para>Lists inode usage per OST and MDT.</para>
977 <para>List space or inode usage for a specific OST pool.</para>
980 <replaceable>filesystem</replaceable>[.
981 <replaceable>pool</replaceable>] |
982 <replaceable>pathname</replaceable>
984 <para>List quotas of user 'bob'.</para>
986 $ lfs quota -u bob /mnt/lustre
988 <para>Show grace times for user quotas on
989 <literal>/mnt/lustre</literal>.</para>
991 $ lfs quota -t -u /mnt/lustre
993 <para>Changes file owner and group.</para>
995 $ lfs quotachown -i /mnt/lustre
997 <para>Checks quotas for user and group. Turns on quotas after making the
1000 $ lfs quotacheck -ug /mnt/lustre
1002 <para>Turns on quotas of user and group.</para>
1004 $ lfs quotaon -ug /mnt/lustre
1006 <para>Turns off quotas of user and group.</para>
1008 $ lfs quotaoff -ug /mnt/lustre
1010 <para>Sets quotas of user 'bob', with a 1 GB block quota hardlimit and a
1011 2 GB block quota softlimit.</para>
1013 $ lfs setquota -u bob --block-softlimit 2000000 --block-hardlimit 1000000
1016 <para>Sets grace times for user quotas: 1000 seconds for block quotas, 1
1017 week and 4 days for inode quotas.</para>
1019 $ lfs setquota -t -u --block-grace 1000 --inode-grace 1w4d /mnt/lustre
1021 <para>Checks the status of all servers (MDT, OST)</para>
1025 <para>Creates a file striped on two OSTs from the pool
1026 <literal>my_pool</literal></para>
1028 $ lfs setstripe --pool my_pool -c 2 /mnt/lustre/file
1030 <para>Lists the pools defined for the mounted Lustre file system
1031 <literal>/mnt/lustre</literal></para>
1033 $ lfs poollist /mnt/lustre/
1035 <para>Lists the OSTs which are members of the pool
1036 <literal>my_pool</literal> in file system
1037 <literal>my_fs</literal></para>
1039 $ lfs poollist my_fs.my_pool
1041 <para>Finds all directories/files associated with
1042 <literal>poolA</literal>.</para>
1044 $ lfs find /mnt/lustre --pool poolA
1046 <para>Finds all directories/files not associated with a pool.</para>
1048 $ lfs find /mnt//lustre --pool ""
1050 <para>Finds all directories/files associated with pool.</para>
1052 $ lfs find /mnt/lustre ! --pool ""
1054 <para>Associates a directory with the pool
1055 <literal>my_pool</literal>, so all new files and directories are created
1058 $ lfs setstripe --pool my_pool /mnt/lustre/dir
1061 <section remap="h5">
1062 <title>See Also</title>
1064 <xref linkend="dbdoclet.50438219_38274" />
1068 <section xml:id="dbdoclet.50438206_42260">
1071 <primary>lfs_migrate</primary>
1073 <literal>lfs_migrate</literal>
1076 <literal>lfs_migrate</literal> utility is a simple tool to migrate files
1077 between Lustre OSTs.</para>
1078 <section remap="h5">
1079 <title>Synopsis</title>
1081 lfs_migrate [-c <replaceable>stripecount</replaceable>] [-h] [-l] [-n] [-q] [-R] [-s] [-y]
1082 [file|directory ...]
1085 <section remap="h5">
1086 <title>Description</title>
1088 <literal>lfs_migrate</literal> utility is a simple tool to assist
1089 migration of files between Lustre OSTs. The utility copies each specified
1090 file to a new file, verifies the file contents have not changed, and then
1091 renames the new file to the original filename. This allows balanced space
1092 usage between OSTs, moving files off OSTs that are starting to show
1093 hardware problems (though are still functional) or OSTs that will be
1094 discontinued.</para>
1096 <para>For versions of Lustre before 2.5,
1097 <literal>lfs_migrate</literal> is not closely integrated with the MDS,
1098 it cannot determine whether a file is currently open and/or in-use by
1099 other applications or nodes. This makes it UNSAFE for use on files that
1100 might be modified by other applications, since the migrated file is
1101 only a copy of the current file. This results in the old file becoming
1102 an open-unlinked file and any modifications to that file are
1105 <para>Files to be migrated can be specified as command-line arguments. If
1106 a directory is specified on the command-line then all files within the
1107 directory are migrated. If no files are specified on the command-line,
1108 then a list of files is read from the standard input, making
1109 <literal>lfs_migrate</literal> suitable for use with
1110 <literal>lfs</literal> find to locate files on specific OSTs and/or
1111 matching other file attributes.</para>
1112 <para>The current file allocation policies on the MDS dictate where the
1113 new files are placed, taking into account whether specific OSTs have been
1114 disabled on the MDS via
1115 <literal>lctl</literal>(preventing new files from being allocated there),
1116 whether some OSTs are overly full (reducing the number of files placed on
1117 those OSTs), or if there is a specific default file striping for the
1118 target directory (potentially changing the stripe count, stripe size, OST
1119 pool, or OST index of a new file).</para>
1122 <literal>lfs_migrate</literal> utility can also be used in some cases to
1125 <primary>fragmentation</primary>
1126 </indexterm>fragmentation. File fragmentation will typically reduce
1127 Lustre file system performance. File fragmentation may be observed on
1128 an aged file system and will commonly occur if the file was written by
1129 many threads. Provided there is sufficient free space (or if it was
1130 written when the file system was nearly full) that is less fragmented
1131 than the file being copied, re-writing a file with
1132 <literal>lfs_migrate</literal> will result in a migrated file with
1133 reduced fragmentation. The tool
1134 <literal>filefrag</literal> can be used to report file fragmentation.
1136 <xref linkend="dbdoclet.50438206_75125" /></para>
1139 <para>As long as a file has extent lengths of tens of megabytes (
1140 <replaceable>read_bandwidth * seek_time</replaceable>) or more, the
1141 read performance for the file will not be significantly impacted by
1142 fragmentation, since the read pipeline can be filled by large reads
1143 from disk even with an occasional disk seek.</para>
1146 <section remap="h5">
1147 <title>Options</title>
1148 <para>Options supporting
1149 <literal>lfs_migrate</literal> are described below.</para>
1150 <informaltable frame="all">
1152 <colspec colname="c1" colwidth="50*" />
1153 <colspec colname="c2" colwidth="50*" />
1158 <emphasis role="bold">Option</emphasis>
1163 <emphasis role="bold">Description</emphasis>
1173 <replaceable>stripecount</replaceable></literal>
1177 <para>Restripe file using the specified stripe count. This
1178 option may not be specified at the same time as the
1179 <literal>-R</literal> option.</para>
1185 <literal>-h</literal>
1189 <para>Display help information.</para>
1194 <literal>-l</literal>
1197 <para>Migrate files with hard links (skips, by default). Files
1198 with multiple hard links are split into multiple separate files
1200 <literal>lfs_migrate</literal>, so they are skipped, by
1201 default, to avoid breaking the hard links.</para>
1206 <literal>-n</literal>
1209 <para>Only print the names of files to be migrated.</para>
1215 <literal>-q</literal>
1219 <para>Run quietly (does not print filenames or status).</para>
1224 <literal>-R</literal>
1226 <entry>Restripe file using default directory striping instead of
1227 keeping striping. This option may not be specified at the same
1229 <literal>-c</literal> option.</entry>
1233 <literal>-s</literal>
1235 <entry>Skip file data comparison after migrate. Default is to
1236 compare migrated file against original to verify
1237 correctness.</entry>
1242 <literal>-y</literal>
1247 <literal>y</literal>' to usage warning without prompting (for
1248 scripts, use with caution).</para>
1255 <section remap="h5">
1256 <title>Examples</title>
1257 <para>Rebalances all files in
1258 <literal>/mnt/lustre/dir</literal>.</para>
1260 $ lfs_migrate /mnt/lustre/file
1262 <para>Migrates files in /test filesystem on OST004 larger than 4 GB in
1265 $ lfs find /test -obd test-OST004 -size +4G | lfs_migrate -y
1268 <section remap="h5">
1269 <title>See Also</title>
1271 <xref linkend="dbdoclet.50438206_94597" />
1275 <section xml:id="dbdoclet.50438206_75125">
1278 <primary>filefrag</primary>
1280 <literal>filefrag</literal>
1283 <literal>e2fsprogs</literal> package contains the
1284 <literal>filefrag</literal> tool which reports the extent of file
1285 fragmentation.</para>
1286 <section remap="h5">
1287 <title>Synopsis</title>
1289 filefrag [ -belsv ] [ files... ]
1292 <section remap="h5">
1293 <title>Description</title>
1295 <literal>filefrag</literal> utility reports the extent of fragmentation in
1297 <literal>filefrag</literal> utility obtains the extent information from
1298 Lustre files using the
1299 <literal>FIEMAP ioctl</literal>, which is efficient and fast, even for
1300 very large files.</para>
1301 <para>In default mode
1303 <para>The default mode is faster than the verbose/extent mode since it
1304 only counts the number of extents.</para>
1306 <literal>filefrag</literal> prints the number of physically discontiguous
1307 extents in the file. In extent or verbose mode, each extent is printed
1308 with details such as the blocks allocated on each OST. For a Lustre file
1309 system, the extents are printed in device offset order (i.e. all of the
1310 extents for one OST first, then the next OST, etc.), not file logical
1311 offset order. If the file logical offset order was used, the Lustre
1312 striping would make the output very verbose and difficult to see if there
1313 was file fragmentation or not.</para>
1315 <para>Note that as long as a file has extent lengths of tens of
1316 megabytes or more (i.e.
1317 <replaceable>read_bandwidth * seek_time >
1318 extent_length</replaceable>), the read performance for the file will
1319 not be significantly impacted by fragmentation, since file readahead
1320 can fully utilize the disk disk bandwidth even with occasional
1323 <para>In default mode
1325 <para>The default mode is faster than the verbose/extent mode.</para>
1327 <literal>filefrag</literal> returns the number of physically discontiguous
1328 extents in the file. In extent or verbose mode, each extent is printed
1329 with details. For a Lustre file system, the extents are printed in device
1330 offset order, not logical offset order.</para>
1332 <section remap="h5">
1333 <title>Options</title>
1334 <para>The options and descriptions for the
1335 <literal>filefrag</literal> utility are listed below.</para>
1336 <informaltable frame="all">
1338 <colspec colname="c1" colwidth="50*" />
1339 <colspec colname="c2" colwidth="50*" />
1344 <emphasis role="bold">Option</emphasis>
1349 <emphasis role="bold">Description</emphasis>
1358 <literal>-b</literal>
1362 <para>Uses the 1024-byte blocksize for the output. By default,
1363 this blocksize is used by the Lustre file system, since OSTs
1364 may use different block sizes.</para>
1370 <literal>-e</literal>
1374 <para>Uses the extent mode when printing the output. This is
1375 the default for Lustre files in verbose mode.</para>
1381 <literal>-l</literal>
1385 <para>Displays extents in LUN offset order. This is the only
1386 available mode for Lustre.</para>
1392 <literal>-s</literal>
1396 <para>Synchronizes any unwritten file data to disk before
1397 requesting the mapping.</para>
1403 <literal>-v</literal>
1407 <para>Prints the file's layout in verbose mode when checking
1408 file fragmentation, including the logical to physical mapping
1409 for each extent in the file and the OST index.</para>
1416 <section remap="h5">
1417 <title>Examples</title>
1418 <para>Lists default output.</para>
1420 $ filefrag /mnt/lustre/foo
1421 /mnt/lustre/foo: 13 extents found
1423 <para>Lists verbose output in extent format.</para>
1425 $ filefrag -v /mnt/lustre/foo
1426 Filesystem type is: bd00bd0
1427 File size of /mnt/lustre/foo is 1468297786 (1433888 blocks of 1024 bytes)
1428 ext: device_logical: physical_offset: length: dev: flags:
1429 0: 0.. 122879: 2804679680..2804802559: 122880: 0002: network
1430 1: 122880.. 245759: 2804817920..2804940799: 122880: 0002: network
1431 2: 245760.. 278527: 2804948992..2804981759: 32768: 0002: network
1432 3: 278528.. 360447: 2804982784..2805064703: 81920: 0002: network
1433 4: 360448.. 483327: 2805080064..2805202943: 122880: 0002: network
1434 5: 483328.. 606207: 2805211136..2805334015: 122880: 0002: network
1435 6: 606208.. 729087: 2805342208..2805465087: 122880: 0002: network
1436 7: 729088.. 851967: 2805473280..2805596159: 122880: 0002: network
1437 8: 851968.. 974847: 2805604352..2805727231: 122880: 0002: network
1438 9: 974848.. 1097727: 2805735424..2805858303: 122880: 0002: network
1439 10: 1097728.. 1220607: 2805866496..2805989375: 122880: 0002: network
1440 11: 1220608.. 1343487: 2805997568..2806120447: 122880: 0002: network
1441 12: 1343488.. 1433599: 2806128640..2806218751: 90112: 0002: network
1442 /mnt/lustre/foo: 13 extents found
1446 <section xml:id="dbdoclet.50438206_86244">
1449 <primary>mount</primary>
1451 <literal>mount</literal>
1454 <literal>mount(8)</literal> Linux command is used to mount a Lustre file
1455 system. When mounting a Lustre file system, mount(8) executes the
1456 <literal>/sbin/mount.lustre</literal> command to complete the mount. The
1457 mount command supports these options specific to a Lustre file
1459 <informaltable frame="all">
1461 <colspec colname="c1" colwidth="50*" />
1462 <colspec colname="c2" colwidth="50*" />
1467 <emphasis role="bold">Server options</emphasis>
1472 <emphasis role="bold">Description</emphasis>
1481 <literal>abort_recov</literal>
1485 <para>Aborts recovery when starting a target</para>
1491 <literal>nosvc</literal>
1495 <para>Starts only MGS/MGC servers</para>
1501 <literal>nomgs</literal>
1505 <para>Start a MDT with a co-located MGS without starting the
1512 <literal>exclude</literal>
1516 <para>Starts with a dead OST</para>
1522 <literal>md_stripe_cache_size</literal>
1526 <para>Sets the stripe cache size for server side disk with a
1527 striped raid configuration</para>
1533 <informaltable frame="all">
1535 <colspec colname="c1" colwidth="50*" />
1536 <colspec colname="c2" colwidth="50*" />
1541 <emphasis role="bold">Client options</emphasis>
1546 <emphasis role="bold">Description</emphasis>
1555 <literal>flock/noflock/localflock</literal>
1559 <para>Enables/disables global flock or local flock support</para>
1565 <literal>user_xattr/nouser_xattr</literal>
1569 <para>Enables/disables user-extended attributes</para>
1575 <literal>user_fid2path/nouser_fid2path</literal>
1579 <para condition="l23">Enables/disables FID to path translation by
1580 regular users</para>
1586 <literal>retry=</literal>
1590 <para>Number of times a client will retry to mount the file
1598 <section xml:id="dbdoclet.50438206_56217">
1599 <title>Handling Timeouts</title>
1600 <para>Timeouts are the most common cause of hung applications. After a
1601 timeout involving an MDS or failover OST, applications attempting to access
1602 the disconnected resource wait until the connection gets
1604 <para>When a client performs any remote operation, it gives the server a
1605 reasonable amount of time to respond. If a server does not reply either due
1606 to a down network, hung server, or any other reason, a timeout occurs which
1607 requires a recovery.</para>
1608 <para>If a timeout occurs, a message (similar to this one), appears on the
1609 console of the client, and in
1610 <literal>/var/log/messages</literal>:</para>
1612 LustreError: 26597:(client.c:810:ptlrpc_expire_one_request()) @@@ timeout
1614 req@a2d45200 x5886/t0 o38->mds_svc_UUID@NID_mds_UUID:12 lens 168/64 ref 1 fl