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"
4 xml:id="userutilities">
5 <title xml:id="userutilities.title">User Utilities</title>
6 <para>This chapter describes user utilities.</para>
7 <section xml:id="dbdoclet.50438206_94597">
10 <primary>lfs</primary>
12 <literal>lfs</literal>
15 <literal>lfs</literal> utility can be used for user configuration routines
16 and monitoring.</para>
18 <title>Synopsis</title>
21 lfs changelog [--follow] <replaceable>mdt_name</replaceable> [startrec [endrec]]
22 lfs changelog_clear <replaceable>mdt_name id endrec</replaceable>
23 lfs check <replaceable>mds|osts|servers</replaceable>
24 lfs df [-i] [-h] [--pool]-p <replaceable>fsname</replaceable>[.<replaceable>pool</replaceable>] [<replaceable>path</replaceable>] [--lazy]
25 lfs find [[!] --atime|-A [-+]N] [[!] --mtime|-M [-+]N]
26 [[!] --ctime|-C [-+]N] [--maxdepth|-D N] [--name|-n <replaceable>pattern</replaceable>]
27 [--print|-p] [--print0|-P] [[!] --obd|-O <replaceable>ost_name</replaceable>[,<replaceable>ost_name...</replaceable>]]
28 [[!] --size|-S [+-]N[kMGTPE]] --type |-t {bcdflpsD}]
29 [[!] --gid|-g|--group|-G <replaceable>gname|gid</replaceable>]
30 [[!] --uid|-u|--user|-U <replaceable>uname|uid</replaceable>]
31 <replaceable>dirname|filename</replaceable>
32 lfs getname [-h]|[path...]
33 lfs getstripe [--obd|-O <replaceable>ost_name</replaceable>] [--quiet|-q] [--verbose|-v]
34 [--count|-c] [--index|-i | --offset|-o]
35 [--size|-s] [--pool|-p] [--directory|-d]
36 [--recursive|-r] [--raw|-R] [-M]
37 <replaceable>dirname|filename</replaceable> ...
38 lfs setstripe [--size|-s stripe_size] [--count|-c <replaceable>stripe_count</replaceable>]
39 [--index|-i|--offset|-o <replaceable>start_ost_index</replaceable>]
40 [--pool|-p <replaceable>pool</replaceable>]
41 <replaceable>dirname|filename</replaceable>
42 lfs setstripe -d <replaceable>dir</replaceable>
44 lfs poollist <replaceable>filesystem</replaceable>[.<replaceable>pool</replaceable>]| <replaceable>pathname</replaceable>
45 lfs quota [-q] [-v] [-h] [-o <replaceable>obd_uuid</replaceable>|-I <replaceable>ost_idx</replaceable>|-i <replaceable>mdt_idx</replaceable>]
46 [-u <replaceable>username|uid|-g</replaceable> <replaceable>group|gid</replaceable>] <replaceable>/mount_point</replaceable>
47 lfs quota -t -u|-g <replaceable>/mount_point</replaceable>
48 lfs quotacheck [-ug] <replaceable>/mount_point</replaceable>
49 lfs quotachown [-i] <replaceable>/mount_point</replaceable>
50 lfs quotainv [-ug] [-f] <replaceable>/mount_point</replaceable>
51 lfs quotaon [-ugf] <replaceable>/mount_point</replaceable>
52 lfs quotaoff [-ug] <replaceable>/mount_point</replaceable>
53 lfs setquota {-u|--user|-g|--group} <replaceable>uname|uid|gname|gid</replaceable>
54 [--block-softlimit <replaceable>block_softlimit</replaceable>]
55 [--block-hardlimit <replaceable>block_hardlimit</replaceable>]
56 [--inode-softlimit <replaceable>inode_softlimit</replaceable>]
57 [--inode-hardlimit <replaceable>inode_hardlimit</replaceable>]
58 <replaceable>/mount_point</replaceable>
59 lfs setquota -u|--user|-g|--group <replaceable>uname|uid|gname|gid</replaceable>
60 [-b <replaceable>block_softlimit</replaceable>] [-B <replaceable>block_hardlimit</replaceable>]
61 [-i <replaceable>inode-softlimit</replaceable>] [-I <replaceable>inode_hardlimit</replaceable>]
62 <replaceable>/mount_point</replaceable>
63 lfs setquota -t -u|-g [--block-grace <replaceable>block_grace</replaceable>]
64 [--inode-grace <replaceable>inode_grace</replaceable>]
65 <replaceable>/mount_point</replaceable>
66 lfs setquota -t -u|-g [-b <replaceable>block_grace</replaceable>] [-i <replaceable>inode_grace</replaceable>]
67 <replaceable>/mount_point</replaceable>
71 <para>In the above example, the
73 <replaceable>/mount_point</replaceable>
74 </literal> parameter refers to the mount point of the Lustre file
78 <para>The old lfs quota output was very detailed and contained
79 cluster-wide quota statistics (including cluster-wide limits for a
80 user/group and cluster-wide usage for a user/group), as well as
81 statistics for each MDS/OST. Now,
82 <literal>lfs quota</literal> has been updated to provide only
83 cluster-wide statistics, by default. To obtain the full report of
84 cluster-wide limits, usage and statistics, use the
85 <literal>-v</literal> option with
86 <literal>lfs quota</literal>.</para>
90 <title>Description</title>
92 <literal>lfs</literal> utility is used to create a new file with a
93 specific striping pattern, determine the default striping pattern, gather
94 the extended attributes (object numbers and location) for a specific
95 file, find files with specific attributes, list OST information or set
96 quota limits. It can be invoked interactively without any arguments or in
97 a non-interactive mode with one of the supported arguments.</para>
100 <title>Options</title>
102 <literal>lfs</literal> options are listed and described below. For a
103 complete list of available options, type help at the
104 <literal>lfs</literal> prompt.</para>
105 <informaltable frame="all">
107 <colspec colname="c1" colwidth="20*" />
108 <colspec colname="c2" colwidth="30*" />
109 <colspec colname="c3" colwidth="50*" />
112 <entry nameend="c2" namest="c1">
114 <emphasis role="bold">Option</emphasis>
119 <emphasis role="bold">Description</emphasis>
126 <entry nameend="c2" namest="c1">
128 <literal>changelog</literal>
132 <para>Shows the metadata changes on an MDT. Start and end
133 points are optional. The
134 <literal>--follow</literal> option blocks on new changes; this
135 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
147 <replaceable>endrec</replaceable>
148 </literal> are no longer of interest to a particular consumer
150 <replaceable>id</replaceable>
151 </literal>, potentially allowing the MDT to free up disk space.
154 <replaceable>endrec</replaceable>
155 </literal> of 0 indicates the current last record. Changelog
156 consumers must be registered on the MDT node using
157 <literal>lctl</literal>.</para>
161 <entry nameend="c2" namest="c1">
162 <literal>check</literal>
165 <para>Displays the status of MDS or OSTs (as specified in the
166 command) or all servers (MDS and OSTs).</para>
170 <entry nameend="c2" namest="c1">
171 <literal>df [-i] [-h] [--pool|-p
172 <replaceable>fsname</replaceable>[.
173 <replaceable>pool</replaceable>] [
174 <replaceable>path</replaceable>] [--lazy]</literal>
178 <literal>-i</literal> to report file system disk space usage or
179 inode usage of each MDT or OST or, if a pool is specified with
181 <literal>-p</literal> option, a subset of OSTs.</para>
182 <para>By default, the usage of all mounted Lustre file systems
184 <literal>path</literal> option is included, only the usage for
185 the specified file system is reported. If the
186 <literal>-h</literal> option is included, the output is printed
187 in human-readable format, using SI base-2 suffixes for
188 <emphasis role="bold">M</emphasis>ega-,
189 <emphasis role="bold">G</emphasis>iga-,
190 <emphasis role="bold">T</emphasis>era-,
191 <emphasis role="bold">P</emphasis>eta-, or
192 <emphasis role="bold">E</emphasis>xabytes.</para>
194 <literal>--lazy</literal> option is specified, any OST that is
195 currently disconnected from the client will be skipped. Using
197 <literal>--lazy</literal> option prevents the
198 <literal>df</literal> output from being blocked when an OST is
199 offline. Only the space on the OSTs that can currently be
200 accessed are returned. The
201 <literal>llite.*.lazystatfs</literal> tunable can be enabled to
202 make this the default behaviour for all
203 <literal>statfs()</literal> operations.</para>
207 <entry nameend="c2" namest="c1">
209 <literal>find</literal>
213 <para>Searches the directory tree rooted at the given
214 directory/filename for files that match the given
217 <literal>!</literal> before an option negates its meaning (files
218 NOT matching the parameter). Using
219 <literal>+</literal> before a numeric value means files with the
220 parameter OR MORE. Using
221 <literal>-</literal> before a numeric value means files with the
222 parameter OR LESS.</para>
228 <literal>--atime</literal>
231 <para>File was last accessed N*24 hours ago. (There is no
233 <literal>atime</literal> is kept coherent across the
235 <para>OSTs store a transient
236 <literal>atime</literal> that is updated when clients do read
238 <literal>atime</literal> is written to the MDS when the file is
239 closed. However, on-disk atime is only updated if it is more
240 than 60 seconds old (
241 <literal>/proc/fs/lustre/mds/*/max_atime_diff</literal>). The
242 Lustre software considers the latest
243 <literal>atime</literal> from all OSTs. If a
244 <literal>setattr</literal> is set by user, then it is updated on
245 both the MDS and OST, allowing the
246 <literal>atime</literal> to go backward.</para>
255 <literal>--ctime</literal>
259 <para>File status was last changed N*24 hours ago.</para>
268 <literal>--mtime</literal>
272 <para>File data was last modified N*24 hours ago.</para>
281 <literal>--obd</literal>
285 <para>File has an object on a specific OST(s).</para>
294 <literal>--size</literal>
298 <para>File has a size in bytes, or kilo-, Mega-, Giga-, Tera-,
299 Peta- or Exabytes if a suffix is given.</para>
308 <literal>--type</literal>
312 <para>File has the type - block, character, directory, pipe,
313 file, symlink, socket or door (used in Solaris operating
323 <literal>--uid</literal>
327 <para>File has a specific numeric user ID.</para>
336 <literal>--user</literal>
340 <para>File owned by a specific user (numeric user ID
350 <literal>--gid</literal>
354 <para>File has a specific group ID.</para>
363 <literal>--group</literal>
367 <para>File belongs to a specific group (numeric group ID
377 <literal>-maxdepth</literal></para>
380 <para>Limits find to descend at most N levels of the directory
390 <literal>--print</literal>/
391 <literal>--print0</literal></para>
394 <para>Prints the full filename, followed by a new line or NULL
395 character correspondingly.</para>
399 <entry nameend="c2" namest="c1">
401 <literal>osts [path]</literal>
405 <para>Lists all OSTs for the file system. If a path located on
406 a mounted Lustre file system is specified, then only OSTs
407 belonging to this file system are displayed.</para>
411 <entry nameend="c2" namest="c1">
413 <literal>getname [path...]</literal>
417 <para>List each Lustre file system instance associated with
418 each Lustre mount point. If no path is specified, all Lustre
419 mount points are interrogated. If a list of paths is provided,
420 the instance of each path is provided. If the path is not a
421 Lustre instance 'No such device' is returned.</para>
425 <entry nameend="c2" namest="c1">
427 <literal>getstripe</literal>
431 <para>Lists striping information for a given filename or
432 directory. By default, the stripe count, stripe size and offset
434 <para>If you only want specific striping information, then the
436 <literal>--count</literal>,
437 <literal>--size</literal>,
438 <literal>--index</literal> or
439 <literal>--offset</literal> plus various combinations of these
440 options can be used to retrieve specific information.</para>
442 <literal>--raw</literal> option is specified, the stripe
443 information is printed without substituting the file system
444 default values for unspecified fields. If the striping EA is
445 not set, 0, 0, and -1 will be printed for the stripe count,
446 size, and offset respectively.</para>
447 <para condition="l24">The
448 <literal>-M</literal> prints the index of the MDT for a given
450 <xref linkend="dbdoclet.rmremotedir" />.</para>
460 <replaceable>ost_name</replaceable></literal>
464 <para>Lists files that have an object on a specific OST.</para>
473 <literal>--quiet</literal>
477 <para>Lists details about the file's object ID
487 <literal>--verbose</literal>
491 <para>Prints additional striping information.</para>
500 <literal>--count</literal>
504 <para>Lists the stripe count (how many OSTs to use).</para>
513 <literal>--index</literal>
517 <para>Lists the index for each OST in the file system.</para>
526 <literal>--offset</literal>
530 <para>Lists the OST index on which file striping starts.</para>
539 <literal>--pool</literal>
543 <para>Lists the pools to which a file belongs.</para>
552 <literal>--size</literal>
556 <para>Lists the stripe size (how much data to write to one OST
557 before moving to the next OST).</para>
566 <literal>--directory</literal>
570 <para>Lists entries about a specified directory instead of its
571 contents (in the same manner as
572 <literal>ls -d</literal>).</para>
581 <literal>--recursive</literal>
585 <para>Recurses into all sub-directories.</para>
589 <entry nameend="c2" namest="c1">
591 <literal>setstripe</literal>
595 <para>Create new files with a specific file layout (stripe
596 pattern) configuration.
598 <para>The file cannot exist prior to using
599 <literal>setstripe</literal>. A directory must exist prior to
601 <literal>setstripe</literal>.</para>
611 <literal>--count stripe_cnt</literal>
615 <para>Number of OSTs over which to stripe a file. A
616 <literal>stripe_cnt</literal> of 0 uses the file system-wide
617 default stripe count (default is 1). A
618 <literal>stripe_cnt</literal> of -1 stripes over all available
628 <literal>--size stripe_size</literal>
630 <para>The default stripe-size is 0. The default start-ost is
631 -1. Do NOT confuse them! If you set start-ost to 0, all new
632 file creations occur on OST 0 (seldom a good idea).</para>
633 </footnote> </para>
636 <para>Number of bytes to store on an OST before moving to the
637 next OST. A stripe_size of 0 uses the file system's default
638 stripe size, (default is 1 MB). Can be specified with
639 <emphasis role="bold">k</emphasis>(KB),
640 <emphasis role="bold">m</emphasis>(MB), or
641 <emphasis role="bold">g</emphasis>(GB), respectively.</para>
650 <literal>--index --offset start_ost_index</literal>
654 <para>The OST index (base 10, starting at 0) on which to start
655 striping for this file. A start_ost_index value of -1 allows
656 the MDS to choose the starting index. This is the default
657 value, and it means that the MDS selects the starting OST as it
658 wants. We strongly recommend selecting this default, as it
659 allows space and load balancing to be done by the MDS as
661 <literal>start_ost_index</literal> value has no relevance on
662 whether the MDS will use round-robin or QoS weighted allocation
663 for the remaining stripes in the file.</para>
673 <replaceable>pool</replaceable></literal>
677 <para>Name of the pre-defined pool of OSTs (see
678 <xref linkend="dbdoclet.50438219_38274" />) that will be used
680 <literal>stripe_cnt</literal>,
681 <literal>stripe_size</literal> and
682 <literal>start_ost</literal> values are used as well. The
683 start-ost value must be part of the pool or an error is
688 <entry nameend="c2" namest="c1">
690 <literal>setstripe -d</literal>
694 <para>Deletes default striping on the specified
699 <entry nameend="c2" namest="c1">
701 <literal>poollist {filesystem}
702 [.poolname]|{pathname}</literal>
706 <para>Lists pools in the file system or pathname, or OSTs in
707 the file system's pool.</para>
711 <entry nameend="c2" namest="c1">
713 <literal>quota [-q] [-v] [-o
714 <replaceable>obd_uuid</replaceable>|-i
715 <replaceable>mdt_idx</replaceable>|-I
716 <replaceable>ost_idx</replaceable>] [-u|-g
717 <replaceable>uname|uid|gname|gid]</replaceable>
718 <replaceable>/mount_point</replaceable></literal>
723 <para>Displays disk usage and limits, either for the full file
724 system or for objects on a specific OBD. A user or group name
725 or an ID can be specified. If both user and group are omitted,
726 quotas for the current UID/GID are shown. The
727 <literal>-q</literal> option disables printing of additional
728 descriptions (including column titles). It fills in blank
730 <literal>grace</literal> column with zeros (when there is no
731 grace period set), to ensure that the number of columns is
733 <literal>-v</literal> option provides more verbose (per-OBD
734 statistics) output.</para>
738 <entry nameend="c2" namest="c1">
741 <replaceable>-u|-g</replaceable>
742 <replaceable>/mount_point</replaceable></literal>
746 <para>Displays block and inode grace times for user (
747 <literal>-u</literal>) or group (
748 <literal>-g</literal>) quotas.</para>
752 <entry nameend="c2" namest="c1">
754 <literal>quotachown</literal>
758 <para>Changes the file's owner and group on OSTs of the
759 specified file system.</para>
763 <entry nameend="c2" namest="c1">
765 <literal>quotacheck [-ugf]
766 <replaceable>/mount_point</replaceable></literal>
770 <para>Scans the specified file system for disk usage, and
771 creates or updates quota files. Options specify quota for users
773 <literal>-u</literal>), groups (
774 <literal>-g</literal>), and force (
775 <literal>-f</literal>).</para>
779 <entry nameend="c2" namest="c1">
781 <literal>quotaon [-ugf]
782 <replaceable>/mount_point</replaceable></literal>
786 <para>Turns on file system quotas. Options specify quota for
788 <literal>-u</literal>), groups (
789 <literal>-g</literal>), and force (
790 <literal>-f</literal>).</para>
794 <entry nameend="c2" namest="c1">
796 <literal>quotaoff [-ugf]
797 <replaceable>/mount_point</replaceable></literal>
801 <para>Turns off file system quotas. Options specify quota for
803 <literal>-u</literal>), groups (
804 <literal>-g</literal>), and force (
805 <literal>-f</literal>).</para>
809 <entry nameend="c2" namest="c1">
811 <literal>quotainv [-ug] [-f]
812 <replaceable>/mount_point</replaceable></literal>
816 <para>Clears quota files (administrative quota files if used
818 <literal>-f</literal>, operational quota files otherwise), all
819 of their quota entries for users (
820 <literal>-u</literal>) or groups (
821 <literal>-g</literal>). After running
822 <literal>quotainv</literal>, you must run
823 <literal>quotacheck</literal> before using quotas.</para>
825 <para>Use extreme caution when using this command; its
826 results cannot be undone.</para>
831 <entry nameend="c2" namest="c1">
833 <literal>setquota -u|-g
835 uname|uid|gname|gid}</replaceable>[--block-softlimit
836 <replaceable>block_softlimit</replaceable>]
838 <replaceable>block_hardlimit</replaceable>]
840 <replaceable>inode_softlimit</replaceable>]
842 <replaceable>inode_hardlimit</replaceable>]
843 <replaceable>/mount_point</replaceable></literal>
847 <para>Sets file system quotas for users or groups. Limits can
849 <literal>--{block|inode}-{softlimit|hardlimit}</literal> or
850 their short equivalents
851 <literal>-b</literal>,
852 <literal>-B</literal>,
853 <literal>-i</literal>,
854 <literal>-I</literal>. Users can set 1, 2, 3 or 4 limits.
857 <literal>setquota</literal> interface is supported, but it may
858 be removed in a future Lustre software release.</para>
859 </footnote>Also, limits can be specified with special suffixes,
860 -b, -k, -m, -g, -t, and -p to indicate units of 1, 2^10, 2^20,
861 2^30, 2^40 and 2^50, respectively. By default, the block limits
862 unit is 1 kilobyte (1,024), and block limits are always
863 kilobyte-grained (even if specified in bytes). See
864 <xref linkend="dbdoclet.50438206_11903" />.</para>
868 <entry nameend="c2" namest="c1">
870 <literal>setquota -t -u|-g [--block-grace
871 <replaceable>block_grace</replaceable>] [--inode-grace
872 <replaceable>inode_grace</replaceable>]
873 <replaceable>/mount_point</replaceable></literal>
877 <para>Sets the file system quota grace times for users or
878 groups. Grace time is specified in '
879 <literal>XXwXXdXXhXXmXXs</literal>' format or as an integer
881 <xref linkend="dbdoclet.50438206_11903" />.</para>
885 <entry nameend="c2" namest="c1">
887 <literal>help</literal>
891 <para>Provides brief help on various
892 <literal>lfs</literal> arguments.</para>
896 <entry nameend="c2" namest="c1">
898 <literal>exit/quit</literal>
902 <para>Quits the interactive
903 <literal>lfs</literal> session.</para>
911 <title xml:id="dbdoclet.50438206_11903">Examples</title>
912 <para>Creates a file striped on two OSTs with 128 KB on each
915 $ lfs setstripe -s 128k -c 2 /mnt/lustre/file1
917 <para>Deletes a default stripe pattern on a given directory. New files
918 use the default striping pattern.</para>
920 $ lfs setstripe -d /mnt/lustre/dir
922 <para>Lists the detailed object allocation of a given file.</para>
924 $ lfs getstripe -v /mnt/lustre/file1
926 <para>List all the mounted Lustre file systems and corresponding Lustre
931 <para>Efficiently lists all files in a given directory and its
932 subdirectories.</para>
934 $ lfs find /mnt/lustre
936 <para>Recursively lists all regular files in a given directory more than
939 $ lfs find /mnt/lustre -mtime +30 -type f -print
941 <para>Recursively lists all files in a given directory that have objects
942 on OST2-UUID. The lfs check servers command checks the status of all
943 servers (MDT and OSTs).</para>
945 $ lfs find --obd OST2-UUID /mnt/lustre/
947 <para>Lists all OSTs in the file system.</para>
951 <para>Lists space usage per OST and MDT in human-readable format.</para>
955 <para>Lists inode usage per OST and MDT.</para>
959 <para>List space or inode usage for a specific OST pool.</para>
962 <replaceable>filesystem</replaceable>[.
963 <replaceable>pool</replaceable>] |
964 <replaceable>pathname</replaceable>
966 <para>List quotas of user 'bob'.</para>
968 $ lfs quota -u bob /mnt/lustre
970 <para>Show grace times for user quotas on
971 <literal>/mnt/lustre</literal>.</para>
973 $ lfs quota -t -u /mnt/lustre
975 <para>Changes file owner and group.</para>
977 $ lfs quotachown -i /mnt/lustre
979 <para>Checks quotas for user and group. Turns on quotas after making the
982 $ lfs quotacheck -ug /mnt/lustre
984 <para>Turns on quotas of user and group.</para>
986 $ lfs quotaon -ug /mnt/lustre
988 <para>Turns off quotas of user and group.</para>
990 $ lfs quotaoff -ug /mnt/lustre
992 <para>Sets quotas of user 'bob', with a 1 GB block quota hardlimit and a
993 2 GB block quota softlimit.</para>
995 $ lfs setquota -u bob --block-softlimit 2000000 --block-hardlimit 1000000
998 <para>Sets grace times for user quotas: 1000 seconds for block quotas, 1
999 week and 4 days for inode quotas.</para>
1001 $ lfs setquota -t -u --block-grace 1000 --inode-grace 1w4d /mnt/lustre
1003 <para>Checks the status of all servers (MDT, OST)</para>
1007 <para>Creates a file striped on two OSTs from the pool
1008 <literal>my_pool</literal></para>
1010 $ lfs setstripe --pool my_pool -c 2 /mnt/lustre/file
1012 <para>Lists the pools defined for the mounted Lustre file system
1013 <literal>/mnt/lustre</literal></para>
1015 $ lfs poollist /mnt/lustre/
1017 <para>Lists the OSTs which are members of the pool
1018 <literal>my_pool</literal> in file system
1019 <literal>my_fs</literal></para>
1021 $ lfs poollist my_fs.my_pool
1023 <para>Finds all directories/files associated with
1024 <literal>poolA</literal>.</para>
1026 $ lfs find /mnt/lustre --pool poolA
1028 <para>Finds all directories/files not associated with a pool.</para>
1030 $ lfs find /mnt//lustre --pool ""
1032 <para>Finds all directories/files associated with pool.</para>
1034 $ lfs find /mnt/lustre ! --pool ""
1036 <para>Associates a directory with the pool
1037 <literal>my_pool</literal>, so all new files and directories are created
1040 $ lfs setstripe --pool my_pool /mnt/lustre/dir
1043 <section remap="h5">
1044 <title>See Also</title>
1046 <xref linkend="dbdoclet.50438219_38274" />
1050 <section xml:id="dbdoclet.50438206_42260">
1053 <primary>lfs_migrate</primary>
1055 <literal>lfs_migrate</literal>
1058 <literal>lfs_migrate</literal> utility is a simple tool to migrate files
1059 between Lustre OSTs.</para>
1060 <section remap="h5">
1061 <title>Synopsis</title>
1063 lfs_migrate [-c <replaceable>stripecount</replaceable>] [-h] [-l] [-n] [-q] [-R] [-s] [-y]
1064 [file|directory ...]
1067 <section remap="h5">
1068 <title>Description</title>
1070 <literal>lfs_migrate</literal> utility is a simple tool to assist
1071 migration of files between Lustre OSTs. The utility copies each specified
1072 file to a new file, verifies the file contents have not changed, and then
1073 renames the new file to the original filename. This allows balanced space
1074 usage between OSTs, moving files off OSTs that are starting to show
1075 hardware problems (though are still functional) or OSTs that will be
1076 discontinued.</para>
1078 <para>For versions of Lustre before 2.5,
1079 <literal>lfs_migrate</literal> is not closely integrated with the MDS,
1080 it cannot determine whether a file is currently open and/or in-use by
1081 other applications or nodes. This makes it UNSAFE for use on files that
1082 might be modified by other applications, since the migrated file is
1083 only a copy of the current file. This results in the old file becoming
1084 an open-unlinked file and any modifications to that file are
1087 <para>Files to be migrated can be specified as command-line arguments. If
1088 a directory is specified on the command-line then all files within the
1089 directory are migrated. If no files are specified on the command-line,
1090 then a list of files is read from the standard input, making
1091 <literal>lfs_migrate</literal> suitable for use with
1092 <literal>lfs</literal> find to locate files on specific OSTs and/or
1093 matching other file attributes.</para>
1094 <para>The current file allocation policies on the MDS dictate where the
1095 new files are placed, taking into account whether specific OSTs have been
1096 disabled on the MDS via
1097 <literal>lctl</literal>(preventing new files from being allocated there),
1098 whether some OSTs are overly full (reducing the number of files placed on
1099 those OSTs), or if there is a specific default file striping for the
1100 target directory (potentially changing the stripe count, stripe size, OST
1101 pool, or OST index of a new file).</para>
1104 <literal>lfs_migrate</literal> utility can also be used in some cases to
1107 <primary>fragmentation</primary>
1108 </indexterm>fragmentation. File fragmentation will typically reduce
1109 Lustre file system performance. File fragmentation may be observed on
1110 an aged file system and will commonly occur if the file was written by
1111 many threads. Provided there is sufficient free space (or if it was
1112 written when the file system was nearly full) that is less fragmented
1113 than the file being copied, re-writing a file with
1114 <literal>lfs_migrate</literal> will result in a migrated file with
1115 reduced fragmentation. The tool
1116 <literal>filefrag</literal> can be used to report file fragmentation.
1118 <xref linkend="dbdoclet.50438206_75125" /></para>
1121 <para>As long as a file has extent lengths of tens of megabytes (
1122 <replaceable>read_bandwidth * seek_time</replaceable>) or more, the
1123 read performance for the file will not be significantly impacted by
1124 fragmentation, since the read pipeline can be filled by large reads
1125 from disk even with an occasional disk seek.</para>
1128 <section remap="h5">
1129 <title>Options</title>
1130 <para>Options supporting
1131 <literal>lfs_migrate</literal> are described below.</para>
1132 <informaltable frame="all">
1134 <colspec colname="c1" colwidth="50*" />
1135 <colspec colname="c2" colwidth="50*" />
1140 <emphasis role="bold">Option</emphasis>
1145 <emphasis role="bold">Description</emphasis>
1155 <replaceable>stripecount</replaceable></literal>
1159 <para>Restripe file using the specified stripe count. This
1160 option may not be specified at the same time as the
1161 <literal>-R</literal> option.</para>
1167 <literal>-h</literal>
1171 <para>Display help information.</para>
1176 <literal>-l</literal>
1179 <para>Migrate files with hard links (skips, by default). Files
1180 with multiple hard links are split into multiple separate files
1182 <literal>lfs_migrate</literal>, so they are skipped, by
1183 default, to avoid breaking the hard links.</para>
1188 <literal>-n</literal>
1191 <para>Only print the names of files to be migrated.</para>
1197 <literal>-q</literal>
1201 <para>Run quietly (does not print filenames or status).</para>
1206 <literal>-R</literal>
1208 <entry>Restripe file using default directory striping instead of
1209 keeping striping. This option may not be specified at the same
1211 <literal>-c</literal> option.</entry>
1215 <literal>-s</literal>
1217 <entry>Skip file data comparison after migrate. Default is to
1218 compare migrated file against original to verify
1219 correctness.</entry>
1224 <literal>-y</literal>
1229 <literal>y</literal>' to usage warning without prompting (for
1230 scripts, use with caution).</para>
1237 <section remap="h5">
1238 <title>Examples</title>
1239 <para>Rebalances all files in
1240 <literal>/mnt/lustre/dir</literal>.</para>
1242 $ lfs_migrate /mnt/lustre/file
1244 <para>Migrates files in /test filesystem on OST004 larger than 4 GB in
1247 $ lfs find /test -obd test-OST004 -size +4G | lfs_migrate -y
1250 <section remap="h5">
1251 <title>See Also</title>
1253 <xref linkend="dbdoclet.50438206_94597" />
1257 <section xml:id="dbdoclet.50438206_75125">
1260 <primary>filefrag</primary>
1262 <literal>filefrag</literal>
1265 <literal>e2fsprogs</literal> package contains the
1266 <literal>filefrag</literal> tool which reports the extent of file
1267 fragmentation.</para>
1268 <section remap="h5">
1269 <title>Synopsis</title>
1271 filefrag [ -belsv ] [ files... ]
1274 <section remap="h5">
1275 <title>Description</title>
1277 <literal>filefrag</literal> utility reports the extent of fragmentation in
1279 <literal>filefrag</literal> utility obtains the extent information from
1280 Lustre files using the
1281 <literal>FIEMAP ioctl</literal>, which is efficient and fast, even for
1282 very large files.</para>
1283 <para>In default mode
1285 <para>The default mode is faster than the verbose/extent mode since it
1286 only counts the number of extents.</para>
1288 <literal>filefrag</literal> prints the number of physically discontiguous
1289 extents in the file. In extent or verbose mode, each extent is printed
1290 with details such as the blocks allocated on each OST. For a Lustre file
1291 system, the extents are printed in device offset order (i.e. all of the
1292 extents for one OST first, then the next OST, etc.), not file logical
1293 offset order. If the file logical offset order was used, the Lustre
1294 striping would make the output very verbose and difficult to see if there
1295 was file fragmentation or not.</para>
1297 <para>Note that as long as a file has extent lengths of tens of
1298 megabytes or more (i.e.
1299 <replaceable>read_bandwidth * seek_time >
1300 extent_length</replaceable>), the read performance for the file will
1301 not be significantly impacted by fragmentation, since file readahead
1302 can fully utilize the disk disk bandwidth even with occasional
1305 <para>In default mode
1307 <para>The default mode is faster than the verbose/extent mode.</para>
1309 <literal>filefrag</literal> returns the number of physically discontiguous
1310 extents in the file. In extent or verbose mode, each extent is printed
1311 with details. For a Lustre file system, the extents are printed in device
1312 offset order, not logical offset order.</para>
1314 <section remap="h5">
1315 <title>Options</title>
1316 <para>The options and descriptions for the
1317 <literal>filefrag</literal> utility are listed below.</para>
1318 <informaltable frame="all">
1320 <colspec colname="c1" colwidth="50*" />
1321 <colspec colname="c2" colwidth="50*" />
1326 <emphasis role="bold">Option</emphasis>
1331 <emphasis role="bold">Description</emphasis>
1340 <literal>-b</literal>
1344 <para>Uses the 1024-byte blocksize for the output. By default,
1345 this blocksize is used by the Lustre file system, since OSTs
1346 may use different block sizes.</para>
1352 <literal>-e</literal>
1356 <para>Uses the extent mode when printing the output. This is
1357 the default for Lustre files in verbose mode.</para>
1363 <literal>-l</literal>
1367 <para>Displays extents in LUN offset order. This is the only
1368 available mode for Lustre.</para>
1374 <literal>-s</literal>
1378 <para>Synchronizes any unwritten file data to disk before
1379 requesting the mapping.</para>
1385 <literal>-v</literal>
1389 <para>Prints the file's layout in verbose mode when checking
1390 file fragmentation, including the logical to physical mapping
1391 for each extent in the file and the OST index.</para>
1398 <section remap="h5">
1399 <title>Examples</title>
1400 <para>Lists default output.</para>
1402 $ filefrag /mnt/lustre/foo
1403 /mnt/lustre/foo: 13 extents found
1405 <para>Lists verbose output in extent format.</para>
1407 $ filefrag -v /mnt/lustre/foo
1408 Filesystem type is: bd00bd0
1409 File size of /mnt/lustre/foo is 1468297786 (1433888 blocks of 1024 bytes)
1410 ext: device_logical: physical_offset: length: dev: flags:
1411 0: 0.. 122879: 2804679680..2804802559: 122880: 0002: network
1412 1: 122880.. 245759: 2804817920..2804940799: 122880: 0002: network
1413 2: 245760.. 278527: 2804948992..2804981759: 32768: 0002: network
1414 3: 278528.. 360447: 2804982784..2805064703: 81920: 0002: network
1415 4: 360448.. 483327: 2805080064..2805202943: 122880: 0002: network
1416 5: 483328.. 606207: 2805211136..2805334015: 122880: 0002: network
1417 6: 606208.. 729087: 2805342208..2805465087: 122880: 0002: network
1418 7: 729088.. 851967: 2805473280..2805596159: 122880: 0002: network
1419 8: 851968.. 974847: 2805604352..2805727231: 122880: 0002: network
1420 9: 974848.. 1097727: 2805735424..2805858303: 122880: 0002: network
1421 10: 1097728.. 1220607: 2805866496..2805989375: 122880: 0002: network
1422 11: 1220608.. 1343487: 2805997568..2806120447: 122880: 0002: network
1423 12: 1343488.. 1433599: 2806128640..2806218751: 90112: 0002: network
1424 /mnt/lustre/foo: 13 extents found
1428 <section xml:id="dbdoclet.50438206_86244">
1431 <primary>mount</primary>
1433 <literal>mount</literal>
1436 <literal>mount(8)</literal> Linux command is used to mount a Lustre file
1437 system. When mounting a Lustre file system, mount(8) executes the
1438 <literal>/sbin/mount.lustre</literal> command to complete the mount. The
1439 mount command supports these options specific to a Lustre file
1441 <informaltable frame="all">
1443 <colspec colname="c1" colwidth="50*" />
1444 <colspec colname="c2" colwidth="50*" />
1449 <emphasis role="bold">Server options</emphasis>
1454 <emphasis role="bold">Description</emphasis>
1463 <literal>abort_recov</literal>
1467 <para>Aborts recovery when starting a target</para>
1473 <literal>nosvc</literal>
1477 <para>Starts only MGS/MGC servers</para>
1483 <literal>nomgs</literal>
1487 <para>Start a MDT with a co-located MGS without starting the
1494 <literal>exclude</literal>
1498 <para>Starts with a dead OST</para>
1504 <literal>md_stripe_cache_size</literal>
1508 <para>Sets the stripe cache size for server side disk with a
1509 striped raid configuration</para>
1515 <informaltable frame="all">
1517 <colspec colname="c1" colwidth="50*" />
1518 <colspec colname="c2" colwidth="50*" />
1523 <emphasis role="bold">Client options</emphasis>
1528 <emphasis role="bold">Description</emphasis>
1537 <literal>flock/noflock/localflock</literal>
1541 <para>Enables/disables global flock or local flock support</para>
1547 <literal>user_xattr/nouser_xattr</literal>
1551 <para>Enables/disables user-extended attributes</para>
1557 <literal>user_fid2path/nouser_fid2path</literal>
1561 <para condition="l23">Enables/disables FID to path translation by
1562 regular users</para>
1568 <literal>retry=</literal>
1572 <para>Number of times a client will retry to mount the file
1580 <section xml:id="dbdoclet.50438206_56217">
1581 <title>Handling Timeouts</title>
1582 <para>Timeouts are the most common cause of hung applications. After a
1583 timeout involving an MDS or failover OST, applications attempting to access
1584 the disconnected resource wait until the connection gets
1586 <para>When a client performs any remote operation, it gives the server a
1587 reasonable amount of time to respond. If a server does not reply either due
1588 to a down network, hung server, or any other reason, a timeout occurs which
1589 requires a recovery.</para>
1590 <para>If a timeout occurs, a message (similar to this one), appears on the
1591 console of the client, and in
1592 <literal>/var/log/messages</literal>:</para>
1594 LustreError: 26597:(client.c:810:ptlrpc_expire_one_request()) @@@ timeout
1596 req@a2d45200 x5886/t0 o38->mds_svc_UUID@NID_mds_UUID:12 lens 168/64 ref 1 fl