Whamcloud - gitweb
LU-9462 doc: update lfs setstripe man page and usage 27/29627/2
authorAndreas Dilger <andreas.dilger@intel.com>
Thu, 11 May 2017 10:43:14 +0000 (04:43 -0600)
committerJohn L. Hammond <john.hammond@intel.com>
Wed, 25 Oct 2017 21:54:35 +0000 (21:54 +0000)
Update the lfs-setstripe.1 man page formatting and content.
Update the "lfs setstripe" usage message to be in "common use" order.

Test-Parameters: trivial
Reviewed-on: https://review.whamcloud.com/27066
Lustre-change-by: Andreas Dilger <andreas.dilger@intel.com>
Lustre-commit: aa83ef5a9ec470d2f6af07d47b3dd763f4a0e7ce

Signed-off-by: Steve Guminski <stephenx.guminski@intel.com>
Change-Id: Ia761c7562fa398a8c1bb4354d09757cd5f3ebbe5
Reviewed-by: Jian Yu <jian.yu@intel.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/29627
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/doc/lfs-setstripe.1
lustre/utils/lfs.c

index 52dc756..583cf31 100644 (file)
-.TH LFS-SETSTRIPIE 1 2015-11-06 "Lustre" "Lustre Utilities"
+.TH LFS-SETSTRIPE 1 2017-08-23 "Lustre" "Lustre Utilities"
 .SH NAME
-lfs setstripe \- set striping pattern of a file.
+lfs setstripe \- set striping pattern of a file or directory default
 .SH SYNOPSIS
-.B lfs setstripe [\fISTRIPE_OPTIONS\fR] <directory|filename>
+.B lfs setstripe \fR[\fISTRIPE_OPTIONS\fR] <\fIdirectory\fR|\fIfilename\fR>
 .br
-.B lfs setstripe -d <directory>
+.B lfs setstripe \fR{\fB--component-end\fR|\fB-E \fIend1\fR} [\fISTRIPE_OPTIONS\fR]
+[{\fB--component-end\fR|\fB-E \fIend2\fR} [\fISTRIPE_OPTIONS\fR] ...] <\fIfilename\fR>
 .br
-.B lfs setstripe <--component-end|-E end1> [\fISTRIPE_OPTIONS\fR] \
-[<--component-end|-E end2> [\fISTRIPE_OPTIONS\fR] ...] <filename>
+.B lfs setstripe --component-add \fR{\fB--component-end\fR|\fB-E \fIend1\fR}
+[\fISTRIPE_OPTIONS\fR] [{\fB--component-end\fR|\fB-E \fIend2\fR} [\fISTRIPE_OPTIONS\fR]
+\&...] <\fIfilename\fR>
 .br
-.B lfs setstripe --component-add <--component-end|-E end1> [\fISTRIPE_OPTIONS\fR] \
-[<--component-end|-E end2> [\fISTRIPE_OPTIONS\fR] ...] <filename>
+.B lfs setstripe --component-del \fR{\fB--component-id\fR|\fB-I \fIcomp_id\fR|
+.B --component-flags=\fIcomp_flags\fR} <\fIfilename\fR>
 .br
-.B lfs setstripe --component-del <--component-id|-I comp_id | \
---component-flags comp_flags> <filename>
+.B lfs setstripe -d \fR<\fIdirectory\fR>
 .br
 .SH DESCRIPTION
 .TP
-.B lfs setstripe [\fISTRIPE_OPTIONS\fR] <directory|filename>
-Create a file with specified striping pattern, or set default stripping pattern
-to a directory.
-.br
-.TP
-.B lfs setstripe -d <directory>
-.br
-Delete the default striping on the specified directory.
-.TP
-.B lfs setstripe <--component-end|-E end1> [\fISTRIPE_OPTIONS\fR] \
-[<--component-end|-E end2> [\fISTRIPE_OPTIONS\fR] ...] <filename>
+.B lfs setstripe \fR[\fISTRIPE_OPTIONS\fR] <\fIdirectory\fR|\fIfilename\fR>
+Create a file with specified layout, or set or replace the default file
+layout on an existing directory.  If the default file layout is set on
+the filesystem root directory, it will be used as the filesystem-wide
+default layout for all files that do not explicitly specify a layout and
+do not have a default layout on the parent directory.  The default layout
+set on a directory will be copied to any new subdirectories created within
+that directory at the time they are created.
+.TP
+.B lfs setstripe \fR{\fB--component-end\fR|\fB-E \fIend1\fR} [\fISTRIPE_OPTIONS\fR] \
+[{\fB--component-end\fR|\fB-E \fIend2\fR} [\fISTRIPE_OPTIONS\fR] ...] <\fIfilename\fR>
 .br
 Create a file with the specified composite layout. Each component defines the
