Whamcloud - gitweb
LU-11099 doc: include "-N" option to lfs_setstripe.1 34/32734/2
authorEmoly Liu <emoly@whamcloud.com>
Wed, 27 Jun 2018 04:18:57 +0000 (12:18 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 18 Jul 2018 06:01:18 +0000 (06:01 +0000)
This patch includes mirror option "-N[mirror_count]" to
lfs_setstripe.1 man page so that the user can follow the manual
to create a mirrored file or set s default mirror layout on a
directory correctly.
The command format is like:
$lfs setstripe -N[mirror_count] [STRIPE_OPTIONS] <dir|filename>

Test-Parameters: trivial

Change-Id: If0fabd79d218e5582f9c64336f60466f35dbd968
Signed-off-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/32734
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/doc/lfs-setstripe.1
lustre/utils/lfs.c

index e73bbff..ec9d342 100644 (file)
@@ -19,6 +19,8 @@ lfs setstripe \- set striping pattern of a file or directory default
 .br
 .B lfs setstripe -d \fR<\fIdirectory\fR>
 .br
 .br
 .B lfs setstripe -d \fR<\fIdirectory\fR>
 .br
+.B lfs setstripe -N\fR[\fImirror_count\fR] \fR[\fISTRIPE_OPTIONS\fR] <\fIdirectory\fR|\fIfilename\fR>
+.br
 .B lfs setstripe --yaml=<yaml_template_file> <filename>
 .br
 .SH DESCRIPTION
 .B lfs setstripe --yaml=<yaml_template_file> <filename>
 .br
 .SH DESCRIPTION
@@ -114,6 +116,21 @@ 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.
 .TP
 only needed if the directory should revert from a directory-specific layout
 to using the global filesystem default layout stored on the root directory.
 .TP
+.B lfs setstripe -N\fR[\fImirror_count\fR] \fR[\fISTRIPE_OPTIONS\fR] <\fIdirectory\fR|\fIfilename\fR>
+.br
+The -N option indicates how many mirrors that have the same layout will be set
+on a file or directory (see \fBlfs-mirror-create\fR(1)). The \fImirror_count\fR
+argument is optional and defaults to 1 if it's not specified; if specified,
+it must follow the option without a space.
+.br
+The \fISTRIPE_OPTIONS\fR specify the specific layout for the mirror. It can
+be a plain layout with specific striping pattern or a composite layout.
+If they are not specified, the stripe options inherited from the previous
+component will be used. If there is no previous component, the
+\fIstripe_count\fR and \fIstripe_size\fR options inherited from filesystem-wide
+default values will be used, and OST \fIpool_name\fR inherited from parent
+directory will be used.
+.TP
 .B lfs setstripe --yaml=<yaml_template_file> <filename>
 .br
 Create a file with layout information specified by a YAML format template
 .B lfs setstripe --yaml=<yaml_template_file> <filename>
 .br
 Create a file with layout information specified by a YAML format template
@@ -243,6 +260,16 @@ This creates a file striped on two OSTs with 128kB on each stripe.
 This deletes a default stripe pattern on dir. New files created in that
 directory will use the filesystem global default instead.
 .TP
 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 -N2 -E 1M -E eof -c -1 /mnt/lustre/dir1
+This sets a default mirror layout on a directory with 2 PFL mirrors. Each mirror
+has the same specified PFL layout.
+.TP
+.B lfs setstripe -N2 /mnt/lustre/file1
+This creates a mirrored file with 2 mirrors. Each mirror has the same default
+striping pattern with \fIstripe_count\fR and \fIstripe_size\fR inherited from
+filesystem-wide default values, and OST \fIpool_name\fR inherited from parent
+directory.
+.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 \
 covers [0, 4M), the second component has 4 stripes and covers [4M, 64M), the \
 .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 \
 covers [0, 4M), the second component has 4 stripes and covers [4M, 64M), the \
index 445cfa7..86900f7 100644 (file)
@@ -308,6 +308,9 @@ command_t cmdlist[] = {
         "To totally delete the default striping from an existing directory:\n"
         "usage: setstripe -d <directory>\n"
         " or\n"
         "To totally delete the default striping from an existing directory:\n"
         "usage: setstripe -d <directory>\n"
         " or\n"
+        "To create a mirrored file or set s default mirror layout on a directory:\n"
+        "usage: setstripe -N[mirror_count] [STRIPE_OPTIONS] <directory|filename>\n"
+        " or\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"
         "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"