Whamcloud - gitweb
LU-2740 utils: Add support for --version option
[fs/lustre-release.git] / lustre / doc / lfs.1
index 8293655..2face13 100644 (file)
@@ -1,6 +1,6 @@
 .TH lfs 1 "2009 Jan 29" Lustre "user utilities"
 .SH NAME
-lfs \- Lustre utility to create a file with specific striping pattern, find the striping pattern of existing files
+lfs \- Lustre utility to create a file with specific striping pattern, find the striping pattern of existing files, do certain quota operations, and manage distributed namespace options for directories
 .SH SYNOPSIS
 .br
 .B lfs
@@ -11,7 +11,9 @@ lfs \- Lustre utility to create a file with specific striping pattern, find the
 .br
 .B lfs check <mds|osts|servers>
 .br
-.B lfs df [-i] [-h] [--pool|-p <fsname>[.<pool>] [path]
+.B lfs df [-i] [-h] [--lazy] [--pool|-p <fsname>[.<pool>] [path]
+.br
+.B lfs fid2path [--link <linkno>] <fsname|rootpath> <fid> ...
 .br
 .B lfs find <directory|filename>
         \fB[[!] --atime|-A [-+]N] [[!] --mtime|-M [-+]N] [[!] --ctime|-C [+-]N]
@@ -21,6 +23,7 @@ lfs \- Lustre utility to create a file with specific striping pattern, find the
         \fB[[!] --stripe-count|-c [+-]<stripes>]
         \fB[[!] --stripe-index|-i <index,...>]
         \fB[[!] --stripe-size|-S [+-]N[kMG]]
+        \fB[[!] --layout|-L raid0,released]
         \fB[--type |-t {bcdflpsD}] [[!] --gid|-g|--group|-G <gname>|<gid>]
         \fB[[!] --uid|-u|--user|-U <uname>|<uid>] [[!] --pool <pool>]\fR
 .br
@@ -29,6 +32,7 @@ lfs \- Lustre utility to create a file with specific striping pattern, find the
 .B lfs getstripe [--obd|-O <uuid>] [--quiet|-q] [--verbose|-v] 
         \fB[--stripe-count|-c ] [--stripe-index|-i] [--mdt-index|-M]
         \fB[--stripe-size|-S] [--directory|-d]
+       \fB[--layout|-L]
         \fB[--pool|-p] [--recursive|-r] [--raw|-R] <dirname|filename> ...\fR
 .br
 .B lfs setstripe [--stripe-size|-S stripe_size] [--stripe-count|-c stripe_count]
@@ -40,6 +44,8 @@ lfs \- Lustre utility to create a file with specific striping pattern, find the
 .B lfs osts
 .RB [ path ]
 .br
+.B lfs path2fid <path> ...
+.br
 .B lfs pool_list <filesystem>[.<pool>] | <pathname>
 .br
 .B lfs quota [-q] [-v] [-o obd_uuid|-I ost_idx|-i mdt_idx] [-u <uname>| -u <uid>|-g <gname>| -g <gid>] <filesystem>
@@ -73,14 +79,19 @@ lfs \- Lustre utility to create a file with specific striping pattern, find the
              \fB[-b <block-grace>] [-i <inode-grace>]
              \fB<filesystem>\fR
 .br
+.br
+.B lfs swap_layouts <filename1> <filename2>
+.br
 .B lfs data_version [-n] \fB<filename>\fR
 .br
+.B lfs --version
+.br
 .B lfs help
 .SH DESCRIPTION
 .B lfs
 can be used to create a new file with a specific striping pattern, determine the default striping pattern, gather the extended attributes (object numbers and location) for a specific file. It can be invoked interactively without any arguments or in a non-interactive mode with one of the arguements supported. 
 .SH OPTIONS
-The various options supported by lctl are listed and explained below:
+The various options supported by lfs are listed and explained below:
 .TP
 .B changelog
 Show the metadata changes on an MDT.  Start and end points are optional.  The --follow option will block on new changes; this option is only valid when run direclty on the MDT node.
@@ -94,16 +105,19 @@ Changelog consumers must be registered on the MDT node using \fBlctl\fR.
 .B check 
 Display the status of MDS or OSTs (as specified in the command) or all the servers (MDS and OSTs)
 .TP
-.B df [-i] [-h] [--pool|-p <fsname>[.<pool>] [path]
+.B df [-i] [-h] [--lazy] [--pool|-p <fsname>[.<pool>] [path]
 Report filesystem disk space usage or inodes usage (with \fB-i\fR) of each
 MDT/OST, or a subset of OSTs if a pool is specified with \fB-p\fR.  By default
 print the usage of all mounted Lustre filesystems, otherwise if \fBpath\fR is
 specified print only the usage of that filesystem.  If \fB-h\fR is given, the
 output is printed in \fIh\fRuman readable format, using SI base-2 suffixes
 for \fBM\fRega-, \fBG\fRiga-, \fBT\fRera-, \fBP\fReta-, or \fBE\fRxabytes.
+The \fB--lazy\fR/\fB-l\fR option skips any OST that is currently disconnected
+from the client.  This avoids blocking the \fBdf\fR output if an OST is down,
+and only returns the space on the OSTs that can currently be accessed.
 .TP
 .B find 
-To search the directory tree rooted at the given dir/file name for the files that match the given parameters: \fB--atime\fR (file was last accessed N*24 hours ago), \fB--ctime\fR (file's status was last changed N*24 hours ago), \fB--mtime\fR (file's data was last modified N*24 hours ago), \fB--obd\fR (file has an object on a specific OST or OSTs), \fB--size\fR (file has size in bytes, or \fBk\fRilo-, \fBM\fRega-, \fBG\fRiga-, \fBT\fRera-, \fBP\fReta-, or \fBE\fRxabytes if a suffix is given), \fB--type\fR (file has the type: \fBb\fRlock, \fBc\fRharacter, \fBd\fRirectory, \fBp\fRipe, \fBf\fRile, sym\fBl\fRink, \fBs\fRocket, or \fBD\fRoor (Solaris)), \fB--uid\fR (file has specific numeric user ID), \fB--user\fR (file owned by specific user, numeric user ID allowed), \fB--gid\fR (file has specific group ID), \fB--group\fR (file belongs to specific group, numeric group ID allowed). The option \fB--maxdepth\fR limits find to decend at most N levels of directory tree. The options \fB--print\fR and \fB--print0\fR print full file name, followed by a newline or NUL character correspondingly.  Using \fB!\fR before an option negates its meaning (\fIfiles NOT matching the parameter\fR).  Using \fB+\fR before a numeric value means \fIfiles with the parameter OR MORE\fR, while \fB-\fR before a numeric value means \fIfiles with the parameter OR LESS\fR.
+To search the directory tree rooted at the given dir/file name for the files that match the given parameters: \fB--atime\fR (file was last accessed N*24 hours ago), \fB--ctime\fR (file's status was last changed N*24 hours ago), \fB--mtime\fR (file's data was last modified N*24 hours ago), \fB--obd\fR (file has an object on a specific OST or OSTs), \fB--size\fR (file has size in bytes, or \fBk\fRilo-, \fBM\fRega-, \fBG\fRiga-, \fBT\fRera-, \fBP\fReta-, or \fBE\fRxabytes if a suffix is given), \fB--type\fR (file has the type: \fBb\fRlock, \fBc\fRharacter, \fBd\fRirectory, \fBp\fRipe, \fBf\fRile, sym\fBl\fRink, \fBs\fRocket, or \fBD\fRoor (Solaris)), \fB--uid\fR (file has specific numeric user ID), \fB--user\fR (file owned by specific user, numeric user ID allowed), \fB--gid\fR (file has specific group ID), \fB--group\fR (file belongs to specific group, numeric group ID allowed), \fB--layout\fR (file has a raid0 layout or is released). The option \fB--maxdepth\fR limits find to decend at most N levels of directory tree. The options \fB--print\fR and \fB--print0\fR print full file name, followed by a newline or NUL character correspondingly.  Using \fB!\fR before an option negates its meaning (\fIfiles NOT matching the parameter\fR).  Using \fB+\fR before a numeric value means \fIfiles with the parameter OR MORE\fR, while \fB-\fR before a numeric value means \fIfiles with the parameter OR LESS\fR.
 .TP
 .B getname [-h]|[path ...]
 Report all the Lustre mount points and the corresponding Lustre filesystem
@@ -120,6 +134,7 @@ to that filesystem are displayed.
 .B getstripe [--obd|-O <uuid>] [--quiet|-q] [--verbose|-v] 
         \fB[--count | -c ] [--index | -i | --offset | -o  ]
         \fB[--pool | -p ] [--size | -s ] [--directory | -d ]
+       \fB[--layout | -L]
         \fB[--recursive | -r ] [--raw | -R ] <dirname|filename>\fR
 .br
 List the striping information for a given filename or directory tree.
@@ -129,6 +144,7 @@ only want specific striping information then the options of
 .BR --size ,
 .BR --index ,
 .BR --offset ,
+.BR --layout ,
 or
 .B --pool  
 can be used to return only the specific fields.
@@ -192,6 +208,18 @@ must be part of the pool or an error will be returned.
 .B setstripe -d
 Delete the default striping on the specified directory.
 .TP
+.B fid2path [--link <linkno>] <fsname|rootpath> <fid> ...
+Print out the pathname(s) for the specified \fIfid\fR(s) from the filesystem
+mounted at \fBrootpath\fR or named \fBfsname\fR.  If a file has multiple
+hard links, then all of the pathnames for that file are printed, unless
+\fB--link\fR limits the printing to only the specified link number (starting
+at 0, in no particular order).  If multiple fids are specified, but only a
+single pathname is needed for each file, use \fB--link 0\fR.
+.TP
+.B path2fid <path> ...
+Print out the FIDs for the specified \fBpath(s)\fR.  If multiple pathnames
+are given, then they will be printed one per line with the path as prefix.
+.TP
 .B pool_list
 .RI { filesystem }[ .poolname "] | {" pathname }
 List the pools in 
@@ -222,6 +250,13 @@ To set filesystem quotas for users or groups. Limits can be specified with -b, -
 .B setquota -t [-u|-g] [--block-grace <block-grace>] [--inode-grace <inode-grace>] <filesystem>
 To set filesystem quota grace times for users or groups. Grace time is specified in "XXwXXdXXhXXmXXs" format or as an integer seconds value, see EXAMPLES
 .TP
+.B swap_layouts <filename1> <filename2>
+Swap the data (layout and OST objects) of two regular files. The
+two files have to be in the same filesystem, owned by the same user,
+reside on the same MDT and writable by the user.
+
+Swapping the layout of two directories is not permitted.
+.TP
 .B data_version [-n] <filename>
 Display current version of file data. If -n is specified, data version is read
 without taking lock. As a consequence, data version could be outdated if there
@@ -232,6 +267,28 @@ Even without -n, race conditions are possible and data version should be
 checked before and after an operation to be confident the data did not change
 during it.
 .TP
+.B mkdir <--index|-i mdt_index> <dir>
+Allocate a new directory on a specified MDT.  
+
+The "lfs mkdir" command is only executable by root unless
+"mdt.*.enable_remote_dir_gid" is set via "lctl set_param" to be either a
+non-zero GID to limit it to a single group (e.g. "operator" or "admin"),
+or "-1" to allow any group to create remote directories.
+
+The root of the file system is on MDT0000, and directories and files inherit the
+MDT of their parent directory unless a different MDT is specified with this
+command.
+
+By default, only directories on MDT0000 can contain directories that are not on
+the same MDT.  However, if "mdt.*.enable_remote_dir" is set non-zero on an MDT
+then it will allow creating remote directories that have parents other than
+MDT0000. This is restricted to avoid creating directory trees that have
+intermediate path components on a series different MDTs and become unavailable
+if any of the intermediate MDTs are offline.
+.TP
+.B --version
+Output the build version of the lfs utility. Use "lctl lustre_build_version" to get the version of the Lustre kernel modules
+.TP
 .B help 
 Provides brief help on the various arguments
 .TP
@@ -295,11 +352,15 @@ Set quotas of user `bob': 1GB block quota hardlimit and 2 GB block quota softlim
 .TP
 .B $ lfs setquota -t -u --block-grace 1000 --inode-grace 1w4d /mnt/lustre
 Set grace times for user quotas: 1000 seconds for block quotas, 1 week and 4 days for inode quotas
+.TP
 .SH BUGS
 The \fBlfs find\fR command isn't as comprehensive as \fBfind\fR(1).
 .SH AUTHOR
 The lfs command is part of the Lustre filesystem.
 .SH SEE ALSO
 .BR lfs-hsm (1),
+.BR lfs-setdirstripe (1),
+.BR lfs-getdirstripe (1),
+.BR lfs-mkdir (1),
 .BR lctl (8),
 .BR lustre (7)