-stripe pattern of the file in the range of [start, end). The first component
-must start from offset 0, and all components must be adjacent with each other,
-no holes are allowed, so each extent will start at the end of previous extent.
-The
-.I -E
+stripe pattern of the file in the range of
+.RI [ start ", " end ].
+The first component implicitly starts at offset 0, and all later components
+start at the end of previous extent.  The
+.B -E
 option is used to specify the end offset of each component, and it also
-indicates the following \fISTRIPE_OPTIONS\fR are for this component. A -1 end
-offset indicates the EOF.
-.TP
-.B lfs setstripe --component-add <--component-end|-E end1> [\fISTRIPE_OPTIONS\fR] \
-[<--component-end|-E end2> [\fISTRIPE_OPTIONS\fR] ...] <filename>
+indicates the following \fISTRIPE_OPTIONS\fR are for this component. The end
+offset of
+.B -1
+or
+.B eof
+indicates the component extends to the end of file.
+.TP
+.B lfs setstripe --component-add \fR{\fB--component-end\fR|\fB-E \fIend1\fR} [\fISTRIPE_OPTIONS\fR] \
+[{\fB--component-end\fR|\fB-E \fIend2\fR} [\fISTRIPE_OPTIONS\fR] ...] <\fIfilename\fR>
 .br
 Add components to an existing composite file. The extent start of the first
 component to be added is equal to the extent end of last component in existing
-file, and all components to be added must be adjacent with each other.
-.TP
-.B lfs setstripe --component-del <--component-id|-I comp_id | \
---component-flags comp_flags> <filename>
+file, and all components to be added must be adjacent with each other.  It is
+not possible to add components incrementally to the default directory layout,
+since the entire default layout can be replaced with one
+.B lfs setstripe
+call.
+.TP
+.B lfs setstripe --component-del \fR{\fB--component-id\fR|\fB-I \fIcomp_id\fR | \
+\fB--component-flags \fIcomp_flags\fR} <\fIfilename\fR>
 .br
 Remove the component(s) specified by component ID or flags from an existing
-file. The ID specified by
-.I -I
+file. The ID specified by the
+.B -I
 option is the numerical unique ID of the component, it can be obtained using
 the
 .B lfs getstripe
-command.
-.I --component-flags
-option is used to specify certain type of components, such as all instantiated
-ones.
+command.  It is not possible to delete components from a default directory
+layout, since the entire default layout can be replaced with one
+.B lfs setstripe
+call.
+The \fB--component-flags\fR option is used to specify certain type of
+components, such as all instantiated ones.
+.TP
+.B lfs setstripe -d \fR<\fIdirectory\fR>
+.br
+Delete the default layout on the specified directory.  It is not necessary
+to delete the default layout on a directory before replacing it.  This is
+only needed if the directory should revert from a directory-specific layout
+to using the global filesystem default layout stored on the root directory.
 .SH STRIPE_OPTIONS
 The various stripe related options are listed and explained below:
 .TP
-.B -c, --stripe-count <\fIstripe_count\fR>
-The number of OSTs to stripe a file over. 0 means to use the filesystem-wide
-default stripe count (default 1), and -1 means to stripe over all available
-OSTs.
+.B -c\fR, \fB--stripe-count \fR<\fIstripe_count\fR>
+The number of OSTs to stripe a file over. \fB0 \fRmeans to use the
+filesystem-wide default stripe count (default 1), and \fB-1 \fRmeans to stripe
+over all available OSTs.
 .TP
-.B -S, --stripe-size <\fIstripe_size\fR>
-The number of bytes to store on each OST before moving to the next OST. 0 means
-to use the filesystem-wide default stripe_size (default 1MB).
+.B -S\fR, \fB--stripe-size \fR<\fIstripe_size\fR>
+The number of bytes to store on each OST before moving to the next OST. \fB0\fR
+means to use the filesystem-wide default stripe_size (default 1MB).
 .TP
