X-Git-Url: https://git.whamcloud.com/?p=doc%2Fmanual.git;a=blobdiff_plain;f=UserUtilities.xml;h=b490a83cb941b6aeee729505c066e51192ef8c87;hp=976dbaa38c211cfb1c894496b9654331c72b53ab;hb=HEAD;hpb=40ae42335c7f27f17b8803278aebf2bdd2e34511 diff --git a/UserUtilities.xml b/UserUtilities.xml index 976dbaa..2668220 100644 --- a/UserUtilities.xml +++ b/UserUtilities.xml @@ -1,11 +1,10 @@ + xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en-US" + xmlns:xi="http://www.w3.org/2001/XInclude" xml:id="userutilities"> User Utilities This chapter describes user utilities. -
+
<indexterm> <primary>lfs</primary> @@ -22,6 +21,7 @@ lfs lfs changelog [--follow] <replaceable>mdt_name</replaceable> [startrec [endrec]] lfs changelog_clear <replaceable>mdt_name id endrec</replaceable> lfs check <replaceable>mds|osts|servers</replaceable> +lfs data_version [-nrw] <replaceable>filename</replaceable> lfs df [-i] [-h] [--pool]-p <replaceable>fsname</replaceable>[.<replaceable>pool</replaceable>] [<replaceable>path</replaceable>] [--lazy] lfs find [[!] --atime|-A [-+]N] [[!] --mtime|-M [-+]N] [[!] --ctime|-C [-+]N] [--maxdepth|-D N] [--name|-n <replaceable>pattern</replaceable>] @@ -32,11 +32,13 @@ lfs find [[!] --atime|-A [-+]N] [[!] --mtime|-M [-+]N] <replaceable>dirname|filename</replaceable> lfs getname [-h]|[path...] lfs getstripe [--obd|-O <replaceable>ost_name</replaceable>] [--quiet|-q] [--verbose|-v] - [--count|-c] [--index|-i | --offset|-o] - [--size|-s] [--pool|-p] [--directory|-d] - [--recursive|-r] [--raw|-R] [-M] + [--stripe-count|-c] [--stripe-index|-i] + [--stripe-size|-s] [--pool|-p] [--directory|-d] + [--mdt-index|-M] [--recursive|-r] [--raw|-R] + [--layout|-L] <replaceable>dirname|filename</replaceable> ... -lfs setstripe [--size|-s stripe_size] [--count|-c <replaceable>stripe_count</replaceable>] +lfs setstripe [--size|-s stripe_size] [--stripe-count|-c <replaceable>stripe_count</replaceable>] + [--overstripe-count|-C <replaceable>stripe_count</replaceable>] [--stripe-index|-i <replaceable>start_ost_index</replaceable>] [--ost-list|-o <replaceable>ost_indicies</replaceable>] [--pool|-p <replaceable>pool</replaceable>] @@ -45,27 +47,22 @@ lfs setstripe -d <replaceable>dir</replaceable> lfs osts [path] lfs pool_list <replaceable>filesystem</replaceable>[.<replaceable>pool</replaceable>]| <replaceable>pathname</replaceable> lfs quota [-q] [-v] [-h] [-o <replaceable>obd_uuid</replaceable>|-I <replaceable>ost_idx</replaceable>|-i <replaceable>mdt_idx</replaceable>] - [-u <replaceable>username|uid|-g</replaceable> <replaceable>group|gid</replaceable>] <replaceable>/mount_point</replaceable> -lfs quota -t -u|-g <replaceable>/mount_point</replaceable> -lfs quotacheck [-ug] <replaceable>/mount_point</replaceable> -lfs quotachown [-i] <replaceable>/mount_point</replaceable> -lfs quotainv [-ug] [-f] <replaceable>/mount_point</replaceable> -lfs quotaon [-ugf] <replaceable>/mount_point</replaceable> -lfs quotaoff [-ug] <replaceable>/mount_point</replaceable> -lfs setquota {-u|--user|-g|--group} <replaceable>uname|uid|gname|gid</replaceable> + [-u <replaceable>username|uid|-g</replaceable> <replaceable>group|gid</replaceable>|-p <replaceable>projid</replaceable>] <replaceable>/mount_point</replaceable> +lfs quota -t -u|-g|-p <replaceable>/mount_point</replaceable> +lfs setquota {-u|--user|-g|--group|-p|--project} <replaceable>uname|uid|gname|gid|projid</replaceable> [--block-softlimit <replaceable>block_softlimit</replaceable>] [--block-hardlimit <replaceable>block_hardlimit</replaceable>] [--inode-softlimit <replaceable>inode_softlimit</replaceable>] [--inode-hardlimit <replaceable>inode_hardlimit</replaceable>] <replaceable>/mount_point</replaceable> -lfs setquota -u|--user|-g|--group <replaceable>uname|uid|gname|gid</replaceable> +lfs setquota -u|--user|-g|--group|-p|--project <replaceable>uname|uid|gname|gid|projid</replaceable> [-b <replaceable>block_softlimit</replaceable>] [-B <replaceable>block_hardlimit</replaceable>] [-i <replaceable>inode-softlimit</replaceable>] [-I <replaceable>inode_hardlimit</replaceable>] <replaceable>/mount_point</replaceable> -lfs setquota -t -u|-g [--block-grace <replaceable>block_grace</replaceable>] +lfs setquota -t -u|-g|-p [--block-grace <replaceable>block_grace</replaceable>] [--inode-grace <replaceable>inode_grace</replaceable>] <replaceable>/mount_point</replaceable> -lfs setquota -t -u|-g [-b <replaceable>block_grace</replaceable>] [-i <replaceable>inode_grace</replaceable>] +lfs setquota -t -u|-g|-p [-b <replaceable>block_grace</replaceable>] [-i <replaceable>inode_grace</replaceable>] <replaceable>/mount_point</replaceable> lfs help </screen> @@ -87,6 +84,13 @@ lfs help <literal>-v</literal> option with <literal>lfs quota</literal>.</para> </note> + <para condition="l28"> + The <literal>quotacheck</literal>, <literal>quotaon</literal> and + <literal>quotaoff</literal> sub-commands were deprecated in the + Lustre 2.4 release, and removed completely in the Lustre 2.8 release. + See <xref linkend="enabling_disk_quotas"/> for details on + configuring and checking quotas. + </para> </section> <section remap="h5"> <title>Description @@ -170,6 +174,40 @@ lfs help + + data_version [-nrw] + filename + + + + Displays the current version of file data. If + -n is specified, the data version is read + without taking a lock. As a consequence, the data version could + be outdated if there are dirty caches on filesystem clients, but + this option will not force data flushes and has less of an + impact on the filesystem. If -r is specified, + the data version is read after dirty pages on clients are + flushed. If -w is specified, the data version + is read after all caching pages on clients are flushed. + + + Even with -r or -w, race + conditions are possible and the data version should be checked + before and after an operation to be confident the data did not + change during it. + + + The data version is the sum of the last committed transaction + numbers of all data objects of a file. It is used by HSM policy + engines for verifying that file data has not been changed during + an archive operation or before a release operation, and by OST + migration, primarily for verifying that file data has not been + changed during a data copy, when done in non-blocking mode. + + + + + df [-i] [-h] [--pool|-p fsname[. pool] [ @@ -234,17 +272,25 @@ lfs help guarantee that atime is kept coherent across the cluster.) - OSTs store a transient + OSTs by default only hold a transient atime that is updated when clients do read requests. Permanent - atime is written to the MDS when the file is + atime is written to the MDT when the file is closed. However, on-disk atime is only updated if it is more than 60 seconds old ( - /proc/fs/lustre/mds/*/max_atime_diff). The - Lustre software considers the latest - atime from all OSTs. If a + mdd.*.atime_diff). + + In Lustre 2.14, it is possible to set + the OSTs to persistently store atime with each object, in + order to get more accurate persistent atime updates for files + that are open for a long time via the similarly-named + obdfilter.*.atime_diff parameter. + + + The client considers the latest atime from + all OSTs and MDTs. If a setattr is set by user, then it is updated on - both the MDS and OST, allowing the + both the MDT and OST, allowing the atime to go backward. @@ -435,10 +481,11 @@ lfs help are returned. If you only want specific striping information, then the options of - --count, - --size, - --index or - --offset plus various combinations of these + --stripe-count, + --stripe-size, + --stripe-index, + --layout, or + --pool plus various combinations of these options can be used to retrieve specific information. If the --raw option is specified, the stripe @@ -446,10 +493,9 @@ lfs help default values for unspecified fields. If the striping EA is not set, 0, 0, and -1 will be printed for the stripe count, size, and offset respectively. - The - -M prints the index of the MDT for a given - directory. See - . + The --mdt-index prints the index of + the MDT for a given directory. See + . @@ -499,7 +545,7 @@ lfs help - --count + --stripe-count @@ -610,7 +656,7 @@ lfs help - --count stripe_cnt + --stripe-count stripe_cnt @@ -627,6 +673,24 @@ lfs help + --overstripe-count stripe_cnt + + + + The same as --stripe-count, but allows overstriping, + which will place more than one stripe per OST if + stripe_cnt is greater than the number of + OSTs. Overstriping is useful for matching the number of stripes + to the number of processes, or with very fast OSTs, where one + stripe per OST is not enough to get full performance. + + + + +   + + + --size stripe_size The default stripe-size is 0. The default start-ost is @@ -693,7 +757,7 @@ lfs help Name of the pre-defined pool of OSTs (see - ) that will be used + ) that will be used for striping. The stripe_cnt, stripe_size and @@ -730,8 +794,8 @@ lfs help quota [-q] [-v] [-o obd_uuid|-i mdt_idx|-I - ost_idx] [-u|-g - uname|uid|gname|gid] + ost_idx] [-u|-g|-p + uname|uid|gname|gid|projid] /mount_point   @@ -739,11 +803,11 @@ lfs help Displays disk usage and limits, either for the full file system or for objects on a specific OBD. A user or group name - or an ID can be specified. If both user and group are omitted, - quotas for the current UID/GID are shown. The - -q option disables printing of additional - descriptions (including column titles). It fills in blank - spaces in the + or an usr, group and project ID can be specified. If all user, + group project ID are omitted, quotas for the current UID/GID + are shown. The -q option disables printing + of additional descriptions (including column titles). It fills + in blank spaces in the grace column with zeros (when there is no grace period set), to ensure that the number of columns is consistent. The @@ -755,101 +819,23 @@ lfs help quota -t - -u|-g + -u|-g|-p /mount_point Displays block and inode grace times for user ( -u) or group ( - -g) quotas. - - - - - - quotachown - - - - Changes the file's owner and group on OSTs of the - specified file system. - - - - - - quotacheck [-ugf] - /mount_point - - - - Scans the specified file system for disk usage, and - creates or updates quota files. Options specify quota for users - ( - -u), groups ( - -g), and force ( - -f). - - - - - - quotaon [-ugf] - /mount_point - - - - Turns on file system quotas. Options specify quota for - users ( - -u), groups ( - -g), and force ( - -f). - - - - - - quotaoff [-ugf] - /mount_point - - - - Turns off file system quotas. Options specify quota for - users ( - -u), groups ( - -g), and force ( - -f). - - - - - - quotainv [-ug] [-f] - /mount_point - - - - Clears quota files (administrative quota files if used - without - -f, operational quota files otherwise), all - of their quota entries for users ( - -u) or groups ( - -g). After running - quotainv, you must run - quotacheck before using quotas. - - Use extreme caution when using this command; its - results cannot be undone. - + -g) or project ( + -p) quotas. - setquota -u|-g - - uname|uid|gname|gid}[--block-softlimit + setquota {-u|-g|-p + uname|uid|gname|gid|projid} + [--block-softlimit block_softlimit] [--block-hardlimit block_hardlimit] @@ -861,8 +847,8 @@ lfs help - Sets file system quotas for users or groups. Limits can - be specified with + Sets file system quotas for users, groups or one project. + Limits can be specified with --{block|inode}-{softlimit|hardlimit} or their short equivalents -b, @@ -878,13 +864,13 @@ lfs help 2^30, 2^40 and 2^50, respectively. By default, the block limits unit is 1 kilobyte (1,024), and block limits are always kilobyte-grained (even if specified in bytes). See - . + . - setquota -t -u|-g [--block-grace + setquota -t -u|-g|-p [--block-grace block_grace] [--inode-grace inode_grace] /mount_point @@ -895,7 +881,7 @@ lfs help groups. Grace time is specified in ' XXwXXdXXhXXmXXs' format or as an integer seconds value. See - . + . @@ -924,8 +910,8 @@ lfs help
-
- Examples +
+ Examples Creates a file striped on two OSTs with 128 KB on each stripe. @@ -984,28 +970,15 @@ $ lfs df --pool $ lfs quota -u bob /mnt/lustre + List quotas of project ID '1'. + +$ lfs quota -p 1 /mnt/lustre + Show grace times for user quotas on /mnt/lustre. $ lfs quota -t -u /mnt/lustre - Changes file owner and group. - -$ lfs quotachown -i /mnt/lustre - - Checks quotas for user and group. Turns on quotas after making the - check. - -$ lfs quotacheck -ug /mnt/lustre - - Turns on quotas of user and group. - -$ lfs quotaon -ug /mnt/lustre - - Turns off quotas of user and group. - -$ lfs quotaoff -ug /mnt/lustre - Sets quotas of user 'bob', with a 1 GB block quota hardlimit and a 2 GB block quota softlimit. @@ -1060,11 +1033,11 @@ $ lfs setstripe --pool my_pool /mnt/lustre/dir
See Also - +
-
+
<indexterm> <primary>lfs_migrate</primary> @@ -1072,50 +1045,54 @@ $ lfs setstripe --pool my_pool /mnt/lustre/dir <literal>lfs_migrate</literal> The - lfs_migrate utility is a simple tool to migrate files - between Lustre OSTs. + lfs_migrate utility is a simple to migrate file + data between OSTs.
Synopsis -lfs_migrate [-c stripecount] [-h] [-l] [-n] [-q] [-R] [-s] [-y] -[file|directory ...] +lfs_migrate [lfs_setstripe_options] + [-h] [-n] [-q] [-R] [-s] [-y] [-0] [file|directory ...]
Description The - lfs_migrate utility is a simple tool to assist - migration of files between Lustre OSTs. The utility copies each specified - file to a new file, verifies the file contents have not changed, and then - renames the new file to the original filename. This allows balanced space - usage between OSTs, moving files off OSTs that are starting to show - hardware problems (though are still functional) or OSTs that will be - discontinued. + lfs_migrate utility is a tool to assist migration + of file data between Lustre OSTs. The utility copies each specified + file to a temporary file using supplied lfs setstripe + options, if any, optionally verifies the file contents have not changed, + and then swaps the layout (OST objects) from the temporary file and the + original file (for Lustre 2.5 and later), or renames the temporary file + to the original filename. This allows the user/administrator to balance + space usage between OSTs, or move files off OSTs that are starting to show + hardware problems (though are still functional) or will be removed. For versions of Lustre before 2.5, - lfs_migrate is not closely integrated with the MDS, - it cannot determine whether a file is currently open and/or in-use by - other applications or nodes. This makes it UNSAFE for use on files that - might be modified by other applications, since the migrated file is - only a copy of the current file. This results in the old file becoming - an open-unlinked file and any modifications to that file are - lost. + lfs_migrate was not integrated with the MDS at all. + That made it UNSAFE for use on files that were being modified by other + applications, since the file was migrated through a copy and rename of + the file. With Lustre 2.5 and later, the new file layout is swapped + with the existing file layout, which ensures that the user-visible + inode number is kept, and open file handles and locks on the file are + kept. Files to be migrated can be specified as command-line arguments. If a directory is specified on the command-line then all files within the directory are migrated. If no files are specified on the command-line, then a list of files is read from the standard input, making lfs_migrate suitable for use with - lfs find to locate files on specific OSTs and/or - matching other file attributes. - The current file allocation policies on the MDS dictate where the - new files are placed, taking into account whether specific OSTs have been - disabled on the MDS via - lctl(preventing new files from being allocated there), - whether some OSTs are overly full (reducing the number of files placed on - those OSTs), or if there is a specific default file striping for the - target directory (potentially changing the stripe count, stripe size, OST - pool, or OST index of a new file). + lfs find to locate files on specific OSTs and/or + matching other file attributes, and other tools that generate a list + of files on standard output. + Unless otherwise specified through command-line options, the + file allocation policies on the MDS dictate where the new files + are placed, taking into account whether specific OSTs have been + disabled on the MDS via lctl (preventing new + files from being allocated there), whether some OSTs are overly full + (reducing the number of files placed on those OSTs), or if there is + a specific default file striping for the parent directory (potentially + changing the stripe count, stripe size, OST pool, or OST index of a + new file). The lfs_migrate utility can also be used in some cases to @@ -1132,7 +1109,7 @@ lfs_migrate [-c stripecount] [-h] [-l] [-n] [-q] [-R] reduced fragmentation. The tool filefrag can be used to report file fragmentation. See - + As long as a file has extent lengths of tens of megabytes ( @@ -1247,31 +1224,41 @@ lfs_migrate [-c stripecount] [-h] [-l] [-n] [-q] [-R] scripts, use with caution). + + + -0 + + Expect NUL-terminated filenames on standard input, as + generated by lfs find -print0 or + find -print0. This allows filenames with + embedded newlines to be handled correctly. + +
Examples - Rebalances all files in - /mnt/lustre/dir. + Rebalance all files in + /mnt/lustre/dir: -$ lfs_migrate /mnt/lustre/file +$ lfs_migrate /mnt/lustre/dir - Migrates files in /test filesystem on OST004 larger than 4 GB in - size. + Migrate files in /test filesystem on OST0004 larger than 4 GB in + size and older than a day old: -$ lfs find /test -obd test-OST004 -size +4G | lfs_migrate -y +$ lfs find /test -obd test-OST0004 -size +4G -mtime +1 | lfs_migrate -y
See Also - +
-
+
<indexterm> <primary>filefrag</primary> @@ -1442,7 +1429,7 @@ File size of /mnt/lustre/foo is 1468297786 (1433888 blocks of 1024 bytes) </screen> </section> </section> - <section xml:id="dbdoclet.50438206_86244"> + <section xml:id="mount"> <title> <indexterm> <primary>mount</primary> @@ -1575,7 +1562,7 @@ File size of /mnt/lustre/foo is 1468297786 (1433888 blocks of 1024 bytes) </para> </entry> <entry> - <para condition="l23">Enables/disables FID to path translation by + <para>Enables/disables FID to path translation by regular users</para> </entry> </row> @@ -1594,7 +1581,7 @@ File size of /mnt/lustre/foo is 1468297786 (1433888 blocks of 1024 bytes) </tgroup> </informaltable> </section> - <section xml:id="dbdoclet.50438206_56217"> + <section xml:id="handling_timeouts"> <title>Handling Timeouts Timeouts are the most common cause of hung applications. After a timeout involving an MDS or failover OST, applications attempting to access @@ -1616,3 +1603,6 @@ RPC:/0/0 rc 0
+