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 pool_list <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>pool_list {filesystem}[.poolname]|{pathname}</literal>
723 <para>Lists pools in the file system or pathname, or OSTs in
724 the file system's pool.</para>
728 <entry nameend="c2" namest="c1">
730 <literal>quota [-q] [-v] [-o
731 <replaceable>obd_uuid</replaceable>|-i
732 <replaceable>mdt_idx</replaceable>|-I
733 <replaceable>ost_idx</replaceable>] [-u|-g
734 <replaceable>uname|uid|gname|gid]</replaceable>
735 <replaceable>/mount_point</replaceable></literal>
740 <para>Displays disk usage and limits, either for the full file
741 system or for objects on a specific OBD. A user or group name
742 or an ID can be specified. If both user and group are omitted,
743 quotas for the current UID/GID are shown. The
744 <literal>-q</literal> option disables printing of additional
745 descriptions (including column titles). It fills in blank
747 <literal>grace</literal> column with zeros (when there is no
748 grace period set), to ensure that the number of columns is
750 <literal>-v</literal> option provides more verbose (per-OBD
751 statistics) output.</para>
755 <entry nameend="c2" namest="c1">
758 <replaceable>-u|-g</replaceable>
759 <replaceable>/mount_point</replaceable></literal>
763 <para>Displays block and inode grace times for user (
764 <literal>-u</literal>) or group (
765 <literal>-g</literal>) quotas.</para>
769 <entry nameend="c2" namest="c1">
771 <literal>quotachown</literal>
775 <para>Changes the file's owner and group on OSTs of the
776 specified file system.</para>
780 <entry nameend="c2" namest="c1">
782 <literal>quotacheck [-ugf]
783 <replaceable>/mount_point</replaceable></literal>
787 <para>Scans the specified file system for disk usage, and
788 creates or updates quota files. Options specify quota for users
790 <literal>-u</literal>), groups (
791 <literal>-g</literal>), and force (
792 <literal>-f</literal>).</para>
796 <entry nameend="c2" namest="c1">
798 <literal>quotaon [-ugf]
799 <replaceable>/mount_point</replaceable></literal>
803 <para>Turns on file system quotas. Options specify quota for
805 <literal>-u</literal>), groups (
806 <literal>-g</literal>), and force (
807 <literal>-f</literal>).</para>
811 <entry nameend="c2" namest="c1">
813 <literal>quotaoff [-ugf]
814 <replaceable>/mount_point</replaceable></literal>
818 <para>Turns off file system quotas. Options specify quota for
820 <literal>-u</literal>), groups (
821 <literal>-g</literal>), and force (
822 <literal>-f</literal>).</para>
826 <entry nameend="c2" namest="c1">
828 <literal>quotainv [-ug] [-f]
829 <replaceable>/mount_point</replaceable></literal>
833 <para>Clears quota files (administrative quota files if used
835 <literal>-f</literal>, operational quota files otherwise), all
836 of their quota entries for users (
837 <literal>-u</literal>) or groups (
838 <literal>-g</literal>). After running
839 <literal>quotainv</literal>, you must run
840 <literal>quotacheck</literal> before using quotas.</para>
842 <para>Use extreme caution when using this command; its
843 results cannot be undone.</para>
848 <entry nameend="c2" namest="c1">
850 <literal>setquota -u|-g
852 uname|uid|gname|gid}</replaceable>[--block-softlimit
853 <replaceable>block_softlimit</replaceable>]
855 <replaceable>block_hardlimit</replaceable>]
857 <replaceable>inode_softlimit</replaceable>]
859 <replaceable>inode_hardlimit</replaceable>]
860 <replaceable>/mount_point</replaceable></literal>
864 <para>Sets file system quotas for users or groups. Limits can
866 <literal>--{block|inode}-{softlimit|hardlimit}</literal> or
867 their short equivalents
868 <literal>-b</literal>,
869 <literal>-B</literal>,
870 <literal>-i</literal>,
871 <literal>-I</literal>. Users can set 1, 2, 3 or 4 limits.
874 <literal>setquota</literal> interface is supported, but it may
875 be removed in a future Lustre software release.</para>
876 </footnote>Also, limits can be specified with special suffixes,
877 -b, -k, -m, -g, -t, and -p to indicate units of 1, 2^10, 2^20,
878 2^30, 2^40 and 2^50, respectively. By default, the block limits
879 unit is 1 kilobyte (1,024), and block limits are always
880 kilobyte-grained (even if specified in bytes). See
881 <xref linkend="dbdoclet.50438206_11903" />.</para>
885 <entry nameend="c2" namest="c1">
887 <literal>setquota -t -u|-g [--block-grace
888 <replaceable>block_grace</replaceable>] [--inode-grace
889 <replaceable>inode_grace</replaceable>]
890 <replaceable>/mount_point</replaceable></literal>
894 <para>Sets the file system quota grace times for users or
895 groups. Grace time is specified in '
896 <literal>XXwXXdXXhXXmXXs</literal>' format or as an integer
898 <xref linkend="dbdoclet.50438206_11903" />.</para>
902 <entry nameend="c2" namest="c1">
904 <literal>help</literal>
908 <para>Provides brief help on various
909 <literal>lfs</literal> arguments.</para>
913 <entry nameend="c2" namest="c1">
915 <literal>exit/quit</literal>
919 <para>Quits the interactive
920 <literal>lfs</literal> session.</para>
928 <title xml:id="dbdoclet.50438206_11903">Examples</title>
929 <para>Creates a file striped on two OSTs with 128 KB on each
932 $ lfs setstripe -s 128k -c 2 /mnt/lustre/file1
934 <para>Deletes a default stripe pattern on a given directory. New files
935 use the default striping pattern.</para>
937 $ lfs setstripe -d /mnt/lustre/dir
939 <para>Lists the detailed object allocation of a given file.</para>
941 $ lfs getstripe -v /mnt/lustre/file1
943 <para>List all the mounted Lustre file systems and corresponding Lustre
948 <para>Efficiently lists all files in a given directory and its
949 subdirectories.</para>
951 $ lfs find /mnt/lustre
953 <para>Recursively lists all regular files in a given directory more than
956 $ lfs find /mnt/lustre -mtime +30 -type f -print
958 <para>Recursively lists all files in a given directory that have objects
959 on OST2-UUID. The lfs check servers command checks the status of all
960 servers (MDT and OSTs).</para>
962 $ lfs find --obd OST2-UUID /mnt/lustre/
964 <para>Lists all OSTs in the file system.</para>
968 <para>Lists space usage per OST and MDT in human-readable format.</para>
972 <para>Lists inode usage per OST and MDT.</para>
976 <para>List space or inode usage for a specific OST pool.</para>
979 <replaceable>filesystem</replaceable>[.
980 <replaceable>pool</replaceable>] |
981 <replaceable>pathname</replaceable>
983 <para>List quotas of user 'bob'.</para>
985 $ lfs quota -u bob /mnt/lustre
987 <para>Show grace times for user quotas on
988 <literal>/mnt/lustre</literal>.</para>
990 $ lfs quota -t -u /mnt/lustre
992 <para>Changes file owner and group.</para>
994 $ lfs quotachown -i /mnt/lustre
996 <para>Checks quotas for user and group. Turns on quotas after making the
999 $ lfs quotacheck -ug /mnt/lustre
1001 <para>Turns on quotas of user and group.</para>
1003 $ lfs quotaon -ug /mnt/lustre
1005 <para>Turns off quotas of user and group.</para>
1007 $ lfs quotaoff -ug /mnt/lustre
1009 <para>Sets quotas of user 'bob', with a 1 GB block quota hardlimit and a
1010 2 GB block quota softlimit.</para>
1012 $ lfs setquota -u bob --block-softlimit 2000000 --block-hardlimit 1000000
1015 <para>Sets grace times for user quotas: 1000 seconds for block quotas, 1
1016 week and 4 days for inode quotas.</para>
1018 $ lfs setquota -t -u --block-grace 1000 --inode-grace 1w4d /mnt/lustre
1020 <para>Checks the status of all servers (MDT, OST)</para>
1024 <para>Creates a file striped on two OSTs from the pool
1025 <literal>my_pool</literal></para>
1027 $ lfs setstripe --pool my_pool -c 2 /mnt/lustre/file
1029 <para>Lists the pools defined for the mounted Lustre file system
1030 <literal>/mnt/lustre</literal></para>
1032 $ lfs pool_list /mnt/lustre/
1034 <para>Lists the OSTs which are members of the pool
1035 <literal>my_pool</literal> in file system
1036 <literal>my_fs</literal></para>
1038 $ lfs pool_list my_fs.my_pool
1040 <para>Finds all directories/files associated with
1041 <literal>poolA</literal>.</para>
1043 $ lfs find /mnt/lustre --pool poolA
1045 <para>Finds all directories/files not associated with a pool.</para>
1047 $ lfs find /mnt//lustre --pool ""
1049 <para>Finds all directories/files associated with pool.</para>
1051 $ lfs find /mnt/lustre ! --pool ""
1053 <para>Associates a directory with the pool
1054 <literal>my_pool</literal>, so all new files and directories are created
1057 $ lfs setstripe --pool my_pool /mnt/lustre/dir
1060 <section remap="h5">
1061 <title>See Also</title>
1063 <xref linkend="dbdoclet.50438219_38274" />
1067 <section xml:id="dbdoclet.50438206_42260">
1070 <primary>lfs_migrate</primary>
1072 <literal>lfs_migrate</literal>
1075 <literal>lfs_migrate</literal> utility is a simple tool to migrate files
1076 between Lustre OSTs.</para>
1077 <section remap="h5">
1078 <title>Synopsis</title>
1080 lfs_migrate [-c <replaceable>stripecount</replaceable>] [-h] [-l] [-n] [-q] [-R] [-s] [-y]
1081 [file|directory ...]
1084 <section remap="h5">
1085 <title>Description</title>
1087 <literal>lfs_migrate</literal> utility is a simple tool to assist
1088 migration of files between Lustre OSTs. The utility copies each specified
1089 file to a new file, verifies the file contents have not changed, and then
1090 renames the new file to the original filename. This allows balanced space
1091 usage between OSTs, moving files off OSTs that are starting to show
1092 hardware problems (though are still functional) or OSTs that will be
1093 discontinued.</para>
1095 <para>For versions of Lustre before 2.5,
1096 <literal>lfs_migrate</literal> is not closely integrated with the MDS,
1097 it cannot determine whether a file is currently open and/or in-use by
1098 other applications or nodes. This makes it UNSAFE for use on files that
1099 might be modified by other applications, since the migrated file is
1100 only a copy of the current file. This results in the old file becoming
1101 an open-unlinked file and any modifications to that file are
1104 <para>Files to be migrated can be specified as command-line arguments. If
1105 a directory is specified on the command-line then all files within the
1106 directory are migrated. If no files are specified on the command-line,
1107 then a list of files is read from the standard input, making
1108 <literal>lfs_migrate</literal> suitable for use with
1109 <literal>lfs</literal> find to locate files on specific OSTs and/or
1110 matching other file attributes.</para>
1111 <para>The current file allocation policies on the MDS dictate where the
1112 new files are placed, taking into account whether specific OSTs have been
1113 disabled on the MDS via
1114 <literal>lctl</literal>(preventing new files from being allocated there),
1115 whether some OSTs are overly full (reducing the number of files placed on
1116 those OSTs), or if there is a specific default file striping for the
1117 target directory (potentially changing the stripe count, stripe size, OST
1118 pool, or OST index of a new file).</para>
1121 <literal>lfs_migrate</literal> utility can also be used in some cases to
1124 <primary>fragmentation</primary>
1125 </indexterm>fragmentation. File fragmentation will typically reduce
1126 Lustre file system performance. File fragmentation may be observed on
1127 an aged file system and will commonly occur if the file was written by
1128 many threads. Provided there is sufficient free space (or if it was
1129 written when the file system was nearly full) that is less fragmented
1130 than the file being copied, re-writing a file with
1131 <literal>lfs_migrate</literal> will result in a migrated file with
1132 reduced fragmentation. The tool
1133 <literal>filefrag</literal> can be used to report file fragmentation.
1135 <xref linkend="dbdoclet.50438206_75125" /></para>
1138 <para>As long as a file has extent lengths of tens of megabytes (
1139 <replaceable>read_bandwidth * seek_time</replaceable>) or more, the
1140 read performance for the file will not be significantly impacted by
1141 fragmentation, since the read pipeline can be filled by large reads
1142 from disk even with an occasional disk seek.</para>
1145 <section remap="h5">
1146 <title>Options</title>
1147 <para>Options supporting
1148 <literal>lfs_migrate</literal> are described below.</para>
1149 <informaltable frame="all">
1151 <colspec colname="c1" colwidth="50*" />
1152 <colspec colname="c2" colwidth="50*" />
1157 <emphasis role="bold">Option</emphasis>
1162 <emphasis role="bold">Description</emphasis>
1172 <replaceable>stripecount</replaceable></literal>
1176 <para>Restripe file using the specified stripe count. This
1177 option may not be specified at the same time as the
1178 <literal>-R</literal> option.</para>
1184 <literal>-h</literal>
1188 <para>Display help information.</para>
1193 <literal>-l</literal>
1196 <para>Migrate files with hard links (skips, by default). Files
1197 with multiple hard links are split into multiple separate files
1199 <literal>lfs_migrate</literal>, so they are skipped, by
1200 default, to avoid breaking the hard links.</para>
1205 <literal>-n</literal>
1208 <para>Only print the names of files to be migrated.</para>
1214 <literal>-q</literal>
1218 <para>Run quietly (does not print filenames or status).</para>
1223 <literal>-R</literal>
1225 <entry>Restripe file using default directory striping instead of
1226 keeping striping. This option may not be specified at the same
1228 <literal>-c</literal> option.</entry>
1232 <literal>-s</literal>
1234 <entry>Skip file data comparison after migrate. Default is to
1235 compare migrated file against original to verify
1236 correctness.</entry>
1241 <literal>-y</literal>
1246 <literal>y</literal>' to usage warning without prompting (for
1247 scripts, use with caution).</para>
1254 <section remap="h5">
1255 <title>Examples</title>
1256 <para>Rebalances all files in
1257 <literal>/mnt/lustre/dir</literal>.</para>
1259 $ lfs_migrate /mnt/lustre/file
1261 <para>Migrates files in /test filesystem on OST004 larger than 4 GB in
1264 $ lfs find /test -obd test-OST004 -size +4G | lfs_migrate -y
1267 <section remap="h5">
1268 <title>See Also</title>
1270 <xref linkend="dbdoclet.50438206_94597" />
1274 <section xml:id="dbdoclet.50438206_75125">
1277 <primary>filefrag</primary>
1279 <literal>filefrag</literal>
1282 <literal>e2fsprogs</literal> package contains the
1283 <literal>filefrag</literal> tool which reports the extent of file
1284 fragmentation.</para>
1285 <section remap="h5">
1286 <title>Synopsis</title>
1288 filefrag [ -belsv ] [ files... ]
1291 <section remap="h5">
1292 <title>Description</title>
1294 <literal>filefrag</literal> utility reports the extent of fragmentation in
1296 <literal>filefrag</literal> utility obtains the extent information from
1297 Lustre files using the
1298 <literal>FIEMAP ioctl</literal>, which is efficient and fast, even for
1299 very large files.</para>
1300 <para>In default mode
1302 <para>The default mode is faster than the verbose/extent mode since it
1303 only counts the number of extents.</para>
1305 <literal>filefrag</literal> prints the number of physically discontiguous
1306 extents in the file. In extent or verbose mode, each extent is printed
1307 with details such as the blocks allocated on each OST. For a Lustre file
1308 system, the extents are printed in device offset order (i.e. all of the
1309 extents for one OST first, then the next OST, etc.), not file logical
1310 offset order. If the file logical offset order was used, the Lustre
1311 striping would make the output very verbose and difficult to see if there
1312 was file fragmentation or not.</para>
1314 <para>Note that as long as a file has extent lengths of tens of
1315 megabytes or more (i.e.
1316 <replaceable>read_bandwidth * seek_time >
1317 extent_length</replaceable>), the read performance for the file will
1318 not be significantly impacted by fragmentation, since file readahead
1319 can fully utilize the disk disk bandwidth even with occasional
1322 <para>In default mode
1324 <para>The default mode is faster than the verbose/extent mode.</para>
1326 <literal>filefrag</literal> returns the number of physically discontiguous
1327 extents in the file. In extent or verbose mode, each extent is printed
1328 with details. For a Lustre file system, the extents are printed in device
1329 offset order, not logical offset order.</para>
1331 <section remap="h5">
1332 <title>Options</title>
1333 <para>The options and descriptions for the
1334 <literal>filefrag</literal> utility are listed below.</para>
1335 <informaltable frame="all">
1337 <colspec colname="c1" colwidth="50*" />
1338 <colspec colname="c2" colwidth="50*" />
1343 <emphasis role="bold">Option</emphasis>
1348 <emphasis role="bold">Description</emphasis>
1357 <literal>-b</literal>
1361 <para>Uses the 1024-byte blocksize for the output. By default,
1362 this blocksize is used by the Lustre file system, since OSTs
1363 may use different block sizes.</para>
1369 <literal>-e</literal>
1373 <para>Uses the extent mode when printing the output. This is
1374 the default for Lustre files in verbose mode.</para>
1380 <literal>-l</literal>
1384 <para>Displays extents in LUN offset order. This is the only
1385 available mode for Lustre.</para>
1391 <literal>-s</literal>
1395 <para>Synchronizes any unwritten file data to disk before
1396 requesting the mapping.</para>
1402 <literal>-v</literal>
1406 <para>Prints the file's layout in verbose mode when checking
1407 file fragmentation, including the logical to physical mapping
1408 for each extent in the file and the OST index.</para>
1415 <section remap="h5">
1416 <title>Examples</title>
1417 <para>Lists default output.</para>
1419 $ filefrag /mnt/lustre/foo
1420 /mnt/lustre/foo: 13 extents found
1422 <para>Lists verbose output in extent format.</para>
1424 $ filefrag -v /mnt/lustre/foo
1425 Filesystem type is: bd00bd0
1426 File size of /mnt/lustre/foo is 1468297786 (1433888 blocks of 1024 bytes)
1427 ext: device_logical: physical_offset: length: dev: flags:
1428 0: 0.. 122879: 2804679680..2804802559: 122880: 0002: network
1429 1: 122880.. 245759: 2804817920..2804940799: 122880: 0002: network
1430 2: 245760.. 278527: 2804948992..2804981759: 32768: 0002: network
1431 3: 278528.. 360447: 2804982784..2805064703: 81920: 0002: network
1432 4: 360448.. 483327: 2805080064..2805202943: 122880: 0002: network
1433 5: 483328.. 606207: 2805211136..2805334015: 122880: 0002: network
1434 6: 606208.. 729087: 2805342208..2805465087: 122880: 0002: network
1435 7: 729088.. 851967: 2805473280..2805596159: 122880: 0002: network
1436 8: 851968.. 974847: 2805604352..2805727231: 122880: 0002: network
1437 9: 974848.. 1097727: 2805735424..2805858303: 122880: 0002: network
1438 10: 1097728.. 1220607: 2805866496..2805989375: 122880: 0002: network
1439 11: 1220608.. 1343487: 2805997568..2806120447: 122880: 0002: network
1440 12: 1343488.. 1433599: 2806128640..2806218751: 90112: 0002: network
1441 /mnt/lustre/foo: 13 extents found
1445 <section xml:id="dbdoclet.50438206_86244">
1448 <primary>mount</primary>
1450 <literal>mount</literal>
1453 <literal>mount(8)</literal> Linux command is used to mount a Lustre file
1454 system. When mounting a Lustre file system, mount(8) executes the
1455 <literal>/sbin/mount.lustre</literal> command to complete the mount. The
1456 mount command supports these options specific to a Lustre file
1458 <informaltable frame="all">
1460 <colspec colname="c1" colwidth="50*" />
1461 <colspec colname="c2" colwidth="50*" />
1466 <emphasis role="bold">Server options</emphasis>
1471 <emphasis role="bold">Description</emphasis>
1480 <literal>abort_recov</literal>
1484 <para>Aborts recovery when starting a target</para>
1490 <literal>nosvc</literal>
1494 <para>Starts only MGS/MGC servers</para>
1500 <literal>nomgs</literal>
1504 <para>Start a MDT with a co-located MGS without starting the
1511 <literal>exclude</literal>
1515 <para>Starts with a dead OST</para>
1521 <literal>md_stripe_cache_size</literal>
1525 <para>Sets the stripe cache size for server side disk with a
1526 striped raid configuration</para>
1532 <informaltable frame="all">
1534 <colspec colname="c1" colwidth="50*" />
1535 <colspec colname="c2" colwidth="50*" />
1540 <emphasis role="bold">Client options</emphasis>
1545 <emphasis role="bold">Description</emphasis>
1554 <literal>flock/noflock/localflock</literal>
1558 <para>Enables/disables global flock or local flock support</para>
1564 <literal>user_xattr/nouser_xattr</literal>
1568 <para>Enables/disables user-extended attributes</para>
1574 <literal>user_fid2path/nouser_fid2path</literal>
1578 <para condition="l23">Enables/disables FID to path translation by
1579 regular users</para>
1585 <literal>retry=</literal>
1589 <para>Number of times a client will retry to mount the file
1597 <section xml:id="dbdoclet.50438206_56217">
1598 <title>Handling Timeouts</title>
1599 <para>Timeouts are the most common cause of hung applications. After a
1600 timeout involving an MDS or failover OST, applications attempting to access
1601 the disconnected resource wait until the connection gets
1603 <para>When a client performs any remote operation, it gives the server a
1604 reasonable amount of time to respond. If a server does not reply either due
1605 to a down network, hung server, or any other reason, a timeout occurs which
1606 requires a recovery.</para>
1607 <para>If a timeout occurs, a message (similar to this one), appears on the
1608 console of the client, and in
1609 <literal>/var/log/messages</literal>:</para>
1611 LustreError: 26597:(client.c:810:ptlrpc_expire_one_request()) @@@ timeout
1613 req@a2d45200 x5886/t0 o38->mds_svc_UUID@NID_mds_UUID:12 lens 168/64 ref 1 fl