-.B -i, --stripe-index <\fIstart_ost_index\fR>
-The OST index (starting at 0) on which to start striping for this file. -1
+.B -i\fR, \fB--stripe-index \fR<\fIstart_ost_index\fR>
+The OST index (starting at 0) on which to start striping for this file. \fB-1\fR
 allows the MDS to choose the starting index and it is strongly recommended, as
 this allows space and load balancing to be done by the MDS as needed.
 .TP
-.B -o, --ost-list <\fIost_indices\fR>
+.B -o\fR, \fB--ost-list \fR<\fIost_indices\fR>
 Used to specify the exact stripe layout on the file system. \fIost_indices\fR
 is a list of OSTs referenced by their indices, which are specified in decimal
 or hex form and can be obtained using the
@@ -103,7 +121,7 @@ must be in the OST list, and it will be used as the index on which to start
 striping the file. Otherwise the striping will occur in the order specified in
 .IR ost_indices .
 .TP
-.B -p, --pool <\fIpool_name\fR>
+.B -p\fR, \fB--pool \fR<\fIpool_name\fR>
 The name of a predefined pool of OSTs (see
 .BR lctl (8))
 that will be used for striping. The
@@ -117,26 +135,33 @@ must be part of the pool or an error will be returned.
 .TP
 There are two options available only for \fBlfs migrate\fR:
 .TP
-.B -b, --block
+.BR -b , --block
 Block file access during data migration (default).
 .TP
-.B -n, --non-block
+.BR -n , --non-block
 Abort migrations if concurrent access is detected.
 .SH COMPONENT_OPTIONS
 The various component related options are listed and explained below:
 .TP
-.B -E, --component-end <\fIend\fR>
+.B -E\fR,\fB--component-end \fR< \fIend\fR>
 The end offset of the component,
 .I end
 is specified in bytes, or using a suffix (kMGTP),
-such as 256M. -1 means the end of file.
+such as 256M. \fB-1\fR means the end of file.
 .TP
-.B -I, --component-id <\fIcomp_id\fR>
+.B -I\fR, \fB--component-id \fR<\fIcomp_id\fR>
 The numerical unique component id.
 .TP
-.B --component-flags <\fIflags\fR>
-Component flags. Available flags: \fBinit\fR: instantiated component.
-\fB^init\fR: uninstantiated component.
+.B --component-flags \fR<\fIflags\fR>
+Component flags. Available \fIflags\fR:
+.RS
+.RS
+.B init\fR: instantiated component.
+.RE
+.RS
+.B ^init\fR: uninstantiated component.
+.RE
+.RE
 .TP
 .B --component-add
 Add specified components to an existing composite file.
@@ -150,8 +175,8 @@ with the last component.
 This creates a file striped on two OSTs with 128kB on each stripe.
 .TP
 .B $ lfs setstripe -d /mnt/lustre/dir
-This deletes a default stripe pattern on dir. New files will use the default \
-striping pattern created therein.
+This deletes a default stripe pattern on dir. New files created in that
+directory will use the filesystem global default instead.
 .TP
 .B $ lfs setstripe -E 4M -c 1 -E 64M -c 4 -E -1 -c -1 /mnt/lustre/file1
 This creates a file with composite layout, the component has 1 stripe and \
index cc6f8dd..83c4226 100644 (file)
@@ -113,19 +113,19 @@ static int lfs_list_commands(int argc, char **argv);
 
 /* Setstripe and migrate share mostly the same parameters */
 #define SSM_CMD_COMMON(cmd) \
-       "usage: "cmd" [--stripe-count|-c <stripe_count>]\n"             \
+       "usage: "cmd" [--component-end|-E <comp_end>]\n"                \
+       "                 [--stripe-count|-c <stripe_count>]\n"         \
        "                 [--stripe-index|-i <start_ost_idx>]\n"        \
        "                 [--stripe-size|-S <stripe_size>]\n"           \
        "                 [--pool|-p <pool_name>]\n"                    \
-       "                 [--ost|-o <ost_indices>]\n"                   \
-       "                 [--component-end|-E <comp_end>]\n"
+       "                 [--ost|-o <ost_indices>]\n"
 
 #define SSM_HELP_COMMON \
-       "\tstripe_size:  Number of bytes on each OST (0 filesystem default)\n" \
-       "\t              Can be specified with k, m or g (in KB, MB and GB\n" \
+       "\tstripe_count: Number of OSTs to stripe over (0=fs default, -1 all)\n" \
+       "\tstart_ost_idx: OST index of first stripe (-1=default round robin)\n"\
+       "\tstripe_size:  Number of bytes on each OST (0=fs default)\n" \
+       "\t              Can be specified with K, M or G (for KB, MB, GB\n" \
        "\t              respectively)\n"                               \
-       "\tstart_ost_idx: OST index of first stripe (-1 default)\n"     \
-       "\tstripe_count: Number of OSTs to stripe over (0 default, -1 all)\n" \
        "\tpool_name:    Name of OST pool to use (default none)\n"      \
        "\tost_indices:  List of OST indices, can be repeated multiple times\n"\
        "\t              Indices be specified in a format of:\n"        \
@@ -133,16 +133,12 @@ static int lfs_list_commands(int argc, char **argv);
        "\t              Or:\n"                                         \
        "\t                -o <ost_1> -o <ost_i>-<ost_j> -o <ost_n>\n"  \
        "\t              If --pool is set with --ost, then the OSTs\n"  \
-       "\t              must be the members of the pool."              \
-       "\tcomp_end:     Extent end of the component\n"                 \
-       "\t              Can be specified with k, m or g (in KB, MB and GB\n" \
-       "\t              respectively, -1 for EOF), it must be aligned with\n"\
-       "\t              the stripe_size\n"
+       "\t              must be the members of the pool.\n"            \
+       "\tcomp_end:     Extent end of component, start after previous end.\n"\
+       "\t              Can be specified with K, M or G (for KB, MB, GB\n" \
+       "\t              respectively, -1 for EOF). Must be a multiple of\n"\
+       "\t              stripe_size.\n"
 
-#define SETSTRIPE_USAGE                                                \
-       SSM_CMD_COMMON("setstripe")                             \
-       "                 <directory|filename>\n"               \
-       SSM_HELP_COMMON                                         \
 
 #define MIGRATE_USAGE                                                  \
        SSM_CMD_COMMON("migrate  ")                                     \
@@ -173,28 +169,26 @@ static bool                file_lease_supported = true;
 /* all available commands */
 command_t cmdlist[] = {
        {"setstripe", lfs_setstripe, 0,
-        "Create a new file with a specific striping pattern or\n"
-        "set the default striping pattern on an existing directory or\n"
-        "delete the default striping pattern from an existing directory or\n"
-        "add layout component(s) to an existing composite file or\n"
-        "delete specified component(s) from an existing composite file\n\n"
-        "To delete default striping from an existing directory:\n"
+        "To create a file with specified striping/composite layout, or\n"
+        "create/replace the default layout on an existing directory:\n"
+        SSM_CMD_COMMON("setstripe")
+        "                 <directory|filename>\n"
+        " or\n"
+        "To add component(s) to an existing composite file:\n"
+        SSM_CMD_COMMON("setstripe --component-add")
+        SSM_HELP_COMMON
+        "To totally delete the default striping from an existing directory:\n"
         "usage: setstripe -d <directory>\n"
         " or\n"
-        "To delete component(s) from an existing composite file:\n"
+        "To delete the last component(s) from an existing composite file\n"
+        "(note that this will also delete any data in those components):\n"
         "usage: setstripe --component-del [--component-id|-I <comp_id>]\n"
         "                               [--component-flags|-F <comp_flags>]\n"
         "                               <filename>\n"
-        "\tcomp_id:     Unique component ID\n"
+        "\tcomp_id:     Unique component ID to delete\n"
         "\tcomp_flags:  'init' indicating all instantiated components\n"
-        "\t             '^init' indicating all uninstantiated components\n"
-        "\t-I and -F can't be specified at the same time\n"
-        " or\n"
-        "To add component(s) to an existing composite file:\n"
-        SSM_CMD_COMMON("setstripe --component-add")
-        " or\n"
-        "To create a file with specified striping/composite layout:\n"
-        SETSTRIPE_USAGE},
+        "\t             '^init' indicating all uninstantiated components\n"
+        "\t-I and -F cannot be specified at the same time\n"},
        {"getstripe", lfs_getstripe, 0,
         "To list the striping info for a given file or files in a\n"
         "directory or recursively for all files in a directory tree.\n"